Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-96753

SQLTransformer tests pass in unexpected empty array after LPS-96012

Details

    Description

      Caused by LPS-96012

          [junit] Testcase: testReplaceBitwiseCheckWithExtraWhitespace(com.liferay.portal.dao.sql.transformer.DB2SQLTransformerLogicTest):	Caused an ERROR
          [junit] 0
          [junit] java.lang.ArrayIndexOutOfBoundsException: 0
          [junit] 	at com.liferay.portal.dao.db.BaseDB.<init>(BaseDB.java:627)
          [junit] 	at com.liferay.portal.dao.db.TestDB.<init>(TestDB.java:28)
          [junit] 	at com.liferay.portal.dao.sql.transformer.DB2SQLTransformerLogicTest.<init>(DB2SQLTransformerLogicTest.java:31)
      

      TestDB.java

      	@Override
      	protected int[] getSQLTypes() {
      		return new int[0];
      	}
      

      BaseDB.java

      	protected BaseDB(DBType dbType, int majorVersion, int minorVersion) {
      		_dbType = dbType;
      		_majorVersion = majorVersion;
      		_minorVersion = minorVersion;
      
      		String[] actual = getTemplate();
      
      		for (int i = 0; i < TEMPLATE.length; i++) {
      			_templates.put(TEMPLATE[i], actual[i]);
      		}
      
      		String[] templateTypes = ArrayUtil.clone(TEMPLATE, 5, 15);
      
      		for (int i = 0; i < templateTypes.length; i++) {
      			_sqlTypes.put(StringUtil.trim(templateTypes[i]), getSQLTypes()[i]);
      		}
      	}
      

      Attachments

        Issue Links

          Activity

            People

              brian.chan Brian Chan
              victor.ware Victor Ware
              Kiyoshi Lee Kiyoshi Lee
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Packages

                  Version Package
                  7.1.X
                  7.2.X
                  Master