From 926b0ea01a43ef41dd6013d82c93bfd3b346b38a Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Sat, 23 Mar 2024 19:51:44 +0100 Subject: [PATCH] Build for Eclipse 4.31 (2024-03), AspectJ 1.9.22, Java 22, Tycho 4.0.6 Signed-off-by: Alexander Kriegisch --- org.aspectj-feature/feature.xml | 2 +- org.aspectj-feature/pom.xml | 2 +- org.aspectj.ajde/META-INF/MANIFEST.MF | 4 +- org.aspectj.ajde/pom.xml | 4 +- org.aspectj.runtime/META-INF/MANIFEST.MF | 24 +-- org.aspectj.runtime/pom.xml | 2 +- org.aspectj.weaver/META-INF/MANIFEST.MF | 46 +++--- org.aspectj.weaver/pom.xml | 4 +- org.eclipse.ajdt.core.tests/pom.xml | 2 +- org.eclipse.ajdt.core/META-INF/MANIFEST.MF | 4 +- org.eclipse.ajdt.core/pom.xml | 2 +- .../ajdt/core/javaelements/AJCodeElement.java | 154 ++++++++++-------- .../core/javaelements/AJCompilationUnit.java | 6 +- .../core/javaelements/AJInjarElement.java | 4 +- .../ajdt/core/javaelements/AdviceElement.java | 7 +- .../ajdt/core/javaelements/AspectElement.java | 3 +- .../javaelements/AspectJMemberElement.java | 15 +- .../javaelements/BinaryAspectElement.java | 3 +- .../javaelements/BinaryAspectElementInfo.java | 3 +- .../core/javaelements/DeclareElement.java | 3 +- .../javaelements/FieldIntertypeElement.java | 3 +- .../javaelements/ITDAwareSourceTypeInfo.java | 33 ++-- .../core/javaelements/IntertypeElement.java | 6 +- .../javaelements/MethodIntertypeElement.java | 11 +- .../core/javaelements/MockSourceMethod.java | 3 +- .../core/javaelements/PointcutElement.java | 15 +- .../ajdt/core/model/AJProjectModelFacade.java | 2 +- .../AJCompilationUnitStructureRequestor.java | 11 +- .../core/ajde/CoreCompilerConfiguration.java | 7 +- org.eclipse.ajdt.releng/build.properties | 5 +- org.eclipse.ajdt.ui/META-INF/MANIFEST.MF | 2 +- .../quickfix/AJSerialVersionSubProcessor.java | 2 +- .../pom.xml | 2 +- org.eclipse.equinox.weaving.aspectj/pom.xml | 2 +- pom.xml | 25 ++- 35 files changed, 228 insertions(+), 195 deletions(-) diff --git a/org.aspectj-feature/feature.xml b/org.aspectj-feature/feature.xml index e247a83d44..10610ba07e 100644 --- a/org.aspectj-feature/feature.xml +++ b/org.aspectj-feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/org.aspectj-feature/pom.xml b/org.aspectj-feature/pom.xml index 45c90dec8c..ee0e99d713 100644 --- a/org.aspectj-feature/pom.xml +++ b/org.aspectj-feature/pom.xml @@ -10,7 +10,7 @@ org.aspectj.ajde - 1.9.21-SNAPSHOT + 1.9.22-SNAPSHOT org.aspectj eclipse-feature diff --git a/org.aspectj.ajde/META-INF/MANIFEST.MF b/org.aspectj.ajde/META-INF/MANIFEST.MF index 89d4e65bd5..9192118cc4 100644 --- a/org.aspectj.ajde/META-INF/MANIFEST.MF +++ b/org.aspectj.ajde/META-INF/MANIFEST.MF @@ -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, @@ -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: . diff --git a/org.aspectj.ajde/pom.xml b/org.aspectj.ajde/pom.xml index e157eca730..b8bcf8a133 100644 --- a/org.aspectj.ajde/pom.xml +++ b/org.aspectj.ajde/pom.xml @@ -6,7 +6,7 @@ org.aspectj.ajde org.aspectj.weaver - 1.9.21-SNAPSHOT + 1.9.22-SNAPSHOT compile @@ -19,7 +19,7 @@ org.aspectj.ajde org.aspectj.ajde - 1.9.21-SNAPSHOT + 1.9.22-SNAPSHOT eclipse-plugin diff --git a/org.aspectj.runtime/META-INF/MANIFEST.MF b/org.aspectj.runtime/META-INF/MANIFEST.MF index 0bfca11b56..82dc87dbab 100644 --- a/org.aspectj.runtime/META-INF/MANIFEST.MF +++ b/org.aspectj.runtime/META-INF/MANIFEST.MF @@ -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 diff --git a/org.aspectj.runtime/pom.xml b/org.aspectj.runtime/pom.xml index 9815c829a4..ad18dda1c3 100644 --- a/org.aspectj.runtime/pom.xml +++ b/org.aspectj.runtime/pom.xml @@ -11,7 +11,7 @@ org.aspectj.ajde org.aspectj.runtime - 1.9.21-SNAPSHOT + 1.9.22-SNAPSHOT eclipse-plugin diff --git a/org.aspectj.weaver/META-INF/MANIFEST.MF b/org.aspectj.weaver/META-INF/MANIFEST.MF index 2ec284b3be..008a7ec055 100644 --- a/org.aspectj.weaver/META-INF/MANIFEST.MF +++ b/org.aspectj.weaver/META-INF/MANIFEST.MF @@ -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 diff --git a/org.aspectj.weaver/pom.xml b/org.aspectj.weaver/pom.xml index a1189c0c2a..c07da1b348 100644 --- a/org.aspectj.weaver/pom.xml +++ b/org.aspectj.weaver/pom.xml @@ -6,7 +6,7 @@ org.aspectj.ajde org.aspectj.runtime - 1.9.21-SNAPSHOT + 1.9.22-SNAPSHOT compile @@ -19,7 +19,7 @@ org.aspectj.ajde org.aspectj.weaver - 1.9.21-SNAPSHOT + 1.9.22-SNAPSHOT eclipse-plugin diff --git a/org.eclipse.ajdt.core.tests/pom.xml b/org.eclipse.ajdt.core.tests/pom.xml index 7701be180c..6c12c47b48 100644 --- a/org.eclipse.ajdt.core.tests/pom.xml +++ b/org.eclipse.ajdt.core.tests/pom.xml @@ -6,7 +6,7 @@ org.aspectj.ajde org.aspectj.weaver - 1.9.21-SNAPSHOT + 1.9.22-SNAPSHOT compile diff --git a/org.eclipse.ajdt.core/META-INF/MANIFEST.MF b/org.eclipse.ajdt.core/META-INF/MANIFEST.MF index d231b568ee..adf9be9981 100644 --- a/org.eclipse.ajdt.core/META-INF/MANIFEST.MF +++ b/org.eclipse.ajdt.core/META-INF/MANIFEST.MF @@ -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, diff --git a/org.eclipse.ajdt.core/pom.xml b/org.eclipse.ajdt.core/pom.xml index 75485d0f26..bbcb8f5e23 100644 --- a/org.eclipse.ajdt.core/pom.xml +++ b/org.eclipse.ajdt.core/pom.xml @@ -6,7 +6,7 @@ org.aspectj.ajde org.aspectj.ajde - 1.9.21-SNAPSHOT + 1.9.22-SNAPSHOT compile diff --git a/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/AJCodeElement.java b/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/AJCodeElement.java index c0df387309..26f2bc9e83 100755 --- a/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/AJCodeElement.java +++ b/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/AJCodeElement.java @@ -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; } /** diff --git a/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/AJCompilationUnit.java b/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/AJCompilationUnit.java index ddd9ca056f..dc16f91abc 100755 --- a/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/AJCompilationUnit.java +++ b/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/AJCompilationUnit.java @@ -62,9 +62,11 @@ import org.eclipse.jdt.core.dom.AST; import org.eclipse.jdt.internal.codeassist.CompletionEngine; import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration; +import org.eclipse.jdt.internal.compiler.env.IElementInfo; import org.eclipse.jdt.internal.core.BecomeWorkingCopyOperation; import org.eclipse.jdt.internal.core.BufferManager; import org.eclipse.jdt.internal.core.CompilationUnit; +import org.eclipse.jdt.internal.core.CompilationUnitElementInfo; import org.eclipse.jdt.internal.core.JavaElement; import org.eclipse.jdt.internal.core.JavaModelManager; import org.eclipse.jdt.internal.core.JavaModelStatus; @@ -221,7 +223,7 @@ public IResource getUnderlyingResource() throws JavaModelException { return ajFile; } - protected void generateInfos(Object info, HashMap newElements, IProgressMonitor monitor) throws JavaModelException { + protected void generateInfos(IElementInfo info, Map newElements, IProgressMonitor monitor) throws JavaModelException { if (!(info instanceof AJCompilationUnitInfo)){ info = new AJCompilationUnitInfo(); } @@ -426,7 +428,7 @@ public boolean isPrimary() { return this.owner == AJWorkingCopyOwner.INSTANCE; } - protected Object createElementInfo() { + protected CompilationUnitElementInfo createElementInfo() { return new AJCompilationUnitInfo(); } diff --git a/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/AJInjarElement.java b/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/AJInjarElement.java index 69a1f21e50..454158824b 100644 --- a/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/AJInjarElement.java +++ b/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/AJInjarElement.java @@ -48,9 +48,9 @@ protected void getHandleMemento(StringBuilder buff) { // injar aspect, which has no parent buff.append(getHandleMementoDelimiter()); buff.append(getName()); - if (this.occurrenceCount > 1) { + if (this.getOccurrenceCount() > 1) { buff.append(JEM_COUNT); - buff.append(this.occurrenceCount); + buff.append(this.getOccurrenceCount()); } } else { super.getHandleMemento(buff); diff --git a/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/AdviceElement.java b/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/AdviceElement.java index 78127d0e1a..cd24cd2686 100755 --- a/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/AdviceElement.java +++ b/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/AdviceElement.java @@ -16,6 +16,7 @@ import org.eclipse.ajdt.internal.core.ras.NoFFDC; import org.eclipse.jdt.core.Signature; import org.eclipse.jdt.internal.core.JavaElement; +import org.eclipse.jdt.internal.core.JavaElementInfo; /** * @author Luzius Meisser @@ -60,9 +61,9 @@ protected void toStringName(StringBuffer buffer) { } } buffer.append(')'); - if (this.occurrenceCount > 1) { + if (this.getOccurrenceCount() > 1) { buffer.append("#"); //$NON-NLS-1$ - buffer.append(this.occurrenceCount); + buffer.append(this.getOccurrenceCount()); } } @@ -73,7 +74,7 @@ protected char getHandleMementoDelimiter() { return AspectElement.JEM_ADVICE; } - protected Object createElementInfo() { + protected JavaElementInfo createElementInfo() { try { IProgramElement ipe = AJProjectModelFactory.getInstance().getModelForJavaElement(this) .javaElementToProgramElement(this); diff --git a/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/AspectElement.java b/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/AspectElement.java index df60e82ad2..c7f43aedd1 100755 --- a/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/AspectElement.java +++ b/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/AspectElement.java @@ -31,6 +31,7 @@ import org.eclipse.jdt.core.Signature; import org.eclipse.jdt.core.WorkingCopyOwner; import org.eclipse.jdt.internal.core.JavaElement; +import org.eclipse.jdt.internal.core.JavaElementInfo; import org.eclipse.jdt.internal.core.SourceType; import org.eclipse.jdt.internal.core.util.MementoTokenizer; @@ -72,7 +73,7 @@ public int getType() { return TYPE; } - protected Object createElementInfo() { + protected JavaElementInfo createElementInfo() { AspectElementInfo info = new AspectElementInfo(); info.setAJKind(IProgramElement.Kind.ASPECT); diff --git a/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/AspectJMemberElement.java b/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/AspectJMemberElement.java index ef49042696..fa944a58f0 100755 --- a/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/AspectJMemberElement.java +++ b/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/AspectJMemberElement.java @@ -107,9 +107,9 @@ protected void getHandleMemento(StringBuilder buff) { buff.append(delimiter); escapeMementoName(buff, fParameterType); } - if (this.occurrenceCount > 1) { + if (this.getOccurrenceCount() > 1) { buff.append(JEM_COUNT); - buff.append(this.occurrenceCount); + buff.append(this.getOccurrenceCount()); } } /** @@ -205,16 +205,15 @@ public String getSignature() throws JavaModelException { } return Signature.createMethodSignature(fParameterTypes, Signature.createTypeSignature(returnTypeName, false)); } -/** - * @see org.eclipse.jdt.internal.core.JavaElement#hashCode() - */ -public int hashCode() { - int hash = super.hashCode(); +@Override +protected int calculateHashCode() { + int hash = super.calculateHashCode(); for (String fParameterType : fParameterTypes) { hash = Util.combineHashCodes(hash, fParameterType.hashCode()); } - return hash; + return hash; } + /** * @see IMethod */ diff --git a/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/BinaryAspectElement.java b/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/BinaryAspectElement.java index 613129ea10..713c24253d 100644 --- a/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/BinaryAspectElement.java +++ b/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/BinaryAspectElement.java @@ -20,6 +20,7 @@ import org.eclipse.jdt.core.WorkingCopyOwner; import org.eclipse.jdt.internal.core.BinaryType; import org.eclipse.jdt.internal.core.JavaElement; +import org.eclipse.jdt.internal.core.JavaElementInfo; import org.eclipse.jdt.internal.core.util.MementoTokenizer; /** @@ -33,7 +34,7 @@ public BinaryAspectElement(JavaElement parent, String name) { super(parent, name); } - protected Object createElementInfo() { + protected JavaElementInfo createElementInfo() { IProgramElement ipe = AJProjectModelFactory.getInstance().getModelForJavaElement(this).javaElementToProgramElement(this); return new BinaryAspectElementInfo(ipe); } diff --git a/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/BinaryAspectElementInfo.java b/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/BinaryAspectElementInfo.java index 22db8ae920..bd7f28f76e 100644 --- a/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/BinaryAspectElementInfo.java +++ b/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/BinaryAspectElementInfo.java @@ -23,13 +23,14 @@ import org.eclipse.jdt.internal.compiler.env.IBinaryMethod; import org.eclipse.jdt.internal.compiler.env.IBinaryNestedType; import org.eclipse.jdt.internal.compiler.env.IBinaryType; +import org.eclipse.jdt.internal.core.JavaElementInfo; /** * @author Andrew Eisenberg * @created Mar 18, 2009 * */ -public class BinaryAspectElementInfo /*extends ClassFileReader*/ implements IBinaryType { +public class BinaryAspectElementInfo /*extends ClassFileReader*/ extends JavaElementInfo implements IBinaryType { private char[] fileName; private final char[] typeName; diff --git a/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/DeclareElement.java b/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/DeclareElement.java index 4ba7071f67..00325a1e78 100755 --- a/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/DeclareElement.java +++ b/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/DeclareElement.java @@ -19,6 +19,7 @@ import org.aspectj.asm.IProgramElement.Kind; import org.eclipse.ajdt.core.model.AJProjectModelFactory; import org.eclipse.jdt.internal.core.JavaElement; +import org.eclipse.jdt.internal.core.JavaElementInfo; /** * @author Luzius Meisser @@ -38,7 +39,7 @@ protected char getHandleMementoDelimiter() { } - protected Object createElementInfo() { + protected JavaElementInfo createElementInfo() { try { IProgramElement ipe = AJProjectModelFactory.getInstance().getModelForJavaElement(this) .javaElementToProgramElement(this); diff --git a/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/FieldIntertypeElement.java b/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/FieldIntertypeElement.java index 8f7a5bd4c5..40008125e9 100644 --- a/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/FieldIntertypeElement.java +++ b/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/FieldIntertypeElement.java @@ -16,6 +16,7 @@ import org.eclipse.jdt.core.IType; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.internal.core.JavaElement; +import org.eclipse.jdt.internal.core.JavaElementInfo; import org.eclipse.jdt.internal.core.SourceField; import org.eclipse.jdt.internal.core.SourceFieldWithChildrenInfo; @@ -43,7 +44,7 @@ public IMember createMockDeclaration(IType parent) { try { final IntertypeElementInfo info = (IntertypeElementInfo) getElementInfo(); return new SourceField((JavaElement) parent, getTargetName()) { - protected Object createElementInfo() { + protected JavaElementInfo createElementInfo() { /* AJDT 1.7 */ ITDSourceFieldElementInfo newInfo = new ITDSourceFieldElementInfo(FieldIntertypeElement.this, info.getChildren()); newInfo.setFlags(CompilationUnitTools.getPublicModifierCode(info)); diff --git a/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/ITDAwareSourceTypeInfo.java b/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/ITDAwareSourceTypeInfo.java index 0aefcc3551..f806294ed5 100644 --- a/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/ITDAwareSourceTypeInfo.java +++ b/org.eclipse.ajdt.core/src/org/eclipse/ajdt/core/javaelements/ITDAwareSourceTypeInfo.java @@ -32,16 +32,9 @@ import org.eclipse.jdt.core.ITypeParameter; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.core.compiler.CharOperation; +import org.eclipse.jdt.internal.compiler.env.IElementInfo; import org.eclipse.jdt.internal.compiler.env.ISourceType; -import org.eclipse.jdt.internal.core.CompilationUnitElementInfo; -import org.eclipse.jdt.internal.core.JavaElement; -import org.eclipse.jdt.internal.core.SourceField; -import org.eclipse.jdt.internal.core.SourceFieldElementInfo; -import org.eclipse.jdt.internal.core.SourceMethod; -import org.eclipse.jdt.internal.core.SourceMethodElementInfo; -import org.eclipse.jdt.internal.core.SourceMethodInfo; -import org.eclipse.jdt.internal.core.SourceType; -import org.eclipse.jdt.internal.core.SourceTypeElementInfo; +import org.eclipse.jdt.internal.core.*; /** * This class provides element info for SourceTypes that know about @@ -58,7 +51,7 @@ private ITDAwareSourceType(JavaElement parent, String name, ITDAwareSourceTypeIn this.info = info; } - public Object getElementInfo() throws JavaModelException { + public IElementInfo getElementInfo() throws JavaModelException { return info; } } @@ -69,20 +62,20 @@ private ITDAwareAspectType(JavaElement parent, String name, ITDAwareSourceTypeIn this.info = info; } - public Object getElementInfo() throws JavaModelException { + public IElementInfo getElementInfo() throws JavaModelException { return info; } } private static final class ITIT extends SourceType { - final Object info; + final IElementInfo info; private ITIT(JavaElement parent, IType actualType, IProgramElement ajElement) throws JavaModelException { super(parent, actualType.getElementName()); this.info = createInfo(actualType, ajElement); } @SuppressWarnings("unchecked") - public Object createInfo(IType actualType, IProgramElement ajElement) throws JavaModelException { - Object elementInfo = ((JavaElement) actualType).getElementInfo(); + public IElementInfo createInfo(IType actualType, IProgramElement ajElement) throws JavaModelException { + IElementInfo elementInfo = ((JavaElement) actualType).getElementInfo(); if (elementInfo instanceof SourceTypeElementInfo) { SourceTypeElementInfo origInfo = (SourceTypeElementInfo) elementInfo; SourceTypeElementInfo newInfo = new SourceTypeElementInfo(); @@ -143,7 +136,7 @@ private IJavaElement[] convertChildren(IJavaElement[] children, List getJavaOptionsMap() { Map optionsMap = null; - JavaProject javaProject; + IProject iProject; try { - javaProject = (JavaProject) project.getNature(JavaCore.NATURE_ID); - optionsMap = javaProject.getOptions(true); + iProject = project.getNature(JavaCore.NATURE_ID).getProject(); + if (iProject instanceof JavaProject) + optionsMap = ((JavaProject) iProject).getOptions(true); } catch (CoreException ignored) { } diff --git a/org.eclipse.ajdt.releng/build.properties b/org.eclipse.ajdt.releng/build.properties index bb8586ca5b..0af7867c65 100644 --- a/org.eclipse.ajdt.releng/build.properties +++ b/org.eclipse.ajdt.releng/build.properties @@ -60,9 +60,10 @@ # 1.9.9.20220418000000 - 1.9.19 snapsot after generics refactoring # 1.9.19.20221222000000 - 1.9.19 release # 1.9.21.20230817000000 - 1.9.20 release +# 1.9.21.20231212000000 - 1.9.21 release -# 1.9.21 release -ajde.version=1.9.21.20231212000000 +# 1.9.22 release +ajde.version=1.9.22.20230323000000 builder=. diff --git a/org.eclipse.ajdt.ui/META-INF/MANIFEST.MF b/org.eclipse.ajdt.ui/META-INF/MANIFEST.MF index 8ee22b9b26..27330c1572 100644 --- a/org.eclipse.ajdt.ui/META-INF/MANIFEST.MF +++ b/org.eclipse.ajdt.ui/META-INF/MANIFEST.MF @@ -41,7 +41,7 @@ Export-Package: org.eclipse.ajdt.internal.builder;aspect-policy:=opt-in, org.eclipse.ajdt.pde.internal.core;aspect-policy:=opt-in, org.eclipse.ajdt.ui;aspect-policy:=opt-in Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.6.0,4.3.0)", - 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.ui.forms;bundle-version="3.3.0", org.eclipse.ui.workbench;bundle-version="[3.6.0,4.3.0)", org.eclipse.jface;bundle-version="[3.6.0,4.3.0)", diff --git a/org.eclipse.ajdt.ui/src/org/eclipse/ajdt/internal/ui/editor/quickfix/AJSerialVersionSubProcessor.java b/org.eclipse.ajdt.ui/src/org/eclipse/ajdt/internal/ui/editor/quickfix/AJSerialVersionSubProcessor.java index 609fed82cd..fa2c7e0c3c 100644 --- a/org.eclipse.ajdt.ui/src/org/eclipse/ajdt/internal/ui/editor/quickfix/AJSerialVersionSubProcessor.java +++ b/org.eclipse.ajdt.ui/src/org/eclipse/ajdt/internal/ui/editor/quickfix/AJSerialVersionSubProcessor.java @@ -109,7 +109,7 @@ public static IProposableFix[] createMissingSerialVersionFixes(CompilationUnit c /** * from PotentialProgrammingProblemsFix */ - private static SimpleName getSelectedName(CompilationUnit compilationUnit, IProblemLocation problem) { + public static SimpleName getSelectedName(CompilationUnit compilationUnit, IProblemLocation problem) { final ASTNode selection= problem.getCoveredNode(compilationUnit); if (selection == null) return null; diff --git a/org.eclipse.equinox.weaving.aspectj.tests/pom.xml b/org.eclipse.equinox.weaving.aspectj.tests/pom.xml index 61007bb9d1..959d3abc75 100644 --- a/org.eclipse.equinox.weaving.aspectj.tests/pom.xml +++ b/org.eclipse.equinox.weaving.aspectj.tests/pom.xml @@ -17,7 +17,7 @@ Stefan Winkler - initial implementation org.aspectj.ajde org.aspectj.weaver - 1.9.21-SNAPSHOT + 1.9.22-SNAPSHOT compile diff --git a/org.eclipse.equinox.weaving.aspectj/pom.xml b/org.eclipse.equinox.weaving.aspectj/pom.xml index 6390c22f10..5dc06a9bbc 100644 --- a/org.eclipse.equinox.weaving.aspectj/pom.xml +++ b/org.eclipse.equinox.weaving.aspectj/pom.xml @@ -15,7 +15,7 @@ Igor Fedorenko - initial implementation org.aspectj.ajde org.aspectj.weaver - 1.9.21-SNAPSHOT + 1.9.22-SNAPSHOT compile diff --git a/pom.xml b/pom.xml index 6804032cc9..a000bd16e9 100644 --- a/pom.xml +++ b/pom.xml @@ -56,12 +56,12 @@ UTF-8 11 11 - 3.0.4 + 4.0.6 - 1.13.1 + 1.14 - 1.9.21 + 1.9.22 META-INF/**, @@ -279,6 +279,25 @@ + + e431 + + e430 + + 1.4.0.v20240213-1357 + + + + 2024-03-releases + p2 + https://download.eclipse.org/releases/2024-03/ + + + + intellij