Skip to content

Commit

Permalink
React to 'is50OrHigher' removal from JDT.
Browse files Browse the repository at this point in the history
- Adjust some tests in GenerateToStringHandlerTest

Signed-off-by: Roland Grunberg <[email protected]>
  • Loading branch information
rgrunber committed Dec 30, 2024
1 parent 1d41dde commit 2e72e62
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ public static TextEdit generateToString(IType type, LspVariableBinding[] fields,
settings.customBuilderSettings = new CustomBuilderSettings();
if (type.getCompilationUnit().getJavaProject() != null) {
String version = type.getCompilationUnit().getJavaProject().getOption(JavaCore.COMPILER_SOURCE, true);
settings.is50orHigher = !JavaModelUtil.isVersionLessThan(version, JavaCore.VERSION_1_5);
settings.is60orHigher = !JavaModelUtil.isVersionLessThan(version, JavaCore.VERSION_1_6);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public void testGenerateToString() throws ValidateEditException, CoreException,
+ " String[] arrays;\r\n"
+ " @Override\r\n"
+ " public String toString() {\r\n"
+ " return \"B [name=\" + name + \", id=\" + id + \", aList=\" + aList + \", arrays=\" + (arrays != null ? Arrays.asList(arrays) : null) + \", getClass()=\" + getClass() + \", hashCode()=\" + hashCode() + \", toString()=\" + super.toString() + \"]\";\r\n"
+ " return \"B [name=\" + name + \", id=\" + id + \", aList=\" + aList + \", arrays=\" + Arrays.toString(arrays) + \", getClass()=\" + getClass() + \", hashCode()=\" + hashCode() + \", toString()=\" + super.toString() + \"]\";\r\n"
+ " }\r\n"
+ "}";
/* @formatter:on */
Expand Down Expand Up @@ -218,7 +218,6 @@ public void testGenerateToString_customizedSettings() throws ValidateEditExcepti
settings.limitElements = true;
settings.limitValue = 10;
settings.customBuilderSettings = new CustomBuilderSettings();
settings.is50orHigher = true;
settings.is60orHigher = true;
generateToString(unit.findPrimaryType(), settings);

Expand Down Expand Up @@ -309,7 +308,7 @@ public void testGenerateToStringAfterCursorPosition() throws ValidateEditExcepti
+ " List<String> aList;/*|*/\r\n"
+ " @Override\r\n"
+ " public String toString() {\r\n"
+ " return \"B [name=\" + name + \", id=\" + id + \", aList=\" + aList + \", arrays=\" + (arrays != null ? Arrays.asList(arrays) : null) + \", getClass()=\" + getClass() + \", hashCode()=\" + hashCode() + \", toString()=\" + super.toString() + \"]\";\r\n"
+ " return \"B [name=\" + name + \", id=\" + id + \", aList=\" + aList + \", arrays=\" + Arrays.toString(arrays) + \", getClass()=\" + getClass() + \", hashCode()=\" + hashCode() + \", toString()=\" + super.toString() + \"]\";\r\n"
+ " }\r\n"
+ " String[] arrays;\r\n"
+ "}";
Expand Down Expand Up @@ -365,7 +364,7 @@ public void testGenerateToStringBeforeCursorPosition() throws ValidateEditExcept
+ " int id;\r\n"
+ " @Override\r\n"
+ " public String toString() {\r\n"
+ " return \"B [name=\" + name + \", id=\" + id + \", aList=\" + aList + \", arrays=\" + (arrays != null ? Arrays.asList(arrays) : null) + \", getClass()=\" + getClass() + \", hashCode()=\" + hashCode() + \", toString()=\" + super.toString() + \"]\";\r\n"
+ " return \"B [name=\" + name + \", id=\" + id + \", aList=\" + aList + \", arrays=\" + Arrays.toString(arrays) + \", getClass()=\" + getClass() + \", hashCode()=\" + hashCode() + \", toString()=\" + super.toString() + \"]\";\r\n"
+ " }\r\n"
+ " List<String> aList;/*|*/\r\n"
+ " String[] arrays;\r\n"
Expand Down

0 comments on commit 2e72e62

Please sign in to comment.