Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2013-01-10 21:22:03 +0000
committerStephan Herrmann2013-01-10 22:01:06 +0000
commit273982d396d6ffaef7f1e1f520ec51776ba69a4c (patch)
tree6fe7f31a4f1fdc0fa62a33a746fb784f9bec84ee /testplugins
parentfd54faa4662f0a6e14064bcd8ea35fb0c4468221 (diff)
downloadorg.eclipse.objectteams-273982d396d6ffaef7f1e1f520ec51776ba69a4c.tar.gz
org.eclipse.objectteams-273982d396d6ffaef7f1e1f520ec51776ba69a4c.tar.xz
org.eclipse.objectteams-273982d396d6ffaef7f1e1f520ec51776ba69a4c.zip
Bug 397867 - [compiler] illegal access to invisible method via callin
binding not detected
Diffstat (limited to 'testplugins')
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/callinbinding/CallinMethodBinding.java44
1 files changed, 40 insertions, 4 deletions
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/callinbinding/CallinMethodBinding.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/callinbinding/CallinMethodBinding.java
index c511c8660..894628e53 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/callinbinding/CallinMethodBinding.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/callinbinding/CallinMethodBinding.java
@@ -1,13 +1,12 @@
/**********************************************************************
* This file is part of "Object Teams Development Tooling"-Software
*
- * Copyright 2004, 2010 IT Service Omikron GmbH and others.
+ * Copyright 2004, 2013 IT Service Omikron GmbH and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- * $Id$
*
* Please visit http://www.eclipse.org/objectteams for updates and contact.
*
@@ -34,7 +33,7 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
-// TESTS_NAMES = new String[] { "testBug387996a" };
+// TESTS_NAMES = new String[] { "test4143J_callinToTeamMethod4" };
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
@@ -7689,7 +7688,44 @@ public class CallinMethodBinding extends AbstractOTJLDTest {
customOptions,
null/*no custom requestor*/);
}
-
+
+ // an after callin binding refers to a package-private method of a super team
+ // https://bugs.eclipse.org/397867 - [compiler] illegal access to invisible method via callin binding not detected
+ public void test4143_callinToTeamMethod4() {
+ runNegativeTest(
+ new String[] {
+ "p2/Team4143cttm4_2.java",
+ "package p2;\n" +
+ "import base p0.T4143cttm4;\n" +
+ "public team class Team4143cttm4_2 extends p1.Team4143cttm4_1 {\n" +
+ " protected class R playedBy T4143cttm4 {\n" +
+ " void k(String s) <- after void test()\n" +
+ " with { s <- \"K\" }\n" +
+ " }\n" +
+ "}\n",
+ "p1/Team4143cttm4_1.java",
+ "package p1;\n" +
+ "public team class Team4143cttm4_1 {\n" +
+ " void k(String s) {\n" +
+ " System.out.print(s);\n" +
+ " }\n" +
+ "}\n",
+ "p0/T4143cttm4.java",
+ "package p0;\n" +
+ "public class T4143cttm4 {\n" +
+ " public void test() {\n" +
+ " System.out.print(\"O\");\n" +
+ " }\n" +
+ "}\n"
+ },
+ "----------\n" +
+ "1. ERROR in p2\\Team4143cttm4_2.java (at line 5)\n" +
+ " void k(String s) <- after void test()\n" +
+ " ^\n" +
+ "The method k(String) from the type Team4143cttm4_1 is not visible\n" +
+ "----------\n");
+ }
+
// implicitly inherited role method requires weakening
public void test4144_callinToInherited1() {
runConformTest(

Back to the top