aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraclement <aclement>2004-04-02 12:45:13 +0000
committeraclement <aclement>2004-04-02 12:45:13 +0000
commit0521e79aea0550b1357a7ccc6a5050f8ce27ce9b (patch)
treefd1c5bdfe7780257d007f7130fe9355352554372
parent33d8ee9eededcd1219a6cbd1d063af005d40a3f7 (diff)
downloadaspectj-0521e79aea0550b1357a7ccc6a5050f8ce27ce9b.tar.gz
aspectj-0521e79aea0550b1357a7ccc6a5050f8ce27ce9b.zip
Fix for Bug 55341
error Type mismatch: cannot convert from java.lang.String to java.lang.String
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/InterTypeMemberFinder.java2
-rw-r--r--org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/BcweaverJarMaker.java13
-rw-r--r--tests/ajcTests.xml11
-rw-r--r--tests/bugs/StringToString/HW.java28
-rw-r--r--tests/bugs/StringToString/X.java10
-rw-r--r--tests/bugs/StringToString/helloworld.jarbin0 -> 1019 bytes
-rw-r--r--weaver/testdata/dummyAspect.jarbin819 -> 811 bytes
-rw-r--r--weaver/testdata/ltw-acaspects.jarbin2412 -> 2406 bytes
-rw-r--r--weaver/testdata/ltw-aspects.jarbin1474 -> 1468 bytes
-rw-r--r--weaver/testdata/ltw-classes.jarbin1410 -> 1410 bytes
-rw-r--r--weaver/testdata/ltw-itdaspects.jarbin3214 -> 4881 bytes
-rw-r--r--weaver/testdata/ltw-peraspects.jarbin1874 -> 1872 bytes
-rw-r--r--weaver/testdata/ltw-woven.jarbin2653 -> 2647 bytes
-rw-r--r--weaver/testdata/megatrace.jarbin5285 -> 5277 bytes
-rw-r--r--weaver/testdata/megatrace0easy.jarbin3256 -> 3246 bytes
-rw-r--r--weaver/testdata/megatrace0hard.jarbin3152 -> 3141 bytes
-rw-r--r--weaver/testdata/megatraceNoweave.jarbin3043 -> 3033 bytes
-rw-r--r--weaver/testdata/tracing.jarbin2616 -> 2606 bytes
-rw-r--r--weaver/testsrc/org/aspectj/weaver/WeavingURLClassLoaderTest.java8
19 files changed, 63 insertions, 9 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/InterTypeMemberFinder.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/InterTypeMemberFinder.java
index d6c4d7b64..4e0f0f7e3 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/InterTypeMemberFinder.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/InterTypeMemberFinder.java
@@ -41,7 +41,7 @@ public class InterTypeMemberFinder implements IMemberFinder {
InvocationSite site,
Scope scope)
{
- FieldBinding retField = sourceTypeBinding.getFieldBase(fieldName, false); // XXX may need to get the correct value for second parameter in the future
+ FieldBinding retField = sourceTypeBinding.getFieldBase(fieldName, true); // XXX may need to get the correct value for second parameter in the future (see #55341)
if (interTypeFields.isEmpty()) return retField;
int fieldLength = fieldName.length;
diff --git a/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/BcweaverJarMaker.java b/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/BcweaverJarMaker.java
index b6dfb5184..98c9ea984 100644
--- a/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/BcweaverJarMaker.java
+++ b/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/BcweaverJarMaker.java
@@ -179,6 +179,16 @@ public class BcweaverJarMaker {
args.add("../tests/bugs/serialVersionUID/Util.java");
CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS);
+
+ // For PR55341
+ args = new ArrayList();
+ args.add("-classpath");
+ args.add("../lib/test/aspectjrt.jar;../lib/test/testing-client.jar" +
+ File.pathSeparator + System.getProperty("aspectjrt.path"));
+ args.add("-outjar");
+ args.add("../tests/bugs/StringToString/helloworld.jar");
+ args.add("../tests/bugs/StringToString/HW.java");
+ CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS);
}
public static void makeURLWeavingClassLoaderJars() throws IOException {
@@ -245,8 +255,7 @@ public class BcweaverJarMaker {
args.add("../weaver/testdata/ltw-itdaspects.jar");
args.add(AjdtAjcTests.TESTDATA_PATH + "/src1/LTWInterfaceITD.aj");
args.add(AjdtAjcTests.TESTDATA_PATH + "/src1/LTWFieldITD.aj");
- /* Uncomment when bug #55341 fixed */
-// args.add(AjdtAjcTests.TESTDATA_PATH + "/src1/LTWMethodITD.aj");
+ args.add(AjdtAjcTests.TESTDATA_PATH + "/src1/LTWMethodITD.aj");
CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS);
/*
diff --git a/tests/ajcTests.xml b/tests/ajcTests.xml
index ce4620ece..3a86750e5 100644
--- a/tests/ajcTests.xml
+++ b/tests/ajcTests.xml
@@ -7523,4 +7523,15 @@
<compile files="Priority.aj" />
</ajc-test>
+ <ajc-test dir="bugs/StringToString" pr="55341"
+ title="error Type mismatch: cannot convert from java.lang.String to java.lang.String"
+ comment="make helloworld.jar with 'ajc -outjar helloworld.jar HW.java' or run BcweaverJarMaker"
+ keywords="">
+ <compile files="X.java" classpath="helloworld.jar">
+ <message kind="warning" line="3"/>
+ <message kind="warning" line="7"/>
+ </compile>
+ </ajc-test>
+
+
</suite>
diff --git a/tests/bugs/StringToString/HW.java b/tests/bugs/StringToString/HW.java
new file mode 100644
index 000000000..66eeca22c
--- /dev/null
+++ b/tests/bugs/StringToString/HW.java
@@ -0,0 +1,28 @@
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.Properties;
+
+public class HW extends ArrayList {
+
+ String message = "Hello World!";
+
+ private void check (String args) {
+ }
+
+ public void println () {
+ System.out.println(message);
+ }
+
+ public static void main(String[] args) {
+ HW hw = new HW();
+ hw.println();
+ for (int i = 0; i < args.length; i++) {
+ String jp = args[i];
+ if (!hw.contains(jp)) {
+ throw new RuntimeException(jp + " missing");
+ }
+ }
+ }
+
+}
diff --git a/tests/bugs/StringToString/X.java b/tests/bugs/StringToString/X.java
new file mode 100644
index 000000000..9ef81978c
--- /dev/null
+++ b/tests/bugs/StringToString/X.java
@@ -0,0 +1,10 @@
+// PR55341
+aspect F {
+ private int HW.intField = 999;
+}
+
+aspect M {
+ public String HW.getMessage () {
+ return message;
+ }
+}
diff --git a/tests/bugs/StringToString/helloworld.jar b/tests/bugs/StringToString/helloworld.jar
new file mode 100644
index 000000000..185b8eb2b
--- /dev/null
+++ b/tests/bugs/StringToString/helloworld.jar
Binary files differ
diff --git a/weaver/testdata/dummyAspect.jar b/weaver/testdata/dummyAspect.jar
index 6bc31ed85..baf5a2a25 100644
--- a/weaver/testdata/dummyAspect.jar
+++ b/weaver/testdata/dummyAspect.jar
Binary files differ
diff --git a/weaver/testdata/ltw-acaspects.jar b/weaver/testdata/ltw-acaspects.jar
index c49320821..3fe72d9d7 100644
--- a/weaver/testdata/ltw-acaspects.jar
+++ b/weaver/testdata/ltw-acaspects.jar
Binary files differ
diff --git a/weaver/testdata/ltw-aspects.jar b/weaver/testdata/ltw-aspects.jar
index 428c2b156..2f232c71f 100644
--- a/weaver/testdata/ltw-aspects.jar
+++ b/weaver/testdata/ltw-aspects.jar
Binary files differ
diff --git a/weaver/testdata/ltw-classes.jar b/weaver/testdata/ltw-classes.jar
index f74d613b7..64aa2aee4 100644
--- a/weaver/testdata/ltw-classes.jar
+++ b/weaver/testdata/ltw-classes.jar
Binary files differ
diff --git a/weaver/testdata/ltw-itdaspects.jar b/weaver/testdata/ltw-itdaspects.jar
index 0870a4a73..868c3b917 100644
--- a/weaver/testdata/ltw-itdaspects.jar
+++ b/weaver/testdata/ltw-itdaspects.jar
Binary files differ
diff --git a/weaver/testdata/ltw-peraspects.jar b/weaver/testdata/ltw-peraspects.jar
index 071d2bbfa..0a903503e 100644
--- a/weaver/testdata/ltw-peraspects.jar
+++ b/weaver/testdata/ltw-peraspects.jar
Binary files differ
diff --git a/weaver/testdata/ltw-woven.jar b/weaver/testdata/ltw-woven.jar
index b0b6368f4..c83beb557 100644
--- a/weaver/testdata/ltw-woven.jar
+++ b/weaver/testdata/ltw-woven.jar
Binary files differ
diff --git a/weaver/testdata/megatrace.jar b/weaver/testdata/megatrace.jar
index aff5ffe96..7b82aa215 100644
--- a/weaver/testdata/megatrace.jar
+++ b/weaver/testdata/megatrace.jar
Binary files differ
diff --git a/weaver/testdata/megatrace0easy.jar b/weaver/testdata/megatrace0easy.jar
index 97c8081aa..24ec93afb 100644
--- a/weaver/testdata/megatrace0easy.jar
+++ b/weaver/testdata/megatrace0easy.jar
Binary files differ
diff --git a/weaver/testdata/megatrace0hard.jar b/weaver/testdata/megatrace0hard.jar
index 583926b3f..3fb566030 100644
--- a/weaver/testdata/megatrace0hard.jar
+++ b/weaver/testdata/megatrace0hard.jar
Binary files differ
diff --git a/weaver/testdata/megatraceNoweave.jar b/weaver/testdata/megatraceNoweave.jar
index 8d454e6a2..577944439 100644
--- a/weaver/testdata/megatraceNoweave.jar
+++ b/weaver/testdata/megatraceNoweave.jar
Binary files differ
diff --git a/weaver/testdata/tracing.jar b/weaver/testdata/tracing.jar
index 2c8cafbcc..3a6749657 100644
--- a/weaver/testdata/tracing.jar
+++ b/weaver/testdata/tracing.jar
Binary files differ
diff --git a/weaver/testsrc/org/aspectj/weaver/WeavingURLClassLoaderTest.java b/weaver/testsrc/org/aspectj/weaver/WeavingURLClassLoaderTest.java
index 41f9b56ab..d3f940e4d 100644
--- a/weaver/testsrc/org/aspectj/weaver/WeavingURLClassLoaderTest.java
+++ b/weaver/testsrc/org/aspectj/weaver/WeavingURLClassLoaderTest.java
@@ -140,9 +140,7 @@ public class WeavingURLClassLoaderTest extends TestCase {
try {
Class clazz = loader.loadClass("LTWHelloWorld");
- /* Uncomment when bug #55341 fixed */
-// invokeMain(clazz,new String[] { "LTWInterfaceITD", "LTWFieldITD", "LTWMethodITD" });
- invokeMain(clazz,new String[] { "LTWInterfaceITD", "LTWFieldITD" });
+ invokeMain(clazz,new String[] { "LTWInterfaceITD", "LTWFieldITD", "LTWMethodITD" });
}
catch (Exception ex) {
fail(ex.toString());
@@ -177,9 +175,7 @@ public class WeavingURLClassLoaderTest extends TestCase {
try {
Class clazz = loader.loadClass("LTWHelloWorld");
- /* Uncomment when bug #55341 fixed */
-// invokeMain(clazz,new String[] { "LTWAspect", "LTWAroundClosure", "LTWPerthis", "LTWInterfaceITD", "LTWFieldITD", "LTWMethodITD", "LTWPerthis"});
- invokeMain(clazz,new String[] { "LTWAspect", "LTWAroundClosure", "LTWPerthis", "LTWInterfaceITD", "LTWFieldITD", "LTWPerthis"});
+ invokeMain(clazz,new String[] { "LTWAspect", "LTWAroundClosure", "LTWPerthis", "LTWInterfaceITD", "LTWFieldITD", "LTWMethodITD", "LTWPerthis"});
}
catch (Exception ex) {
fail(ex.toString());