Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2012-08-14 19:05:54 +0000
committerStephan Herrmann2012-08-14 19:05:54 +0000
commit4de020060990f372c8abe9c88bac083a5d485ec6 (patch)
tree4f0dc631bfe3065a24a5f6f473cd5aeaaa44e627 /testplugins
parentc98d9e22c784c4fc73d2fbfde2fc51b730c6a9da (diff)
downloadorg.eclipse.objectteams-4de020060990f372c8abe9c88bac083a5d485ec6.tar.gz
org.eclipse.objectteams-4de020060990f372c8abe9c88bac083a5d485ec6.tar.xz
org.eclipse.objectteams-4de020060990f372c8abe9c88bac083a5d485ec6.zip
Bug 387236 - [compiler] type mismatch in signature-less c-t-f with arrayreleases/OTDT_2.2M1builds/201208141515
type causes NPE
Diffstat (limited to 'testplugins')
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/calloutbinding/CalloutToField.java33
1 files changed, 33 insertions, 0 deletions
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/calloutbinding/CalloutToField.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/calloutbinding/CalloutToField.java
index 6fb98469f..42b446d24 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/calloutbinding/CalloutToField.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/calloutbinding/CalloutToField.java
@@ -3670,4 +3670,37 @@ public class CalloutToField extends AbstractOTJLDTest {
},
"OK0");
}
+
+ // Bug 387236 - [compiler] type mismatch in signature-less c-t-f with array type causes NPE
+ public void testBug387236() {
+ runNegativeTest(new String[] {
+ "b/Base.java",
+ "package b;\n" +
+ "\n" +
+ "public class Base {\n" +
+ " Object[] values;\n" +
+ "}",
+ "t/Team.java",
+ "package t;\n" +
+ "\n" +
+ "import base b.Base;\n" +
+ "\n" +
+ "public team class Team {\n" +
+ " protected abstract class AR {\n" +
+ " protected abstract String[] getValues();\n" +
+ " }\n" +
+ " protected class CR extends AR playedBy Base {\n" +
+ " @SuppressWarnings(\"decapsulation\") getValues -> get values;\n" +
+ " \n" +
+ " }\n" +
+ "}\n"
+ },
+ "----------\n" +
+ "1. ERROR in t\\Team.java (at line 10)\n" +
+ " @SuppressWarnings(\"decapsulation\") getValues -> get values;\n" +
+ " ^^^^^^^^^\n" +
+ "When binding field values via callout to role method getValues():\n" +
+ "Incompatible types: can\'t convert java.lang.Object[] to java.lang.String[] (OTJLD 3.5(b)).\n" +
+ "----------\n");
+ }
}

Back to the top