Test.java revision 1472
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
/*
* @test
* @bug 6832293
* @summary JIT compiler got wrong result in type checking with -server
*/
interface SomeInterface {
int SEVENS = 777;
}
interface AnotherInterface {
int THIRDS = 33;
}
class SomeClass implements SomeInterface {
int i;
SomeClass(int i) {
this.i = i;
}
}
float f;
ImmediateSubclass(int i, float f) {
super(i);
this.f = f;
}
}
double d;
FinalSubclass(int i, float f, double d) {
super(i, f);
this.d = d;
}
}
public class Test {
/* try to pre initialize */
}
}
int i [], j [];
SomeInterface u [], v[] [];
AnotherInterface w [];
SomeClass x [] [];
i = new int [10];
i[0] = 777;
j = (int []) i;
if (j != i)
else if (j.length != 10)
else if (j[0] != 777)
v = new SomeClass [3] [];
x = (SomeClass [] []) v;
if (! (x instanceof SomeInterface [] []))
else if (! (x instanceof SomeClass [] []))
else if (x != v)
if (! (x[0] instanceof ImmediateSubclass []))
if (! (x[1] instanceof FinalSubclass []))
w = (AnotherInterface []) x[1];
if (! (w instanceof FinalSubclass []))
else if (w != x[1])
else if (w.length != 4)
return errorStatus;
}
}