Skip to content

Commit

Permalink
Build for Eclipse 4.31 (2024-03), AspectJ 1.9.22, Java 22, Tycho 4.0.6
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Kriegisch <[email protected]>
  • Loading branch information
kriegaex committed Mar 23, 2024
1 parent e86b713 commit 926b0ea
Show file tree
Hide file tree
Showing 35 changed files with 228 additions and 195 deletions.
2 changes: 1 addition & 1 deletion org.aspectj-feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<feature
id="org.aspectj"
label="%featureName"
version="1.9.21.qualifier"
version="1.9.22.qualifier"
provider-name="%providerName"
plugin="org.eclipse.aspectj">

Expand Down
2 changes: 1 addition & 1 deletion org.aspectj-feature/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>

<groupId>org.aspectj.ajde</groupId>
<version>1.9.21-SNAPSHOT</version>
<version>1.9.22-SNAPSHOT</version>
<artifactId>org.aspectj</artifactId>
<packaging>eclipse-feature</packaging>

Expand Down
4 changes: 2 additions & 2 deletions org.aspectj.ajde/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Automatic-Module-Name: org.aspectj.ajde
Bundle-ManifestVersion: 2
Bundle-Name: AspectJ
Bundle-SymbolicName: org.aspectj.ajde; singleton:=true
Bundle-Version: 1.9.21.qualifier
Bundle-Version: 1.9.22.qualifier
Bundle-Vendor: Eclipse AspectJ Development Tools
Export-Package: org.aspectj.ajde.core,
org.aspectj.ajde.core.internal,
Expand Down Expand Up @@ -66,7 +66,7 @@ Require-Bundle: org.apache.ant,
org.eclipse.core.resources,
org.eclipse.core.runtime,
org.eclipse.text,
org.aspectj.weaver;bundle-version="1.9.21";visibility:=reexport
org.aspectj.weaver;bundle-version="1.9.22";visibility:=reexport
Bundle-ActivationPolicy: lazy
Eclipse-BundleShape: jar
Bundle-ClassPath: .
4 changes: 2 additions & 2 deletions org.aspectj.ajde/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<dependency>
<groupId>org.aspectj.ajde</groupId>
<artifactId>org.aspectj.weaver</artifactId>
<version>1.9.21-SNAPSHOT</version>
<version>1.9.22-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand All @@ -19,7 +19,7 @@

<groupId>org.aspectj.ajde</groupId>
<artifactId>org.aspectj.ajde</artifactId>
<version>1.9.21-SNAPSHOT</version>
<version>1.9.22-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>

<build>
Expand Down
24 changes: 12 additions & 12 deletions org.aspectj.runtime/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ Automatic-Module-Name: org.aspectj.runtime
Bundle-ManifestVersion: 2
Bundle-Name: AspectJ Runtime
Bundle-SymbolicName: org.aspectj.runtime
Bundle-Version: 1.9.21.qualifier
Bundle-Version: 1.9.22.qualifier
Bundle-Vendor: Eclipse AspectJ Development Tools
Export-Package: org.aspectj.internal.lang.annotation;version="1.9.21",
org.aspectj.internal.lang.reflect;version="1.9.21",
org.aspectj.lang;version="1.9.21",
org.aspectj.lang.annotation;version="1.9.21",
org.aspectj.lang.internal.lang;version="1.9.21",
org.aspectj.lang.reflect;version="1.9.21",
org.aspectj.runtime;version="1.9.21",
org.aspectj.runtime.internal;version="1.9.21",
org.aspectj.runtime.internal.cflowstack;version="1.9.21",
org.aspectj.runtime.reflect;version="1.9.21"
Export-Package: org.aspectj.internal.lang.annotation;version="1.9.22",
org.aspectj.internal.lang.reflect;version="1.9.22",
org.aspectj.lang;version="1.9.22",
org.aspectj.lang.annotation;version="1.9.22",
org.aspectj.lang.internal.lang;version="1.9.22",
org.aspectj.lang.reflect;version="1.9.22",
org.aspectj.runtime;version="1.9.22",
org.aspectj.runtime.internal;version="1.9.22",
org.aspectj.runtime.internal.cflowstack;version="1.9.22",
org.aspectj.runtime.reflect;version="1.9.22"
Eclipse-BundleShape: jar
Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-ClassPath: .
Implementation-Version: 1.9.21
Implementation-Version: 1.9.22
Implementation-Vendor: aspectj.org
2 changes: 1 addition & 1 deletion org.aspectj.runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<groupId>org.aspectj.ajde</groupId>
<artifactId>org.aspectj.runtime</artifactId>
<version>1.9.21-SNAPSHOT</version>
<version>1.9.22-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>

