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 188982 Details for
Bug 337093
[compiler][generics] Javac-warning on vararg missing in Eclipse
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch under test
patch.txt (text/plain), 3.74 KB, created by
Srikanth Sankaran
on 2011-02-15 04:41:32 EST
(
hide
)
Description:
Patch under test
Filename:
MIME Type:
Creator:
Srikanth Sankaran
Created:
2011-02-15 04:41:32 EST
Size:
3.74 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java,v >retrieving revision 1.107 >diff -u -r1.107 ASTNode.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java 8 Feb 2011 05:16:20 -0000 1.107 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java 15 Feb 2011 09:39:27 -0000 >@@ -296,7 +296,7 @@ > invocationStatus |= checkInvocationArgument(scope, arguments[i], params[i] , argumentTypes[i], originalRawParam); > } > int argLength = arguments.length; >- if (lastIndex < argLength) { // vararg argument was provided >+ if (lastIndex <= argLength) { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=337093 > TypeBinding parameterType = params[lastIndex]; > TypeBinding originalRawParam = null; > >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/VarargsTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/VarargsTest.java,v >retrieving revision 1.62 >diff -u -r1.62 VarargsTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/VarargsTest.java 20 Oct 2010 14:25:09 -0000 1.62 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/VarargsTest.java 15 Feb 2011 09:39:47 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2005, 2010 IBM Corporation and others. >+ * Copyright (c) 2005, 2011 IBM Corporation 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 >@@ -2196,4 +2196,42 @@ > " X$1(X arg0, java.lang.Integer $anonymous0, java.lang.String... $anonymous1, java.lang.Float arg3);\n"; > checkDisassembledClassFile(OUTPUT_DIR + File.separator + "X$1.class", "X$1", expectedOutput); > } >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=337093 >+ public void test063() { >+ Map options = getCompilerOptions(); >+ options.put(CompilerOptions.OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation, CompilerOptions.DISABLED); >+ this.runNegativeTest( >+ new String[] { >+ "X.java", >+ "import java.util.Collection;\n" + >+ "import java.util.Iterator;\n" + >+ "public class X {\n" + >+ " public static class IteratorChain<T> implements Iterator<T> {\n" + >+ " public IteratorChain(Collection<? extends T> a, Collection<? extends T> b, Collection<? extends T> ... collections) {\n" + >+ " }\n" + >+ " public boolean hasNext() {\n" + >+ " return false;\n" + >+ " }\n" + >+ " public T next() {\n" + >+ " return null;\n" + >+ " }\n" + >+ " public void remove() {\n" + >+ " throw new UnsupportedOperationException();\n" + >+ " }\n" + >+ " }\n" + >+ " public static void main(String[] args) {\n" + >+ " new IteratorChain<Number>(null, null);\n" + >+ " }\n" + >+ "}\n", // ================= >+ }, >+ "----------\n" + >+ "1. WARNING in X.java (at line 18)\n" + >+ " new IteratorChain<Number>(null, null);\n" + >+ " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + >+ "Type safety : A generic array of Collection<? extends Number> is created for a varargs parameter\n" + >+ "----------\n", >+ null, >+ true, >+ options); >+ } > }
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 337093
: 188982