Reset svn properties
git-svn-id: https://svn.apache.org/repos/asf/maven/shared/trunk@575678 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/pom.xml b/pom.xml
index 1961bf1..ffc086d 100755
--- a/pom.xml
+++ b/pom.xml
@@ -1,115 +1,115 @@
-<?xml version="1.0" encoding="UTF-8"?>
- <!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
-
- <groupId>org.apache.maven.shared</groupId>
- <artifactId>maven-shared-components</artifactId>
- <version>7</version>
- </parent>
-
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.maven.shared</groupId>
- <artifactId>maven-dependency-analyzer</artifactId>
- <packaging>jar</packaging>
- <version>1.0-alpha-3-SNAPSHOT</version>
-
- <name>Maven Dependency Analyzer</name>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.4</source>
- <target>1.4</target>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-maven-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>descriptor</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- <resources>
- <!-- Include super-pom defined main/resources
- Removing this section will break the build.
- Since we have defined a new build/resources
- section for the Apache process LICENSE and NOTICE
- files, this original default section is now
- required. -->
- <resource>
- <directory>${basedir}/src/main/resources</directory>
- </resource>
- </resources>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>asm</groupId>
- <artifactId>asm</artifactId>
- <version>3.0</version>
- </dependency>
- <dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-utils</artifactId>
- <version>1.1</version>
- </dependency>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-project</artifactId>
- <version>2.0.5</version>
- </dependency>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-model</artifactId>
- <version>2.0.5</version>
- </dependency>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-artifact</artifactId>
- <version>2.0.5</version>
- </dependency>
- <dependency>
- <groupId>jmock</groupId>
- <artifactId>jmock</artifactId>
- <version>1.1.0</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
- <scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/maven/shared/trunk/maven-dependency-analyzer</connection>
- <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/shared/trunk/maven-dependency-analyzer</developerConnection>
- <url>http://svn.apache.org/viewcvs.cgi/maven/shared/trunk/maven-dependency-analyzer</url>
- </scm>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+ <!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+
+ <groupId>org.apache.maven.shared</groupId>
+ <artifactId>maven-shared-components</artifactId>
+ <version>7</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.maven.shared</groupId>
+ <artifactId>maven-dependency-analyzer</artifactId>
+ <packaging>jar</packaging>
+ <version>1.0-alpha-3-SNAPSHOT</version>
+
+ <name>Maven Dependency Analyzer</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.4</source>
+ <target>1.4</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>descriptor</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ <resources>
+ <!-- Include super-pom defined main/resources
+ Removing this section will break the build.
+ Since we have defined a new build/resources
+ section for the Apache process LICENSE and NOTICE
+ files, this original default section is now
+ required. -->
+ <resource>
+ <directory>${basedir}/src/main/resources</directory>
+ </resource>
+ </resources>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>asm</groupId>
+ <artifactId>asm</artifactId>
+ <version>3.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-utils</artifactId>
+ <version>1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-project</artifactId>
+ <version>2.0.5</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-model</artifactId>
+ <version>2.0.5</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-artifact</artifactId>
+ <version>2.0.5</version>
+ </dependency>
+ <dependency>
+ <groupId>jmock</groupId>
+ <artifactId>jmock</artifactId>
+ <version>1.1.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <scm>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/maven/shared/trunk/maven-dependency-analyzer</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/shared/trunk/maven-dependency-analyzer</developerConnection>
+ <url>http://svn.apache.org/viewcvs.cgi/maven/shared/trunk/maven-dependency-analyzer</url>
+ </scm>
+</project>
diff --git a/src/main/java/org/apache/maven/shared/dependency/analyzer/ClassAnalyzer.java b/src/main/java/org/apache/maven/shared/dependency/analyzer/ClassAnalyzer.java
index cb4cc2b..855b644 100644
--- a/src/main/java/org/apache/maven/shared/dependency/analyzer/ClassAnalyzer.java
+++ b/src/main/java/org/apache/maven/shared/dependency/analyzer/ClassAnalyzer.java
@@ -1,42 +1,42 @@
-package org.apache.maven.shared.dependency.analyzer;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.Set;
-
-/**
- *
- *
- * @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
- * @version $Id$
- */
-public interface ClassAnalyzer
-{
- // fields -----------------------------------------------------------------
-
- String ROLE = ClassAnalyzer.class.getName();
-
- // public methods ---------------------------------------------------------
-
- Set analyze( URL url )
- throws IOException;
-}
+package org.apache.maven.shared.dependency.analyzer;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.Set;
+
+/**
+ *
+ *
+ * @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
+ * @version $Id$
+ */
+public interface ClassAnalyzer
+{
+ // fields -----------------------------------------------------------------
+
+ String ROLE = ClassAnalyzer.class.getName();
+
+ // public methods ---------------------------------------------------------
+
+ Set analyze( URL url )
+ throws IOException;
+}
diff --git a/src/main/java/org/apache/maven/shared/dependency/analyzer/ClassFileVisitor.java b/src/main/java/org/apache/maven/shared/dependency/analyzer/ClassFileVisitor.java
index 7f37c0d..ab8e4c5 100644
--- a/src/main/java/org/apache/maven/shared/dependency/analyzer/ClassFileVisitor.java
+++ b/src/main/java/org/apache/maven/shared/dependency/analyzer/ClassFileVisitor.java
@@ -1,33 +1,33 @@
-package org.apache.maven.shared.dependency.analyzer;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.io.InputStream;
-
-/**
- *
- *
- * @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
- * @version $Id$
- */
-public interface ClassFileVisitor
-{
- void visitClass( String className, InputStream in );
-}
+package org.apache.maven.shared.dependency.analyzer;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.InputStream;
+
+/**
+ *
+ *
+ * @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
+ * @version $Id$
+ */
+public interface ClassFileVisitor
+{
+ void visitClass( String className, InputStream in );
+}
diff --git a/src/main/java/org/apache/maven/shared/dependency/analyzer/ClassFileVisitorUtils.java b/src/main/java/org/apache/maven/shared/dependency/analyzer/ClassFileVisitorUtils.java
index 65a2496..b045933 100644
--- a/src/main/java/org/apache/maven/shared/dependency/analyzer/ClassFileVisitorUtils.java
+++ b/src/main/java/org/apache/maven/shared/dependency/analyzer/ClassFileVisitorUtils.java
@@ -1,149 +1,149 @@
-package org.apache.maven.shared.dependency.analyzer;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.jar.JarEntry;
-import java.util.jar.JarInputStream;
-
-import org.codehaus.plexus.util.DirectoryScanner;
-
-/**
- *
- *
- * @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
- * @version $Id$
- */
-public final class ClassFileVisitorUtils
-{
- // constants --------------------------------------------------------------
-
- private static final String[] CLASS_INCLUDES = { "**/*.class" };
-
- // constructors -----------------------------------------------------------
-
- private ClassFileVisitorUtils()
- {
- // private constructor for utility class
- }
-
- // public methods ---------------------------------------------------------
-
- public static void accept( URL url, ClassFileVisitor visitor )
- throws IOException
- {
- if ( url.getPath().endsWith( ".jar" ) )
- {
- acceptJar( url, visitor );
- }
- else if ( url.getProtocol().equals( "file" ) )
- {
- try
- {
- File file = new File( new URI( url.toString() ).getPath() );
-
- if ( file.isDirectory() )
- {
- acceptDirectory( file, visitor );
- }
- else
- {
- throw new IllegalArgumentException( "Cannot accept visitor on URL: " + url );
- }
- }
- catch ( URISyntaxException exception )
- {
- IllegalArgumentException e = new IllegalArgumentException( "Cannot accept visitor on URL: " + url );
- e.initCause( exception );
- throw e;
- }
- }
- else
- {
- throw new IllegalArgumentException( "Cannot accept visitor on URL: " + url );
- }
- }
-
- // private methods --------------------------------------------------------
-
- private static void acceptJar( URL url, ClassFileVisitor visitor )
- throws IOException
- {
- JarInputStream in = new JarInputStream( url.openStream() );
-
- JarEntry entry = null;
-
- while ( ( entry = in.getNextJarEntry() ) != null )
- {
- String name = entry.getName();
-
- if ( name.endsWith( ".class" ) )
- visitClass( name, in, visitor );
- }
-
- in.close();
- }
-
- private static void acceptDirectory( File directory, ClassFileVisitor visitor )
- throws IOException
- {
- if ( !directory.isDirectory() )
- throw new IllegalArgumentException( "File is not a directory" );
-
- DirectoryScanner scanner = new DirectoryScanner();
-
- scanner.setBasedir( directory );
- scanner.setIncludes( CLASS_INCLUDES );
-
- scanner.scan();
-
- String[] paths = scanner.getIncludedFiles();
-
- for ( int i = 0; i < paths.length; i++ )
- {
- String path = paths[i].replace( File.separatorChar, '/' );
-
- File file = new File( directory, path );
- FileInputStream in = new FileInputStream( file );
-
- visitClass( path, in, visitor );
-
- in.close();
- }
- }
-
- private static void visitClass( String path, InputStream in, ClassFileVisitor visitor )
- {
- if ( !path.endsWith( ".class" ) )
- throw new IllegalArgumentException( "Path is not a class" );
-
- String className = path.substring( 0, path.length() - 6 );
-
- className = className.replace( '/', '.' );
-
- visitor.visitClass( className, in );
- }
-}
+package org.apache.maven.shared.dependency.analyzer;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.jar.JarEntry;
+import java.util.jar.JarInputStream;
+
+import org.codehaus.plexus.util.DirectoryScanner;
+
+/**
+ *
+ *
+ * @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
+ * @version $Id$
+ */
+public final class ClassFileVisitorUtils
+{
+ // constants --------------------------------------------------------------
+
+ private static final String[] CLASS_INCLUDES = { "**/*.class" };
+
+ // constructors -----------------------------------------------------------
+
+ private ClassFileVisitorUtils()
+ {
+ // private constructor for utility class
+ }
+
+ // public methods ---------------------------------------------------------
+
+ public static void accept( URL url, ClassFileVisitor visitor )
+ throws IOException
+ {
+ if ( url.getPath().endsWith( ".jar" ) )
+ {
+ acceptJar( url, visitor );
+ }
+ else if ( url.getProtocol().equals( "file" ) )
+ {
+ try
+ {
+ File file = new File( new URI( url.toString() ).getPath() );
+
+ if ( file.isDirectory() )
+ {
+ acceptDirectory( file, visitor );
+ }
+ else
+ {
+ throw new IllegalArgumentException( "Cannot accept visitor on URL: " + url );
+ }
+ }
+ catch ( URISyntaxException exception )
+ {
+ IllegalArgumentException e = new IllegalArgumentException( "Cannot accept visitor on URL: " + url );
+ e.initCause( exception );
+ throw e;
+ }
+ }
+ else
+ {
+ throw new IllegalArgumentException( "Cannot accept visitor on URL: " + url );
+ }
+ }
+
+ // private methods --------------------------------------------------------
+
+ private static void acceptJar( URL url, ClassFileVisitor visitor )
+ throws IOException
+ {
+ JarInputStream in = new JarInputStream( url.openStream() );
+
+ JarEntry entry = null;
+
+ while ( ( entry = in.getNextJarEntry() ) != null )
+ {
+ String name = entry.getName();
+
+ if ( name.endsWith( ".class" ) )
+ visitClass( name, in, visitor );
+ }
+
+ in.close();
+ }
+
+ private static void acceptDirectory( File directory, ClassFileVisitor visitor )
+ throws IOException
+ {
+ if ( !directory.isDirectory() )
+ throw new IllegalArgumentException( "File is not a directory" );
+
+ DirectoryScanner scanner = new DirectoryScanner();
+
+ scanner.setBasedir( directory );
+ scanner.setIncludes( CLASS_INCLUDES );
+
+ scanner.scan();
+
+ String[] paths = scanner.getIncludedFiles();
+
+ for ( int i = 0; i < paths.length; i++ )
+ {
+ String path = paths[i].replace( File.separatorChar, '/' );
+
+ File file = new File( directory, path );
+ FileInputStream in = new FileInputStream( file );
+
+ visitClass( path, in, visitor );
+
+ in.close();
+ }
+ }
+
+ private static void visitClass( String path, InputStream in, ClassFileVisitor visitor )
+ {
+ if ( !path.endsWith( ".class" ) )
+ throw new IllegalArgumentException( "Path is not a class" );
+
+ String className = path.substring( 0, path.length() - 6 );
+
+ className = className.replace( '/', '.' );
+
+ visitor.visitClass( className, in );
+ }
+}
diff --git a/src/main/java/org/apache/maven/shared/dependency/analyzer/CollectorClassFileVisitor.java b/src/main/java/org/apache/maven/shared/dependency/analyzer/CollectorClassFileVisitor.java
index e2ee10b..a850279 100644
--- a/src/main/java/org/apache/maven/shared/dependency/analyzer/CollectorClassFileVisitor.java
+++ b/src/main/java/org/apache/maven/shared/dependency/analyzer/CollectorClassFileVisitor.java
@@ -1,63 +1,63 @@
-package org.apache.maven.shared.dependency.analyzer;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.io.InputStream;
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- *
- *
- * @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
- * @version $Id$
- */
-public class CollectorClassFileVisitor
- implements ClassFileVisitor
-{
- // fields -----------------------------------------------------------------
-
- private final Set classes;
-
- // constructors -----------------------------------------------------------
-
- public CollectorClassFileVisitor()
- {
- classes = new HashSet();
- }
-
- // ClassFileVisitor methods -----------------------------------------------
-
- /*
- * @see org.apache.maven.shared.dependency.analyzer.ClassFileVisitor#visitClass(java.lang.String,
- * java.io.InputStream)
- */
- public void visitClass( String className, InputStream in )
- {
- classes.add( className );
- }
-
- // public methods ---------------------------------------------------------
-
- public Set getClasses()
- {
- return classes;
- }
-}
+package org.apache.maven.shared.dependency.analyzer;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.InputStream;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ *
+ *
+ * @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
+ * @version $Id$
+ */
+public class CollectorClassFileVisitor
+ implements ClassFileVisitor
+{
+ // fields -----------------------------------------------------------------
+
+ private final Set classes;
+
+ // constructors -----------------------------------------------------------
+
+ public CollectorClassFileVisitor()
+ {
+ classes = new HashSet();
+ }
+
+ // ClassFileVisitor methods -----------------------------------------------
+
+ /*
+ * @see org.apache.maven.shared.dependency.analyzer.ClassFileVisitor#visitClass(java.lang.String,
+ * java.io.InputStream)
+ */
+ public void visitClass( String className, InputStream in )
+ {
+ classes.add( className );
+ }
+
+ // public methods ---------------------------------------------------------
+
+ public Set getClasses()
+ {
+ return classes;
+ }
+}
diff --git a/src/main/java/org/apache/maven/shared/dependency/analyzer/DefaultClassAnalyzer.java b/src/main/java/org/apache/maven/shared/dependency/analyzer/DefaultClassAnalyzer.java
index 5f70ed8..57067e6 100644
--- a/src/main/java/org/apache/maven/shared/dependency/analyzer/DefaultClassAnalyzer.java
+++ b/src/main/java/org/apache/maven/shared/dependency/analyzer/DefaultClassAnalyzer.java
@@ -1,50 +1,50 @@
-package org.apache.maven.shared.dependency.analyzer;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.Set;
-
-/**
- *
- *
- * @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
- * @version $Id$
- * @plexus.component role="org.apache.maven.shared.dependency.analyzer.ClassAnalyzer"
- */
-public class DefaultClassAnalyzer
- implements ClassAnalyzer
-{
- // ClassAnalyzer methods --------------------------------------------------
-
- /*
- * @see org.apache.maven.shared.dependency.analyzer.ClassAnalyzer#analyze(java.net.URL)
- */
- public Set analyze( URL url )
- throws IOException
- {
- CollectorClassFileVisitor visitor = new CollectorClassFileVisitor();
-
- ClassFileVisitorUtils.accept( url, visitor );
-
- return visitor.getClasses();
- }
-}
+package org.apache.maven.shared.dependency.analyzer;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.Set;
+
+/**
+ *
+ *
+ * @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
+ * @version $Id$
+ * @plexus.component role="org.apache.maven.shared.dependency.analyzer.ClassAnalyzer"
+ */
+public class DefaultClassAnalyzer
+ implements ClassAnalyzer
+{
+ // ClassAnalyzer methods --------------------------------------------------
+
+ /*
+ * @see org.apache.maven.shared.dependency.analyzer.ClassAnalyzer#analyze(java.net.URL)
+ */
+ public Set analyze( URL url )
+ throws IOException
+ {
+ CollectorClassFileVisitor visitor = new CollectorClassFileVisitor();
+
+ ClassFileVisitorUtils.accept( url, visitor );
+
+ return visitor.getClasses();
+ }
+}
diff --git a/src/main/java/org/apache/maven/shared/dependency/analyzer/DefaultProjectDependencyAnalyzer.java b/src/main/java/org/apache/maven/shared/dependency/analyzer/DefaultProjectDependencyAnalyzer.java
index ca801fc..dcba497 100644
--- a/src/main/java/org/apache/maven/shared/dependency/analyzer/DefaultProjectDependencyAnalyzer.java
+++ b/src/main/java/org/apache/maven/shared/dependency/analyzer/DefaultProjectDependencyAnalyzer.java
@@ -1,212 +1,212 @@
-package org.apache.maven.shared.dependency.analyzer;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.DefaultArtifact;
-import org.apache.maven.project.MavenProject;
-import org.codehaus.plexus.util.StringUtils;
-
-/**
- *
- *
- * @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
- * @version $Id$
- * @plexus.component role="org.apache.maven.shared.dependency.analyzer.ProjectDependencyAnalyzer"
- */
-public class DefaultProjectDependencyAnalyzer
- implements ProjectDependencyAnalyzer
-{
- // fields -----------------------------------------------------------------
-
- /**
- * ClassAnalyzer
- *
- * @plexus.requirement
- */
- private ClassAnalyzer classAnalyzer;
-
- /**
- * DependencyAnalyzer
- *
- * @plexus.requirement
- */
- private DependencyAnalyzer dependencyAnalyzer;
-
- // ProjectDependencyAnalyzer methods --------------------------------------
-
- /*
- * @see org.apache.maven.shared.dependency.analyzer.ProjectDependencyAnalyzer#analyze(org.apache.maven.project.MavenProject)
- */
- public ProjectDependencyAnalysis analyze( MavenProject project )
- throws ProjectDependencyAnalyzerException
- {
- File target = new File(project.getBuild().getDirectory());
-
- //gracefully handle pom projects and files with no target folders
- if ( "pom".equals( project.getPackaging() ) || !target.exists() )
- {
- //TODO: figure out how to log this.
- return new ProjectDependencyAnalysis(Collections.EMPTY_SET,Collections.EMPTY_SET,Collections.EMPTY_SET);
- }
-
- try
- {
- Map artifactClassMap = buildArtifactClassMap( project );
-
- Set dependencyClasses = buildDependencyClasses( project );
-
- Set declaredArtifacts = project.getDependencyArtifacts();
-
- Set usedArtifacts = new HashSet();
-
- for ( Iterator dependencyIterator = dependencyClasses.iterator(); dependencyIterator.hasNext(); )
- {
- String className = (String) dependencyIterator.next();
-
- Artifact artifact = findArtifactForClassName( artifactClassMap, className );
-
- if ( artifact != null )
- usedArtifacts.add( artifact );
- }
-
- Set usedDeclaredArtifacts = new HashSet( declaredArtifacts );
- usedDeclaredArtifacts.retainAll( usedArtifacts );
-
- Set usedUndeclaredArtifacts = new HashSet( usedArtifacts );
- usedUndeclaredArtifacts = removeAll( usedUndeclaredArtifacts, declaredArtifacts );
-
- Set unusedDeclaredArtifacts = new HashSet( declaredArtifacts );
- unusedDeclaredArtifacts = removeAll( unusedDeclaredArtifacts, usedArtifacts );
-
- return new ProjectDependencyAnalysis( usedDeclaredArtifacts, usedUndeclaredArtifacts,
- unusedDeclaredArtifacts );
- }
- catch ( IOException exception )
- {
- throw new ProjectDependencyAnalyzerException( "Cannot analyze dependencies", exception );
- }
- }
-
- /**
- * This method defines a new way to remove the artifacts by using the
- * conflict id. We don't care about the version here because there can be
- * only 1 for a given artifact anyway.
- *
- * @param start
- * initial set
- * @param remove
- * set to exclude
- * @return set with remove excluded
- */
- private Set removeAll( Set start, Set remove )
- {
- Set results = new HashSet( start.size() );
- Iterator iter = start.iterator();
- while ( iter.hasNext() )
- {
- Artifact artifact = (Artifact) iter.next();
- Iterator iter2 = remove.iterator();
- boolean found = false;
- while ( iter2.hasNext() )
- {
- Artifact artifact2 = (Artifact) iter2.next();
- DefaultArtifact a;
- if ( artifact.getDependencyConflictId().equals( artifact2.getDependencyConflictId() ) )
- {
- found = true;
- }
- }
- if ( !found )
- {
- results.add( artifact );
- }
- }
- return results;
- }
-
- // private methods --------------------------------------------------------
-
- private Map buildArtifactClassMap( MavenProject project )
- throws IOException
- {
- Map artifactClassMap = new HashMap();
-
- Set dependencyArtifacts = project.getArtifacts();
-
- for ( Iterator iterator = dependencyArtifacts.iterator(); iterator.hasNext(); )
- {
- Artifact artifact = (Artifact) iterator.next();
-
- File file = artifact.getFile();
-
- if ( file != null && file.getName().endsWith( ".jar" ) )
- {
- URL url = file.toURL();
-
- Set classes = classAnalyzer.analyze( url );
-
- artifactClassMap.put( artifact, classes );
- }
- }
-
- return artifactClassMap;
- }
-
- private Set buildDependencyClasses( MavenProject project )
- throws IOException
- {
- String buildDirectory = project.getBuild().getDirectory();
-
- URL buildDirectoryURL = new File( buildDirectory ).toURI().toURL();
-
- return dependencyAnalyzer.analyze( buildDirectoryURL );
- }
-
- private Artifact findArtifactForClassName( Map artifactClassMap, String className )
- {
- for ( Iterator artifactIterator = artifactClassMap.keySet().iterator(); artifactIterator.hasNext(); )
- {
- Artifact artifact = (Artifact) artifactIterator.next();
-
- Set artifactClassNames = (Set) artifactClassMap.get( artifact );
-
- for ( Iterator classNameIterator = artifactClassNames.iterator(); classNameIterator.hasNext(); )
- {
- String artifactClassName = (String) classNameIterator.next();
-
- if ( artifactClassName.equals( className ) )
- return artifact;
- }
- }
-
- return null;
- }
-}
+package org.apache.maven.shared.dependency.analyzer;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.DefaultArtifact;
+import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.util.StringUtils;
+
+/**
+ *
+ *
+ * @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
+ * @version $Id$
+ * @plexus.component role="org.apache.maven.shared.dependency.analyzer.ProjectDependencyAnalyzer"
+ */
+public class DefaultProjectDependencyAnalyzer
+ implements ProjectDependencyAnalyzer
+{
+ // fields -----------------------------------------------------------------
+
+ /**
+ * ClassAnalyzer
+ *
+ * @plexus.requirement
+ */
+ private ClassAnalyzer classAnalyzer;
+
+ /**
+ * DependencyAnalyzer
+ *
+ * @plexus.requirement
+ */
+ private DependencyAnalyzer dependencyAnalyzer;
+
+ // ProjectDependencyAnalyzer methods --------------------------------------
+
+ /*
+ * @see org.apache.maven.shared.dependency.analyzer.ProjectDependencyAnalyzer#analyze(org.apache.maven.project.MavenProject)
+ */
+ public ProjectDependencyAnalysis analyze( MavenProject project )
+ throws ProjectDependencyAnalyzerException
+ {
+ File target = new File(project.getBuild().getDirectory());
+
+ //gracefully handle pom projects and files with no target folders
+ if ( "pom".equals( project.getPackaging() ) || !target.exists() )
+ {
+ //TODO: figure out how to log this.
+ return new ProjectDependencyAnalysis(Collections.EMPTY_SET,Collections.EMPTY_SET,Collections.EMPTY_SET);
+ }
+
+ try
+ {
+ Map artifactClassMap = buildArtifactClassMap( project );
+
+ Set dependencyClasses = buildDependencyClasses( project );
+
+ Set declaredArtifacts = project.getDependencyArtifacts();
+
+ Set usedArtifacts = new HashSet();
+
+ for ( Iterator dependencyIterator = dependencyClasses.iterator(); dependencyIterator.hasNext(); )
+ {
+ String className = (String) dependencyIterator.next();
+
+ Artifact artifact = findArtifactForClassName( artifactClassMap, className );
+
+ if ( artifact != null )
+ usedArtifacts.add( artifact );
+ }
+
+ Set usedDeclaredArtifacts = new HashSet( declaredArtifacts );
+ usedDeclaredArtifacts.retainAll( usedArtifacts );
+
+ Set usedUndeclaredArtifacts = new HashSet( usedArtifacts );
+ usedUndeclaredArtifacts = removeAll( usedUndeclaredArtifacts, declaredArtifacts );
+
+ Set unusedDeclaredArtifacts = new HashSet( declaredArtifacts );
+ unusedDeclaredArtifacts = removeAll( unusedDeclaredArtifacts, usedArtifacts );
+
+ return new ProjectDependencyAnalysis( usedDeclaredArtifacts, usedUndeclaredArtifacts,
+ unusedDeclaredArtifacts );
+ }
+ catch ( IOException exception )
+ {
+ throw new ProjectDependencyAnalyzerException( "Cannot analyze dependencies", exception );
+ }
+ }
+
+ /**
+ * This method defines a new way to remove the artifacts by using the
+ * conflict id. We don't care about the version here because there can be
+ * only 1 for a given artifact anyway.
+ *
+ * @param start
+ * initial set
+ * @param remove
+ * set to exclude
+ * @return set with remove excluded
+ */
+ private Set removeAll( Set start, Set remove )
+ {
+ Set results = new HashSet( start.size() );
+ Iterator iter = start.iterator();
+ while ( iter.hasNext() )
+ {
+ Artifact artifact = (Artifact) iter.next();
+ Iterator iter2 = remove.iterator();
+ boolean found = false;
+ while ( iter2.hasNext() )
+ {
+ Artifact artifact2 = (Artifact) iter2.next();
+ DefaultArtifact a;
+ if ( artifact.getDependencyConflictId().equals( artifact2.getDependencyConflictId() ) )
+ {
+ found = true;
+ }
+ }
+ if ( !found )
+ {
+ results.add( artifact );
+ }
+ }
+ return results;
+ }
+
+ // private methods --------------------------------------------------------
+
+ private Map buildArtifactClassMap( MavenProject project )
+ throws IOException
+ {
+ Map artifactClassMap = new HashMap();
+
+ Set dependencyArtifacts = project.getArtifacts();
+
+ for ( Iterator iterator = dependencyArtifacts.iterator(); iterator.hasNext(); )
+ {
+ Artifact artifact = (Artifact) iterator.next();
+
+ File file = artifact.getFile();
+
+ if ( file != null && file.getName().endsWith( ".jar" ) )
+ {
+ URL url = file.toURL();
+
+ Set classes = classAnalyzer.analyze( url );
+
+ artifactClassMap.put( artifact, classes );
+ }
+ }
+
+ return artifactClassMap;
+ }
+
+ private Set buildDependencyClasses( MavenProject project )
+ throws IOException
+ {
+ String buildDirectory = project.getBuild().getDirectory();
+
+ URL buildDirectoryURL = new File( buildDirectory ).toURI().toURL();
+
+ return dependencyAnalyzer.analyze( buildDirectoryURL );
+ }
+
+ private Artifact findArtifactForClassName( Map artifactClassMap, String className )
+ {
+ for ( Iterator artifactIterator = artifactClassMap.keySet().iterator(); artifactIterator.hasNext(); )
+ {
+ Artifact artifact = (Artifact) artifactIterator.next();
+
+ Set artifactClassNames = (Set) artifactClassMap.get( artifact );
+
+ for ( Iterator classNameIterator = artifactClassNames.iterator(); classNameIterator.hasNext(); )
+ {
+ String artifactClassName = (String) classNameIterator.next();
+
+ if ( artifactClassName.equals( className ) )
+ return artifact;
+ }
+ }
+
+ return null;
+ }
+}
diff --git a/src/main/java/org/apache/maven/shared/dependency/analyzer/DependencyAnalyzer.java b/src/main/java/org/apache/maven/shared/dependency/analyzer/DependencyAnalyzer.java
index 1b6ee1d..c4d9153 100644
--- a/src/main/java/org/apache/maven/shared/dependency/analyzer/DependencyAnalyzer.java
+++ b/src/main/java/org/apache/maven/shared/dependency/analyzer/DependencyAnalyzer.java
@@ -1,42 +1,42 @@
-package org.apache.maven.shared.dependency.analyzer;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.Set;
-
-/**
- * DependencyAnalyzer
- *
- * @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
- * @version $Id$
- */
-public interface DependencyAnalyzer
-{
- // fields -----------------------------------------------------------------
-
- String ROLE = DependencyAnalyzer.class.getName();
-
- // public methods ---------------------------------------------------------
-
- Set analyze( URL url )
- throws IOException;
-}
+package org.apache.maven.shared.dependency.analyzer;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.Set;
+
+/**
+ * DependencyAnalyzer
+ *
+ * @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
+ * @version $Id$
+ */
+public interface DependencyAnalyzer
+{
+ // fields -----------------------------------------------------------------
+
+ String ROLE = DependencyAnalyzer.class.getName();
+
+ // public methods ---------------------------------------------------------
+
+ Set analyze( URL url )
+ throws IOException;
+}
diff --git a/src/main/java/org/apache/maven/shared/dependency/analyzer/ProjectDependencyAnalysis.java b/src/main/java/org/apache/maven/shared/dependency/analyzer/ProjectDependencyAnalysis.java
index c8052a2..b060acd 100644
--- a/src/main/java/org/apache/maven/shared/dependency/analyzer/ProjectDependencyAnalysis.java
+++ b/src/main/java/org/apache/maven/shared/dependency/analyzer/ProjectDependencyAnalysis.java
@@ -1,66 +1,66 @@
-package org.apache.maven.shared.dependency.analyzer;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.util.Set;
-
-/**
- *
- *
- * @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
- * @version $Id$
- */
-public class ProjectDependencyAnalysis
-{
- // fields -----------------------------------------------------------------
-
- private final Set usedDeclaredArtifacts;
-
- private final Set usedUndeclaredArtifacts;
-
- private final Set unusedDeclaredArtifacts;
-
- // constructors -----------------------------------------------------------
-
- public ProjectDependencyAnalysis( Set usedDeclaredArtifacts, Set usedUndeclaredArtifacts,
- Set unusedDeclaredArtifacts )
- {
- this.usedDeclaredArtifacts = usedDeclaredArtifacts;
- this.usedUndeclaredArtifacts = usedUndeclaredArtifacts;
- this.unusedDeclaredArtifacts = unusedDeclaredArtifacts;
- }
-
- // public methods ---------------------------------------------------------
-
- public Set getUsedDeclaredArtifacts()
- {
- return usedDeclaredArtifacts;
- }
-
- public Set getUsedUndeclaredArtifacts()
- {
- return usedUndeclaredArtifacts;
- }
-
- public Set getUnusedDeclaredArtifacts()
- {
- return unusedDeclaredArtifacts;
- }
-}
+package org.apache.maven.shared.dependency.analyzer;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.Set;
+
+/**
+ *
+ *
+ * @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
+ * @version $Id$
+ */
+public class ProjectDependencyAnalysis
+{
+ // fields -----------------------------------------------------------------
+
+ private final Set usedDeclaredArtifacts;
+
+ private final Set usedUndeclaredArtifacts;
+
+ private final Set unusedDeclaredArtifacts;
+
+ // constructors -----------------------------------------------------------
+
+ public ProjectDependencyAnalysis( Set usedDeclaredArtifacts, Set usedUndeclaredArtifacts,
+ Set unusedDeclaredArtifacts )
+ {
+ this.usedDeclaredArtifacts = usedDeclaredArtifacts;
+ this.usedUndeclaredArtifacts = usedUndeclaredArtifacts;
+ this.unusedDeclaredArtifacts = unusedDeclaredArtifacts;
+ }
+
+ // public methods ---------------------------------------------------------
+
+ public Set getUsedDeclaredArtifacts()
+ {
+ return usedDeclaredArtifacts;
+ }
+
+ public Set getUsedUndeclaredArtifacts()
+ {
+ return usedUndeclaredArtifacts;
+ }
+
+ public Set getUnusedDeclaredArtifacts()
+ {
+ return unusedDeclaredArtifacts;
+ }
+}
diff --git a/src/main/java/org/apache/maven/shared/dependency/analyzer/ProjectDependencyAnalyzer.java b/src/main/java/org/apache/maven/shared/dependency/analyzer/ProjectDependencyAnalyzer.java
index f060e5b..0780d64 100644
--- a/src/main/java/org/apache/maven/shared/dependency/analyzer/ProjectDependencyAnalyzer.java
+++ b/src/main/java/org/apache/maven/shared/dependency/analyzer/ProjectDependencyAnalyzer.java
@@ -1,40 +1,40 @@
-package org.apache.maven.shared.dependency.analyzer;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.maven.project.MavenProject;
-
-/**
- *
- *
- * @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
- * @version $Id$
- */
-public interface ProjectDependencyAnalyzer
-{
- // fields -----------------------------------------------------------------
-
- String ROLE = ProjectDependencyAnalyzer.class.getName();
-
- // public methods ---------------------------------------------------------
-
- ProjectDependencyAnalysis analyze( MavenProject project)
- throws ProjectDependencyAnalyzerException;
-}
+package org.apache.maven.shared.dependency.analyzer;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.maven.project.MavenProject;
+
+/**
+ *
+ *
+ * @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
+ * @version $Id$
+ */
+public interface ProjectDependencyAnalyzer
+{
+ // fields -----------------------------------------------------------------
+
+ String ROLE = ProjectDependencyAnalyzer.class.getName();
+
+ // public methods ---------------------------------------------------------
+
+ ProjectDependencyAnalysis analyze( MavenProject project)
+ throws ProjectDependencyAnalyzerException;
+}
diff --git a/src/main/java/org/apache/maven/shared/dependency/analyzer/ProjectDependencyAnalyzerException.java b/src/main/java/org/apache/maven/shared/dependency/analyzer/ProjectDependencyAnalyzerException.java
index 45e9de3..34bd8a0 100644
--- a/src/main/java/org/apache/maven/shared/dependency/analyzer/ProjectDependencyAnalyzerException.java
+++ b/src/main/java/org/apache/maven/shared/dependency/analyzer/ProjectDependencyAnalyzerException.java
@@ -1,49 +1,49 @@
-package org.apache.maven.shared.dependency.analyzer;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- *
- *
- * @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
- * @version $Id$
- */
-public class ProjectDependencyAnalyzerException
- extends Exception
-{
- // constants --------------------------------------------------------------
-
- /**
- * The serialisation unique ID.
- */
- private static final long serialVersionUID = -5954447543668196977L;
-
- // constructors -----------------------------------------------------------
-
- public ProjectDependencyAnalyzerException( String message )
- {
- super( message );
- }
-
- public ProjectDependencyAnalyzerException( String message, Throwable cause )
- {
- super( message, cause );
- }
-}
+package org.apache.maven.shared.dependency.analyzer;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ *
+ *
+ * @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
+ * @version $Id$
+ */
+public class ProjectDependencyAnalyzerException
+ extends Exception
+{
+ // constants --------------------------------------------------------------
+
+ /**
+ * The serialisation unique ID.
+ */
+ private static final long serialVersionUID = -5954447543668196977L;
+
+ // constructors -----------------------------------------------------------
+
+ public ProjectDependencyAnalyzerException( String message )
+ {
+ super( message );
+ }
+
+ public ProjectDependencyAnalyzerException( String message, Throwable cause )
+ {
+ super( message, cause );
+ }
+}
diff --git a/src/main/java/org/apache/maven/shared/dependency/analyzer/asm/ASMDependencyAnalyzer.java b/src/main/java/org/apache/maven/shared/dependency/analyzer/asm/ASMDependencyAnalyzer.java
index c31501e..88ca64c 100644
--- a/src/main/java/org/apache/maven/shared/dependency/analyzer/asm/ASMDependencyAnalyzer.java
+++ b/src/main/java/org/apache/maven/shared/dependency/analyzer/asm/ASMDependencyAnalyzer.java
@@ -1,53 +1,53 @@
-package org.apache.maven.shared.dependency.analyzer.asm;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.Set;
-
-import org.apache.maven.shared.dependency.analyzer.ClassFileVisitorUtils;
-import org.apache.maven.shared.dependency.analyzer.DependencyAnalyzer;
-
-/**
- * ASMDependencyAnalyzer
- *
- * @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
- * @version $Id$
- * @plexus.component role="org.apache.maven.shared.dependency.analyzer.DependencyAnalyzer"
- */
-public class ASMDependencyAnalyzer
- implements DependencyAnalyzer
-{
- // DependencyAnalyzer methods ---------------------------------------------
-
- /*
- * @see org.apache.maven.shared.dependency.analyzer.DependencyAnalyzer#analyze(java.net.URL)
- */
- public Set analyze( URL url )
- throws IOException
- {
- DependencyClassFileVisitor visitor = new DependencyClassFileVisitor();
-
- ClassFileVisitorUtils.accept( url, visitor );
-
- return visitor.getDependencies();
- }
-}
+package org.apache.maven.shared.dependency.analyzer.asm;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.Set;
+
+import org.apache.maven.shared.dependency.analyzer.ClassFileVisitorUtils;
+import org.apache.maven.shared.dependency.analyzer.DependencyAnalyzer;
+
+/**
+ * ASMDependencyAnalyzer
+ *
+ * @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
+ * @version $Id$
+ * @plexus.component role="org.apache.maven.shared.dependency.analyzer.DependencyAnalyzer"
+ */
+public class ASMDependencyAnalyzer
+ implements DependencyAnalyzer
+{
+ // DependencyAnalyzer methods ---------------------------------------------
+
+ /*
+ * @see org.apache.maven.shared.dependency.analyzer.DependencyAnalyzer#analyze(java.net.URL)
+ */
+ public Set analyze( URL url )
+ throws IOException
+ {
+ DependencyClassFileVisitor visitor = new DependencyClassFileVisitor();
+
+ ClassFileVisitorUtils.accept( url, visitor );
+
+ return visitor.getDependencies();
+ }
+}
diff --git a/src/main/java/org/apache/maven/shared/dependency/analyzer/asm/DependencyClassFileVisitor.java b/src/main/java/org/apache/maven/shared/dependency/analyzer/asm/DependencyClassFileVisitor.java
index 0034e2a..bc02c41 100644
--- a/src/main/java/org/apache/maven/shared/dependency/analyzer/asm/DependencyClassFileVisitor.java
+++ b/src/main/java/org/apache/maven/shared/dependency/analyzer/asm/DependencyClassFileVisitor.java
@@ -1,85 +1,85 @@
-package org.apache.maven.shared.dependency.analyzer.asm;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.apache.maven.shared.dependency.analyzer.ClassFileVisitor;
-import org.objectweb.asm.ClassReader;
-
-/**
- *
- *
- * @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
- * @version $Id$
- */
-public class DependencyClassFileVisitor
- implements ClassFileVisitor
-{
- // fields -----------------------------------------------------------------
-
- private final Set dependencies;
-
- // constructors -----------------------------------------------------------
-
- public DependencyClassFileVisitor()
- {
- dependencies = new HashSet();
- }
-
- // ClassFileVisitor methods -----------------------------------------------
-
- /*
- * @see org.apache.maven.shared.dependency.analyzer.ClassFileVisitor#visitClass(java.lang.String,
- * java.io.InputStream)
- */
- public void visitClass( String className, InputStream in )
- {
- try
- {
- ClassReader reader = new ClassReader( in );
- DependencyVisitor visitor = new DependencyVisitor();
-
- reader.accept( visitor, 0 );
-
- dependencies.addAll( visitor.getClasses() );
- }
- catch ( IOException exception )
- {
- exception.printStackTrace();
- }
- catch (IndexOutOfBoundsException e)
- {
- //some bug inside ASM causes an IOB exception. Log it and move on?
- //this happens when the class isn't valid.
- System.out.println("Unable to process: "+ className);
- }
- }
-
- // public methods ---------------------------------------------------------
-
- public Set getDependencies()
- {
- return dependencies;
- }
-}
+package org.apache.maven.shared.dependency.analyzer.asm;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.maven.shared.dependency.analyzer.ClassFileVisitor;
+import org.objectweb.asm.ClassReader;
+
+/**
+ *
+ *
+ * @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
+ * @version $Id$
+ */
+public class DependencyClassFileVisitor
+ implements ClassFileVisitor
+{
+ // fields -----------------------------------------------------------------
+
+ private final Set dependencies;
+
+ // constructors -----------------------------------------------------------
+
+ public DependencyClassFileVisitor()
+ {
+ dependencies = new HashSet();
+ }
+
+ // ClassFileVisitor methods -----------------------------------------------
+
+ /*
+ * @see org.apache.maven.shared.dependency.analyzer.ClassFileVisitor#visitClass(java.lang.String,
+ * java.io.InputStream)
+ */
+ public void visitClass( String className, InputStream in )
+ {
+ try
+ {
+ ClassReader reader = new ClassReader( in );
+ DependencyVisitor visitor = new DependencyVisitor();
+
+ reader.accept( visitor, 0 );
+
+ dependencies.addAll( visitor.getClasses() );
+ }
+ catch ( IOException exception )
+ {
+ exception.printStackTrace();
+ }
+ catch (IndexOutOfBoundsException e)
+ {
+ //some bug inside ASM causes an IOB exception. Log it and move on?
+ //this happens when the class isn't valid.
+ System.out.println("Unable to process: "+ className);
+ }
+ }
+
+ // public methods ---------------------------------------------------------
+
+ public Set getDependencies()
+ {
+ return dependencies;
+ }
+}
diff --git a/src/test/java/org/apache/maven/shared/dependency/analyzer/CollectorClassFileVisitorTest.java b/src/test/java/org/apache/maven/shared/dependency/analyzer/CollectorClassFileVisitorTest.java
index 4c25aa8..06d7ece 100644
--- a/src/test/java/org/apache/maven/shared/dependency/analyzer/CollectorClassFileVisitorTest.java
+++ b/src/test/java/org/apache/maven/shared/dependency/analyzer/CollectorClassFileVisitorTest.java
@@ -1,67 +1,67 @@
-package org.apache.maven.shared.dependency.analyzer;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.apache.maven.shared.dependency.analyzer.CollectorClassFileVisitor;
-
-import junit.framework.TestCase;
-
-/**
- * Tests <code>CollectorClassFileVisitor</code>.
- *
- * @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
- * @version $Id$
- * @see CollectorClassFileVisitor
- */
-public class CollectorClassFileVisitorTest
- extends TestCase
-{
- // fields -----------------------------------------------------------------
-
- private CollectorClassFileVisitor visitor;
-
- // TestCase thods ---------------------------------------------------------
-
- /*
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp()
- throws Exception
- {
- visitor = new CollectorClassFileVisitor();
- }
-
- // tests ------------------------------------------------------------------
-
- public void testVisitClass()
- {
- visitor.visitClass( "a.b.c", null );
- visitor.visitClass( "x.y.z", null );
-
- Set expected = new HashSet();
- expected.add( "a.b.c" );
- expected.add( "x.y.z" );
-
- assertEquals( expected, visitor.getClasses() );
- }
-}
+package org.apache.maven.shared.dependency.analyzer;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.maven.shared.dependency.analyzer.CollectorClassFileVisitor;
+
+import junit.framework.TestCase;
+
+/**
+ * Tests <code>CollectorClassFileVisitor</code>.
+ *
+ * @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
+ * @version $Id$
+ * @see CollectorClassFileVisitor
+ */
+public class CollectorClassFileVisitorTest
+ extends TestCase
+{
+ // fields -----------------------------------------------------------------
+
+ private CollectorClassFileVisitor visitor;
+
+ // TestCase thods ---------------------------------------------------------
+
+ /*
+ * @see junit.framework.TestCase#setUp()
+ */
+ protected void setUp()
+ throws Exception
+ {
+ visitor = new CollectorClassFileVisitor();
+ }
+
+ // tests ------------------------------------------------------------------
+
+ public void testVisitClass()
+ {
+ visitor.visitClass( "a.b.c", null );
+ visitor.visitClass( "x.y.z", null );
+
+ Set expected = new HashSet();
+ expected.add( "a.b.c" );
+ expected.add( "x.y.z" );
+
+ assertEquals( expected, visitor.getClasses() );
+ }
+}
diff --git a/src/test/java/org/apache/maven/shared/dependency/analyzer/InputStreamConstraint.java b/src/test/java/org/apache/maven/shared/dependency/analyzer/InputStreamConstraint.java
index 9481c88..93b273e 100644
--- a/src/test/java/org/apache/maven/shared/dependency/analyzer/InputStreamConstraint.java
+++ b/src/test/java/org/apache/maven/shared/dependency/analyzer/InputStreamConstraint.java
@@ -1,100 +1,100 @@
-package org.apache.maven.shared.dependency.analyzer;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.codehaus.plexus.util.IOUtil;
-import org.jmock.core.Constraint;
-
-/**
- *
- *
- * @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
- * @version $Id$
- */
-public class InputStreamConstraint
- implements Constraint
-{
- // constants --------------------------------------------------------------
-
- private static final String DEFAULT_CHARSET_NAME = "UTF-8";
-
- // fields -----------------------------------------------------------------
-
- private final String expected;
-
- private final String charsetName;
-
- // constructors -----------------------------------------------------------
-
- public InputStreamConstraint( String expected )
- {
- this( expected, DEFAULT_CHARSET_NAME );
- }
-
- public InputStreamConstraint( String expected, String charsetName )
- {
- this.expected = expected;
- this.charsetName = charsetName;
- }
-
- // Constraint methods -----------------------------------------------------
-
- /*
- * @see org.jmock.core.Constraint#eval(java.lang.Object)
- */
- public boolean eval( Object object )
- {
- if ( !( object instanceof InputStream ) )
- {
- return false;
- }
-
- InputStream in = (InputStream) object;
-
- try
- {
- String actual = IOUtil.toString( in, charsetName );
-
- return expected.equals( actual );
- }
- catch ( IOException exception )
- {
- return false;
- }
- }
-
- // SelfDescribing methods -------------------------------------------------
-
- /*
- * @see org.jmock.core.SelfDescribing#describeTo(java.lang.StringBuffer)
- */
- public StringBuffer describeTo( StringBuffer buffer )
- {
- buffer.append( "in(" );
- buffer.append( "\"" ).append( expected ).append( "\"" );
- buffer.append( "," ).append( charsetName );
- buffer.append( ")" );
-
- return buffer;
- }
-}
+package org.apache.maven.shared.dependency.analyzer;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.codehaus.plexus.util.IOUtil;
+import org.jmock.core.Constraint;
+
+/**
+ *
+ *
+ * @author <a href="mailto:markhobson@gmail.com">Mark Hobson</a>
+ * @version $Id$
+ */
+public class InputStreamConstraint
+ implements Constraint
+{
+ // constants --------------------------------------------------------------
+
+ private static final String DEFAULT_CHARSET_NAME = "UTF-8";
+
+ // fields -----------------------------------------------------------------
+
+ private final String expected;
+
+ private final String charsetName;
+
+ // constructors -----------------------------------------------------------
+
+ public InputStreamConstraint( String expected )
+ {
+ this( expected, DEFAULT_CHARSET_NAME );
+ }
+
+ public InputStreamConstraint( String expected, String charsetName )
+ {
+ this.expected = expected;
+ this.charsetName = charsetName;
+ }
+
+ // Constraint methods -----------------------------------------------------
+
+ /*
+ * @see org.jmock.core.Constraint#eval(java.lang.Object)
+ */
+ public boolean eval( Object object )
+ {
+ if ( !( object instanceof InputStream ) )
+ {
+ return false;
+ }
+
+ InputStream in = (InputStream) object;
+
+ try
+ {
+ String actual = IOUtil.toString( in, charsetName );
+
+ return expected.equals( actual );
+ }
+ catch ( IOException exception )
+ {
+ return false;
+ }
+ }
+
+ // SelfDescribing methods -------------------------------------------------
+
+ /*
+ * @see org.jmock.core.SelfDescribing#describeTo(java.lang.StringBuffer)
+ */
+ public StringBuffer describeTo( StringBuffer buffer )
+ {
+ buffer.append( "in(" );
+ buffer.append( "\"" ).append( expected ).append( "\"" );
+ buffer.append( "," ).append( charsetName );
+ buffer.append( ")" );
+
+ return buffer;
+ }
+}