@Test public void testPropertiesCopied() { Map<String, String> props = new HashMap<String, String>(); props.put( "key", "value1" ); Artifact a = new SubArtifact( newMainArtifact( "gid:aid:ver" ), "", "pom", props, null ); assertEquals( "value1", a.getProperty( "key", null ) ); props.clear(); assertEquals( "value1", a.getProperty( "key", null ) ); props.put( "key", "value2" ); a = a.setProperties( props ); assertEquals( "value2", a.getProperty( "key", null ) ); props.clear(); assertEquals( "value2", a.getProperty( "key", null ) ); }
public Artifact setProperties( Map<String, String> properties ) { if ( this.properties.equals( properties ) || ( properties == null && this.properties.isEmpty() ) ) { return this; } return new SubArtifact( mainArtifact, classifier, extension, properties, file ); }
SubArtifact extends AbstractArtifact { public Artifact setProperties( Map<String, String> properties ) { if ( this.properties.equals( properties ) || ( properties == null && this.properties.isEmpty() ) ) { return this; } return new SubArtifact( mainArtifact, classifier, extension, properties, file ); } }
SubArtifact extends AbstractArtifact { public Artifact setProperties( Map<String, String> properties ) { if ( this.properties.equals( properties ) || ( properties == null && this.properties.isEmpty() ) ) { return this; } return new SubArtifact( mainArtifact, classifier, extension, properties, file ); } SubArtifact( Artifact mainArtifact, String classifier, String extension );  SubArtifact( Artifact mainArtifact, String classifier, String extension, File file );  SubArtifact( Artifact mainArtifact, String classifier, String extension, Map<String, String> properties );  SubArtifact( Artifact mainArtifact, String classifier, String extension, Map<String, String> properties,
                        File file ); private  SubArtifact( Artifact mainArtifact, String classifier, String extension, File file,
                         Map<String, String> properties ); }
SubArtifact extends AbstractArtifact { public Artifact setProperties( Map<String, String> properties ) { if ( this.properties.equals( properties ) || ( properties == null && this.properties.isEmpty() ) ) { return this; } return new SubArtifact( mainArtifact, classifier, extension, properties, file ); } SubArtifact( Artifact mainArtifact, String classifier, String extension );  SubArtifact( Artifact mainArtifact, String classifier, String extension, File file );  SubArtifact( Artifact mainArtifact, String classifier, String extension, Map<String, String> properties );  SubArtifact( Artifact mainArtifact, String classifier, String extension, Map<String, String> properties,
                        File file ); private  SubArtifact( Artifact mainArtifact, String classifier, String extension, File file,
                         Map<String, String> properties ); String getGroupId(); String getArtifactId(); String getVersion(); String getBaseVersion(); boolean isSnapshot(); String getClassifier(); String getExtension(); File getFile(); Artifact setFile( File file ); Map<String, String> getProperties(); Artifact setProperties( Map<String, String> properties ); }
SubArtifact extends AbstractArtifact { public Artifact setProperties( Map<String, String> properties ) { if ( this.properties.equals( properties ) || ( properties == null && this.properties.isEmpty() ) ) { return this; } return new SubArtifact( mainArtifact, classifier, extension, properties, file ); } SubArtifact( Artifact mainArtifact, String classifier, String extension );  SubArtifact( Artifact mainArtifact, String classifier, String extension, File file );  SubArtifact( Artifact mainArtifact, String classifier, String extension, Map<String, String> properties );  SubArtifact( Artifact mainArtifact, String classifier, String extension, Map<String, String> properties,
                        File file ); private  SubArtifact( Artifact mainArtifact, String classifier, String extension, File file,
                         Map<String, String> properties ); String getGroupId(); String getArtifactId(); String getVersion(); String getBaseVersion(); boolean isSnapshot(); String getClassifier(); String getExtension(); File getFile(); Artifact setFile( File file ); Map<String, String> getProperties(); Artifact setProperties( Map<String, String> properties );  }