Details
-
Bug
-
Status: Ready for Testing
-
Resolution: Fixed
-
Master
-
7.3.x, 7.2.x, 7.1.x, 7.0.x
-
Committed
-
3
Description
I want to format my class that has no package. But the formatter incorrectly changes the type I'm using in a declaration in Document_Add.java--the formatter removes the "." between the class and the inner class in this declaration:
DocumentResource.Builder builder = DocumentResource.builder();
Changing it to this:
DocumentResourceBuilder builder = DocumentResource.builder();
*Steps:*
- Unzip the attached liferay-g9i6.zip
- cd liferay-g9i6
- ./gradlew formatSource
Result:
$ ./gradlew formatSource
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true> Task :formatSource
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true
Scanning for files...
Initializing checks...
/home/jhinkey/Desktop/liferay-g9i6/Document_Add.java (SourceCheck:JavaImportsCheck)
Processing checks: 100% completedDeprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.6.1/userguide/command_line_interface.html#sec:command_line_warnings
Changed line:
DocumentResourceBuilder builder = DocumentResource.builder();
Notice that SF removed the "." between DocumentResource and Builder.
Expected result: Leave the line as...
DocumentResource.Builder builder = DocumentResource.builder();
Workaround:* Suppress the JavaImportsCheck in the suppressions XML file.
Attachments
Issue Links
- relates
-
LPS-130076 StringIndexOutOfBoundsException trying to format a class with no package
- Ready for Testing