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 193962 Details for
Bug 339478
[1.7][compiler] support for diamond case
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]
Revised Implementation v1.0
patch.txt (text/plain), 23.79 KB, created by
Srikanth Sankaran
on 2011-04-24 03:56:55 EDT
(
hide
)
Description:
Revised Implementation v1.0
Filename:
MIME Type:
Creator:
Srikanth Sankaran
Created:
2011-04-24 03:56:55 EDT
Size:
23.79 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/core/compiler/IProblem.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/IProblem.java,v >retrieving revision 1.225.2.13 >diff -u -r1.225.2.13 IProblem.java >--- compiler/org/eclipse/jdt/core/compiler/IProblem.java 21 Apr 2011 06:09:53 -0000 1.225.2.13 >+++ compiler/org/eclipse/jdt/core/compiler/IProblem.java 24 Apr 2011 07:53:28 -0000 >@@ -1379,6 +1379,8 @@ > int PolymorphicMethodNotBelow17 = MethodRelated + 876; > /** @since 3.7 */ > int IncorrectSwitchType17 = TypeRelated + 877; >+ /** @since 3.7 */ >+ int CannotInferElidedTypes = TypeRelated + 878; > > /** > * External problems -- These are problems defined by other plugins >Index: compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java,v >retrieving revision 1.84.2.6 >diff -u -r1.84.2.6 AllocationExpression.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java 23 Apr 2011 07:21:32 -0000 1.84.2.6 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java 24 Apr 2011 07:53:29 -0000 >@@ -17,6 +17,7 @@ > *******************************************************************************/ > package org.eclipse.jdt.internal.compiler.ast; > >+import org.eclipse.jdt.core.compiler.CharOperation; > import org.eclipse.jdt.internal.compiler.ASTVisitor; > import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; > import org.eclipse.jdt.internal.compiler.codegen.*; >@@ -33,6 +34,7 @@ > public TypeReference[] typeArguments; > public TypeBinding[] genericTypeArguments; > public FieldDeclaration enumConstant; // for enum constant initializations >+ protected TypeBinding typeExpected; // for <> inference > > public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) { > // check captured variables are initialized in current context (26134) >@@ -359,6 +361,10 @@ > scope.problemReporter().cannotInstantiate(this.type, this.resolvedType); > return this.resolvedType; > } >+ if (this.type != null && (this.type.bits & ASTNode.IsDiamond) != 0) { >+ TypeBinding [] inferredTypes = inferElidedTypes(((ParameterizedTypeBinding) this.resolvedType).genericType(), argumentTypes, scope); >+ this.resolvedType = this.type.resolvedType = scope.environment().createParameterizedType(((ParameterizedTypeBinding) this.resolvedType).genericType(), inferredTypes, ((ParameterizedTypeBinding) this.resolvedType).enclosingType()); >+ } > ReferenceBinding allocationType = (ReferenceBinding) this.resolvedType; > if (!(this.binding = scope.getConstructor(allocationType, argumentTypes, this)).isValidBinding()) { > if (this.binding.declaringClass == null) { >@@ -384,6 +390,25 @@ > return allocationType; > } > >+public TypeBinding[] inferElidedTypes(ReferenceBinding allocationType, TypeBinding[] argumentTypes, final BlockScope scope) { >+ /* Given the allocation type and the arguments to the constructor, see if we can synthesize a generic static factory >+ method that would, given the argument types and the invocation site, manufacture a parameterized object of type allocationType. >+ If we are successful then by design and construction, the parameterization of the return type of the factory method is identical >+ to the types elided in the <>. >+ */ >+ MethodBinding factory = scope.getStaticFactory(allocationType, argumentTypes, this); >+ if (factory instanceof ParameterizedGenericMethodBinding && factory.isValidBinding()) { >+ return ((ParameterizedTypeBinding)factory.returnType).arguments; >+ } >+ scope.problemReporter().cannotInferElidedTypes(this); >+ int arity = allocationType.typeVariables().length; >+ TypeBinding [] inferredTypes = new TypeBinding[arity]; >+ for (int i = 0; i < arity; i++) { >+ inferredTypes[i] = new ProblemReferenceBinding(CharOperation.NO_CHAR_CHAR, null, ProblemReasons.InferenceFailed); >+ } >+ return inferredTypes; >+} >+ > public void setActualReceiverType(ReferenceBinding receiverType) { > // ignored > } >@@ -413,4 +438,17 @@ > } > visitor.endVisit(this, scope); > } >+/** >+ * @see org.eclipse.jdt.internal.compiler.ast.Expression#setExpectedType(org.eclipse.jdt.internal.compiler.lookup.TypeBinding) >+ */ >+public void setExpectedType(TypeBinding expectedType) { >+ this.typeExpected = expectedType; >+} >+/** >+ * @see org.eclipse.jdt.internal.compiler.lookup.InvocationSite#expectedType() >+ */ >+public TypeBinding expectedType() { >+ return this.typeExpected; >+} >+ > } >Index: compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java,v >retrieving revision 1.63.2.6 >diff -u -r1.63.2.6 ParameterizedQualifiedTypeReference.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java 19 Apr 2011 21:36:37 -0000 1.63.2.6 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java 24 Apr 2011 07:53:29 -0000 >@@ -253,7 +253,6 @@ > scope.problemReporter().incorrectArityForParameterizedType(this, currentType, argTypes, i); > return null; > } >- checkBounds = false; // successful <> inference needs no bounds check, we will scream foul if needed during inference. > } > // check parameterizing non-static member type of raw type > if (typeIsConsistent && !currentType.isStatic()) { >@@ -265,11 +264,13 @@ > } > } > ParameterizedTypeBinding parameterizedType = scope.environment().createParameterizedType(currentOriginal, argTypes, qualifyingType); >- // check argument type compatibility >- if (checkBounds) // otherwise will do it in Scope.connectTypeVariables() or generic method resolution >- parameterizedType.boundCheck(scope, args); >- else >- scope.deferBoundCheck(this); >+ // check argument type compatibility for non <> cases - <> case needs no bounds check, we will scream foul if needed during inference. >+ if (!isDiamond) { >+ if (checkBounds) // otherwise will do it in Scope.connectTypeVariables() or generic method resolution >+ parameterizedType.boundCheck(scope, args); >+ else >+ scope.deferBoundCheck(this); >+ } > qualifyingType = parameterizedType; > } else { > ReferenceBinding currentOriginal = (ReferenceBinding)currentType.original(); >Index: compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java,v >retrieving revision 1.54.2.6 >diff -u -r1.54.2.6 ParameterizedSingleTypeReference.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java 19 Apr 2011 21:36:37 -0000 1.54.2.6 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java 24 Apr 2011 07:53:31 -0000 >@@ -209,6 +209,7 @@ > return null; > } > >+ final boolean isDiamond = (this.bits & ASTNode.IsDiamond) != 0; > TypeVariableBinding[] typeVariables = currentOriginal.typeVariables(); > if (typeVariables == Binding.NO_TYPE_VARIABLES) { // non generic invoked with arguments > boolean isCompliant15 = scope.compilerOptions().originalSourceLevel >= ClassFileConstants.JDK1_5; >@@ -227,11 +228,10 @@ > } > // if missing generic type, and compliance >= 1.5, then will rebuild a parameterized binding > } else if (argLength != typeVariables.length) { >- if ((this.bits & ASTNode.IsDiamond) == 0) { // check arity, IsDiamond never set for 1.6- >+ if (!isDiamond) { // check arity, IsDiamond never set for 1.6- > scope.problemReporter().incorrectArityForParameterizedType(this, currentType, argTypes); > return null; > } >- checkBounds = false; // successful <> inference needs no bounds check, we will scream foul if needed during inference. > } else if (!currentType.isStatic()) { > ReferenceBinding actualEnclosing = currentType.enclosingType(); > if (actualEnclosing != null && actualEnclosing.isRawType()){ >@@ -242,11 +242,13 @@ > } > > ParameterizedTypeBinding parameterizedType = scope.environment().createParameterizedType(currentOriginal, argTypes, enclosingType); >- // check argument type compatibility >- if (checkBounds) // otherwise will do it in Scope.connectTypeVariables() or generic method resolution >- parameterizedType.boundCheck(scope, this.typeArguments); >- else >- scope.deferBoundCheck(this); >+ // check argument type compatibility for non <> cases - <> case needs no bounds check, we will scream foul if needed during inference. >+ if (!isDiamond) { >+ if (checkBounds) // otherwise will do it in Scope.connectTypeVariables() or generic method resolution >+ parameterizedType.boundCheck(scope, this.typeArguments); >+ else >+ scope.deferBoundCheck(this); >+ } > if (isTypeUseDeprecated(parameterizedType, scope)) > reportDeprecatedType(parameterizedType, scope); > >Index: compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java,v >retrieving revision 1.101.2.5 >diff -u -r1.101.2.5 QualifiedAllocationExpression.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java 23 Apr 2011 07:21:32 -0000 1.101.2.5 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java 24 Apr 2011 07:53:31 -0000 >@@ -27,6 +27,7 @@ > import org.eclipse.jdt.internal.compiler.lookup.ExtraCompilerModifiers; > import org.eclipse.jdt.internal.compiler.lookup.LocalTypeBinding; > import org.eclipse.jdt.internal.compiler.lookup.MethodBinding; >+import org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding; > import org.eclipse.jdt.internal.compiler.lookup.ProblemMethodBinding; > import org.eclipse.jdt.internal.compiler.lookup.ProblemReasons; > import org.eclipse.jdt.internal.compiler.lookup.ProblemReferenceBinding; >@@ -385,6 +386,10 @@ > scope.problemReporter().cannotInstantiate(this.type, receiverType); > return this.resolvedType = receiverType; > } >+ if (this.type != null && (this.type.bits & ASTNode.IsDiamond) != 0) { >+ TypeBinding [] inferredTypes = inferElidedTypes(((ParameterizedTypeBinding) receiverType).genericType(), argumentTypes, scope); >+ receiverType = this.type.resolvedType = scope.environment().createParameterizedType(((ParameterizedTypeBinding) receiverType).genericType(), inferredTypes, ((ParameterizedTypeBinding) receiverType).enclosingType()); >+ } > ReferenceBinding allocationType = (ReferenceBinding) receiverType; > if ((this.binding = scope.getConstructor(allocationType, argumentTypes, this)).isValidBinding()) { > if (isMethodUseDeprecated(this.binding, scope, true)) { >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/ProblemReasons.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ProblemReasons.java,v >retrieving revision 1.14.28.1 >diff -u -r1.14.28.1 ProblemReasons.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/ProblemReasons.java 2 Mar 2011 11:56:58 -0000 1.14.28.1 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/ProblemReasons.java 24 Apr 2011 07:53:32 -0000 >@@ -31,4 +31,5 @@ > final int TypeArgumentsForRawGenericMethod = 13; // for generic method > final int InvalidTypeForStaticImport = 14; > final int InvalidTypeForAutoManagedResource = 15; >+ final int InferenceFailed = 16; > } >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java,v >retrieving revision 1.380.2.3 >diff -u -r1.380.2.3 Scope.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java 15 Feb 2011 05:43:47 -0000 1.380.2.3 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java 24 Apr 2011 07:53:37 -0000 >@@ -25,6 +25,7 @@ > import org.eclipse.jdt.internal.compiler.problem.ProblemReporter; > import org.eclipse.jdt.internal.compiler.util.HashtableOfObject; > import org.eclipse.jdt.internal.compiler.util.ObjectVector; >+import org.eclipse.jdt.internal.compiler.util.SimpleLookupTable; > import org.eclipse.jdt.internal.compiler.util.SimpleSet; > > public abstract class Scope { >@@ -4023,4 +4024,137 @@ > int startIndex() { > return 0; > } >+ /* Given an allocation type and arguments at the allocation site, answer a synthetic generic static factory method >+ that could instead be invoked with identical results. Return null if no compatible, visible, most specific method >+ could be found. This method is modeled after Scope.getConstructor and Scope.getMethod. >+ */ >+ public MethodBinding getStaticFactory (ReferenceBinding allocationType, TypeBinding[] argumentTypes, final InvocationSite allocationSite) { >+ TypeVariableBinding[] classTypeVariables = allocationType.typeVariables(); >+ int classTypeVariablesArity = classTypeVariables.length; >+ MethodBinding[] methods = allocationType.getMethods(TypeConstants.INIT, argumentTypes.length); >+ MethodBinding [] staticFactories = new MethodBinding[methods.length]; >+ int sfi = 0; >+ for (int i = 0, length = methods.length; i < length; i++) { >+ MethodBinding method = methods[i]; >+ >+ TypeVariableBinding[] methodTypeVariables = method.typeVariables(); >+ int methodTypeVariablesArity = methodTypeVariables.length; >+ >+ final TypeBinding[] genericTypeArguments = allocationSite.genericTypeArguments(); >+ if (genericTypeArguments != null && genericTypeArguments.length < methodTypeVariablesArity) >+ continue; // wrong tree, don't bark. >+ MethodBinding staticFactory = new MethodBinding(method.modifiers | ClassFileConstants.AccStatic, TypeConstants.SYNTHETIC_STATIC_FACTORY, >+ null, null, null, method.declaringClass); >+ staticFactory.typeVariables = new TypeVariableBinding[classTypeVariablesArity + (genericTypeArguments == null ? methodTypeVariablesArity : 0)]; >+ final SimpleLookupTable map = new SimpleLookupTable(classTypeVariablesArity + methodTypeVariablesArity); >+ // Rename each type variable T of the type to T' >+ final LookupEnvironment environment = environment(); >+ for (int j = 0; j < classTypeVariablesArity; j++) { >+ map.put(classTypeVariables[j], staticFactory.typeVariables[j] = new TypeVariableBinding(CharOperation.concat(classTypeVariables[j].sourceName, "'".toCharArray()), //$NON-NLS-1$ >+ staticFactory, j, environment)); >+ } >+ // Rename each type variable U of method U to U'' if not explicitly parameterized. Otherwise use the parameterizing type. >+ for (int j = classTypeVariablesArity, max = classTypeVariablesArity + methodTypeVariablesArity; j < max; j++) { >+ map.put(methodTypeVariables[j - classTypeVariablesArity], >+ genericTypeArguments != null ? genericTypeArguments[j - classTypeVariablesArity] : >+ (staticFactory.typeVariables[j] = new TypeVariableBinding(CharOperation.concat(methodTypeVariables[j - classTypeVariablesArity].sourceName, "''".toCharArray()), //$NON-NLS-1$ >+ staticFactory, j, environment))); >+ } >+ final Scope scope = this; >+ Substitution substitution = new Substitution() { >+ public LookupEnvironment environment() { >+ return scope.environment(); >+ } >+ public boolean isRawSubstitution() { >+ return false; >+ } >+ public TypeBinding substitute(TypeVariableBinding typeVariable) { >+ return (TypeBinding) map.get(typeVariable); >+ } >+ }; >+ >+ // initialize new variable bounds >+ for (int j = 0, max = classTypeVariablesArity + methodTypeVariablesArity; j < max; j++) { >+ TypeVariableBinding originalVariable = j < classTypeVariablesArity ? classTypeVariables[j] : methodTypeVariables[j - classTypeVariablesArity]; >+ TypeBinding substitutedType = (TypeBinding) map.get(originalVariable); >+ if (substitutedType instanceof TypeVariableBinding) { >+ TypeVariableBinding substitutedVariable = (TypeVariableBinding) substitutedType; >+ TypeBinding substitutedSuperclass = Scope.substitute(substitution, originalVariable.superclass); >+ ReferenceBinding[] substitutedInterfaces = Scope.substitute(substitution, originalVariable.superInterfaces); >+ if (originalVariable.firstBound != null) { >+ substitutedVariable.firstBound = originalVariable.firstBound == originalVariable.superclass >+ ? substitutedSuperclass // could be array type or interface >+ : substitutedInterfaces[0]; >+ } >+ switch (substitutedSuperclass.kind()) { >+ case Binding.ARRAY_TYPE : >+ substitutedVariable.superclass = environment.getResolvedType(TypeConstants.JAVA_LANG_OBJECT, null); >+ substitutedVariable.superInterfaces = substitutedInterfaces; >+ break; >+ default: >+ if (substitutedSuperclass.isInterface()) { >+ substitutedVariable.superclass = environment.getResolvedType(TypeConstants.JAVA_LANG_OBJECT, null); >+ int interfaceCount = substitutedInterfaces.length; >+ System.arraycopy(substitutedInterfaces, 0, substitutedInterfaces = new ReferenceBinding[interfaceCount+1], 1, interfaceCount); >+ substitutedInterfaces[0] = (ReferenceBinding) substitutedSuperclass; >+ substitutedVariable.superInterfaces = substitutedInterfaces; >+ } else { >+ substitutedVariable.superclass = (ReferenceBinding) substitutedSuperclass; // typeVar was extending other typeVar which got substituted with interface >+ substitutedVariable.superInterfaces = substitutedInterfaces; >+ } >+ } >+ } >+ } >+ TypeVariableBinding[] returnTypeParameters = new TypeVariableBinding[classTypeVariablesArity]; >+ for (int j = 0; j < classTypeVariablesArity; j++) { >+ returnTypeParameters[j] = (TypeVariableBinding) map.get(classTypeVariables[j]); >+ } >+ staticFactory.returnType = environment.createParameterizedType(allocationType, returnTypeParameters, allocationType.enclosingType()); >+ staticFactory.parameters = Scope.substitute(substitution, method.parameters); >+ staticFactory.thrownExceptions = Scope.substitute(substitution, method.thrownExceptions); >+ if (staticFactory.thrownExceptions == null) { >+ staticFactory.thrownExceptions = Binding.NO_EXCEPTIONS; >+ } >+ staticFactories[sfi++] = new ParameterizedMethodBinding((ParameterizedTypeBinding) environment.convertToParameterizedType(staticFactory.declaringClass), >+ staticFactory); >+ } >+ if (sfi != methods.length) { >+ System.arraycopy(staticFactories, 0, staticFactories = new MethodBinding[sfi], 0, sfi); >+ } >+ InvocationSite site = new InvocationSite() { // Alternate site to not expose the generic type arguments as they have already been substituted. >+ public int sourceStart() { return allocationSite.sourceStart(); } >+ public int sourceEnd() { return allocationSite.sourceEnd(); } >+ public void setFieldIndex(int depth) { allocationSite.setFieldIndex(depth); } >+ public void setDepth(int depth) { allocationSite.setDepth(depth);} >+ public void setActualReceiverType(ReferenceBinding receiverType) { allocationSite.setActualReceiverType(receiverType);} >+ public boolean isTypeAccess() { return allocationSite.isTypeAccess(); } >+ public boolean isSuperAccess() { return allocationSite.isSuperAccess(); } >+ public TypeBinding[] genericTypeArguments() { return null; } >+ public TypeBinding expectedType() { return allocationSite.expectedType(); } >+ }; >+ MethodBinding[] compatible = new MethodBinding[sfi]; >+ int compatibleIndex = 0; >+ for (int i = 0; i < sfi; i++) { >+ MethodBinding compatibleMethod = computeCompatibleMethod(staticFactories[i], argumentTypes, site); >+ if (compatibleMethod != null) { >+ if (compatibleMethod.isValidBinding()) >+ compatible[compatibleIndex++] = compatibleMethod; >+ } >+ } >+ >+ if (compatibleIndex == 0) { >+ return null; >+ } >+ MethodBinding[] visible = new MethodBinding[compatibleIndex]; >+ int visibleIndex = 0; >+ for (int i = 0; i < compatibleIndex; i++) { >+ MethodBinding method = compatible[i]; >+ if (method.canBeSeenBy(allocationSite, this)) >+ visible[visibleIndex++] = method; >+ } >+ if (visibleIndex == 0) { >+ return null; >+ } >+ return visibleIndex == 1 ? visible[0] : mostSpecificMethodBinding(visible, visibleIndex, argumentTypes, allocationSite, allocationType); >+ } > } >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java,v >retrieving revision 1.51.2.4 >diff -u -r1.51.2.4 TypeConstants.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java 19 Apr 2011 13:09:09 -0000 1.51.2.4 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/TypeConstants.java 24 Apr 2011 07:53:37 -0000 >@@ -170,6 +170,7 @@ > char[] SYNTHETIC_ENCLOSING_INSTANCE_PREFIX = "this$".toCharArray(); //$NON-NLS-1$ > char[] SYNTHETIC_ACCESS_METHOD_PREFIX = "access$".toCharArray(); //$NON-NLS-1$ > char[] SYNTHETIC_ENUM_CONSTANT_INITIALIZATION_METHOD_PREFIX = " enum constant initialization$".toCharArray(); //$NON-NLS-1$ >+ char[] SYNTHETIC_STATIC_FACTORY = "<factory>".toCharArray(); //$NON-NLS-1$ > > // synthetic package-info name > public static final char[] PACKAGE_INFO_NAME = "package-info".toCharArray(); //$NON-NLS-1$ >Index: compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java,v >retrieving revision 1.430.2.19 >diff -u -r1.430.2.19 ProblemReporter.java >--- compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java 21 Apr 2011 06:09:56 -0000 1.430.2.19 >+++ compiler/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java 24 Apr 2011 07:53:44 -0000 >@@ -7748,4 +7748,12 @@ > resources[0].declarationSourceStart, > resources[resources.length - 1].declarationSourceEnd); > } >+public void cannotInferElidedTypes(AllocationExpression allocationExpression) { >+ this.handle( >+ IProblem.CannotInferElidedTypes, >+ NoArgument, >+ NoArgument, >+ allocationExpression.sourceStart, >+ allocationExpression.sourceEnd); >+} > } >\ No newline at end of file >Index: compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties,v >retrieving revision 1.262.2.15 >diff -u -r1.262.2.15 messages.properties >--- compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties 21 Apr 2011 06:09:56 -0000 1.262.2.15 >+++ compiler/org/eclipse/jdt/internal/compiler/problem/messages.properties 24 Apr 2011 07:53:44 -0000 >@@ -639,6 +639,7 @@ > 875 = Multi-catch parameters are not allowed for source level below 1.7 > 876 = Invocation of polymorphic methods not allowed for source level below 1.7 > 877 = Cannot switch on a value of type {0}. Only convertible int values, strings or enum constants are permitted >+878 = Cannot infer elided type(s) > > ### ELABORATIONS > ## Access restrictions
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 339478
:
190845
|
191332
|
191458
|
191707
|
191785
|
191891
|
191902
|
191946
|
191947
|
191984
|
192058
|
193887
|
193901
|
193918
|
193951
| 193962 |
193963