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 191223 Details for
Bug 339447
synchronized access modifier retained on clone() bridge
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix + regression test
patch_339447.txt (text/plain), 4.81 KB, created by
Olivier Thomann
on 2011-03-15 11:58:15 EDT
(
hide
)
Description:
Proposed fix + regression test
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2011-03-15 11:58:15 EDT
Size:
4.81 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/SyntheticMethodBinding.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SyntheticMethodBinding.java,v >retrieving revision 1.27 >diff -u -r1.27 SyntheticMethodBinding.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/SyntheticMethodBinding.java 5 Jan 2011 19:57:26 -0000 1.27 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/SyntheticMethodBinding.java 15 Mar 2011 15:57:00 -0000 >@@ -231,7 +231,7 @@ > this.selector = overridenMethodToBridge.selector; > // amongst other, clear the AccGenericSignature, so as to ensure no remains of original inherited persist (101794) > // also use the modifiers from the target method, as opposed to inherited one (147690) >- this.modifiers = (targetMethod.modifiers | ClassFileConstants.AccBridge | ClassFileConstants.AccSynthetic) & ~(ClassFileConstants.AccAbstract | ClassFileConstants.AccNative | ClassFileConstants.AccFinal | ExtraCompilerModifiers.AccGenericSignature); >+ this.modifiers = (targetMethod.modifiers | ClassFileConstants.AccBridge | ClassFileConstants.AccSynthetic) & ~(ClassFileConstants.AccSynchronized | ClassFileConstants.AccAbstract | ClassFileConstants.AccNative | ClassFileConstants.AccFinal | ExtraCompilerModifiers.AccGenericSignature); > this.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved); > this.returnType = overridenMethodToBridge.returnType; > this.parameters = overridenMethodToBridge.parameters; >@@ -299,7 +299,7 @@ > this.selector = overridenMethodToBridge.selector; > // amongst other, clear the AccGenericSignature, so as to ensure no remains of original inherited persist (101794) > // also use the modifiers from the target method, as opposed to inherited one (147690) >- this.modifiers = (overridenMethodToBridge.modifiers | ClassFileConstants.AccBridge | ClassFileConstants.AccSynthetic) & ~(ClassFileConstants.AccAbstract | ClassFileConstants.AccNative | ClassFileConstants.AccFinal | ExtraCompilerModifiers.AccGenericSignature); >+ this.modifiers = (overridenMethodToBridge.modifiers | ClassFileConstants.AccBridge | ClassFileConstants.AccSynthetic) & ~(ClassFileConstants.AccSynchronized | ClassFileConstants.AccAbstract | ClassFileConstants.AccNative | ClassFileConstants.AccFinal | ExtraCompilerModifiers.AccGenericSignature); > this.tagBits |= (TagBits.AnnotationResolved | TagBits.DeprecatedAnnotationResolved); > this.returnType = overridenMethodToBridge.returnType; > this.parameters = overridenMethodToBridge.parameters; >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java,v >retrieving revision 1.222 >diff -u -r1.222 MethodVerifyTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java 17 Jan 2011 08:05:03 -0000 1.222 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java 15 Mar 2011 15:57:03 -0000 >@@ -27,7 +27,7 @@ > > public class MethodVerifyTest extends AbstractComparableTest { > static { >-// TESTS_NAMES = new String[] { "test331446" }; >+// TESTS_NAMES = new String[] { "test339447" }; > // TESTS_NUMBERS = new int[] { 213 }; > // TESTS_RANGE = new int[] { 190, -1}; > } >@@ -11968,4 +11968,32 @@ > compilerOptions14, > null); > } >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=339447 >+public void test339447() throws Exception { >+ this.runConformTest( >+ new String[] { >+ "X.java", >+ "public class X implements Cloneable {\n" + >+ " public synchronized X clone() {\n" + >+ " return this;\n" + >+ " }\n" + >+ "}", // ================= >+ }, >+ ""); >+ // ensure bridge methods have target method modifiers, and inherited thrown exceptions >+ String expectedOutput = >+ " public bridge synthetic java.lang.Object clone() throws java.lang.CloneNotSupportedException;"; >+ >+ File f = new File(OUTPUT_DIR + File.separator + "X.class"); >+ byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f); >+ ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler(); >+ String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED); >+ int index = result.indexOf(expectedOutput); >+ if (index == -1 || expectedOutput.length() == 0) { >+ System.out.println(Util.displayString(result, 3)); >+ } >+ if (index == -1) { >+ assertEquals("Wrong contents", expectedOutput, result); >+ } >+} > }
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 339447
: 191223