firzencode / jarjar

Automatically exported from code.google.com/p/jarjar
0 stars 0 forks source link

class declared in default section of switch not included #41

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
A class declared in the default section of a switch statement does not get 
included as a dependency in the JAR file.

What steps will reproduce the problem?

        switch ( enumString )
        {
          default:

            throw new EnumUnknownException ( enumString );
        }

What is the expected output? What do you see instead?

I expect to see EnumUnknownException.class included in jar file.

What version of the product are you using? On what operating system?

Maven Plugin 0.0.4:

            <plugin>
              <!-- http://docs.atlassian.com/jarjar-maven-plugin/ -->
              <groupId>com.atlassian.maven.plugins</groupId>
              <artifactId>jarjar-maven-plugin</artifactId>
              <version>0.0.4</version>
            </plugin>

Windows Vista.

Please provide any additional information below.

An easy workaround is to declare the class outside default section.  I just 
include a line like this in the constructor method:

// jarjar workaround
new EnumUnknownException ( );

The EnumUnknownException.class file is then included in the JAR file.

Original issue reported on code.google.com by david.wallace.croft on 11 Jul 2010 at 5:55

GoogleCodeExporter commented 8 years ago
I found another example of this bug where the missing class was declared in a 
switch statement.  This one was in a switch case other than the switch default.

Original comment by david.wallace.croft on 11 Jul 2010 at 6:19