--- /dev/null
+public class pr112458<V>
+{
+ public void setInnerClasses(InnerClass[] classes){};
+
+ public static class InnerClass {}
+}
--- /dev/null
+public class pr112458_2<V>
+{
+ public void setInnerClasses(InnerClass[] classes){};
+
+ public static class InnerClass {}
+
+ public static void main(String []argv) {
+ new pr112458_2();
+ }
+}
+
+aspect X {
+ before(pr112458_2.InnerClass[] ics): execution(void setInnerClasses(..)) && args(ics) {
+ }
+}
import org.aspectj.systemtest.ajc150.AllTestsAspectJ150;
import org.aspectj.systemtest.ajc150.ataspectj.AtAjAnnotationGenTests;
+import org.aspectj.systemtest.ajc151.AllTestsAspectJ151;
public class AllTests15 {
//$JUnit-BEGIN$
suite.addTest(AllTests14.suite());
suite.addTest(AllTestsAspectJ150.suite());
+ suite.addTest(AllTestsAspectJ151.suite());
suite.addTest(AtAjAnnotationGenTests.suite());
//$JUnit-END$
return suite;
public class AllTestsAspectJ150 {
public static Test suite() {
- TestSuite suite = new TestSuite("Java5/AspectJ5 tests");
+ TestSuite suite = new TestSuite("AspectJ1.5.0 tests");
//$JUnit-BEGIN$
suite.addTestSuite(MigrationTests.class);
suite.addTest(Ajc150Tests.suite());
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2006 IBM
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * Andy Clement - initial API and implementation
+ *******************************************************************************/
+package org.aspectj.systemtest.ajc151;
+
+import java.io.File;
+
+import junit.framework.Test;
+
+import org.aspectj.testing.XMLBasedAjcTestCase;
+
+public class Ajc151Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
+
+ public void testMemberTypesInGenericTypes_pr112458() { runTest("member types in generic types");}
+ public void testMemberTypesInGenericTypes_pr112458_2() { runTest("member types in generic types - 2");}
+
+
+ /////////////////////////////////////////
+ public static Test suite() {
+ return XMLBasedAjcTestCase.loadSuite(Ajc151Tests.class);
+ }
+
+ protected File getSpecFile() {
+ return new File("../tests/src/org/aspectj/systemtest/ajc151/ajc151.xml");
+ }
+
+}
\ No newline at end of file
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2006 IBM
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * Andy Clement - initial API and implementation
+ *******************************************************************************/
+package org.aspectj.systemtest.ajc151;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class AllTestsAspectJ151 {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite("AspectJ 1.5.1 tests");
+ //$JUnit-BEGIN$
+ suite.addTest(Ajc151Tests.suite());
+ //$JUnit-END$
+ return suite;
+ }
+}
--- /dev/null
+<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]>
+
+<!-- AspectJ v1.5.1 Tests -->
+<suite>
+
+ <ajc-test dir="bugs151" title="member types in generic types">
+ <compile files="pr112458.aj" options="-1.5 -emacssym"/>
+ </ajc-test>
+
+ <ajc-test dir="bugs151" title="member types in generic types - 2">
+ <compile files="pr112458_2.aj" options="-1.5 -emacssym"/>
+ <run class="pr112458_2"/>
+ </ajc-test>
+
+</suite>
\ No newline at end of file
if (signature.startsWith(ResolvedType.PARAMETERIZED_TYPE_IDENTIFIER)) {
// parameterized type, calculate signature erasure and type parameters
+
+ // (see pr112458) It is possible for a parameterized type to have *no* type parameters visible in its signature.
+ // This happens for an inner type of a parameterized type which simply inherits the type parameters
+ // of its parent. In this case it is parameterized but theres no < in the signature.
+
int startOfParams = signature.indexOf('<');
int endOfParams = signature.lastIndexOf('>');
- String signatureErasure = "L" + signature.substring(1,startOfParams) + ";";
- UnresolvedType[] typeParams = createTypeParams(signature.substring(startOfParams +1, endOfParams));
- return new UnresolvedType(signature,signatureErasure,typeParams);
+ if (startOfParams==-1) {
+ // Should be an inner type of a parameterized type - could assert there is a '$' in the signature....
+ String signatureErasure = "L" + signature.substring(1);
+ UnresolvedType[] typeParams = new UnresolvedType[0];
+ return new UnresolvedType(signature,signatureErasure,typeParams);
+ } else {
+ String signatureErasure = "L" + signature.substring(1,startOfParams) + ";";
+ UnresolvedType[] typeParams = createTypeParams(signature.substring(startOfParams +1, endOfParams));
+ return new UnresolvedType(signature,signatureErasure,typeParams);
+ }
} else if (signature.equals("?")){
UnresolvedType ret = UnresolvedType.SOMETHING;
ret.typeKind = TypeKind.WILDCARD;