<build>
Expand Down
46 changes: 23 additions & 23 deletions org.aspectj.weaver/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,31 @@ Can-Redefine-Classes: true
Bundle-ManifestVersion: 2
Bundle-Name: AspectJ Weaver
Bundle-SymbolicName: org.aspectj.weaver
Bundle-Version: 1.9.21.qualifier
Bundle-Version: 1.9.22.qualifier
Bundle-Vendor: Eclipse AspectJ Development Tools
Require-Bundle: org.aspectj.runtime;bundle-version="1.9.21";visibility:=reexport
Export-Package: org.aspectj.apache.bcel;version="1.9.21",
org.aspectj.apache.bcel.classfile;version="1.9.21",
org.aspectj.apache.bcel.classfile.annotation;version="1.9.21",
org.aspectj.apache.bcel.generic;version="1.9.21",
org.aspectj.apache.bcel.util;version="1.9.21",
org.aspectj.asm;version="1.9.21",
org.aspectj.asm.internal;version="1.9.21",
org.aspectj.bridge;version="1.9.21",
org.aspectj.bridge.context;version="1.9.21",
org.aspectj.util;version="1.9.21",
org.aspectj.weaver;version="1.9.21",
org.aspectj.weaver.ast;version="1.9.21",
org.aspectj.weaver.bcel;version="1.9.21",
org.aspectj.weaver.internal.tools;version="1.9.21",
org.aspectj.weaver.loadtime;version="1.9.21",
org.aspectj.weaver.loadtime.definition;version="1.9.21",
org.aspectj.weaver.model;version="1.9.21",
org.aspectj.weaver.patterns;version="1.9.21",
org.aspectj.weaver.reflect;version="1.9.21",
org.aspectj.weaver.tools;version="1.9.21"
Require-Bundle: org.aspectj.runtime;bundle-version="1.9.22";visibility:=reexport
Export-Package: org.aspectj.apache.bcel;version="1.9.22",
org.aspectj.apache.bcel.classfile;version="1.9.22",
org.aspectj.apache.bcel.classfile.annotation;version="1.9.22",
org.aspectj.apache.bcel.generic;version="1.9.22",
org.aspectj.apache.bcel.util;version="1.9.22",
org.aspectj.asm;version="1.9.22",
org.aspectj.asm.internal;version="1.9.22",
org.aspectj.bridge;version="1.9.22",
org.aspectj.bridge.context;version="1.9.22",
org.aspectj.util;version="1.9.22",
org.aspectj.weaver;version="1.9.22",
org.aspectj.weaver.ast;version="1.9.22",
org.aspectj.weaver.bcel;version="1.9.22",
org.aspectj.weaver.internal.tools;version="1.9.22",
org.aspectj.weaver.loadtime;version="1.9.22",
org.aspectj.weaver.loadtime.definition;version="1.9.22",
org.aspectj.weaver.model;version="1.9.22",
org.aspectj.weaver.patterns;version="1.9.22",
org.aspectj.weaver.reflect;version="1.9.22",
org.aspectj.weaver.tools;version="1.9.22"
Eclipse-BundleShape: jar
Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-ClassPath: .
Implementation-Version: 1.9.21
Implementation-Version: 1.9.22
Implementation-Vendor: aspectj.org
4 changes: 2 additions & 2 deletions org.aspectj.weaver/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<dependency>
<groupId>org.aspectj.ajde</groupId>
<artifactId>org.aspectj.runtime</artifactId>
<version>1.9.21-SNAPSHOT</version>
<version>1.9.22-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand All @@ -19,7 +19,7 @@

