Lines 1-5
Link Here
|
1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
2 |
* Copyright (c) 2000, 2009 IBM Corporation and others. |
2 |
* Copyright (c) 2000, 2010 IBM Corporation and others. |
3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
Lines 7-12
Link Here
|
7 |
* |
7 |
* |
8 |
* Contributors: |
8 |
* Contributors: |
9 |
* IBM Corporation - initial API and implementation |
9 |
* IBM Corporation - initial API and implementation |
|
|
10 |
* Stephan Herrmann <stephan@cs.tu-berlin.de> - Contribution for Bug 331872 - [compiler] NPE in Scope.createArrayType when attempting qualified access from type parameter |
10 |
*******************************************************************************/ |
11 |
*******************************************************************************/ |
11 |
package org.eclipse.jdt.core.tests.compiler.regression; |
12 |
package org.eclipse.jdt.core.tests.compiler.regression; |
12 |
import java.io.File; |
13 |
import java.io.File; |
Lines 544-547
Link Here
|
544 |
assertEquals("unexpected bytecode sequence", expectedOutput, actualOutput); |
545 |
assertEquals("unexpected bytecode sequence", expectedOutput, actualOutput); |
545 |
} |
546 |
} |
546 |
} |
547 |
} |
|
|
548 |
|
549 |
// https://bugs.eclipse.org/331872 - [compiler] NPE in Scope.createArrayType when attempting qualified access from type parameter |
550 |
public void test018() throws Exception { |
551 |
if (new CompilerOptions(getCompilerOptions()).complianceLevel < ClassFileConstants.JDK1_5) |
552 |
return; |
553 |
this.runNegativeTest( |
554 |
new String[] { |
555 |
"X.java", |
556 |
"public class X<p> {\n" + |
557 |
" void foo(p.O[] elems) {\n" + |
558 |
" }\n" + |
559 |
" void bar() {\n" + |
560 |
" foo(new Object[0]);\n" + |
561 |
" }\n" + |
562 |
"}\n", |
563 |
}, |
564 |
"----------\n" + |
565 |
"1. ERROR in X.java (at line 2)\n" + |
566 |
" void foo(p.O[] elems) {\n" + |
567 |
" ^^^^^\n" + |
568 |
"Illegal qualified access from the type parameter p\n" + |
569 |
"----------\n" + |
570 |
"2. ERROR in X.java (at line 2)\n" + |
571 |
" void foo(p.O[] elems) {\n" + |
572 |
" ^^^\n" + |
573 |
"p.O cannot be resolved to a type\n" + |
574 |
"----------\n" + |
575 |
"3. ERROR in X.java (at line 5)\n" + |
576 |
" foo(new Object[0]);\n" + |
577 |
" ^^^\n" + |
578 |
"The method foo(O[]) from the type X<p> refers to the missing type O\n" + |
579 |
"----------\n"); |
580 |
} |
547 |
} |
581 |
} |