0001: /*
0002: * Licensed to the Apache Software Foundation (ASF) under one or more
0003: * contributor license agreements. See the NOTICE file distributed with
0004: * this work for additional information regarding copyright ownership.
0005: * The ASF licenses this file to You under the Apache License, Version 2.0
0006: * (the "License"); you may not use this file except in compliance with
0007: * the License. You may obtain a copy of the License at
0008: *
0009: * http://www.apache.org/licenses/LICENSE-2.0
0010: *
0011: * Unless required by applicable law or agreed to in writing, software
0012: * distributed under the License is distributed on an "AS IS" BASIS,
0013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0014: * See the License for the specific language governing permissions and
0015: * limitations under the License.
0016: */
0017:
0018: /**
0019: * @author Serguei S.Zapreyev
0020: * @version $Revision$
0021: */package java.lang;
0022:
0023: import java.lang.reflect.*;
0024: import java.io.File;
0025: import java.io.FileOutputStream;
0026:
0027: import org.apache.harmony.test.TestResources;
0028:
0029: import junit.framework.TestCase;
0030:
0031: /*
0032: * Created on May 03-06, 2006
0033: *
0034: * This ClassGenericsTest4 class is used to test the Core API Class, Method,
0035: * Constructor classes
0036: *
0037: */
0038:
0039: @SuppressWarnings(value={"all"})
0040: public class ClassGenericsTest4<$X$> extends TestCase {
0041: class $Mc3$01 {
0042: };
0043:
0044: interface $MI3$01<$T$0 extends java.io.Serializable> {
0045: };
0046:
0047: interface $MI3$02<_T$_1$ extends $MI3$01> {
0048: };
0049:
0050: interface $MI3$03<T2$> extends $MI3$01 {
0051: };
0052:
0053: interface $MI3$04<T$2> {
0054: interface $MI3$05<_T$21_, _$T22> {
0055: };
0056: };
0057:
0058: public class $Mc3$02<$_T3_$ extends ClassGenericsTest4> {
0059: public class $Mc3$04<T5 extends ClassGenericsTest4> {
0060: };
0061: };
0062:
0063: public class $Mc4$<_> {
0064: public class $Mc5<_> {
0065: };
0066:
0067: public class Mc5<_> {
0068: };
0069: };
0070:
0071: public interface $Mi4$<_> {
0072: public interface $$$$$Mi5<_> {
0073: };
0074:
0075: public interface $$$$Mi5<_> {
0076: };
0077:
0078: public interface $$$Mi5<_> {
0079: };
0080:
0081: public interface $$Mi5<_> {
0082: };
0083:
0084: public interface $Mi5<_> {
0085: };
0086:
0087: public interface Mi5<_> {
0088: };
0089:
0090: public interface Mi5$<_> {
0091: };
0092: };
0093:
0094: public interface $Mi4<_> {
0095: /* //XXX's compiler errors are risen here:
0096: public interface $$Mi5<_> {
0097: };
0098: public interface $Mi5<_> {
0099: };
0100: public interface Mi5<_> {
0101: };
0102: public interface Mi5$<_> {
0103: };
0104: */
0105: };
0106:
0107: /**
0108: * processing generalized local classes
0109: */
0110: public void test_1() throws Exception {
0111: class $Mc3$01<T> {
0112: }
0113: ;
0114: class $Mc3$02<$_T3_$ extends ClassGenericsTest4> {
0115: class $Mc3$04<T5 extends $Mc3$01<$Mi4<Cloneable>> & $Mi4$.$$$$$Mi5 & $Mi4$.$$$$Mi5 & $Mi4$.$$$Mi5 & $Mi4$.$$Mi5 & $Mi4$.$Mi5 & $Mi4$.Mi5 & $Mi4$, T6 extends $Mc3$01<$Mi4<? super Cloneable>> & $Mi4$.$$$$$Mi5, T7 extends $Mc3$01<$Mi4<? extends java.io.Serializable>> & $Mi4$.$$$$$Mi5>
0116: implements $Mi4$.$$$$$Mi5, $Mi4$.$$$$Mi5,
0117: $Mi4$.$$$Mi5, $Mi4$.$$Mi5, $Mi4$.$Mi5, $Mi4$.Mi5,
0118: $Mi4$ {
0119: };
0120: }
0121: ;
0122: if (!$Mc3$01.class.getName().equals(
0123: "java.lang.ClassGenericsTest4$1$Mc3$01"))
0124: fail("test_1, case 001 FAILED: " + $Mc3$01.class.getName());
0125: if (!$Mc3$01.class.getSimpleName().equals("$Mc3$01"))
0126: fail("test_1, case 002 FAILED: "
0127: + $Mc3$01.class.getSimpleName());
0128: if ($Mc3$01.class.getCanonicalName() != null)
0129: fail("test_1, case 0021 FAILED: "
0130: + $Mc3$01.class.getCanonicalName());
0131: Type at[] = $Mc3$01.class.getTypeParameters();
0132: TypeVariable tv = (TypeVariable) at[0];
0133: if (!tv.getName().equals("T"))
0134: fail("test_1, case 003 FAILED: " + tv.getName());
0135: Class cc = (Class) tv.getBounds()[0];
0136: if (!cc.getName().equals("java.lang.Object"))
0137: fail("test_1, case 004 FAILED: " + cc.getName());
0138:
0139: if (!$Mc3$02.class.getName().equals(
0140: "java.lang.ClassGenericsTest4$1$Mc3$02"))
0141: fail("test_1, case 005 FAILED: " + $Mc3$02.class.getName());
0142: if (!$Mc3$02.class.getSimpleName().equals("$Mc3$02"))
0143: fail("test_1, case 006 FAILED: "
0144: + $Mc3$02.class.getSimpleName());
0145: if ($Mc3$02.class.getCanonicalName() != null)
0146: fail("test_1, case 007 FAILED: "
0147: + $Mc3$02.class.getCanonicalName());
0148: at = $Mc3$02.class.getTypeParameters();
0149: tv = (TypeVariable) at[0];
0150: if (!tv.getName().equals("$_T3_$"))
0151: fail("test_1, case 008 FAILED: " + tv.getName());
0152: cc = (Class) tv.getBounds()[0];
0153: if (!cc.getName().equals("java.lang.ClassGenericsTest4"))
0154: fail("test_1, case 009 FAILED: " + cc.getName());
0155:
0156: if (!$Mc3$02.$Mc3$04.class.getName().equals(
0157: "java.lang.ClassGenericsTest4$1$Mc3$02$$Mc3$04"))
0158: fail("test_1, case 010 FAILED: "
0159: + $Mc3$02.$Mc3$04.class.getName());
0160: if (!$Mc3$02.$Mc3$04.class.getSimpleName().equals("$Mc3$04"))
0161: fail("test_1, case 011 FAILED: "
0162: + $Mc3$02.$Mc3$04.class.getSimpleName());
0163: if ($Mc3$02.$Mc3$04.class.getCanonicalName() != null)
0164: fail("test_1, case 012 FAILED: "
0165: + $Mc3$02.$Mc3$04.class.getCanonicalName());
0166: Type ab[] = null;
0167: ParameterizedType pt = null;
0168: if (RuntimeAdditionalSupport1.openingFlag) {
0169: try {
0170: at = $Mc3$02.$Mc3$04.class.getTypeParameters();
0171: tv = (TypeVariable) at[0];
0172: if (!tv.getName().equals("T5"))
0173: fail("test_1, case 0121 FAILED: " + tv.getName());
0174: /*Type*/ab/*[]*/= tv.getBounds();
0175: /*ParameterizedType*/pt = (ParameterizedType) ab[0];
0176: if (!pt
0177: .toString()
0178: .equals(
0179: "java.lang.ClassGenericsTest4$1$Mc3$01<java.lang.ClassGenericsTest4.$Mi4<java.lang.Cloneable>>"))
0180: fail("test_1, case 013 FAILED: " + tv.getName());
0181:
0182: if (!((Class) ((ParameterizedType) ab[0]).getRawType())
0183: .getName()
0184: .equals("java.lang.ClassGenericsTest4$1$Mc3$01"))
0185: fail("test_1, case 014 FAILED: "
0186: + ((Class) ((ParameterizedType) ab[0])
0187: .getRawType()).getName());
0188: if (((ParameterizedType) ab[0]).getOwnerType() != null)
0189: fail("test_1, case 015 FAILED: "
0190: + ((ParameterizedType) ab[0])
0191: .getOwnerType());
0192: if (!((Class) ab[1]).getName().equals(
0193: "java.lang.ClassGenericsTest4$$Mi4$$$$$$$Mi5")
0194: || !((Class) ab[1]).getSimpleName().equals(
0195: "$$$$$Mi5"))
0196: fail("test_1, case 016 FAILED: "
0197: + ((Class) ab[1]).getName() + "|"
0198: + ((Class) ab[2]).getSimpleName());
0199: if (!((Class) ab[2]).getName().equals(
0200: "java.lang.ClassGenericsTest4$$Mi4$$$$$$Mi5")
0201: || !((Class) ab[2]).getSimpleName().equals(
0202: "$$$$Mi5"))
0203: fail("test_1, case 017 FAILED: "
0204: + ((Class) ab[1]).getName() + "|"
0205: + ((Class) ab[2]).getSimpleName());
0206: if (!((Class) ab[3]).getName().equals(
0207: "java.lang.ClassGenericsTest4$$Mi4$$$$$Mi5")
0208: || !((Class) ab[3]).getSimpleName().equals(
0209: "$$$Mi5"))
0210: fail("test_1, case 018 FAILED: "
0211: + ((Class) ab[1]).getName() + "|"
0212: + ((Class) ab[2]).getSimpleName());
0213: if (!((Class) ab[4]).getName().equals(
0214: "java.lang.ClassGenericsTest4$$Mi4$$$$Mi5")
0215: || !((Class) ab[4]).getSimpleName().equals(
0216: "$$Mi5"))
0217: fail("test_1, case 019 FAILED: "
0218: + ((Class) ab[1]).getName() + "|"
0219: + ((Class) ab[2]).getSimpleName());
0220: if (!((Class) ab[5]).getName().equals(
0221: "java.lang.ClassGenericsTest4$$Mi4$$$Mi5")
0222: || !((Class) ab[5]).getSimpleName().equals(
0223: "$Mi5"))
0224: fail("test_1, case 020 FAILED: "
0225: + ((Class) ab[1]).getName() + "|"
0226: + ((Class) ab[2]).getSimpleName());
0227: if (!((Class) ab[6]).getName().equals(
0228: "java.lang.ClassGenericsTest4$$Mi4$$Mi5")
0229: || !((Class) ab[6]).getSimpleName().equals(
0230: "Mi5"))
0231: fail("test_1, case 021 FAILED: "
0232: + ((Class) ab[2]).getName() + "|"
0233: + ((Class) ab[2]).getSimpleName());
0234: if (!((Class) ab[7]).getName().equals(
0235: "java.lang.ClassGenericsTest4$$Mi4$"))
0236: fail("test_1, case 022 FAILED: "
0237: + ((Class) ab[7]).getName());
0238:
0239: tv = (TypeVariable) at[1];
0240: if (!tv.getName().equals("T6"))
0241: fail("test_1, case 023 FAILED: " + tv.getName());
0242: ab = tv.getBounds();
0243: pt = (ParameterizedType) ab[0];
0244: if (!pt
0245: .toString()
0246: .equals(
0247: "java.lang.ClassGenericsTest4$1$Mc3$01<java.lang.ClassGenericsTest4.$Mi4<? super java.lang.Cloneable>>"))
0248: fail("test_1, case 024 FAILED: " + tv.getName());
0249:
0250: if (!((Class) ((ParameterizedType) ab[0]).getRawType())
0251: .getName()
0252: .equals("java.lang.ClassGenericsTest4$1$Mc3$01"))
0253: fail("test_1, case 025 FAILED: "
0254: + ((Class) ((ParameterizedType) ab[0])
0255: .getRawType()).getName());
0256: if (((ParameterizedType) ab[0]).getOwnerType() != null)
0257: fail("test_1, case 026 FAILED: "
0258: + ((ParameterizedType) ab[0])
0259: .getOwnerType());
0260: if (!((Class) ab[1]).getName().equals(
0261: "java.lang.ClassGenericsTest4$$Mi4$$$$$$$Mi5")
0262: || !((Class) ab[1]).getSimpleName().equals(
0263: "$$$$$Mi5"))
0264: fail("test_1, case 027 FAILED: "
0265: + ((Class) ab[1]).getName() + "|"
0266: + ((Class) ab[2]).getSimpleName());
0267:
0268: tv = (TypeVariable) at[2];
0269: if (!tv.getName().equals("T7"))
0270: fail("test_1, case 028 FAILED: " + tv.getName());
0271: ab = tv.getBounds();
0272: pt = (ParameterizedType) ab[0];
0273: if (!pt
0274: .toString()
0275: .equals(
0276: "java.lang.ClassGenericsTest4$1$Mc3$01<java.lang.ClassGenericsTest4.$Mi4<? extends java.io.Serializable>>"))
0277: fail("test_1, case 029 FAILED: " + tv.getName());
0278:
0279: if (!((Class) ((ParameterizedType) ab[0]).getRawType())
0280: .getName()
0281: .equals("java.lang.ClassGenericsTest4$1$Mc3$01"))
0282: fail("test_1, case 030 FAILED: "
0283: + ((Class) ((ParameterizedType) ab[0])
0284: .getRawType()).getName());
0285: if (((ParameterizedType) ab[0]).getOwnerType() != null)
0286: fail("test_1, case 031 FAILED: "
0287: + ((ParameterizedType) ab[0])
0288: .getOwnerType());
0289: if (!((Class) ab[1]).getName().equals(
0290: "java.lang.ClassGenericsTest4$$Mi4$$$$$$$Mi5")
0291: || !((Class) ab[1]).getSimpleName().equals(
0292: "$$$$$Mi5"))
0293: fail("test_1, case 032 FAILED: "
0294: + ((Class) ab[1]).getName() + "|"
0295: + ((Class) ab[2]).getSimpleName());
0296:
0297: at = $Mc3$02.$Mc3$04.class.getGenericInterfaces();
0298:
0299: if (!((Class) at[0]).getName().equals(
0300: "java.lang.ClassGenericsTest4$$Mi4$$$$$$$Mi5")
0301: || !((Class) at[0]).getSimpleName().equals(
0302: "$$$$$Mi5"))
0303: fail("test_1, case 033 FAILED: "
0304: + ((Class) at[0]).getName() + "|"
0305: + ((Class) at[0]).getSimpleName());
0306: if (!((Class) at[1]).getName().equals(
0307: "java.lang.ClassGenericsTest4$$Mi4$$$$$$Mi5")
0308: || !((Class) at[1]).getSimpleName().equals(
0309: "$$$$Mi5"))
0310: fail("test_1, case 034 FAILED: "
0311: + ((Class) at[1]).getName() + "|"
0312: + ((Class) at[1]).getSimpleName());
0313: if (!((Class) at[2]).getName().equals(
0314: "java.lang.ClassGenericsTest4$$Mi4$$$$$Mi5")
0315: || !((Class) at[2]).getSimpleName().equals(
0316: "$$$Mi5"))
0317: fail("test_1, case 035 FAILED: "
0318: + ((Class) at[2]).getName() + "|"
0319: + ((Class) at[2]).getSimpleName());
0320: if (!((Class) at[3]).getName().equals(
0321: "java.lang.ClassGenericsTest4$$Mi4$$$$Mi5")
0322: || !((Class) at[3]).getSimpleName().equals(
0323: "$$Mi5"))
0324: fail("test_1, case 036 FAILED: "
0325: + ((Class) at[3]).getName() + "|"
0326: + ((Class) at[3]).getSimpleName());
0327: if (!((Class) at[4]).getName().equals(
0328: "java.lang.ClassGenericsTest4$$Mi4$$$Mi5")
0329: || !((Class) at[4]).getSimpleName().equals(
0330: "$Mi5"))
0331: fail("test_1, case 037 FAILED: "
0332: + ((Class) at[4]).getName() + "|"
0333: + ((Class) at[4]).getSimpleName());
0334: if (!((Class) at[5]).getName().equals(
0335: "java.lang.ClassGenericsTest4$$Mi4$$Mi5")
0336: || !((Class) at[5]).getSimpleName().equals(
0337: "Mi5"))
0338: fail("test_1, case 038 FAILED: "
0339: + ((Class) at[5]).getName() + "|"
0340: + ((Class) at[5]).getSimpleName());
0341: if (!((Class) at[6]).getName().equals(
0342: "java.lang.ClassGenericsTest4$$Mi4$"))
0343: fail("test_1, case 039 FAILED: "
0344: + ((Class) at[6]).getName());
0345: } catch (java.lang.reflect.GenericSignatureFormatError e) {
0346: System.out
0347: .println("ClassGenericsTest4.test_1.XXX_case_1 is excluded temporarily because the used compiler generates incorrect signature which leads to the case falure.");
0348: }
0349: }
0350: Class ac[] = new Class[3];
0351: meth(ac);
0352: if (!ac[0].getName().equals(
0353: "java.lang.ClassGenericsTest4$2$Mc3$01"))
0354: fail("test_1, case 040 FAILED: " + ac[0].getName());
0355: if (!ac[0].getSimpleName().equals("$Mc3$01"))
0356: fail("test_1, case 041 FAILED: " + ac[0].getSimpleName());
0357: if (ac[0].getCanonicalName() != null)
0358: fail("test_1, case 042 FAILED: " + ac[0].getCanonicalName());
0359: at = ac[0].getTypeParameters();
0360: tv = (TypeVariable) at[0];
0361: if (!tv.getName().equals("T"))
0362: fail("test_1, case 043 FAILED: " + tv.getName());
0363: cc = (Class) tv.getBounds()[0];
0364: if (!cc.getName().equals("java.lang.Object"))
0365: fail("test_1, case 044 FAILED: " + cc.getName());
0366:
0367: if (!ac[1].getName().equals(
0368: "java.lang.ClassGenericsTest4$2$Mc3$02"))
0369: fail("test_1, case 045 FAILED: " + ac[1].getName());
0370: if (!ac[1].getSimpleName().equals("$Mc3$02"))
0371: fail("test_1, case 046 FAILED: " + ac[1].getSimpleName());
0372: if (ac[1].getCanonicalName() != null)
0373: fail("test_1, case 047 FAILED: " + ac[1].getCanonicalName());
0374: at = ac[1].getTypeParameters();
0375: tv = (TypeVariable) at[0];
0376: if (!tv.getName().equals("$_T3_$"))
0377: fail("test_1, case 048 FAILED: " + tv.getName());
0378: cc = (Class) tv.getBounds()[0];
0379: if (!cc.getName().equals("java.lang.ClassGenericsTest4"))
0380: fail("test_1, case 049 FAILED: " + cc.getName());
0381:
0382: if (!ac[2].getName().equals(
0383: "java.lang.ClassGenericsTest4$2$Mc3$02$$Mc3$04"))
0384: fail("test_1, case 050 FAILED: " + ac[2].getName());
0385: if (!ac[2].getSimpleName().equals("$Mc3$04"))
0386: fail("test_1, case 051 FAILED: " + ac[2].getSimpleName());
0387: if (ac[2].getCanonicalName() != null)
0388: fail("test_1, case 052 FAILED: " + ac[2].getCanonicalName());
0389: if (RuntimeAdditionalSupport1.openingFlag) {
0390: try {
0391: at = ac[2].getTypeParameters();
0392: tv = (TypeVariable) at[0];
0393: if (!tv.getName().equals("T5"))
0394: fail("test_1, case 053 FAILED: " + tv.getName());
0395: ab = tv.getBounds();
0396: pt = (ParameterizedType) ab[0];
0397: if (!pt
0398: .toString()
0399: .equals(
0400: "java.lang.ClassGenericsTest4$2$Mc3$01<java.lang.ClassGenericsTest4.$Mi4<java.lang.Cloneable>>"))
0401: fail("test_1, case 054 FAILED: " + tv.getName());
0402:
0403: if (!((Class) ((ParameterizedType) ab[0]).getRawType())
0404: .getName()
0405: .equals("java.lang.ClassGenericsTest4$2$Mc3$01"))
0406: fail("test_1, case 055 FAILED: "
0407: + ((Class) ((ParameterizedType) ab[0])
0408: .getRawType()).getName());
0409: if (((ParameterizedType) ab[0]).getOwnerType() != null)
0410: fail("test_1, case 056 FAILED: "
0411: + ((ParameterizedType) ab[0])
0412: .getOwnerType());
0413: if (!((Class) ab[1]).getName().equals(
0414: "java.lang.ClassGenericsTest4$$Mi4$$$$$$$Mi5")
0415: || !((Class) ab[1]).getSimpleName().equals(
0416: "$$$$$Mi5"))
0417: fail("test_1, case 057 FAILED: "
0418: + ((Class) ab[1]).getName() + "|"
0419: + ((Class) ab[2]).getSimpleName());
0420: if (!((Class) ab[2]).getName().equals(
0421: "java.lang.ClassGenericsTest4$$Mi4$$$$$$Mi5")
0422: || !((Class) ab[2]).getSimpleName().equals(
0423: "$$$$Mi5"))
0424: fail("test_1, case 058 FAILED: "
0425: + ((Class) ab[1]).getName() + "|"
0426: + ((Class) ab[2]).getSimpleName());
0427: if (!((Class) ab[3]).getName().equals(
0428: "java.lang.ClassGenericsTest4$$Mi4$$$$$Mi5")
0429: || !((Class) ab[3]).getSimpleName().equals(
0430: "$$$Mi5"))
0431: fail("test_1, case 059 FAILED: "
0432: + ((Class) ab[1]).getName() + "|"
0433: + ((Class) ab[2]).getSimpleName());
0434: if (!((Class) ab[4]).getName().equals(
0435: "java.lang.ClassGenericsTest4$$Mi4$$$$Mi5")
0436: || !((Class) ab[4]).getSimpleName().equals(
0437: "$$Mi5"))
0438: fail("test_1, case 060 FAILED: "
0439: + ((Class) ab[1]).getName() + "|"
0440: + ((Class) ab[2]).getSimpleName());
0441: if (!((Class) ab[5]).getName().equals(
0442: "java.lang.ClassGenericsTest4$$Mi4$$$Mi5")
0443: || !((Class) ab[5]).getSimpleName().equals(
0444: "$Mi5"))
0445: fail("test_1, case 061 FAILED: "
0446: + ((Class) ab[1]).getName() + "|"
0447: + ((Class) ab[2]).getSimpleName());
0448: if (!((Class) ab[6]).getName().equals(
0449: "java.lang.ClassGenericsTest4$$Mi4$$Mi5")
0450: || !((Class) ab[6]).getSimpleName().equals(
0451: "Mi5"))
0452: fail("test_1, case 062 FAILED: "
0453: + ((Class) ab[2]).getName() + "|"
0454: + ((Class) ab[2]).getSimpleName());
0455: if (!((Class) ab[7]).getName().equals(
0456: "java.lang.ClassGenericsTest4$$Mi4$"))
0457: fail("test_1, case 063 FAILED: "
0458: + ((Class) ab[7]).getName());
0459:
0460: tv = (TypeVariable) at[1];
0461: if (!tv.getName().equals("T6"))
0462: fail("test_1, case 064 FAILED: " + tv.getName());
0463: ab = tv.getBounds();
0464: pt = (ParameterizedType) ab[0];
0465: if (!pt
0466: .toString()
0467: .equals(
0468: "java.lang.ClassGenericsTest4$2$Mc3$01<java.lang.ClassGenericsTest4.$Mi4<? super java.lang.Cloneable>>"))
0469: fail("test_1, case 065 FAILED: " + tv.getName());
0470:
0471: if (!((Class) ((ParameterizedType) ab[0]).getRawType())
0472: .getName()
0473: .equals("java.lang.ClassGenericsTest4$2$Mc3$01"))
0474: fail("test_1, case 066 FAILED: "
0475: + ((Class) ((ParameterizedType) ab[0])
0476: .getRawType()).getName());
0477: if (((ParameterizedType) ab[0]).getOwnerType() != null)
0478: fail("test_1, case 067 FAILED: "
0479: + ((ParameterizedType) ab[0])
0480: .getOwnerType());
0481: if (!((Class) ab[1]).getName().equals(
0482: "java.lang.ClassGenericsTest4$$Mi4$$$$$$$Mi5")
0483: || !((Class) ab[1]).getSimpleName().equals(
0484: "$$$$$Mi5"))
0485: fail("test_1, case 068 FAILED: "
0486: + ((Class) ab[1]).getName() + "|"
0487: + ((Class) ab[2]).getSimpleName());
0488:
0489: tv = (TypeVariable) at[2];
0490: if (!tv.getName().equals("T7"))
0491: fail("test_1, case 069 FAILED: " + tv.getName());
0492: ab = tv.getBounds();
0493: pt = (ParameterizedType) ab[0];
0494: if (!pt
0495: .toString()
0496: .equals(
0497: "java.lang.ClassGenericsTest4$2$Mc3$01<java.lang.ClassGenericsTest4.$Mi4<? extends java.io.Serializable>>"))
0498: fail("test_1, case 070 FAILED: " + tv.getName());
0499:
0500: if (!((Class) ((ParameterizedType) ab[0]).getRawType())
0501: .getName()
0502: .equals("java.lang.ClassGenericsTest4$2$Mc3$01"))
0503: fail("test_1, case 071 FAILED: "
0504: + ((Class) ((ParameterizedType) ab[0])
0505: .getRawType()).getName());
0506: if (((ParameterizedType) ab[0]).getOwnerType() != null)
0507: fail("test_1, case 072 FAILED: "
0508: + ((ParameterizedType) ab[0])
0509: .getOwnerType());
0510: if (!((Class) ab[1]).getName().equals(
0511: "java.lang.ClassGenericsTest4$$Mi4$$$$$$$Mi5")
0512: || !((Class) ab[1]).getSimpleName().equals(
0513: "$$$$$Mi5"))
0514: fail("test_1, case 073 FAILED: "
0515: + ((Class) ab[1]).getName() + "|"
0516: + ((Class) ab[2]).getSimpleName());
0517:
0518: at = ac[2].getGenericInterfaces();
0519:
0520: if (!((Class) at[0]).getName().equals(
0521: "java.lang.ClassGenericsTest4$$Mi4$$$$$$$Mi5")
0522: || !((Class) at[0]).getSimpleName().equals(
0523: "$$$$$Mi5"))
0524: fail("test_1, case 074 FAILED: "
0525: + ((Class) at[0]).getName() + "|"
0526: + ((Class) at[0]).getSimpleName());
0527: if (!((Class) at[1]).getName().equals(
0528: "java.lang.ClassGenericsTest4$$Mi4$$$$$$Mi5")
0529: || !((Class) at[1]).getSimpleName().equals(
0530: "$$$$Mi5"))
0531: fail("test_1, case 075 FAILED: "
0532: + ((Class) at[1]).getName() + "|"
0533: + ((Class) at[1]).getSimpleName());
0534: if (!((Class) at[2]).getName().equals(
0535: "java.lang.ClassGenericsTest4$$Mi4$$$$$Mi5")
0536: || !((Class) at[2]).getSimpleName().equals(
0537: "$$$Mi5"))
0538: fail("test_1, case 076 FAILED: "
0539: + ((Class) at[2]).getName() + "|"
0540: + ((Class) at[2]).getSimpleName());
0541: if (!((Class) at[3]).getName().equals(
0542: "java.lang.ClassGenericsTest4$$Mi4$$$$Mi5")
0543: || !((Class) at[3]).getSimpleName().equals(
0544: "$$Mi5"))
0545: fail("test_1, case 077 FAILED: "
0546: + ((Class) at[3]).getName() + "|"
0547: + ((Class) at[3]).getSimpleName());
0548: if (!((Class) at[4]).getName().equals(
0549: "java.lang.ClassGenericsTest4$$Mi4$$$Mi5")
0550: || !((Class) at[4]).getSimpleName().equals(
0551: "$Mi5"))
0552: fail("test_1, case 078 FAILED: "
0553: + ((Class) at[4]).getName() + "|"
0554: + ((Class) at[4]).getSimpleName());
0555: if (!((Class) at[5]).getName().equals(
0556: "java.lang.ClassGenericsTest4$$Mi4$$Mi5")
0557: || !((Class) at[5]).getSimpleName().equals(
0558: "Mi5"))
0559: fail("test_1, case 079 FAILED: "
0560: + ((Class) at[5]).getName() + "|"
0561: + ((Class) at[5]).getSimpleName());
0562: if (!((Class) at[6]).getName().equals(
0563: "java.lang.ClassGenericsTest4$$Mi4$"))
0564: fail("test_1, case 080 FAILED: "
0565: + ((Class) at[6]).getName());
0566: } catch (java.lang.reflect.GenericSignatureFormatError e) {
0567: System.out
0568: .println("ClassGenericsTest4.test_1.XXX_case_2 is excluded temporarily because the used compiler generates incorrect signature which leads to the case falure.");
0569: }
0570: }
0571: }
0572:
0573: public void meth(Class ac[]) {
0574: class $Mc3$01<T> {
0575: }
0576: ;
0577: class $Mc3$02<$_T3_$ extends ClassGenericsTest4> {
0578: class $Mc3$04<T5 extends $Mc3$01<$Mi4<Cloneable>> & $Mi4$.$$$$$Mi5 & $Mi4$.$$$$Mi5 & $Mi4$.$$$Mi5 & $Mi4$.$$Mi5 & $Mi4$.$Mi5 & $Mi4$.Mi5 & $Mi4$, T6 extends $Mc3$01<$Mi4<? super Cloneable>> & $Mi4$.$$$$$Mi5, T7 extends $Mc3$01<$Mi4<? extends java.io.Serializable>> & $Mi4$.$$$$$Mi5>
0579: implements $Mi4$.$$$$$Mi5, $Mi4$.$$$$Mi5,
0580: $Mi4$.$$$Mi5, $Mi4$.$$Mi5, $Mi4$.$Mi5, $Mi4$.Mi5,
0581: $Mi4$ {
0582: };
0583: }
0584: ;
0585: ac[0] = $Mc3$01.class;
0586: ac[1] = $Mc3$02.class;
0587: ac[2] = $Mc3$02.$Mc3$04.class;
0588: }
0589:
0590: /**
0591: * checks for cases when generalized classes have been loaded by another class loader
0592: */
0593: public void test_2() throws Exception {
0594: ClassLoader ld = TestResources.getLoader();
0595: Class temp = ld
0596: .loadClass("org.apache.harmony.lang.generics.TemplateSet");
0597: Class ac[] = temp.getDeclaredClasses();
0598: Type ap[];
0599: TypeVariable tv;
0600: Type ab[];
0601: Type ai[];
0602: Type aa[];
0603: Type aa2[];
0604: Type oc;
0605: WildcardType wc;
0606: Type aa3[];
0607:
0608: Class Mc003 = null;
0609: for (int i = 0; i < ac.length; i++) {
0610: if (ac[i]
0611: .getName()
0612: .equals(
0613: "org.apache.harmony.lang.generics.TemplateSet$Mc003")) {
0614: Mc003 = ac[i];
0615: }
0616: }
0617: ap = Mc003.getTypeParameters();
0618: if (ap.length != 1)
0619: fail("test_2, case 001 FAILED: " + ap.length);
0620: tv = (TypeVariable) ap[0];
0621: if (!tv.getName().equals("T4"))
0622: fail("test_2, case 002 FAILED: " + tv.getName());
0623: if (!((Class) tv.getGenericDeclaration()).getName().equals(
0624: "org.apache.harmony.lang.generics.TemplateSet$Mc003"))
0625: fail("test_2, case 003 FAILED: "
0626: + ((Class) tv.getGenericDeclaration()).getName());
0627: ab = tv.getBounds();
0628: if (!((Class) ab[0]).getName().equals("java.lang.Thread"))
0629: fail("test_2, case 004 FAILED: "
0630: + ((Class) ab[0]).getName());
0631: if (!((Class) ab[1]).getName().equals("java.io.Serializable"))
0632: fail("test_2, case 005 FAILED: "
0633: + ((Class) ab[1]).getName());
0634: if (!((Class) ab[2]).getName().equals("java.lang.Cloneable"))
0635: fail("test_2, case 006 FAILED: "
0636: + ((Class) ab[2]).getName());
0637: //////////////////////////////////////////////////////////////////////////////////////////////
0638: ai = Mc003.getGenericInterfaces();
0639: if (ai.length != 3)
0640: fail("test_2, case 007 FAILED: " + ai.length);
0641: if (!((Class) ((ParameterizedType) ai[0]).getRawType())
0642: .getName()
0643: .equals(
0644: "org.apache.harmony.lang.generics.TemplateSet$MI002"))
0645: fail("test_2, case 008 FAILED: "
0646: + ((Class) ((ParameterizedType) ai[0]).getRawType())
0647: .getName());
0648: if (!((Class) ((ParameterizedType) ai[0]).getOwnerType())
0649: .getName().equals(
0650: "org.apache.harmony.lang.generics.TemplateSet"))
0651: fail("test_2, case 009 FAILED: "
0652: + ((Class) ((ParameterizedType) ai[0])
0653: .getOwnerType()).getName());
0654: aa = ((ParameterizedType) ai[0]).getActualTypeArguments();
0655: if (aa.length != 1)
0656: fail("test_2, case 010 FAILED: " + aa.length);
0657: if (!((Class) ((ParameterizedType) aa[0]).getRawType())
0658: .getName()
0659: .equals(
0660: "org.apache.harmony.lang.generics.TemplateSet$MI003"))
0661: fail("test_2, case 011 FAILED: "
0662: + ((Class) ((ParameterizedType) aa[0]).getRawType())
0663: .getName());
0664: if (!((Class) ((ParameterizedType) aa[0]).getOwnerType())
0665: .getName().equals(
0666: "org.apache.harmony.lang.generics.TemplateSet"))
0667: fail("test_2, case 012 FAILED: "
0668: + ((Class) ((ParameterizedType) aa[0])
0669: .getOwnerType()).getName());
0670: aa2 = ((ParameterizedType) aa[0]).getActualTypeArguments(); //java.io.Serializable
0671: if (aa2.length != 1)
0672: fail("test_2, case 013 FAILED: " + aa.length);
0673: if (!((Class) aa2[0]).getName().equals("java.io.Serializable"))
0674: fail("test_2, case 014 FAILED: "
0675: + ((Class) ((ParameterizedType) aa2[0])
0676: .getRawType()).getName());
0677:
0678: if (!((Class) ((ParameterizedType) ai[1]).getRawType())
0679: .getName()
0680: .equals(
0681: "org.apache.harmony.lang.generics.TemplateSet$MI003"))
0682: fail("test_2, case 015 FAILED: "
0683: + ((Class) ((ParameterizedType) ai[1]).getRawType())
0684: .getName());
0685: if (!((Class) ((ParameterizedType) ai[1]).getOwnerType())
0686: .getName().equals(
0687: "org.apache.harmony.lang.generics.TemplateSet"))
0688: fail("test_2, case 016 FAILED: "
0689: + ((Class) ((ParameterizedType) ai[1])
0690: .getOwnerType()).getName());
0691: aa = ((ParameterizedType) ai[1]).getActualTypeArguments();
0692: if (aa.length != 1)
0693: fail("test_2, case 017 FAILED: " + aa.length);
0694: if (!((Class) ((ParameterizedType) aa[0]).getRawType())
0695: .getName()
0696: .equals(
0697: "org.apache.harmony.lang.generics.TemplateSet$MI003"))
0698: fail("test_2, case 018 FAILED: "
0699: + ((Class) ((ParameterizedType) aa[0]).getRawType())
0700: .getName());
0701: if (!((Class) ((ParameterizedType) aa[0]).getOwnerType())
0702: .getName().equals(
0703: "org.apache.harmony.lang.generics.TemplateSet"))
0704: fail("test_2, case 019 FAILED: "
0705: + ((Class) ((ParameterizedType) aa[0])
0706: .getOwnerType()).getName());
0707: aa2 = ((ParameterizedType) aa[0]).getActualTypeArguments(); //java.lang.Cloneable
0708: if (aa2.length != 1)
0709: fail("test_2, case 020 FAILED: " + aa.length);
0710: if (!((Class) aa2[0]).getName().equals("java.lang.Cloneable"))
0711: fail("test_2, case 021 FAILED: "
0712: + ((Class) ((ParameterizedType) aa2[0])
0713: .getRawType()).getName());
0714:
0715: if (!((Class) ((ParameterizedType) ai[2]).getRawType())
0716: .getName()
0717: .equals(
0718: "org.apache.harmony.lang.generics.TemplateSet$MI004$MI005"))
0719: fail("test_2, case 022 FAILED: "
0720: + ((Class) ((ParameterizedType) ai[2]).getRawType())
0721: .getName());
0722: if (!((Class) ((ParameterizedType) ai[2]).getOwnerType())
0723: .getName()
0724: .equals(
0725: "org.apache.harmony.lang.generics.TemplateSet$MI004"))
0726: fail("test_2, case 023 FAILED: "
0727: + ((Class) ((ParameterizedType) ai[2])
0728: .getOwnerType()).getName());
0729: aa = ((ParameterizedType) ai[2]).getActualTypeArguments();
0730: if (aa.length != 2)
0731: fail("test_2, case 002 FAILED: " + aa.length);
0732: if (!((Class) aa[0]).getName().equals("java.lang.reflect.Type"))
0733: fail("test_2, case 024 FAILED: "
0734: + ((Class) ((ParameterizedType) aa[0]).getRawType())
0735: .getName());
0736: if (!((Class) aa[1]).getName().equals("java.lang.reflect.Type"))
0737: fail("test_2, case 025 FAILED: "
0738: + ((Class) ((ParameterizedType) aa[1]).getRawType())
0739: .getName());
0740:
0741: //////////////////////////////////////////////////////////////////////////////////////////////
0742: if (!(Mc003.getGenericSuperclass() instanceof java.lang.reflect.ParameterizedType))
0743: fail("test_2, case 026 FAILED: "
0744: + Mc003.getGenericSuperclass());
0745: if (!((Class) ((ParameterizedType) Mc003.getGenericSuperclass())
0746: .getRawType()).getSimpleName().equals("Mc002"))
0747: fail("test_2, case 027 FAILED: "
0748: + Mc003.getGenericSuperclass());
0749: if (!((Class) ((ParameterizedType) Mc003.getGenericSuperclass())
0750: .getRawType()).getAnnotations()[0].annotationType()
0751: .getSimpleName().equals("igt"))
0752: fail("test_2, case 028 FAILED: "
0753: + ((Class) ((ParameterizedType) Mc003
0754: .getGenericSuperclass()).getRawType())
0755: .getAnnotations()[0].annotationType()
0756: .getSimpleName());
0757: aa = ((ParameterizedType) Mc003.getGenericSuperclass())
0758: .getActualTypeArguments();
0759: if (aa.length != 1)
0760: fail("test_2, case 029 FAILED: " + aa.length);
0761: if (!((Class) aa[0]).getName().equals(
0762: "org.apache.harmony.lang.generics.TemplateSet"))
0763: fail("test_2, case 030 FAILED: "
0764: + ((Class) aa[0]).getName());
0765: oc = ((ParameterizedType) Mc003.getGenericSuperclass())
0766: .getOwnerType();
0767: if (!((Class) ((ParameterizedType) oc).getRawType()).getName()
0768: .equals("org.apache.harmony.lang.generics.TemplateSet"))
0769: fail("test_2, case 031 FAILED: "
0770: + Mc003.getGenericSuperclass());
0771: if (((ParameterizedType) oc).getOwnerType() != null)
0772: fail("test_2, case 032 FAILED: "
0773: + ((ParameterizedType) oc).getOwnerType());
0774: aa = ((ParameterizedType) oc).getActualTypeArguments();
0775: if (aa.length != 1)
0776: fail("test_2, case 033 FAILED: " + aa.length);
0777: wc = (WildcardType) aa[0];
0778: aa3 = wc.getLowerBounds();
0779: if (aa3.length != 1)
0780: fail("test_2, case 034 FAILED: " + aa3.length);
0781: if (!((Class) aa3[0]).equals(Class.class))
0782: fail("test_2, case 035 FAILED: " + ((Class) aa3[0]));
0783: aa3 = wc.getUpperBounds();
0784: if (aa3.length != 1)
0785: fail("test_2, case 036 FAILED: " + aa3.length);
0786: if (!((Class) aa3[0]).equals(Object.class))
0787: fail("test_2, case 037 FAILED: " + ((Class) aa3[0]));
0788: ////////////////////////////////////////////////////////////////////////////////////////////////////
0789: ////////////////////////////////////////////////////////////////////////////////////////////////////
0790: ////////////////////////////////////////////////////////////////////////////////////////////////////
0791: Class Mc007\u0391 = null;
0792: for (int i = 0; i < ac.length; i++) {
0793: if (ac[i]
0794: .getName()
0795: .equals(
0796: "org.apache.harmony.lang.generics.TemplateSet$Mc007\u0391")) {
0797: Mc007\u0391 = ac[i];
0798: }
0799: }
0800: ap = Mc007\u0391.getTypeParameters();
0801: if (ap.length != 1)
0802: fail("test_2, case 038 FAILED: " + ap.length);
0803: tv = (TypeVariable) ap[0];
0804: if (!tv.getName().equals("T7"))
0805: fail("test_2, case 039 FAILED: " + tv.getName());
0806: if (!((Class) tv.getGenericDeclaration())
0807: .getName()
0808: .equals(
0809: "org.apache.harmony.lang.generics.TemplateSet$Mc007\u0391"))
0810: fail("test_2, case 040 FAILED: "
0811: + ((Class) tv.getGenericDeclaration()).getName());
0812: ab = tv.getBounds();
0813: if (!((Class) ab[0]).getName().equals("java.lang.Thread"))
0814: fail("test_2, case 041 FAILED: "
0815: + ((Class) ab[0]).getName());
0816: if (!((Class) ab[1]).getName().equals("java.io.Serializable"))
0817: fail("test_2, case 042 FAILED: "
0818: + ((Class) ab[1]).getName());
0819: if (!((Class) ab[2]).getName().equals("java.lang.Cloneable"))
0820: fail("test_2, case 043 FAILED: "
0821: + ((Class) ab[2]).getName());
0822: //////////////////////////////////////////////////////////////////////////////////////////////
0823: ai = Mc007\u0391.getGenericInterfaces();
0824: if (ai.length != 0)
0825: fail("test_2, case 001 FAILED: " + ap.length);
0826: //////////////////////////////////////////////////////////////////////////////////////////////
0827: if (!(Mc007\u0391.getGenericSuperclass() instanceof java.lang.Object))
0828: fail("test_2, case 044 FAILED: "
0829: + Mc007\u0391.getGenericSuperclass());
0830: ////////////////////////////////////////////////////////////////////////////////////////////////////
0831: ////////////////////////////////////////////////////////////////////////////////////////////////////
0832: ////////////////////////////////////////////////////////////////////////////////////////////////////
0833: Class Mc008\u0576\u06C0\u06F10 = null;
0834: for (int i = 0; i < ac.length; i++) {
0835: if (ac[i]
0836: .getName()
0837: .equals(
0838: "org.apache.harmony.lang.generics.TemplateSet$Mc008\u0576\u06C0\u06F10")) {
0839: Mc008\u0576\u06C0\u06F10 = ac[i];
0840: }
0841: }
0842: ap = Mc008\u0576\u06C0\u06F10.getTypeParameters();
0843: if (ap.length != 1)
0844: fail("test_2, case 045 FAILED: " + ap.length);
0845: tv = (TypeVariable) ap[0];
0846: if (!tv.getName().equals("T8"))
0847: fail("test_2, case 046 FAILED: " + tv.getName());
0848: if (!((Class) tv.getGenericDeclaration())
0849: .getName()
0850: .equals(
0851: "org.apache.harmony.lang.generics.TemplateSet$Mc008\u0576\u06C0\u06F10"))
0852: fail("test_2, case 047 FAILED: "
0853: + ((Class) tv.getGenericDeclaration()).getName());
0854: ab = tv.getBounds();
0855: if (!((Class) ab[0])
0856: .getName()
0857: .equals(
0858: "org.apache.harmony.lang.generics.TemplateSet$Mc007\u0391"))
0859: fail("test_2, case 048 FAILED: "
0860: + ((Class) ab[0]).getName());
0861: if (!((Class) ab[1]).getName().equals("java.io.Serializable"))
0862: fail("test_2, case 049 FAILED: "
0863: + ((Class) ab[1]).getName());
0864: if (!((Class) ab[2]).getName().equals("java.lang.Cloneable"))
0865: fail("test_2, case 050 FAILED: "
0866: + ((Class) ab[2]).getName());
0867: //////////////////////////////////////////////////////////////////////////////////////////////
0868: ai = Mc008\u0576\u06C0\u06F10.getGenericInterfaces();
0869: if (ai.length != 3)
0870: fail("test_2, case 051 FAILED: " + ai.length);
0871: if (!((Class) ((ParameterizedType) ai[0]).getRawType())
0872: .getName()
0873: .equals(
0874: "org.apache.harmony.lang.generics.TemplateSet$MI002"))
0875: fail("test_2, case 052 FAILED: "
0876: + ((Class) ((ParameterizedType) ai[0]).getRawType())
0877: .getName());
0878: if (!((Class) ((ParameterizedType) ai[0]).getOwnerType())
0879: .getName().equals(
0880: "org.apache.harmony.lang.generics.TemplateSet"))
0881: fail("test_2, case 053 FAILED: "
0882: + ((Class) ((ParameterizedType) ai[0])
0883: .getOwnerType()).getName());
0884: aa = ((ParameterizedType) ai[0]).getActualTypeArguments();
0885: if (aa.length != 1)
0886: fail("test_2, case 054 FAILED: " + aa.length);
0887: if (!((Class) ((ParameterizedType) aa[0]).getRawType())
0888: .getName()
0889: .equals(
0890: "org.apache.harmony.lang.generics.TemplateSet$MI003"))
0891: fail("test_2, case 055 FAILED: "
0892: + ((Class) ((ParameterizedType) aa[0]).getRawType())
0893: .getName());
0894: if (!((Class) ((ParameterizedType) aa[0]).getOwnerType())
0895: .getName().equals(
0896: "org.apache.harmony.lang.generics.TemplateSet"))
0897: fail("test_2, case 056 FAILED: "
0898: + ((Class) ((ParameterizedType) aa[0])
0899: .getOwnerType()).getName());
0900: aa2 = ((ParameterizedType) aa[0]).getActualTypeArguments(); //java.io.Serializable
0901: if (aa2.length != 1)
0902: fail("test_2, case 057 FAILED: " + aa.length);
0903: if (!((Class) aa2[0]).getName().equals("java.io.Serializable"))
0904: fail("test_2, case 058 FAILED: "
0905: + ((Class) ((ParameterizedType) aa2[0])
0906: .getRawType()).getName());
0907:
0908: if (!((Class) ((ParameterizedType) ai[1]).getRawType())
0909: .getName()
0910: .equals(
0911: "org.apache.harmony.lang.generics.TemplateSet$MI003"))
0912: fail("test_2, case 059 FAILED: "
0913: + ((Class) ((ParameterizedType) ai[1]).getRawType())
0914: .getName());
0915: if (!((Class) ((ParameterizedType) ai[1]).getOwnerType())
0916: .getName().equals(
0917: "org.apache.harmony.lang.generics.TemplateSet"))
0918: fail("test_2, case 060 FAILED: "
0919: + ((Class) ((ParameterizedType) ai[1])
0920: .getOwnerType()).getName());
0921: aa = ((ParameterizedType) ai[1]).getActualTypeArguments();
0922: if (aa.length != 1)
0923: fail("test_2, case 061 FAILED: " + aa.length);
0924: if (!((Class) ((ParameterizedType) aa[0]).getRawType())
0925: .getName()
0926: .equals(
0927: "org.apache.harmony.lang.generics.TemplateSet$MI003"))
0928: fail("test_2, case 062 FAILED: "
0929: + ((Class) ((ParameterizedType) aa[0]).getRawType())
0930: .getName());
0931: if (!((Class) ((ParameterizedType) aa[0]).getOwnerType())
0932: .getName().equals(
0933: "org.apache.harmony.lang.generics.TemplateSet"))
0934: fail("test_2, case 063 FAILED: "
0935: + ((Class) ((ParameterizedType) aa[0])
0936: .getOwnerType()).getName());
0937: aa2 = ((ParameterizedType) aa[0]).getActualTypeArguments(); //java.lang.Cloneable
0938: if (aa2.length != 1)
0939: fail("test_2, case 064 FAILED: " + aa.length);
0940: if (!((Class) aa2[0]).getName().equals("java.lang.Cloneable"))
0941: fail("test_2, case 065 FAILED: "
0942: + ((Class) ((ParameterizedType) aa2[0])
0943: .getRawType()).getName());
0944:
0945: if (!((Class) ((ParameterizedType) ai[2]).getRawType())
0946: .getName()
0947: .equals(
0948: "org.apache.harmony.lang.generics.TemplateSet$MI004$MI005"))
0949: fail("test_2, case 066 FAILED: "
0950: + ((Class) ((ParameterizedType) ai[2]).getRawType())
0951: .getName());
0952: if (!((Class) ((ParameterizedType) ai[2]).getOwnerType())
0953: .getName()
0954: .equals(
0955: "org.apache.harmony.lang.generics.TemplateSet$MI004"))
0956: fail("test_2, case 067 FAILED: "
0957: + ((Class) ((ParameterizedType) ai[2])
0958: .getOwnerType()).getName());
0959: aa = ((ParameterizedType) ai[2]).getActualTypeArguments();
0960: if (aa.length != 2)
0961: fail("test_2, case 068 FAILED: " + aa.length);
0962: if (!((Class) aa[0])
0963: .getName()
0964: .equals(
0965: "org.apache.harmony.lang.generics.TemplateSet$Mc007\u0391"))
0966: fail("test_2, case 069 FAILED: "
0967: + ((Class) ((ParameterizedType) aa[0]).getRawType())
0968: .getName());
0969: if (!((Class) aa[1]).getName().equals("java.lang.reflect.Type"))
0970: fail("test_2, case 070 FAILED: "
0971: + ((Class) ((ParameterizedType) aa[1]).getRawType())
0972: .getName());
0973:
0974: //////////////////////////////////////////////////////////////////////////////////////////////
0975: if (!(Mc008\u0576\u06C0\u06F10.getGenericSuperclass() instanceof java.lang.reflect.ParameterizedType))
0976: fail("test_2, case 071 FAILED: "
0977: + Mc008\u0576\u06C0\u06F10.getGenericSuperclass());
0978: if (!((Class) ((ParameterizedType) Mc008\u0576\u06C0\u06F10
0979: .getGenericSuperclass()).getRawType()).getSimpleName()
0980: .equals("Mc002"))
0981: fail("test_2, case 072 FAILED: "
0982: + ((Class) ((ParameterizedType) Mc008\u0576\u06C0\u06F10
0983: .getGenericSuperclass()).getRawType()));
0984: if (!((Class) ((ParameterizedType) Mc008\u0576\u06C0\u06F10
0985: .getGenericSuperclass()).getRawType()).getAnnotations()[0]
0986: .annotationType().getSimpleName().equals("igt"))
0987: fail("test_2, case 073 FAILED: "
0988: + ((Class) ((ParameterizedType) Mc008\u0576\u06C0\u06F10
0989: .getGenericSuperclass()).getRawType())
0990: .getAnnotations()[0].annotationType()
0991: .getSimpleName());
0992: aa = ((ParameterizedType) Mc008\u0576\u06C0\u06F10
0993: .getGenericSuperclass()).getActualTypeArguments();
0994: if (aa.length != 1)
0995: fail("test_2, case 074 FAILED: " + aa.length);
0996: if (!((Class) aa[0]).getName().equals(
0997: "org.apache.harmony.lang.generics.TemplateSet"))
0998: fail("test_2, case 075 FAILED: "
0999: + ((Class) ((ParameterizedType) aa[0]).getRawType())
1000: .getName());
1001: oc = ((ParameterizedType) Mc008\u0576\u06C0\u06F10
1002: .getGenericSuperclass()).getOwnerType();
1003: if (!((Class) ((ParameterizedType) oc).getRawType()).getName()
1004: .equals("org.apache.harmony.lang.generics.TemplateSet"))
1005: fail("test_2, case 076 FAILED: "
1006: + ((Class) ((ParameterizedType) oc).getRawType())
1007: .getName());
1008: if (((ParameterizedType) oc).getOwnerType() != null)
1009: fail("test_2, case 077 FAILED: "
1010: + ((ParameterizedType) oc).getOwnerType());
1011: aa = ((ParameterizedType) oc).getActualTypeArguments();
1012: if (aa.length != 1)
1013: fail("test_2, case 078 FAILED: " + aa.length);
1014: wc = (WildcardType) aa[0];
1015: aa3 = wc.getLowerBounds();
1016: if (aa3.length != 1)
1017: fail("test_2, case 079 FAILED: " + aa3.length);
1018: if (!((Class) aa3[0]).equals(Mc007\u0391))
1019: fail("test_2, case 080 FAILED: " + ((Class) aa3[0]));
1020: aa3 = wc.getUpperBounds();
1021: if (aa3.length != 1)
1022: fail("test_2, case 081 FAILED: " + aa3.length);
1023: if (!((Class) aa3[0]).equals(Object.class))
1024: fail("test_2, case 082 FAILED: " + ((Class) aa3[0]));
1025: ////////////////////////////////////////////////////////////////////////////////////////////////////
1026: ////////////////////////////////////////////////////////////////////////////////////////////////////
1027: ////////////////////////////////////////////////////////////////////////////////////////////////////
1028: Class MC011\u0576\u06C0\u06F10 = null;
1029: for (int i = 0; i < ac.length; i++) {
1030: if (ac[i]
1031: .getName()
1032: .equals(
1033: "org.apache.harmony.lang.generics.TemplateSet$MC011\u0576\u06C0\u06F10")) {
1034: MC011\u0576\u06C0\u06F10 = ac[i];
1035: }
1036: }
1037: ap = MC011\u0576\u06C0\u06F10.getTypeParameters();
1038: if (ap.length != 0)
1039: fail("test_2, case 083 FAILED: " + ap.length);
1040: //////////////////////////////////////////////////////////////////////////////////////////////
1041: ai = MC011\u0576\u06C0\u06F10.getGenericInterfaces();
1042: if (ai.length != 1)
1043: fail("test_2, case 084 FAILED: " + ai.length);
1044: if (!((Class) ai[0])
1045: .getName()
1046: .equals(
1047: "org.apache.harmony.lang.generics.TemplateSet$MI010\u0576\u06C0\u06F10"))
1048: fail("test_2, case 085 FAILED: "
1049: + ((Class) ai[0]).getName());
1050: //////////////////////////////////////////////////////////////////////////////////////////////
1051: if (!((Class) MC011\u0576\u06C0\u06F10.getGenericSuperclass())
1052: .getName()
1053: .equals(
1054: "org.apache.harmony.lang.generics.TemplateSet$Mc010\u0576\u06C0\u06F10"))
1055: fail("test_2, case 086 FAILED: "
1056: + ((Class) Mc008\u0576\u06C0\u06F10
1057: .getGenericSuperclass()).getName());
1058: }
1059:
1060: /**
1061: * spoiled signature
1062: */
1063: public void test_3() throws Exception {
1064:
1065: final String RESOURCE_PATH = "test.resource.path";
1066: ClassLoader ld = TestResources.getLoader();
1067:
1068: String path = System.getProperty(RESOURCE_PATH);
1069:
1070: /*
1071: * package org.apache.harmony.lang.generics;
1072: * import java.lang.reflect.TypeVariable;
1073: * public class BadSignatureTemplate<$X$> {
1074: *
1075: * public TypeVariable[] test_1() throws Exception {
1076: * class $Mc3$01<T> {};
1077: * class $Mc3$02<$_T3_$ extends Class> {
1078: * class $Mc3$04<T5 extends $Mc3$01<Cloneable>> {
1079: * };
1080: * };
1081: * return $Mc3$02.$Mc3$04.class.getTypeParameters();
1082: * }
1083: * }
1084: */
1085: /*
1086: * package org.apache.harmony.lang.generics;
1087: * import junit.framework.TestCase;
1088: * public class BadSignatureTemplate<$X$> extends TestCase {
1089: * public void test_1() throws Exception {
1090: * class $Mc3$01<T> {};
1091: * class $Mc3$02<$_T3_$ extends Class> {
1092: * class $Mc3$04<T5 extends $Mc3$01<Cloneable>> {
1093: * };
1094: * };
1095: * $Mc3$02.$Mc3$04.class.getTypeParameters();
1096: * }
1097: * }
1098: */
1099: byte BadSignatureTemplate[] = {
1100: /**/
1101: -54, -2, -70, -66, 0, 0, 0, 49, 0, 32, 10, 0, 5, 0, 18, 7, 0,
1102: 20, 10, 0, 24, 0, 25, 7, 0, 26, 7, 0, 27, 1, 0, 6, 60,
1103: 105, 110, 105, 116, 62, 1, 0, 3, 40, 41, 86, 1, 0, 4,
1104: 67, 111, 100, 101, 1, 0, 15, 76, 105, 110, 101, 78,
1105: 117, 109, 98, 101, 114, 84, 97, 98, 108, 101, 1, 0, 6,
1106: 116, 101, 115, 116, 95, 49, 1, 0, 35, 40, 41, 91, 76,
1107: 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 114, 101,
1108: 102, 108, 101, 99, 116, 47, 84, 121, 112, 101, 86, 97,
1109: 114, 105, 97, 98, 108, 101, 59, 1, 0, 10, 69, 120, 99,
1110: 101, 112, 116, 105, 111, 110, 115, 7, 0, 28, 1, 0, 9,
1111: 83, 105, 103, 110, 97, 116, 117, 114, 101, 1, 0, 42,
1112: 60, 36, 88, 36, 58, 76, 106, 97, 118, 97, 47, 108, 97,
1113: 110, 103, 47, 79, 98, 106, 101, 99, 116, 59, 62, 76,
1114: 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 79, 98,
1115: 106, 101, 99, 116, 59, 1, 0, 10, 83, 111, 117, 114, 99,
1116: 101, 70, 105, 108, 101, 1, 0, 25, 66, 97, 100, 83, 105,
1117: 103, 110, 97, 116, 117, 114, 101, 84, 101, 109, 112,
1118: 108, 97, 116, 101, 46, 106, 97, 118, 97, 12, 0, 6, 0,
1119: 7, 7, 0, 29, 1, 0, 70, 111, 114, 103, 47, 97, 112, 97,
1120: 99, 104, 101, 47, 104, 97, 114, 109, 111, 110, 121, 47,
1121: 108, 97, 110, 103, 47, 103, 101, 110, 101, 114, 105,
1122: 99, 115, 47, 66, 97, 100, 83, 105, 103, 110, 97, 116,
1123: 117, 114, 101, 84, 101, 109, 112, 108, 97, 116, 101,
1124: 36, 49, 36, 77, 99, 51, 36, 48, 50, 36, 36, 77, 99, 51,
1125: 36, 48, 52, 1, 0, 7, 36, 77, 99, 51, 36, 48, 50, 1, 0,
1126: 12, 73, 110, 110, 101, 114, 67, 108, 97, 115, 115, 101,
1127: 115, 1, 0, 7, 36, 77, 99, 51, 36, 48, 52, 7, 0, 30, 12,
1128: 0, 31, 0, 11, 1, 0, 53, 111, 114, 103, 47, 97, 112, 97,
1129: 99, 104, 101, 47, 104, 97, 114, 109, 111, 110, 121, 47,
1130: 108, 97, 110, 103, 47, 103, 101, 110, 101, 114, 105,
1131: 99, 115, 47, 66, 97, 100, 83, 105, 103, 110, 97, 116,
1132: 117, 114, 101, 84, 101, 109, 112, 108, 97, 116, 101, 1,
1133: 0, 16, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 79,
1134: 98, 106, 101, 99, 116, 1, 0, 19, 106, 97, 118, 97, 47,
1135: 108, 97, 110, 103, 47, 69, 120, 99, 101, 112, 116, 105,
1136: 111, 110, 1, 0, 62, 111, 114, 103, 47, 97, 112, 97, 99,
1137: 104, 101, 47, 104, 97, 114, 109, 111, 110, 121, 47,
1138: 108, 97, 110, 103, 47, 103, 101, 110, 101, 114, 105,
1139: 99, 115, 47, 66, 97, 100, 83, 105, 103, 110, 97, 116,
1140: 117, 114, 101, 84, 101, 109, 112, 108, 97, 116, 101,
1141: 36, 49, 36, 77, 99, 51, 36, 48, 50, 1, 0, 15, 106, 97,
1142: 118, 97, 47, 108, 97, 110, 103, 47, 67, 108, 97, 115,
1143: 115, 1, 0, 17, 103, 101, 116, 84, 121, 112, 101, 80,
1144: 97, 114, 97, 109, 101, 116, 101, 114, 115, 0, 33, 0, 4,
1145: 0, 5, 0, 0, 0, 0, 0, 2, 0, 1, 0, 6, 0, 7, 0, 1, 0, 8,
1146: 0, 0, 0, 29, 0, 1, 0, 1, 0, 0, 0, 5, 42, -73, 0, 1,
1147: -79, 0, 0, 0, 1, 0, 9, 0, 0, 0, 6, 0, 1, 0, 0, 0, 5, 0,
1148: 1, 0, 10, 0, 11, 0, 2, 0, 8, 0, 0, 0, 31, 0, 1, 0, 1,
1149: 0, 0, 0, 7, 19, 0, 2, -74, 0, 3, -80, 0, 0, 0, 1, 0, 9,
1150: 0, 0, 0, 6, 0, 1, 0, 0, 0, 13, 0, 12, 0, 0, 0, 4, 0, 1,
1151: 0, 13, 0, 3, 0, 14, 0, 0, 0, 2, 0, 15, 0, 16, 0, 0, 0,
1152: 2, 0, 17, 0, 22, 0, 0, 0, 18, 0, 2, 0, 19, 0, 0, 0, 21,
1153: 0, 0, 0, 2, 0, 19, 0, 23, 0, 0,
1154: /**/
1155: /*
1156: -54,-2,-70,-66,0,0,0,49,0,32,10,0,5,0,17,7,0,19,10,0,23,0,24,7,0,
1157: 25,7,0,26,1,0,6,60,105,110,105,116,62,1,0,3,40,41,86,1,0,4,67,111,100,
1158: 101,1,0,15,76,105,110,101,78,117,109,98,101,114,84,97,98,108,101,1,0,6,116,101,115,
1159: 116,95,49,1,0,10,69,120,99,101,112,116,105,111,110,115,7,0,27,1,0,9,83,105,103,
1160: 110,97,116,117,114,101,1,0,50,60,36,88,36,58,76,106,97,118,97,47,108,97,110,103,47,
1161: 79,98,106,101,99,116,59,62,76,106,117,110,105,116,47,102,114,97,109,101,119,111,114,107,47,
1162: 84,101,115,116,67,97,115,101,59,1,0,10,83,111,117,114,99,101,70,105,108,101,1,0,25,
1163: 66,97,100,83,105,103,110,97,116,117,114,101,84,101,109,112,108,97,116,101,46,106,97,118,97,
1164: 12,0,6,0,7,7,0,28,1,0,70,111,114,103,47,97,112,97,99,104,101,47,104,97,114,
1165: 109,111,110,121,47,108,97,110,103,47,103,101,110,101,114,105,99,115,47,66,97,100,83,105,103,
1166: 110,97,116,117,114,101,84,101,109,112,108,97,116,101,36,49,36,77,99,51,36,48,50,36,36,
1167: 77,99,51,36,48,52,1,0,7,36,77,99,51,36,48,50,1,0,12,73,110,110,101,114,67,
1168: 108,97,115,115,101,115,1,0,7,36,77,99,51,36,48,52,7,0,29,12,0,30,0,31,1,
1169: 0,53,111,114,103,47,97,112,97,99,104,101,47,104,97,114,109,111,110,121,47,108,97,110,103,
1170: 47,103,101,110,101,114,105,99,115,47,66,97,100,83,105,103,110,97,116,117,114,101,84,101,109,
1171: 112,108,97,116,101,1,0,24,106,117,110,105,116,47,102,114,97,109,101,119,111,114,107,47,84,
1172: 101,115,116,67,97,115,101,1,0,19,106,97,118,97,47,108,97,110,103,47,69,120,99,101,112,
1173: 116,105,111,110,1,0,62,111,114,103,47,97,112,97,99,104,101,47,104,97,114,109,111,110,121,
1174: 47,108,97,110,103,47,103,101,110,101,114,105,99,115,47,66,97,100,83,105,103,110,97,116,117,
1175: 114,101,84,101,109,112,108,97,116,101,36,49,36,77,99,51,36,48,50,1,0,15,106,97,118,
1176: 97,47,108,97,110,103,47,67,108,97,115,115,1,0,17,103,101,116,84,121,112,101,80,97,114,
1177: 97,109,101,116,101,114,115,1,0,35,40,41,91,76,106,97,118,97,47,108,97,110,103,47,114,
1178: 101,102,108,101,99,116,47,84,121,112,101,86,97,114,105,97,98,108,101,59,0,33,0,4,0,
1179: 5,0,0,0,0,0,2,0,1,0,6,0,7,0,1,0,8,0,0,0,29,0,1,0,1,
1180: 0,0,0,5,42,-73,0,1,-79,0,0,0,1,0,9,0,0,0,6,0,1,0,0,0,6,
1181: 0,1,0,10,0,7,0,2,0,8,0,0,0,36,0,1,0,1,0,0,0,8,19,0,2,
1182: -74,0,3,87,-79,0,0,0,1,0,9,0,0,0,10,0,2,0,0,0,16,0,7,0,17,
1183: 0,11,0,0,0,4,0,1,0,12,0,3,0,13,0,0,0,2,0,14,0,15,0,0,0,
1184: 2,0,16,0,21,0,0,0,18,0,2,0,18,0,0,0,20,0,0,0,2,0,18,0,22,
1185: 0,0,
1186: */
1187: };
1188:
1189: byte BadSignatureTemplate$1$Mc3$02[] = {
1190: /*
1191: -54,-2,-70,-66,0,0,0,49,0,31,9,0,3,0,22,10,0,4,0,23,7,0,24,7,0,
1192: 25,1,0,7,36,77,99,51,36,48,50,1,0,12,73,110,110,101,114,67,108,97,115,115,101,
1193: 115,7,0,26,1,0,7,36,77,99,51,36,48,52,1,0,6,116,104,105,115,36,48,1,0,
1194: 55,76,111,114,103,47,97,112,97,99,104,101,47,104,97,114,109,111,110,121,47,108,97,110,103,
1195: 47,103,101,110,101,114,105,99,115,47,66,97,100,83,105,103,110,97,116,117,114,101,84,101,109,
1196: 112,108,97,116,101,59,1,0,6,60,105,110,105,116,62,1,0,58,40,76,111,114,103,47,97,
1197: 112,97,99,104,101,47,104,97,114,109,111,110,121,47,108,97,110,103,47,103,101,110,101,114,105,
1198: 99,115,47,66,97,100,83,105,103,110,97,116,117,114,101,84,101,109,112,108,97,116,101,59,41,
1199: 86,1,0,4,67,111,100,101,1,0,15,76,105,110,101,78,117,109,98,101,114,84,97,98,108,
1200: 101,1,0,9,83,105,103,110,97,116,117,114,101,1,0,44,60,36,95,84,51,95,36,58,76,
1201: 106,97,118,97,47,108,97,110,103,47,67,108,97,115,115,59,62,76,106,97,118,97,47,108,97,
1202: 110,103,47,79,98,106,101,99,116,59,1,0,10,83,111,117,114,99,101,70,105,108,101,1,0,
1203: 25,66,97,100,83,105,103,110,97,116,117,114,101,84,101,109,112,108,97,116,101,46,106,97,118,
1204: 97,1,0,15,69,110,99,108,111,115,105,110,103,77,101,116,104,111,100,7,0,27,12,0,28,
1205: 0,29,12,0,9,0,10,12,0,11,0,30,1,0,62,111,114,103,47,97,112,97,99,104,101,
1206: 47,104,97,114,109,111,110,121,47,108,97,110,103,47,103,101,110,101,114,105,99,115,47,66,97,
1207: 100,83,105,103,110,97,116,117,114,101,84,101,109,112,108,97,116,101,36,49,36,77,99,51,36,
1208: 48,50,1,0,16,106,97,118,97,47,108,97,110,103,47,79,98,106,101,99,116,1,0,70,111,
1209: 114,103,47,97,112,97,99,104,101,47,104,97,114,109,111,110,121,47,108,97,110,103,47,103,101,
1210: 110,101,114,105,99,115,47,66,97,100,83,105,103,110,97,116,117,114,101,84,101,109,112,108,97,
1211: 116,101,36,49,36,77,99,51,36,48,50,36,36,77,99,51,36,48,52,1,0,53,111,114,103,
1212: 47,97,112,97,99,104,101,47,104,97,114,109,111,110,121,47,108,97,110,103,47,103,101,110,101,
1213: 114,105,99,115,47,66,97,100,83,105,103,110,97,116,117,114,101,84,101,109,112,108,97,116,101,
1214: 1,0,6,116,101,115,116,95,49,1,0,35,40,41,91,76,106,97,118,97,47,108,97,110,103,
1215: 47,114,101,102,108,101,99,116,47,84,121,112,101,86,97,114,105,97,98,108,101,59,1,0,3,
1216: 40,41,86,0,32,0,3,0,4,0,0,0,1,16,16,0,9,0,10,0,0,0,1,0,0,
1217: 0,11,0,12,0,1,0,13,0,0,0,38,0,2,0,2,0,0,0,10,42,43,-75,0,1,
1218: 42,-73,0,2,-79,0,0,0,1,0,14,0,0,0,10,0,2,0,0,0,9,0,9,0,11,
1219: 0,4,0,15,0,0,0,2,0,16,0,17,0,0,0,2,0,18,0,19,0,0,0,4,0,
1220: 20,0,21,0,6,0,0,0,18,0,2,0,3,0,0,0,5,0,0,0,7,0,3,0,8,
1221: 0,0,
1222: */
1223: /**/
1224: -54, -2, -70, -66, 0, 0, 0, 49, 0, 30, 9, 0, 3, 0, 22, 10, 0,
1225: 4, 0, 23, 7, 0, 24, 7, 0, 25, 1, 0, 7, 36, 77, 99, 51,
1226: 36, 48, 50, 1, 0, 12, 73, 110, 110, 101, 114, 67, 108,
1227: 97, 115, 115, 101, 115, 7, 0, 26, 1, 0, 7, 36, 77, 99,
1228: 51, 36, 48, 52, 1, 0, 6, 116, 104, 105, 115, 36, 48, 1,
1229: 0, 55, 76, 111, 114, 103, 47, 97, 112, 97, 99, 104,
1230: 101, 47, 104, 97, 114, 109, 111, 110, 121, 47, 108, 97,
1231: 110, 103, 47, 103, 101, 110, 101, 114, 105, 99, 115,
1232: 47, 66, 97, 100, 83, 105, 103, 110, 97, 116, 117, 114,
1233: 101, 84, 101, 109, 112, 108, 97, 116, 101, 59, 1, 0, 6,
1234: 60, 105, 110, 105, 116, 62, 1, 0, 58, 40, 76, 111, 114,
1235: 103, 47, 97, 112, 97, 99, 104, 101, 47, 104, 97, 114,
1236: 109, 111, 110, 121, 47, 108, 97, 110, 103, 47, 103,
1237: 101, 110, 101, 114, 105, 99, 115, 47, 66, 97, 100, 83,
1238: 105, 103, 110, 97, 116, 117, 114, 101, 84, 101, 109,
1239: 112, 108, 97, 116, 101, 59, 41, 86, 1, 0, 4, 67, 111,
1240: 100, 101, 1, 0, 15, 76, 105, 110, 101, 78, 117, 109,
1241: 98, 101, 114, 84, 97, 98, 108, 101, 1, 0, 9, 83, 105,
1242: 103, 110, 97, 116, 117, 114, 101, 1, 0, 44, 60, 36, 95,
1243: 84, 51, 95, 36, 58, 76, 106, 97, 118, 97, 47, 108, 97,
1244: 110, 103, 47, 67, 108, 97, 115, 115, 59, 62, 76, 106,
1245: 97, 118, 97, 47, 108, 97, 110, 103, 47, 79, 98, 106,
1246: 101, 99, 116, 59, 1, 0, 10, 83, 111, 117, 114, 99, 101,
1247: 70, 105, 108, 101, 1, 0, 25, 66, 97, 100, 83, 105, 103,
1248: 110, 97, 116, 117, 114, 101, 84, 101, 109, 112, 108,
1249: 97, 116, 101, 46, 106, 97, 118, 97, 1, 0, 15, 69, 110,
1250: 99, 108, 111, 115, 105, 110, 103, 77, 101, 116, 104,
1251: 111, 100, 7, 0, 27, 12, 0, 28, 0, 29, 12, 0, 9, 0, 10,
1252: 12, 0, 11, 0, 29, 1, 0, 62, 111, 114, 103, 47, 97, 112,
1253: 97, 99, 104, 101, 47, 104, 97, 114, 109, 111, 110, 121,
1254: 47, 108, 97, 110, 103, 47, 103, 101, 110, 101, 114,
1255: 105, 99, 115, 47, 66, 97, 100, 83, 105, 103, 110, 97,
1256: 116, 117, 114, 101, 84, 101, 109, 112, 108, 97, 116,
1257: 101, 36, 49, 36, 77, 99, 51, 36, 48, 50, 1, 0, 16, 106,
1258: 97, 118, 97, 47, 108, 97, 110, 103, 47, 79, 98, 106,
1259: 101, 99, 116, 1, 0, 70, 111, 114, 103, 47, 97, 112, 97,
1260: 99, 104, 101, 47, 104, 97, 114, 109, 111, 110, 121, 47,
1261: 108, 97, 110, 103, 47, 103, 101, 110, 101, 114, 105,
1262: 99, 115, 47, 66, 97, 100, 83, 105, 103, 110, 97, 116,
1263: 117, 114, 101, 84, 101, 109, 112, 108, 97, 116, 101,
1264: 36, 49, 36, 77, 99, 51, 36, 48, 50, 36, 36, 77, 99, 51,
1265: 36, 48, 52, 1, 0, 53, 111, 114, 103, 47, 97, 112, 97,
1266: 99, 104, 101, 47, 104, 97, 114, 109, 111, 110, 121, 47,
1267: 108, 97, 110, 103, 47, 103, 101, 110, 101, 114, 105,
1268: 99, 115, 47, 66, 97, 100, 83, 105, 103, 110, 97, 116,
1269: 117, 114, 101, 84, 101, 109, 112, 108, 97, 116, 101, 1,
1270: 0, 6, 116, 101, 115, 116, 95, 49, 1, 0, 3, 40, 41, 86,
1271: 0, 32, 0, 3, 0, 4, 0, 0, 0, 1, 16, 16, 0, 9, 0, 10, 0,
1272: 0, 0, 1, 0, 0, 0, 11, 0, 12, 0, 1, 0, 13, 0, 0, 0, 38,
1273: 0, 2, 0, 2, 0, 0, 0, 10, 42, 43, -75, 0, 1, 42, -73, 0,
1274: 2, -79, 0, 0, 0, 1, 0, 14, 0, 0, 0, 10, 0, 2, 0, 0, 0,
1275: 11, 0, 9, 0, 13, 0, 4, 0, 15, 0, 0, 0, 2, 0, 16, 0, 17,
1276: 0, 0, 0, 2, 0, 18, 0, 19, 0, 0, 0, 4, 0, 20, 0, 21, 0,
1277: 6, 0, 0, 0, 18, 0, 2, 0, 3, 0, 0, 0, 5, 0, 0, 0, 7, 0,
1278: 3, 0, 8, 0, 0,
1279: /**/
1280: };
1281:
1282: byte BadSignatureTemplate$1$Mc3$02$$Mc3$04[] = {
1283: /*
1284: -54,-2,-70,-66,0,0,0,49,0,28,9,0,3,0,20,10,0,4,0,21,7,0,22,7,0,
1285: 24,1,0,6,116,104,105,115,36,49,7,0,25,1,0,7,36,77,99,51,36,48,50,1,0,
1286: 12,73,110,110,101,114,67,108,97,115,115,101,115,1,0,64,76,111,114,103,47,97,112,97,99,
1287: 104,101,47,104,97,114,109,111,110,121,47,108,97,110,103,47,103,101,110,101,114,105,99,115,47,
1288: 66,97,100,83,105,103,110,97,116,117,114,101,84,101,109,112,108,97,116,101,36,49,36,77,99,
1289: 51,36,48,50,59,1,0,6,60,105,110,105,116,62,1,0,67,40,76,111,114,103,47,97,112,
1290: 97,99,104,101,47,104,97,114,109,111,110,121,47,108,97,110,103,47,103,101,110,101,114,105,99,
1291: 115,47,66,97,100,83,105,103,110,97,116,117,114,101,84,101,109,112,108,97,116,101,36,49,36,
1292: 77,99,51,36,48,50,59,41,86,1,0,4,67,111,100,101,1,0,15,76,105,110,101,78,117,
1293: 109,98,101,114,84,97,98,108,101,1,0,9,83,105,103,110,97,116,117,114,101,7,0,26,1,
1294: 0,7,36,77,99,51,36,48,49,1,0,110,60,84,53,58,76,111,114,103,47,97,112,97,99,
1295: 104,101,47,104,97,114,109,111,110,121,47,108,97,110,103,47,103,101,110,101,114,105,99,115,47,
1296: 66,97,100,83,105,103,110,97,116,117,114,101,84,101,109,112,108,97,116,101,46,49,36,77,99,
1297: 51,36,48,49,60,76,106,97,118,97,47,108,97,110,103,47,67,108,111,110,101,97,98,108,101,
1298: 59,62,59,62,76,106,97,118,97,47,108,97,110,103,47,79,98,106,101,99,116,59,1,0,10,
1299: 83,111,117,114,99,101,70,105,108,101,1,0,25,66,97,100,83,105,103,110,97,116,117,114,101,
1300: 84,101,109,112,108,97,116,101,46,106,97,118,97,12,0,5,0,9,12,0,10,0,27,1,0,
1301: 70,111,114,103,47,97,112,97,99,104,101,47,104,97,114,109,111,110,121,47,108,97,110,103,47,
1302: 103,101,110,101,114,105,99,115,47,66,97,100,83,105,103,110,97,116,117,114,101,84,101,109,112,
1303: 108,97,116,101,36,49,36,77,99,51,36,48,50,36,36,77,99,51,36,48,52,1,0,7,36,
1304: 77,99,51,36,48,52,1,0,16,106,97,118,97,47,108,97,110,103,47,79,98,106,101,99,116,
1305: 1,0,62,111,114,103,47,97,112,97,99,104,101,47,104,97,114,109,111,110,121,47,108,97,110,
1306: 103,47,103,101,110,101,114,105,99,115,47,66,97,100,83,105,103,110,97,116,117,114,101,84,101,
1307: 109,112,108,97,116,101,36,49,36,77,99,51,36,48,50,1,0,62,111,114,103,47,97,112,97,
1308: 99,104,101,47,104,97,114,109,111,110,121,47,108,97,110,103,47,103,101,110,101,114,105,99,115,
1309: 47,66,97,100,83,105,103,110,97,116,117,114,101,84,101,109,112,108,97,116,101,36,49,36,77,
1310: 99,51,36,48,49,1,0,3,40,41,86,0,32,0,3,0,4,0,0,0,1,16,16,0,5,
1311: 0,9,0,0,0,1,0,0,0,10,0,11,0,1,0,12,0,0,0,34,0,2,0,2,0,
1312: 0,0,10,42,43,-75,0,1,42,-73,0,2,-79,0,0,0,1,0,13,0,0,0,6,0,1,
1313: 0,0,0,10,0,3,0,14,0,0,0,2,0,17,0,18,0,0,0,2,0,19,0,8,0,
1314: 0,0,26,0,3,0,6,0,0,0,7,0,0,0,15,0,0,0,16,0,0,0,3,0,6,
1315: 0,23,0,0,
1316: */
1317: /**/
1318: -54, -2, -70, -66, 0, 0, 0, 49, 0, 28, 9, 0, 3, 0, 20, 10, 0,
1319: 4, 0, 21, 7, 0, 22, 7, 0, 24, 1, 0, 6, 116, 104, 105,
1320: 115, 36, 49, 7, 0, 25, 1, 0, 7, 36, 77, 99, 51, 36, 48,
1321: 50, 1, 0, 12, 73, 110, 110, 101, 114, 67, 108, 97, 115,
1322: 115, 101, 115, 1, 0, 64, 76, 111, 114, 103, 47, 97,
1323: 112, 97, 99, 104, 101, 47, 104, 97, 114, 109, 111, 110,
1324: 121, 47, 108, 97, 110, 103, 47, 103, 101, 110, 101,
1325: 114, 105, 99, 115, 47, 66, 97, 100, 83, 105, 103, 110,
1326: 97, 116, 117, 114, 101, 84, 101, 109, 112, 108, 97,
1327: 116, 101, 36, 49, 36, 77, 99, 51, 36, 48, 50, 59, 1, 0,
1328: 6, 60, 105, 110, 105, 116, 62, 1, 0, 67, 40, 76, 111,
1329: 114, 103, 47, 97, 112, 97, 99, 104, 101, 47, 104, 97,
1330: 114, 109, 111, 110, 121, 47, 108, 97, 110, 103, 47,
1331: 103, 101, 110, 101, 114, 105, 99, 115, 47, 66, 97, 100,
1332: 83, 105, 103, 110, 97, 116, 117, 114, 101, 84, 101,
1333: 109, 112, 108, 97, 116, 101, 36, 49, 36, 77, 99, 51,
1334: 36, 48, 50, 59, 41, 86, 1, 0, 4, 67, 111, 100, 101, 1,
1335: 0, 15, 76, 105, 110, 101, 78, 117, 109, 98, 101, 114,
1336: 84, 97, 98, 108, 101, 1, 0, 9, 83, 105, 103, 110, 97,
1337: 116, 117, 114, 101, 7, 0, 26, 1, 0, 7, 36, 77, 99, 51,
1338: 36, 48, 49, 1, 0, 110, 60, 84, 53, 58, 76, 111, 114,
1339: 103, 47, 97, 112, 97, 99, 104, 101, 47, 104, 97, 114,
1340: 109, 111, 110, 121, 47, 108, 97, 110, 103, 47, 103,
1341: 101, 110, 101, 114, 105, 99, 115, 47, 66, 97, 100, 83,
1342: 105, 103, 110, 97, 116, 117, 114, 101, 84, 101, 109,
1343: 112, 108, 97, 116, 101, 46, 49, 36, 77, 99, 51, 36, 48,
1344: 49, 60, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103,
1345: 47, 67, 108, 111, 110, 101, 97, 98, 108, 101, 59, 62,
1346: 59, 62, 76, 106, 97, 118, 97, 47, 108, 97, 110, 103,
1347: 47, 79, 98, 106, 101, 99, 116, 59, 1, 0, 10, 83, 111,
1348: 117, 114, 99, 101, 70, 105, 108, 101, 1, 0, 25, 66, 97,
1349: 100, 83, 105, 103, 110, 97, 116, 117, 114, 101, 84,
1350: 101, 109, 112, 108, 97, 116, 101, 46, 106, 97, 118, 97,
1351: 12, 0, 5, 0, 9, 12, 0, 10, 0, 27, 1, 0, 70, 111, 114,
1352: 103, 47, 97, 112, 97, 99, 104, 101, 47, 104, 97, 114,
1353: 109, 111, 110, 121, 47, 108, 97, 110, 103, 47, 103,
1354: 101, 110, 101, 114, 105, 99, 115, 47, 66, 97, 100, 83,
1355: 105, 103, 110, 97, 116, 117, 114, 101, 84, 101, 109,
1356: 112, 108, 97, 116, 101, 36, 49, 36, 77, 99, 51, 36, 48,
1357: 50, 36, 36, 77, 99, 51, 36, 48, 52, 1, 0, 7, 36, 77,
1358: 99, 51, 36, 48, 52, 1, 0, 16, 106, 97, 118, 97, 47,
1359: 108, 97, 110, 103, 47, 79, 98, 106, 101, 99, 116, 1, 0,
1360: 62, 111, 114, 103, 47, 97, 112, 97, 99, 104, 101, 47,
1361: 104, 97, 114, 109, 111, 110, 121, 47, 108, 97, 110,
1362: 103, 47, 103, 101, 110, 101, 114, 105, 99, 115, 47, 66,
1363: 97, 100, 83, 105, 103, 110, 97, 116, 117, 114, 101, 84,
1364: 101, 109, 112, 108, 97, 116, 101, 36, 49, 36, 77, 99,
1365: 51, 36, 48, 50, 1, 0, 62, 111, 114, 103, 47, 97, 112,
1366: 97, 99, 104, 101, 47, 104, 97, 114, 109, 111, 110, 121,
1367: 47, 108, 97, 110, 103, 47, 103, 101, 110, 101, 114,
1368: 105, 99, 115, 47, 66, 97, 100, 83, 105, 103, 110, 97,
1369: 116, 117, 114, 101, 84, 101, 109, 112, 108, 97, 116,
1370: 101, 36, 49, 36, 77, 99, 51, 36, 48, 49, 1, 0, 3, 40,
1371: 41, 86, 0, 32, 0, 3, 0, 4, 0, 0, 0, 1, 16, 16, 0, 5, 0,
1372: 9, 0, 0, 0, 1, 0, 0, 0, 10, 0, 11, 0, 1, 0, 12, 0, 0,
1373: 0, 34, 0, 2, 0, 2, 0, 0, 0, 10, 42, 43, -75, 0, 1, 42,
1374: -73, 0, 2, -79, 0, 0, 0, 1, 0, 13, 0, 0, 0, 6, 0, 1, 0,
1375: 0, 0, 12, 0, 3, 0, 14, 0, 0, 0, 2, 0, 17, 0, 18, 0, 0,
1376: 0, 2, 0, 19, 0, 8, 0, 0, 0, 26, 0, 3, 0, 6, 0, 0, 0, 7,
1377: 0, 0, 0, 15, 0, 0, 0, 16, 0, 0, 0, 3, 0, 6, 0, 23, 0,
1378: 0,
1379: /**/
1380: };
1381:
1382: byte BadSignatureTemplate$1$Mc3$01[] = {
1383: /*
1384: -54,-2,-70,-66,0,0,0,49,0,28,9,0,3,0,18,10,0,4,0,19,7,0,20,7,0,
1385: 23,1,0,6,116,104,105,115,36,48,1,0,55,76,111,114,103,47,97,112,97,99,104,101,47,
1386: 104,97,114,109,111,110,121,47,108,97,110,103,47,103,101,110,101,114,105,99,115,47,66,97,100,
1387: 83,105,103,110,97,116,117,114,101,84,101,109,112,108,97,116,101,59,1,0,6,60,105,110,105,
1388: 116,62,1,0,58,40,76,111,114,103,47,97,112,97,99,104,101,47,104,97,114,109,111,110,121,
1389: 47,108,97,110,103,47,103,101,110,101,114,105,99,115,47,66,97,100,83,105,103,110,97,116,117,
1390: 114,101,84,101,109,112,108,97,116,101,59,41,86,1,0,4,67,111,100,101,1,0,15,76,105,
1391: 110,101,78,117,109,98,101,114,84,97,98,108,101,1,0,9,83,105,103,110,97,116,117,114,101,
1392: 1,0,40,60,84,58,76,106,97,118,97,47,108,97,110,103,47,79,98,106,101,99,116,59,62,
1393: 76,106,97,118,97,47,108,97,110,103,47,79,98,106,101,99,116,59,1,0,10,83,111,117,114,
1394: 99,101,70,105,108,101,1,0,25,66,97,100,83,105,103,110,97,116,117,114,101,84,101,109,112,
1395: 108,97,116,101,46,106,97,118,97,1,0,15,69,110,99,108,111,115,105,110,103,77,101,116,104,
1396: 111,100,7,0,24,12,0,25,0,26,12,0,5,0,6,12,0,7,0,27,1,0,62,111,114,
1397: 103,47,97,112,97,99,104,101,47,104,97,114,109,111,110,121,47,108,97,110,103,47,103,101,110,
1398: 101,114,105,99,115,47,66,97,100,83,105,103,110,97,116,117,114,101,84,101,109,112,108,97,116,
1399: 101,36,49,36,77,99,51,36,48,49,1,0,7,36,77,99,51,36,48,49,1,0,12,73,110,
1400: 110,101,114,67,108,97,115,115,101,115,1,0,16,106,97,118,97,47,108,97,110,103,47,79,98,
1401: 106,101,99,116,1,0,53,111,114,103,47,97,112,97,99,104,101,47,104,97,114,109,111,110,121,
1402: 47,108,97,110,103,47,103,101,110,101,114,105,99,115,47,66,97,100,83,105,103,110,97,116,117,
1403: 114,101,84,101,109,112,108,97,116,101,1,0,6,116,101,115,116,95,49,1,0,35,40,41,91,
1404: 76,106,97,118,97,47,108,97,110,103,47,114,101,102,108,101,99,116,47,84,121,112,101,86,97,
1405: 114,105,97,98,108,101,59,1,0,3,40,41,86,0,32,0,3,0,4,0,0,0,1,16,16,
1406: 0,5,0,6,0,0,0,1,0,0,0,7,0,8,0,1,0,9,0,0,0,34,0,2,0,
1407: 2,0,0,0,10,42,43,-75,0,1,42,-73,0,2,-79,0,0,0,1,0,10,0,0,0,6,
1408: 0,1,0,0,0,8,0,4,0,11,0,0,0,2,0,12,0,13,0,0,0,2,0,14,0,
1409: 15,0,0,0,4,0,16,0,17,0,22,0,0,0,10,0,1,0,3,0,0,0,21,0,0,
1410: */
1411: /**/
1412: -54, -2, -70, -66, 0, 0, 0, 49, 0, 27, 9, 0, 3, 0, 18, 10, 0,
1413: 4, 0, 19, 7, 0, 20, 7, 0, 23, 1, 0, 6, 116, 104, 105,
1414: 115, 36, 48, 1, 0, 55, 76, 111, 114, 103, 47, 97, 112,
1415: 97, 99, 104, 101, 47, 104, 97, 114, 109, 111, 110, 121,
1416: 47, 108, 97, 110, 103, 47, 103, 101, 110, 101, 114,
1417: 105, 99, 115, 47, 66, 97, 100, 83, 105, 103, 110, 97,
1418: 116, 117, 114, 101, 84, 101, 109, 112, 108, 97, 116,
1419: 101, 59, 1, 0, 6, 60, 105, 110, 105, 116, 62, 1, 0, 58,
1420: 40, 76, 111, 114, 103, 47, 97, 112, 97, 99, 104, 101,
1421: 47, 104, 97, 114, 109, 111, 110, 121, 47, 108, 97, 110,
1422: 103, 47, 103, 101, 110, 101, 114, 105, 99, 115, 47, 66,
1423: 97, 100, 83, 105, 103, 110, 97, 116, 117, 114, 101, 84,
1424: 101, 109, 112, 108, 97, 116, 101, 59, 41, 86, 1, 0, 4,
1425: 67, 111, 100, 101, 1, 0, 15, 76, 105, 110, 101, 78,
1426: 117, 109, 98, 101, 114, 84, 97, 98, 108, 101, 1, 0, 9,
1427: 83, 105, 103, 110, 97, 116, 117, 114, 101, 1, 0, 40,
1428: 60, 84, 58, 76, 106, 97, 118, 97, 47, 108, 97, 110,
1429: 103, 47, 79, 98, 106, 101, 99, 116, 59, 62, 76, 106,
1430: 97, 118, 97, 47, 108, 97, 110, 103, 47, 79, 98, 106,
1431: 101, 99, 116, 59, 1, 0, 10, 83, 111, 117, 114, 99, 101,
1432: 70, 105, 108, 101, 1, 0, 25, 66, 97, 100, 83, 105, 103,
1433: 110, 97, 116, 117, 114, 101, 84, 101, 109, 112, 108,
1434: 97, 116, 101, 46, 106, 97, 118, 97, 1, 0, 15, 69, 110,
1435: 99, 108, 111, 115, 105, 110, 103, 77, 101, 116, 104,
1436: 111, 100, 7, 0, 24, 12, 0, 25, 0, 26, 12, 0, 5, 0, 6,
1437: 12, 0, 7, 0, 26, 1, 0, 62, 111, 114, 103, 47, 97, 112,
1438: 97, 99, 104, 101, 47, 104, 97, 114, 109, 111, 110, 121,
1439: 47, 108, 97, 110, 103, 47, 103, 101, 110, 101, 114,
1440: 105, 99, 115, 47, 66, 97, 100, 83, 105, 103, 110, 97,
1441: 116, 117, 114, 101, 84, 101, 109, 112, 108, 97, 116,
1442: 101, 36, 49, 36, 77, 99, 51, 36, 48, 49, 1, 0, 7, 36,
1443: 77, 99, 51, 36, 48, 49, 1, 0, 12, 73, 110, 110, 101,
1444: 114, 67, 108, 97, 115, 115, 101, 115, 1, 0, 16, 106,
1445: 97, 118, 97, 47, 108, 97, 110, 103, 47, 79, 98, 106,
1446: 101, 99, 116, 1, 0, 53, 111, 114, 103, 47, 97, 112, 97,
1447: 99, 104, 101, 47, 104, 97, 114, 109, 111, 110, 121, 47,
1448: 108, 97, 110, 103, 47, 103, 101, 110, 101, 114, 105,
1449: 99, 115, 47, 66, 97, 100, 83, 105, 103, 110, 97, 116,
1450: 117, 114, 101, 84, 101, 109, 112, 108, 97, 116, 101, 1,
1451: 0, 6, 116, 101, 115, 116, 95, 49, 1, 0, 3, 40, 41, 86,
1452: 0, 32, 0, 3, 0, 4, 0, 0, 0, 1, 16, 16, 0, 5, 0, 6, 0,
1453: 0, 0, 1, 0, 0, 0, 7, 0, 8, 0, 1, 0, 9, 0, 0, 0, 34, 0,
1454: 2, 0, 2, 0, 0, 0, 10, 42, 43, -75, 0, 1, 42, -73, 0, 2,
1455: -79, 0, 0, 0, 1, 0, 10, 0, 0, 0, 6, 0, 1, 0, 0, 0, 10,
1456: 0, 4, 0, 11, 0, 0, 0, 2, 0, 12, 0, 13, 0, 0, 0, 2, 0,
1457: 14, 0, 15, 0, 0, 0, 4, 0, 16, 0, 17, 0, 22, 0, 0, 0,
1458: 10, 0, 1, 0, 3, 0, 0, 0, 21, 0, 0,
1459: /**/
1460: };
1461: path = path + File.separator + "org" + File.separator
1462: + "apache" + File.separator + "harmony"
1463: + File.separator + "lang" + File.separator + "generics";
1464: File f0 = new File(path);
1465: f0.mkdir();
1466: File f2 = new File(path + File.separator
1467: + "BadSignatureTemplate.class");
1468: f2.createNewFile();
1469: System.out.println(path + File.separator
1470: + "BadSignatureTemplate.class");
1471: FileOutputStream fos = new FileOutputStream(f2);
1472: fos.write(BadSignatureTemplate);
1473: fos.flush();
1474: fos.close();
1475: f2 = new File(path + File.separator
1476: + "BadSignatureTemplate$1$Mc3$02.class");
1477: f2.createNewFile();
1478: fos = new FileOutputStream(f2);
1479: fos.write(BadSignatureTemplate$1$Mc3$02);
1480: fos.flush();
1481: fos.close();
1482: f2 = new File(path + File.separator
1483: + "BadSignatureTemplate$1$Mc3$02$$Mc3$04.class");
1484: f2.createNewFile();
1485: fos = new FileOutputStream(f2);
1486: fos.write(BadSignatureTemplate$1$Mc3$02$$Mc3$04);
1487: fos.flush();
1488: fos.close();
1489: f2 = new File(path + File.separator
1490: + "BadSignatureTemplate$1$Mc3$01.class");
1491: f2.createNewFile();
1492: fos = new FileOutputStream(f2);
1493: fos.write(BadSignatureTemplate$1$Mc3$01);
1494: fos.flush();
1495: fos.close();
1496:
1497: Class temp = ld
1498: .loadClass("org.apache.harmony.lang.generics.BadSignatureTemplate");
1499: /*Class ac[] = */temp.getDeclaredClasses();
1500:
1501: Method m = null;
1502: try {
1503: java.lang.reflect.Method am[] = temp.getDeclaredMethods();
1504: for (int ii = 0; ii < am.length; ii++) {
1505: if (am[ii].getName().equals("test_1")) {
1506: m = am[ii];
1507: }
1508: }
1509: m.getName();
1510: } catch (Exception e) {
1511: fail("test_3, case 001 FAILED: " + e.toString());
1512: }
1513: try {
1514: Object o = temp.newInstance();
1515: Object o2 = o.getClass().getDeclaredMethod("test_1")
1516: .invoke(o, (Object[]) null);
1517: fail("test_3, case 002 FAILED: GenericSignatureFormatError should be risen.");
1518: System.out.println(((TypeVariable[]) o2)[0].getName());
1519: System.out
1520: .println(((ParameterizedType) ((TypeVariable[]) o2)[0]
1521: .getBounds()[0]).toString());
1522: } catch (java.lang.reflect.InvocationTargetException e) {
1523: if (!(e.getCause() instanceof java.lang.reflect.GenericSignatureFormatError)) {
1524: fail("test_3, case 003 FAILED: GenericSignatureFormatError should be risen.");
1525: }
1526: }
1527: }
1528: }
|