Bug 339476 - Can't ask to parameterize a member of non-generic type
Summary: Can't ask to parameterize a member of non-generic type
Status: RESOLVED WORKSFORME
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.6.10   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 1.6.12   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-10 03:47 EST by Petr CLA
Modified: 2011-04-26 19:34 EDT (History)
1 user (show)

See Also:


Attachments
test projects (10.07 KB, application/zip)
2011-03-10 03:49 EST, Petr CLA
no flags Details
aspectj output file (14.75 KB, text/plain)
2011-03-10 03:50 EST, Petr CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petr CLA 2011-03-10 03:47:23 EST
Build Identifier: 

The code that I compile by using Maven or Netbeans throw java.lang.IllegalStateException: Can't ask to parameterize a member of non-generic type.

look at simple example in attachment (test.zip)
- test.zip contains 2 identical projects in different named directories.
- throwing the exception depends on the path to java classes of these projects.
- dir c:\test\ok is compiled without any problems
- dir c:\test\fail1 is compiled with java.lang.IllegalStateException in output
file (ajcore.XXX.txt)
- if you remove "1" from fail1 (c:\test\fail1 => c:\test\fail) it will compile
without any problems
- if you remove public override method in class ChildTest$ChildInnerTest it will compile without any problems

this bug is simillar to: https://bugs.eclipse.org/bugs/show_bug.cgi?id=298675

Reproducible: Always

Steps to Reproduce:
1. unpack test.zip to C:\
2. run build.bat in C:\test\fail1 (requirements: Apache Maven)
Comment 1 Petr CLA 2011-03-10 03:49:58 EST
Created attachment 190831 [details]
test projects
Comment 2 Petr CLA 2011-03-10 03:50:32 EST
Created attachment 190832 [details]
aspectj output file
Comment 3 Petr CLA 2011-03-10 07:27:04 EST
simple example in attachment (test.zip)
correction:
- if you remove "fail" from fail1 (c:\test\fail1 => c:\test\1) it will compile
without any problems
Comment 4 Andrew Clement CLA 2011-04-26 19:34:18 EDT
I recreated it pretty quickly (thanks for the testcode), but then I observed that the line numbers didn't tie up with recent AspectJ builds.  I then looked at the ajcore file you attached, and it says:

AspectJ Compiler 1.6.2 built on Saturday Oct 4, 2008 at 05:47:07 GMT

Although your pom expressed a 1.6.10 dependency, that was only onto the runtime, it didn't determine the level of compiler that would be used.  I changed the pom slightly (new dependencies in the aspectj-maven-plugin section, and up'd the version of the plugin to 1.2):

     <groupId>org.codehaus.mojo</groupId>
        <artifactId>aspectj-maven-plugin</artifactId>
        <version>1.2</version> // this is a change
// this bit is new...
        <dependencies>
           <dependency>
              <groupId>org.aspectj</groupId>
              <artifactId>aspectjrt</artifactId>
              <version>1.6.10</version>
           </dependency>
           <dependency>
              <groupId>org.aspectj</groupId>
              <artifactId>aspectjtools</artifactId>
              <version>1.6.10</version>
              </dependency>
           </dependencies>
// ... down to here
        <configuration>
          <source>1.6</source>
          <complianceLevel>1.6</complianceLevel>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>compile</goal>       <!-- use this goal to weave all your main classes -->
              <!--<goal>test-compile</goal>   use this goal to weave all your test classes -->
            </goals>
          </execution>
        </executions>
      </plugin>

with those changes, the build now runs clean using 1.6.10.  After playing with versions looks like this issue was fixed in the 1.6.8 timeframe.