Issue Type: Bug Bug
Affects Versions: 1.9
Assignee: Stephen Connolly
Attachments: AnimalSnifferJava17.zip
Created: 31/Jul/13 1:19 AM
Description:

See the attached zip for an example Maven project. Catching an exception class introduced in 1.7 does not fail the build when running "mvn clean install", even though Java 1.5 is required in the POM:

Java code:

    public static void main(String[] args) {
        try {
            throwsSubclassOfReflectiveOperationException();
        } catch (ReflectiveOperationException roe) {
            // Would expect the use of this catch to fail the build; specified the use of Java 1.5 in pom, but
            // ReflectiveOperationException was introduced in 1.7
			roe.printStackTrace();
        }
    }

    public static void throwsSubclassOfReflectiveOperationException() throws NoSuchMethodException {
        throw new NoSuchMethodException();
    }

POM config:

 <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>animal-sniffer-maven-plugin</artifactId>
                <version>1.9</version>
                <configuration>
                    <signature>
                        <groupId>org.codehaus.mojo.signature</groupId>
                        <artifactId>java15</artifactId>
                        <version>1.0</version>
                    </signature>
                </configuration>
                <executions>
                    <execution>
                        <id>java-api-check</id>
                        <phase>test</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

Does this fall into the same category as https://jira.codehaus.org/browse/MANIMALSNIFFER-36 (the catch is not reflected in bytecode?).

Project: Mojo Animal Sniffer
Priority: Major Major
Reporter: Lauri Harpf
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

Reply via email to