Skip to content

Commit 27bd078

Browse files
committed
Update target platform to Eclipse 2024/09.
Avoid Apache Commons dependency. Move from javax.annotations to jakarta.annoations.
1 parent 36b39a0 commit 27bd078

File tree

9 files changed

+40
-38
lines changed

9 files changed

+40
-38
lines changed

org.jmolecules.eclipse.feature/feature.xml

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<feature
3-
id="org.jmolecules.eclipse.feature"
3+
id="org.jmolecules.eclipse"
44
label="jMolecules"
55
version="1.0.0.qualifier"
66
provider-name="jmolecules.org">
@@ -220,12 +220,11 @@ domain models in distraction-free, plain old Java.
220220
</license>
221221

222222
<requires>
223-
<import plugin="org.eclipse.core.runtime"/>
224-
<import plugin="org.eclipse.ui"/>
225-
<import plugin="javax.inject"/>
226223
<import plugin="org.eclipse.core.resources"/>
227-
<import plugin="org.eclipse.jdt.core"/>
224+
<import plugin="org.eclipse.core.runtime"/>
228225
<import plugin="org.eclipse.e4.core.services"/>
226+
<import plugin="org.eclipse.jdt.core"/>
227+
<import plugin="org.eclipse.ui"/>
229228
</requires>
230229

231230
<plugin

org.jmolecules.eclipse.feature/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<version>1.0.0-SNAPSHOT</version>
99
</parent>
1010

11-
<artifactId>org.jmolecules.eclipse.feature</artifactId>
11+
<artifactId>org.jmolecules.eclipse</artifactId>
1212
<packaging>eclipse-feature</packaging>
1313

1414
<name>JMolecules for Eclipse Feature</name>

org.jmolecules.eclipse.plugin.explorer/META-INF/MANIFEST.MF

+6-8
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,17 @@ Bundle-Name: jMolecules Explorer
44
Bundle-SymbolicName: org.jmolecules.eclipse.plugin.explorer;singleton:=true
55
Bundle-Version: 1.0.0.qualifier
66
Bundle-Vendor: jmolecules.org
7-
Require-Bundle: org.eclipse.core.runtime,
8-
org.eclipse.ui,
7+
Require-Bundle: com.google.guava,
98
org.eclipse.core.resources,
9+
org.eclipse.core.runtime,
1010
org.eclipse.jdt.core,
11-
org.apache.commons.lang,
1211
org.eclipse.jdt.ui,
13-
javax.inject,
14-
javax.annotation,
12+
org.eclipse.ui,
1513
org.eclipse.ui.workbench.texteditor,
1614
org.eclipse.ui.ide,
1715
org.eclipse.ui.navigator,
18-
org.eclipse.ui.navigator.resources,
19-
com.google.guava
20-
Bundle-RequiredExecutionEnvironment: JavaSE-11
16+
org.eclipse.ui.navigator.resources
17+
Bundle-RequiredExecutionEnvironment: JavaSE-17
2118
Automatic-Module-Name: org.jmolecules.eclipse.plugin.explorer
2219
Export-Package: org.jmolecules.eclipse.plugin.explorer
20+
Import-Package: jakarta.annotation

org.jmolecules.eclipse.plugin.explorer/src/org/jmolecules/eclipse/plugin/explorer/ExplorerView.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
import java.util.Optional;
2626

27-
import javax.annotation.PostConstruct;
27+
import jakarta.annotation.PostConstruct;
2828

2929
import org.eclipse.jdt.core.IJavaElement;
3030
import org.eclipse.jdt.core.IJavaProject;

org.jmolecules.eclipse.plugin.explorer/src/org/jmolecules/eclipse/plugin/explorer/JMolecules.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
import static java.util.stream.Collectors.toList;
2222
import static java.util.stream.Collectors.toSet;
2323

24-
import static org.apache.commons.lang.StringUtils.substringAfterLast;
25-
import static org.apache.commons.lang.StringUtils.substringBeforeLast;
2624
import static org.jmolecules.eclipse.plugin.explorer.JMolecules.Concept.Category.CQRS_ARCHITECTURE;
2725
import static org.jmolecules.eclipse.plugin.explorer.JMolecules.Concept.Category.DDD;
2826
import static org.jmolecules.eclipse.plugin.explorer.JMolecules.Concept.Category.EVENTS;
@@ -235,8 +233,11 @@ private boolean isAnnotating(ICompilationUnit compilationUnit, IAnnotatable anno
235233
}
236234

