Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/maven/tycho-version-4.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
carstenartur authored Mar 24, 2024
2 parents 815dbff + da75f89 commit adbea66
Show file tree
Hide file tree
Showing 16 changed files with 49 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:

# Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
- name: Run Codacy Analysis CLI
uses: codacy/codacy-analysis-cli-action@5cc54a75f9ad88159bb54046196d920e40e367a5
uses: codacy/codacy-analysis-cli-action@33d455949345bddfdb845fba76b57b70cc83754b
with:
# Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository
# You can also omit the token and run the tools that support default configurations
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
- name: Cache Maven packages
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
# start xvfb in the background
sudo /usr/bin/Xvfb $DISPLAY -screen 0 1280x1024x24 &
- name: Cache Maven packages
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pmd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
distribution: 'temurin'
- name: Run PMD
id: pmdcommon
uses: pmd/pmd-github-action@v1
uses: pmd/pmd-github-action@v2
with:
rulesets: 'rulesets/java/quickstart.xml'

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<jacoco-version>0.8.11</jacoco-version>
<java-version>17</java-version>
<java-execenv>JavaSE-17</java-execenv>
<spotbugs-version>4.7.3.6</spotbugs-version>
<spotbugs-version>4.8.2.0</spotbugs-version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<modules>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ public ASTProcessor<E, V, T> callClassInstanceCreationVisitor(BiPredicate<ClassI
*/
public ASTProcessor<E, V, T> callClassInstanceCreationVisitor(Class typeof,BiPredicate<ClassInstanceCreation, E> bs) {
Map<String, Object> map = Map.ofEntries(
new AbstractMap.SimpleEntry<String, Object>(HelperVisitor.TYPEOF, typeof)
new AbstractMap.SimpleEntry<>(HelperVisitor.TYPEOF, typeof)
);
nodetypelist.put(VisitorEnum.ClassInstanceCreation, new NodeHolder(bs, null, map));
return this;
Expand Down Expand Up @@ -1177,7 +1177,7 @@ public ASTProcessor<E, V, T> callMethodInvocationVisitor(BiPredicate<ASTNode, E>
*/
public ASTProcessor<E, V, T> callMethodInvocationVisitor(String methodname, BiPredicate<ASTNode, E> bs) {
Map<String, Object> map = Map.ofEntries(
new AbstractMap.SimpleEntry<String, Object>(HelperVisitor.METHODNAME, methodname)
new AbstractMap.SimpleEntry<>(HelperVisitor.METHODNAME, methodname)
);
nodetypelist.put(VisitorEnum.MethodInvocation, new NodeHolder(bs, null, map));
return this;
Expand All @@ -1190,7 +1190,7 @@ public ASTProcessor<E, V, T> callMethodInvocationVisitor(String methodname, BiPr
*/
public ASTProcessor<E, V, T> callMethodInvocationVisitor(Class typeof, BiPredicate<ASTNode, E> bs) {
Map<String, Object> map = Map.ofEntries(
new AbstractMap.SimpleEntry<String, Object>(HelperVisitor.TYPEOF, typeof)
new AbstractMap.SimpleEntry<>(HelperVisitor.TYPEOF, typeof)
);
nodetypelist.put(VisitorEnum.MethodInvocation, new NodeHolder(bs, null, map));
return this;
Expand All @@ -1215,8 +1215,8 @@ public ASTProcessor<E, V, T> callMethodInvocationVisitor(Class typeof,String met
*/
public ASTProcessor<E, V, T> callMethodInvocationVisitor(Class typeof,String methodname, BiPredicate<MethodInvocation, E> bs, Function<ASTNode, ASTNode> navigate) {
Map<String, Object> map = Map.ofEntries(
new AbstractMap.SimpleEntry<String, Object>(HelperVisitor.METHODNAME, methodname),
new AbstractMap.SimpleEntry<String, Object>(HelperVisitor.TYPEOF, typeof)
new AbstractMap.SimpleEntry<>(HelperVisitor.METHODNAME, methodname),
new AbstractMap.SimpleEntry<>(HelperVisitor.TYPEOF, typeof)
);
nodetypelist.put(VisitorEnum.MethodInvocation, new NodeHolder(bs, navigate, map));
return this;
Expand All @@ -1231,7 +1231,7 @@ public ASTProcessor<E, V, T> callMethodInvocationVisitor(Class typeof,String met
public ASTProcessor<E, V, T> callMethodInvocationVisitor(String methodname, BiPredicate<ASTNode, E> bs,
Function<ASTNode, ASTNode> navigate) {
Map<String, Object> map = Map.ofEntries(
new AbstractMap.SimpleEntry<String, Object>(HelperVisitor.METHODNAME, methodname)
new AbstractMap.SimpleEntry<>(HelperVisitor.METHODNAME, methodname)
);
nodetypelist.put(VisitorEnum.MethodInvocation, new NodeHolder(bs, navigate, map));
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ public BiPredicate<? extends ASTNode, E> addMethodInvocation(BiPredicate<MethodI
public BiPredicate<? extends ASTNode, E> addMethodInvocation(String methodname,
BiPredicate<MethodInvocation, E> bs) {
predicatedata.put(VisitorEnum.MethodInvocation, Map.ofEntries(
new AbstractMap.SimpleEntry<String, Object>(METHODNAME, methodname)
new AbstractMap.SimpleEntry<>(METHODNAME, methodname)
));
return predicatemap.put(VisitorEnum.MethodInvocation, bs);
}
Expand All @@ -695,8 +695,8 @@ public BiPredicate<? extends ASTNode, E> addMethodInvocation(String methodname,
public BiPredicate<? extends ASTNode, E> addMethodInvocation(Class typeof, String methodname,
BiPredicate<MethodInvocation, E> bs) {
Map<String, Object> map = Map.ofEntries(
new AbstractMap.SimpleEntry<String, Object>(METHODNAME, methodname),
new AbstractMap.SimpleEntry<String, Object>(TYPEOF, typeof)
new AbstractMap.SimpleEntry<>(METHODNAME, methodname),
new AbstractMap.SimpleEntry<>(TYPEOF, typeof)
);
predicatedata.put(VisitorEnum.MethodInvocation, map);
return predicatemap.put(VisitorEnum.MethodInvocation, bs);
Expand Down Expand Up @@ -1166,7 +1166,7 @@ public BiPredicate<? extends ASTNode, E> addVariableDeclarationStatement(
public BiPredicate<? extends ASTNode, E> addVariableDeclarationStatement(Class<?> typeof,
BiPredicate<VariableDeclarationStatement, E> bs) {
Map<String, Object> map = Map.ofEntries(
new AbstractMap.SimpleEntry<String, Object>(TYPEOF, typeof)
new AbstractMap.SimpleEntry<>(TYPEOF, typeof)
);
predicatedata.put(VisitorEnum.VariableDeclarationStatement, map);
return predicatemap.put(VisitorEnum.VariableDeclarationStatement, bs);
Expand Down Expand Up @@ -1677,7 +1677,7 @@ public BiConsumer<? extends ASTNode, E> addMethodInvocation(BiConsumer<MethodInv
*/
public BiConsumer<? extends ASTNode, E> addMethodInvocation(String methodname, BiConsumer<MethodInvocation, E> bc) {
this.consumerdata.put(VisitorEnum.MethodInvocation, Map.ofEntries(
new AbstractMap.SimpleEntry<String, Object>(METHODNAME, methodname)
new AbstractMap.SimpleEntry<>(METHODNAME, methodname)
));
return consumermap.put(VisitorEnum.MethodInvocation, bc);
}
Expand Down Expand Up @@ -2146,7 +2146,7 @@ public BiConsumer<? extends ASTNode, E> addVariableDeclarationStatement(
public BiConsumer<? extends ASTNode, E> addVariableDeclarationStatement(Class<?> typeof,
BiConsumer<VariableDeclarationStatement, E> bc) {
Map<String, Object> map = Map.ofEntries(
new AbstractMap.SimpleEntry<String, Object>(TYPEOF, typeof)
new AbstractMap.SimpleEntry<>(TYPEOF, typeof)
);
consumerdata.put(VisitorEnum.VariableDeclarationStatement, map);
return consumermap.put(VisitorEnum.VariableDeclarationStatement, bc);
Expand Down Expand Up @@ -2710,11 +2710,11 @@ public void addMethodDeclaration(BiPredicate<MethodDeclaration, E> bs, BiConsume
public void addMethodInvocation(String methodname, BiPredicate<MethodInvocation, E> bs,
BiConsumer<MethodInvocation, E> bc) {
predicatedata.put(VisitorEnum.MethodInvocation, Map.ofEntries(
new AbstractMap.SimpleEntry<String, Object>(METHODNAME, methodname)
new AbstractMap.SimpleEntry<>(METHODNAME, methodname)
));
predicatemap.put(VisitorEnum.MethodInvocation, bs);
consumerdata.put(VisitorEnum.MethodInvocation, Map.ofEntries(
new AbstractMap.SimpleEntry<String, Object>(METHODNAME, methodname)
new AbstractMap.SimpleEntry<>(METHODNAME, methodname)
));
consumermap.put(VisitorEnum.MethodInvocation, bc);
}
Expand All @@ -2729,8 +2729,8 @@ public void addMethodInvocation(String methodname, BiPredicate<MethodInvocation,
public void addMethodInvocation(Class typeof, String methodname, BiPredicate<MethodInvocation, E> bs,
BiConsumer<MethodInvocation, E> bc) {
Map<String, Object> map = Map.ofEntries(
new AbstractMap.SimpleEntry<String, Object>(METHODNAME, methodname),
new AbstractMap.SimpleEntry<String, Object>(TYPEOF, typeof)
new AbstractMap.SimpleEntry<>(METHODNAME, methodname),
new AbstractMap.SimpleEntry<>(TYPEOF, typeof)
);
predicatedata.put(VisitorEnum.MethodInvocation, map);
predicatemap.put(VisitorEnum.MethodInvocation, bs);
Expand Down Expand Up @@ -3270,7 +3270,7 @@ public void addVariableDeclarationStatement(BiPredicate<VariableDeclarationState
public void addVariableDeclarationStatement(Class<?> typeof, BiPredicate<VariableDeclarationStatement, E> bs,
BiConsumer<VariableDeclarationStatement, E> bc) {
Map<String, Object> map = Map.ofEntries(
new AbstractMap.SimpleEntry<String, Object>(TYPEOF, typeof)
new AbstractMap.SimpleEntry<>(TYPEOF, typeof)
);
predicatedata.put(VisitorEnum.VariableDeclarationStatement, map);
consumerdata.put(VisitorEnum.VariableDeclarationStatement, map);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,15 +375,15 @@ enum ExplicitEncodingPatterns {
@ParameterizedTest
@EnumSource(ExplicitEncodingPatterns.class)
public void testExplicitEncodingParametrized(ExplicitEncodingPatterns test) throws CoreException {
IPackageFragment pack= context.fSourceFolder.createPackageFragment("test1", false, null);
IPackageFragment pack= context.getfSourceFolder().createPackageFragment("test1", false, null);
ICompilationUnit cu= pack.createCompilationUnit("E1.java", test.given, false, null);
context.enable(MYCleanUpConstants.EXPLICITENCODING_CLEANUP);
context.assertRefactoringResultAsExpected(new ICompilationUnit[] {cu}, new String[] {test.expected}, null);
}

@Test
public void testExplicitEncoding_donttouch() throws CoreException{
IPackageFragment pack= context.fSourceFolder.createPackageFragment("test1", false, null);
IPackageFragment pack= context.getfSourceFolder().createPackageFragment("test1", false, null);
ICompilationUnit cu= pack.createCompilationUnit("E2.java",
"" //
+ "package test1;\n" //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,7 @@ enum UseFunctionalLoop {
@ParameterizedTest
@EnumSource(UseFunctionalLoop.class)
public void testExplicitEncodingParametrized(UseFunctionalLoop test) throws CoreException {
IPackageFragment pack= context.fSourceFolder.createPackageFragment("test1", false, null);
IPackageFragment pack= context.getfSourceFolder().createPackageFragment("test1", false, null);
ICompilationUnit cu= pack.createCompilationUnit("TestDemo.java", test.given, false, null);
context.enable(MYCleanUpConstants.USEFUNCTIONALLOOP_CLEANUP);
context.assertRefactoringResultAsExpected(new ICompilationUnit[] {cu}, new String[] {test.expected}, null);
Expand Down Expand Up @@ -1610,7 +1610,7 @@ public void testExplicitEncodingParametrized(UseFunctionalLoop test) throws Core

})
public void testExplicitEncoding_donttouch(String dontchange) throws CoreException {
IPackageFragment pack= context.fSourceFolder.createPackageFragment("testdemo", false, null);
IPackageFragment pack= context.getfSourceFolder().createPackageFragment("testdemo", false, null);
ICompilationUnit cu= pack.createCompilationUnit("TestDemo.java",
dontchange,
false, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ enum JFaceCleanupCases{
@ParameterizedTest
@EnumSource(JFaceCleanupCases.class)
public void testJFaceCleanupParametrized(JFaceCleanupCases test) throws CoreException {
IPackageFragment pack= context.fSourceFolder.createPackageFragment("test", false, null);
IPackageFragment pack= context.getfSourceFolder().createPackageFragment("test", false, null);
ICompilationUnit cu= pack.createCompilationUnit("Test.java", test.given, false, null);
context.enable(MYCleanUpConstants.JFACE_CLEANUP);
context.assertRefactoringResultAsExpected(new ICompilationUnit[] {cu}, new String[] {test.expected}, null);
Expand Down Expand Up @@ -144,7 +144,7 @@ enum NO_JFaceCleanupCases {
@ParameterizedTest
@EnumSource(NO_JFaceCleanupCases.class)
public void testJFaceCleanup_donttouch(NO_JFaceCleanupCases test) throws CoreException {
IPackageFragment pack= context.fSourceFolder.createPackageFragment("test", false, null);
IPackageFragment pack= context.getfSourceFolder().createPackageFragment("test", false, null);
ICompilationUnit cu= pack.createCompilationUnit("Test.java",test.given,false, null);
context.enable(MYCleanUpConstants.JFACE_CLEANUP);
context.assertRefactoringHasNoChange(new ICompilationUnit[] { cu });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,15 @@ enum PlatformStatusPatterns {
@ParameterizedTest
@EnumSource(PlatformStatusPatterns.class)
public void testPlatformStatusParametrized(PlatformStatusPatterns test) throws CoreException {
IPackageFragment pack= context.fSourceFolder.createPackageFragment("test1", false, null);
IPackageFragment pack= context.getfSourceFolder().createPackageFragment("test1", false, null);
ICompilationUnit cu= pack.createCompilationUnit("E1.java", test.given, false, null);
context.enable(MYCleanUpConstants.SIMPLIFY_STATUS_CLEANUP);
context.assertRefactoringResultAsExpected(new ICompilationUnit[] {cu}, new String[] {test.expected}, null);
}

@Test
public void testPlatformStatus_donttouch() throws CoreException {
IPackageFragment pack= context.fSourceFolder.createPackageFragment("test1", false, null);
IPackageFragment pack= context.getfSourceFolder().createPackageFragment("test1", false, null);
ICompilationUnit cu= pack.createCompilationUnit("E2.java",
"" //
+ "package test1;\n" //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ enum PlatformStatusPatterns {
@ParameterizedTest
@EnumSource(PlatformStatusPatterns.class)
public void testPlatformStatusParametrized(PlatformStatusPatterns test) throws CoreException {
IPackageFragment pack= context.fSourceFolder.createPackageFragment("test1", false, null);
IPackageFragment pack= context.getfSourceFolder().createPackageFragment("test1", false, null);
ICompilationUnit cu= pack.createCompilationUnit("E1.java", test.given, false, null);
context.enable(MYCleanUpConstants.SIMPLIFY_STATUS_CLEANUP);
context.assertRefactoringResultAsExpected(new ICompilationUnit[] {cu}, new String[] {test.expected}, null);
Expand Down Expand Up @@ -146,7 +146,7 @@ enum PlatformStatusPatternsDontTouch {
@ParameterizedTest
@EnumSource(PlatformStatusPatternsDontTouch.class)
public void testPlatformStatus_donttouch(PlatformStatusPatternsDontTouch test) throws CoreException {
IPackageFragment pack= context.fSourceFolder.createPackageFragment("test1", false, null);
IPackageFragment pack= context.getfSourceFolder().createPackageFragment("test1", false, null);
ICompilationUnit cu= pack.createCompilationUnit("E2.java", test.given, false, null);
context.enable(MYCleanUpConstants.SIMPLIFY_STATUS_CLEANUP);
context.assertRefactoringHasNoChange(new ICompilationUnit[] { cu });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public class AbstractEclipseJava implements AfterEachCallback, BeforeEachCallbac
private final String testresources_stubs;
private final String compliance;
private static final String TEST_SETUP_PROJECT= "TestSetupProject"; //$NON-NLS-1$
public IPackageFragmentRoot fSourceFolder;
private IPackageFragmentRoot fSourceFolder;
private CustomProfile fProfile;

public AbstractEclipseJava(String stubs, String compilerversion) {
Expand All @@ -93,8 +93,8 @@ public void beforeEach(ExtensionContext context) throws CoreException {
Map<String, String> options= javaProject.getOptions(false);
JavaCore.setComplianceOptions(compliance, options);
javaProject.setOptions(options);
fSourceFolder= AbstractEclipseJava.addSourceContainer(getProject(TEST_SETUP_PROJECT), "src", new Path[0], //$NON-NLS-1$
new Path[0], null, new IClasspathAttribute[0]);
setfSourceFolder(AbstractEclipseJava.addSourceContainer(getProject(TEST_SETUP_PROJECT), "src", new Path[0], //$NON-NLS-1$
new Path[0], null, new IClasspathAttribute[0]));
Map<String, String> settings= new HashMap<>();
fProfile= new ProfileManager.CustomProfile("testProfile", settings, CleanUpProfileVersioner.CURRENT_VERSION, //$NON-NLS-1$
CleanUpProfileVersioner.PROFILE_KIND);
Expand All @@ -106,7 +106,7 @@ public void beforeEach(ExtensionContext context) throws CoreException {

@Override
public void afterEach(ExtensionContext context) throws CoreException {
delete(fSourceFolder);
delete(getfSourceFolder());
}

public IJavaProject getProject(String projectname) {
Expand Down Expand Up @@ -464,4 +464,12 @@ private void commitProfile() throws CoreException {
profileStore.writeProfiles(profiles, InstanceScope.INSTANCE);
CleanUpPreferenceUtil.saveSaveParticipantOptions(InstanceScope.INSTANCE, fProfile.getSettings());
}

public IPackageFragmentRoot getfSourceFolder() {
return fSourceFolder;
}

public void setfSourceFolder(IPackageFragmentRoot fSourceFolder) {
this.fSourceFolder = fSourceFolder;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ enum While2EnhancedForLoop {
@ParameterizedTest
@EnumSource(While2EnhancedForLoop.class)
public void testWhile2enhancedForLoopParametrized(While2EnhancedForLoop test) throws CoreException {
IPackageFragment pack= context.fSourceFolder.createPackageFragment("test1", false, null);
IPackageFragment pack= context.getfSourceFolder().createPackageFragment("test1", false, null);
ICompilationUnit cu= pack.createCompilationUnit("TestDemo.java", test.given, false, null);
context.enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
context.assertRefactoringResultAsExpected(new ICompilationUnit[] {cu}, new String[] {test.expected}, null);
Expand Down Expand Up @@ -402,7 +402,7 @@ enum NO_While2EnhancedForLoop {
@ParameterizedTest
@EnumSource(NO_While2EnhancedForLoop.class)
public void testWhile2enhancedForLoop_donttouch(NO_While2EnhancedForLoop test) throws CoreException {
IPackageFragment pack= context.fSourceFolder.createPackageFragment("test", false, null);
IPackageFragment pack= context.getfSourceFolder().createPackageFragment("test", false, null);
ICompilationUnit cu= pack.createCompilationUnit("Test.java",test.given,false, null);
context.enable(CleanUpConstants.CONTROL_STATEMENTS_CONVERT_FOR_LOOP_TO_ENHANCED);
context.assertRefactoringHasNoChange(new ICompilationUnit[] { cu });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ public void simpleTest3c() {
@Test
public void simpleTest3d() {
Set<ASTNode> nodesprocessed = null;
HelperVisitor<ReferenceHolder<String,NodeFound>,String,NodeFound> hv = new HelperVisitor<>(nodesprocessed, new ReferenceHolder<String, NodeFound>());
HelperVisitor<ReferenceHolder<String,NodeFound>,String,NodeFound> hv = new HelperVisitor<>(nodesprocessed, new ReferenceHolder<>());
VisitorEnum.stream().forEach(ve -> {
hv.add(ve, (node, holder) -> {
String x = "Start "+node.getNodeType() + " :" + node; //$NON-NLS-1$ //$NON-NLS-2$
Expand Down
Loading

0 comments on commit adbea66

Please sign in to comment.