Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 193414 Details for
Bug 335777
[compiler] don't flag missing precedence if different enclosing teams
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
test & proposed fix
Bug_335777.patch (text/plain), 4.06 KB, created by
Stephan Herrmann
on 2011-04-16 07:55:49 EDT
(
hide
)
Description:
test & proposed fix
Filename:
MIME Type:
Creator:
Stephan Herrmann
Created:
2011-04-16 07:55:49 EDT
Size:
4.06 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/PrecedenceBinding.java >=================================================================== >--- compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/PrecedenceBinding.java (revision 1244) >+++ compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/PrecedenceBinding.java (working copy) >@@ -31,6 +31,7 @@ > import org.eclipse.jdt.internal.compiler.lookup.MethodBinding; > import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; > import org.eclipse.jdt.internal.compiler.lookup.Scope; >+import org.eclipse.objectteams.otdt.internal.core.compiler.model.TeamModel; > > /** > * NEW for OTDT. >@@ -227,13 +228,13 @@ > return false; > } > } >+ ReferenceBinding role1 = callin1._declaringRoleClass; >+ ReferenceBinding role2 = callin2._declaringRoleClass; > if (CharOperation.equals(callin1.name, callin2.name)) { >- ReferenceBinding role1 = callin1._declaringRoleClass; >- ReferenceBinding role2 = callin2._declaringRoleClass; > if (role1.isCompatibleWith(role2) || role2.isCompatibleWith(role1)) > return false; // callin overriding > } >- return true; >+ return TeamModel.areCompatibleEnclosings(role1.enclosingType(), role2.enclosingType()); > } > return false; > } >#P org.eclipse.objectteams.otdt.tests >Index: otjld/org/eclipse/objectteams/otdt/tests/otjld/callinbinding/CallinMethodBinding.java >=================================================================== >--- otjld/org/eclipse/objectteams/otdt/tests/otjld/callinbinding/CallinMethodBinding.java (revision 1244) >+++ otjld/org/eclipse/objectteams/otdt/tests/otjld/callinbinding/CallinMethodBinding.java (working copy) >@@ -34,7 +34,7 @@ > // 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[] { "test4125_resultInMethodSpec3"}; >+// TESTS_NAMES = new String[] { "test4127_precedenceDeclaration19"}; > // TESTS_NUMBERS = new int[] { 1459 }; > // TESTS_RANGE = new int[] { 1097, -1 }; > } >@@ -4801,6 +4801,48 @@ > "\'precedence\' declaration can only refer to direct role classes, however PrecBug.RA.RB is a nested role of team PrecBug.RA (OTJLD 4.8).\n" + > "----------\n"); > } >+ >+ // Bug 335777 - [compiler] don't flag missing precedence if different enclosing teams >+ public void test4127_precedenceDeclaration19 () { >+ runConformTest( >+ new String[] { >+ "PrecBug19.java", >+ "public team class PrecBug19 {\n" + >+ " protected team class RA playedBy A {\n" + >+ " void some(String v) <- before void myMethod2()\n" + >+ " with { v <- \"RA\" }\n" + >+ " void some(String v) <- after void myMethod2()\n" + >+ " with { v <- \"RA\" }\n" + >+ " void some(String v) {\n" + >+ " System.out.print(\"some\"+v);\n" + >+ " }\n" + >+ " protected class RB playedBy B {\n" + >+ " void some(String v) <- before void myMethod2()" + >+ " with { v <- \"RB\" }\n" + >+ " void some(String v) <- after void myMethod2()" + >+ " with { v <- \"RB\" }\n" + >+ " }\n" + >+ " }\n" + >+ " public PrecBug19(A as RA a) {\n" + >+ " a.activate();\n" + >+ " }\n" + >+ " public static void main(String... args) {\n" + >+ " B b = new B();\n" + >+ " new PrecBug19(b).activate();\n" + >+ " new B().myMethod2();\n" + >+ " }\n" + >+ "}\n", >+ "A.java", >+ "public class A {\n" + >+ " void myMethod2() { System.out.print(\"-\"); }\n" + >+ "}\n", >+ "B.java", >+ "public class B extends A {\n" + >+ "}\n" >+ }, >+ "someRAsomeRB-someRBsomeRA"); >+ } >+ > // a regular class has a precedence declaration > // 4.1.28-otjld-invalid-precedence-declaration-1 > public void test4128_invalidPrecedenceDeclaration1() {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 335777
: 193414