Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
#3113 Extract method name to constant
  • Loading branch information
Obolrom committed Aug 30, 2024
commit b047d491a7b4c534ee859976ad6f1cb4c933f322
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java: [17, 21]
java: [17, 19, 21]
name: 'Linux JDK ${{ matrix.java }}'
runs-on: ubuntu-latest
steps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ public class TypeFactory {
sb.append( ')' );
return sb.toString();
};
private static final String LINKED_HASH_SET_FACTORY_METHOD_NAME = "newLinkedHashSet";
private static final String LINKED_HASH_MAP_FACTORY_METHOD_NAME = "newLinkedHashMap";

private final ElementUtils elementUtils;
private final TypeUtils typeUtils;
Expand Down Expand Up @@ -126,7 +128,7 @@ public TypeFactory(ElementUtils elementUtils, TypeUtils typeUtils, FormattingMes
Set.class.getName(),
withLoadFactorAdjustment(
getType( LinkedHashSet.class ),
isSourceVersionAtLeast19() ? "newLinkedHashSet" : null
isSourceVersionAtLeast19() ? LINKED_HASH_SET_FACTORY_METHOD_NAME : null
)
);
implementationTypes.put( SortedSet.class.getName(), withDefaultConstructor( getType( TreeSet.class ) ) );
Expand All @@ -136,7 +138,7 @@ public TypeFactory(ElementUtils elementUtils, TypeUtils typeUtils, FormattingMes
Map.class.getName(),
withLoadFactorAdjustment(
getType( LinkedHashMap.class ),
isSourceVersionAtLeast19() ? "newLinkedHashMap" : null
isSourceVersionAtLeast19() ? LINKED_HASH_MAP_FACTORY_METHOD_NAME : null
)
);
implementationTypes.put( SortedMap.class.getName(), withDefaultConstructor( getType( TreeMap.class ) ) );
Expand Down