<groupId>org.aspectj.ajde</groupId>
<artifactId>org.aspectj.weaver</artifactId>
<version>1.9.21-SNAPSHOT</version>
<version>1.9.22-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>

<build>
Expand Down
2 changes: 1 addition & 1 deletion org.eclipse.ajdt.core.tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<dependency>
<groupId>org.aspectj.ajde</groupId>
<artifactId>org.aspectj.weaver</artifactId>
<version>1.9.21-SNAPSHOT</version>
<version>1.9.22-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
4 changes: 2 additions & 2 deletions org.eclipse.ajdt.core/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ Export-Package: org.eclipse.ajdt.core;aspect-policy:=opt-in,
org.eclipse.ajdt.internal.core.refactoring;x-friends:="org.eclipse.ajdt.core.tests"
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.6.0,4.3.0)",
org.eclipse.pde.build;bundle-version="[3.6.0,4.3.0)";resolution:=optional,
org.eclipse.core.resources;bundle-version="[3.6.0,4.3.0)",
org.eclipse.core.resources;bundle-version="[3.20.0,4.3.0)",
org.eclipse.jdt.core;bundle-version="[3.9.0,4.3.0)",
org.eclipse.text;bundle-version="[3.5.0,4.3.0)",
org.eclipse.ltk.core.refactoring;bundle-version="[3.5.0,4.3.0)",
org.aspectj.ajde;bundle-version="1.9.21";visibility:=reexport,
org.aspectj.ajde;bundle-version="1.9.22";visibility:=reexport,
org.eclipse.pde.core;bundle-version="[3.6.0,4.3.0)";resolution:=optional,
org.eclipse.contribution.weaving.jdt;bundle-version="2.2.4";resolution:=optional,
org.eclipse.ant.core,
Expand Down
2 changes: 1 addition & 1 deletion org.eclipse.ajdt.core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<dependency>
<groupId>org.aspectj.ajde</groupId>
<artifactId>org.aspectj.ajde</artifactId>
<version>1.9.21-SNAPSHOT</version>
<version>1.9.22-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,95 +34,105 @@ public class AJCodeElement extends LocalVariable implements IAJCodeElement {
private int startLine;

public AJCodeElement(JavaElement parent, String name) {
super(parent,name,0,0,0,0,"I", new org.eclipse.jdt.internal.compiler.ast.Annotation[0], 0, false); //$NON-NLS-1$
this.name=name;
// The 3 calls to 'initializeLocations' are a horrible hack, see comment there
super(
parent, name, 0, 0,
initializeLocations(parent, name)[0],
initializeLocations(parent, name)[1],
"I", new org.eclipse.jdt.internal.compiler.ast.Annotation[0], 0, false //$NON-NLS-1$
);
this.name = name;
startLine = initializeLocations(parent, name)[2];
}

public AJCodeElement(JavaElement parent, String name, int occurrence) {
this(parent,name);
this.occurrenceCount = occurrence;
this.setOccurrenceCount(occurrence);
}



public ISourceRange getNameRange() {
if (nameStart==0) {
initializeLocations();
}
return new SourceRange(this.nameStart, this.nameEnd-this.nameStart+1);
}

public int hashCode() {
return Util.combineHashCodes(name.hashCode(),occurrenceCount);
}

public boolean equals(Object o) {
if (!(o instanceof AJCodeElement)) {
return super.equals(o);
}
AJCodeElement ajce = (AJCodeElement)o;
return super.equals(o) && (occurrenceCount == ajce.occurrenceCount);
return super.equals(o) && (getOccurrenceCount() == ajce.getOccurrenceCount());
}

public void initializeLocations() {
// try the easy way:
IProgramElement ipe =
AJProjectModelFactory.getInstance().getModelForJavaElement(this).javaElementToProgramElement(this);
ISourceLocation sloc = ipe.getSourceLocation();
if (sloc != null) {
startLine = sloc.getLine();

nameStart = sloc.getOffset();
if (sloc instanceof EclipseSourceLocation) {
EclipseSourceLocation esloc = (EclipseSourceLocation) sloc;
nameEnd = esloc.getEndPos();
}
}

// sometimes the start and end values are not set...so do it the hard way
// so calculate it from the line
if (nameStart <= 0 || nameEnd <= 0) {
try {
IOpenable openable = this.getParent().getOpenableParent();
IBuffer buffer;
if (openable instanceof AJCompilationUnit) {
AJCompilationUnit ajCompUnit = (AJCompilationUnit) openable;
ajCompUnit.requestOriginalContentMode();
buffer = openable.getBuffer();
ajCompUnit.discardOriginalContentMode();
} else {
buffer = openable.getBuffer();
}
String source = buffer.getContents();

int lines = 0;
for (int i = 0; i < source.length(); i++) {
if (source.charAt(i) == '\n') {
lines++;
if (lines == startLine-1) {
// starting remove white space
i++;
while (i < source.length() && (Character.isWhitespace(source.charAt(i))
&& source.charAt(i) != '\n')) {
i++;
}
nameStart=i;
break;
}
}
}

for (int i = nameStart+1; i < source.length(); i++) {
if (source.charAt(i) == '\n' || source.charAt(i) ==';') {
nameEnd = i-1;
break;
}
}

nameStart = Math.min(nameStart,nameEnd);
} catch (JavaModelException ignored) {
}
}
public static int[] initializeLocations(JavaElement parent, String name) {
// This is a horrible hack to accomodate the fact that LocalVariable.nameStart, and .nameEnd were made final in
// Eclipse 2024-12. Instead of initialising the variables after creation, the values must now be passed directly
// into the super constructor. Therefore, this method is called 3x, once for each of the 3 values returned. This is
// inefficient, but keeps us from caching the array in a static thread-local variable, possibly creating a memory
// leak in doing so.
LocalVariable dummyInstance = new LocalVariable(
parent, name, 0, 0, 0, 0, "I", new org.eclipse.jdt.internal.compiler.ast.Annotation[0], 0, false //$NON-NLS-1$
);

// Return values: [0] nameStart, [1] nameEnd, [2] startLine
final int[] locations = new int[3];

// Try the easy way first
IProgramElement ipe =
AJProjectModelFactory.getInstance().getModelForJavaElement(dummyInstance).javaElementToProgramElement(dummyInstance);
ISourceLocation sloc = ipe.getSourceLocation();
if (sloc != null) {
locations[2] = sloc.getLine();
locations[0] = sloc.getOffset();
if (sloc instanceof EclipseSourceLocation) {
EclipseSourceLocation esloc = (EclipseSourceLocation) sloc;
locations[1] = esloc.getEndPos();
}
}

// Sometimes, the start and end values are not set. So, do it the hard way and calculate them from the line.
if (locations[0] <= 0 || locations[1] <= 0) {
try {
IOpenable openable = parent.getOpenableParent();
IBuffer buffer;
if (openable instanceof AJCompilationUnit) {
AJCompilationUnit ajCompUnit = (AJCompilationUnit) openable;
ajCompUnit.requestOriginalContentMode();
buffer = openable.getBuffer();
ajCompUnit.discardOriginalContentMode();
}
else {
buffer = openable.getBuffer();
}
String source = buffer.getContents();

int lines = 0;
for (int i = 0; i < source.length(); i++) {
if (source.charAt(i) == '\n') {
lines++;
if (lines == locations[2] - 1) {
// starting remove white space
i++;
while (i < source.length() && Character.isWhitespace(source.charAt(i)) && source.charAt(i) != '\n') {
i++;
}
locations[0] = i;
break;
}
}
}

for (int i = locations[0] + 1; i < source.length(); i++) {
if (source.charAt(i) == '\n' || source.charAt(i) == ';') {
locations[1] = i - 1;
break;
}
}

locations[0] = Math.min(locations[0], locations[1]);
}
catch (JavaModelException ignored) {}
}

return locations;
}

/**
Expand Down
Loading

0 comments on commit 926b0ea

Please sign in to comment.