237235
IImportDeclaration[] imports = getImports(compilationUnit);
238-
String pckg = substringBeforeLast(fqcn, ".").concat(".");
239-
String name = substringAfterLast(fqcn, ".");
236+
237+
int lastDotIndex = fqcn.lastIndexOf(".");
238+
239+
String pckg = fqcn.substring(0, lastDotIndex - 1).concat(".");
240+
String name = fqcn.substring(lastDotIndex + 1);
240241

241242
return stream(imports).anyMatch(i -> i.getElementName().startsWith(pckg))
242243
&& (stream(annotations).anyMatch(a -> a.getElementName().equals(name)));

org.jmolecules.eclipse.plugin.explorer/src/org/jmolecules/eclipse/plugin/explorer/TreeFactory.java

+19-15
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,17 @@
1515
*/
1616
package org.jmolecules.eclipse.plugin.explorer;
1717

18-
import static java.util.Arrays.stream;
19-
import static java.util.Collections.emptyList;
20-
import static java.util.Collections.unmodifiableList;
18+
import static java.util.Arrays.*;
19+
import static java.util.Collections.*;
2120
import static java.util.Optional.empty;
2221
import static java.util.Optional.of;
23-
import static java.util.stream.Collectors.toList;
24-
import static java.util.stream.Collectors.toSet;
25-
import static java.util.stream.Stream.concat;
26-
27-
import static org.apache.commons.lang.builder.EqualsBuilder.reflectionEquals;
28-
import static org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode;
29-
import static org.jmolecules.eclipse.plugin.explorer.JavaModelUtils.getChildren;
30-
import static org.jmolecules.eclipse.plugin.explorer.JavaModelUtils.getFields;
31-
import static org.jmolecules.eclipse.plugin.explorer.JavaModelUtils.getMethods;
32-
import static org.jmolecules.eclipse.plugin.explorer.JavaModelUtils.isPackageInfo;
22+
import static java.util.stream.Collectors.*;
23+
import static java.util.stream.Stream.*;
24+
import static org.jmolecules.eclipse.plugin.explorer.JavaModelUtils.*;
3325

3426
import java.util.ArrayList;
3527
import java.util.List;
28+
import java.util.Objects;
3629
import java.util.Optional;
3730
import java.util.stream.Stream;
3831

@@ -176,12 +169,23 @@ class TreeNode {
176169

177170
@Override
178171
public int hashCode() {
179-
return reflectionHashCode(this, new String[] { "parent" });
172+
return Objects.hash(children, source, concepts);
180173
}
181174

182175
@Override
183176
public boolean equals(Object obj) {
184-
return reflectionEquals(this, obj, new String[] { "parent" });
177+
178+
if (this == obj) {
179+
return true;
180+
}
181+
182+
if (!(obj instanceof TreeNode that)) {
183+
return false;
184+
}
185+
186+
return this.children.equals(that.children)
187+
&& this.source.equals(that.source)
188+
&& this.concepts.equals(that.concepts);
185189
}
186190

187191
Optional<TreeNode> findNode(IJavaElement source) {

org.jmolecules.eclipse.updatesite/category.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<site>
3-
<feature url="features/org.jmolecules.eclipse.feature_1.0.0.qualifier.jar" id="org.jmolecules.eclipse.feature" version="1.0.0.qualifier">
3+
<feature id="org.jmolecules.eclipse">
44
<category name="org.jmolecules"/>
55
</feature>
66
<category-def name="org.jmolecules" label="JMolecules for Eclipse">

org.jmolecules.eclipse.updatesite/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<groupId>org.eclipse.tycho</groupId>
2020
<artifactId>tycho-p2-publisher-plugin</artifactId>
2121
<configuration>
22-
<profiles>JavaSE-11</profiles>
22+
<profiles>JavaSE-17</profiles>
2323
</configuration>
2424
</plugin>
2525
</plugins>

pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
<repositories>
5454
<repository>
5555
<id>eclipse-latest</id>
56-
<url>https://download.eclipse.org/releases/2021-12/</url>
56+
<url>https://download.eclipse.org/releases/2024-09/</url>
5757
<layout>p2</layout>
5858
</repository>
5959
</repositories>
@@ -181,7 +181,7 @@
181181
<arch>x86_64</arch>
182182
</environment>
183183
</environments>
184-
<executionEnvironment>JavaSE-11</executionEnvironment>
184+
<executionEnvironment>JavaSE-17</executionEnvironment>
185185
<includePackedArtifacts>true</includePackedArtifacts>
186186
<resolver>p2</resolver>
187187
</configuration>

0 commit comments

Comments
 (0)