Skip to content

Commit 11274d1

Browse files
authored
Remove a few tbousand lines of commented and obslete code (#2200)
1 parent f63d92c commit 11274d1

File tree

28 files changed

+2
-1168
lines changed

28 files changed

+2
-1168
lines changed

compat/maven-artifact/src/test/java/org/apache/maven/artifact/versioning/VersionRangeTest.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -720,12 +720,6 @@ public boolean enforceVersion(String requiredVersionRange, ArtifactVersion actua
720720
return vr.containsVersion(actualVersion);
721721
}
722722

723-
@Test
724-
void testOrder0() {
725-
// assertTrue( new DefaultArtifactVersion( "1.0-alpha10" ).compareTo( new DefaultArtifactVersion( "1.0-alpha1" )
726-
// ) > 0 );
727-
}
728-
729723
@Test
730724
void testCache() throws InvalidVersionSpecificationException {
731725
VersionRange range = VersionRange.createFromVersionSpec("[1.0,1.2]");

compat/maven-compat/src/main/java/org/apache/maven/artifact/resolver/ResolutionListener.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
/**
2525
* Listens to the resolution process and handles events.
26-
*
2726
*/
2827
@Deprecated
2928
public interface ResolutionListener {
@@ -77,13 +76,8 @@ public interface ResolutionListener {
7776
@Deprecated
7877
void manageArtifact(Artifact artifact, Artifact replacement);
7978

80-
// TODO Use the following two instead of manageArtifact
8179
// TODO Remove ResolutionListenerDM interface
8280

83-
// void manageArtifactVersion( Artifact artifact, Artifact replacement );
84-
85-
// void manageArtifactScope( Artifact artifact, Artifact replacement );
86-
8781
void omitForCycle(Artifact artifact);
8882

8983
/**

compat/maven-compat/src/main/java/org/apache/maven/project/interpolation/StringSearchModelInterpolator.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,6 @@ private boolean isQualifiedForInterpolation(Field field, Class<?> fieldType) {
273273
return false;
274274
}
275275

276-
// if ( fieldType.isPrimitive() )
277-
// {
278-
// return false;
279-
// }
280-
281276
return !"parent".equals(field.getName());
282277
}
283278

compat/maven-compat/src/main/java/org/apache/maven/project/validation/ModelValidationResult.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,6 @@ public String render(String indentation) {
6363
}
6464

6565
StringBuilder message = new StringBuilder();
66-
67-
// if ( messages.size() == 1 )
68-
// {
69-
// message.append( "There was 1 validation error: " );
70-
// }
71-
// else
72-
// {
73-
// message.append( "There was " + messages.size() + " validation errors: " + LS );
74-
// }
75-
//
7666
for (int i = 0; i < messages.size(); i++) {
7767
message.append(indentation)
7868
.append('[')

compat/maven-compat/src/main/java/org/apache/maven/repository/legacy/LegacyRepositorySystem.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -331,22 +331,6 @@ public ArtifactResolutionResult resolve(ArtifactResolutionRequest request) {
331331
return artifactResolver.resolve(request);
332332
}
333333

334-
// public void addProxy( String protocol, String host, int port, String username, String password,
335-
// String nonProxyHosts )
336-
// {
337-
// ProxyInfo proxyInfo = new ProxyInfo();
338-
// proxyInfo.setHost( host );
339-
// proxyInfo.setType( protocol );
340-
// proxyInfo.setPort( port );
341-
// proxyInfo.setNonProxyHosts( nonProxyHosts );
342-
// proxyInfo.setUserName( username );
343-
// proxyInfo.setPassword( password );
344-
//
345-
// proxies.put( protocol, proxyInfo );
346-
//
347-
// wagonManager.addProxy( protocol, host, port, username, password, nonProxyHosts );
348-
// }
349-
350334
public List<ArtifactRepository> getEffectiveRepositories(List<ArtifactRepository> repositories) {
351335
if (repositories == null) {
352336
return null;

compat/maven-compat/src/main/java/org/apache/maven/repository/metadata/ArtifactMetadata.java

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -169,27 +169,7 @@ public ArtifactMetadata(
169169
error);
170170
}
171171

172-
public ArtifactMetadata(Artifact af) {
173-
/*
174-
if ( af != null )
175-
{
176-
init( af );
177-
}
178-
*/
179-
}
180-
// ------------------------------------------------------------------
181-
// public void init( ArtifactMetadata af )
182-
// {
183-
// setGroupId( af.getGroupId() );
184-
// setArtifactId( af.getArtifactId() );
185-
// setVersion( af.getVersion() );
186-
// setType( af.getType() );
187-
// setScope( af.getScope() );
188-
// setClassifier( af.getClassifier() );
189-
// //setUri( af.getDownloadUrl() );
190-
//
191-
// this.resolved = af.isResolved();
192-
// }
172+
public ArtifactMetadata(Artifact af) {}
193173

194174
@Override
195175
public String toString() {

compat/maven-compat/src/main/java/org/apache/maven/repository/metadata/DefaultClasspathTransformation.java

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -101,27 +101,6 @@ protected void visit(MetadataGraphVertex node) // , String version, String artif
101101
}
102102

103103
cpc.add(md);
104-
//
105-
// TreeSet<MetadataGraphEdge> deps = new TreeSet<MetadataGraphEdge>(
106-
// new Comparator<MetadataGraphEdge>()
107-
// {
108-
// public int compare( MetadataGraphEdge e1
109-
// , MetadataGraphEdge e2
110-
// )
111-
// {
112-
// if( e1.getDepth() == e2.getDepth() )
113-
// {
114-
// if( e2.getPomOrder() == e1.getPomOrder() )
115-
// return
116-
// e1.getTarget().toString().compareTo(e2.getTarget().toString() );
117-
//
118-
// return e2.getPomOrder() - e1.getPomOrder();
119-
// }
120-
//
121-
// return e2.getDepth() - e1.getDepth();
122-
// }
123-
// }
124-
// );
125104

126105
List<MetadataGraphEdge> exits = graph.getExcidentEdges(node);
127106

compat/maven-compat/src/main/java/org/apache/maven/repository/metadata/DefaultGraphConflictResolver.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,8 @@ public MetadataGraph resolveConflicts(MetadataGraph graph, ArtifactScopeEnum sco
9494
if (entry.equals(v)) { // unless it's an entry point.
9595
// currently processing the entry point - it should not have any entry incident edges
9696
res.getEntry().getMd().setWhy("This is a graph entry point. No links.");
97-
} else {
98-
// System.out.println("--->"+v.getMd().toDomainString()
99-
// +" has been terminated on this entry set\n-------------------\n"
100-
// +ins
101-
// +"\n-------------------\n"
102-
// );
10397
}
10498
} else {
105-
// System.out.println("+++>"+v.getMd().toDomainString()+" still has "+edge.toString() );
10699
// fill in domain md with actual version data
107100
ArtifactMetadata md = v.getMd();
108101
ArtifactMetadata newMd = new ArtifactMetadata(
@@ -126,10 +119,6 @@ public MetadataGraph resolveConflicts(MetadataGraph graph, ArtifactScopeEnum sco
126119
res.addEdge(sourceV, newV, edge);
127120
}
128121
}
129-
// System.err.println("Original graph("+graph.getVertices().size()+"):\n"+graph.toString());
130-
// System.err.println("Cleaned("+requestedScope+") graph("+res.getVertices().size()+"):\n"+res.toString());
131-
// System.err.println("Linked("+requestedScope+")
132-
// subgraph("+linkedRes.getVertices().size()+"):\n"+linkedRes.toString());
133122
return findLinkedSubgraph(res);
134123
} catch (MetadataResolutionException e) {
135124
throw new GraphConflictResolutionException(e);

compat/maven-compat/src/main/java/org/apache/maven/repository/metadata/MetadataGraphVertex.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,5 @@ public int hashCode() {
168168
}
169169

170170
return hashString.toString().hashCode();
171-
172-
// BASE64Encoder b64 = new BASE64Encoder();
173-
// return b64.encode( hashString.toString().getBytes() ).hashCode();
174171
}
175-
176-
// ---------------------------------------------------------------------
177-
// ---------------------------------------------------------------------
178172
}

compat/maven-compat/src/main/java/org/apache/maven/settings/DefaultMavenSettingsBuilder.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,6 @@ private File getFile(String pathPattern, String basedirSysProp, String altLocati
125125
// basedirSysProp is non regexp and basedir too
126126
path = pathPattern.replace("${" + basedirSysProp + "}", basedir);
127127
path = path.replace("\\", "/");
128-
// ---------------------------------------------------------------------------------
129-
// I'm not sure if this last regexp was really intended to disallow the usage of
130-
// network paths as user.home directory. Unfortunately it did. I removed it and
131-
// have not detected any problems yet.
132-
// ---------------------------------------------------------------------------------
133-
// path = path.replaceAll( "//", "/" );
134-
135128
}
136129
return new File(path).getAbsoluteFile();
137130
}

compat/maven-compat/src/main/java/org/apache/maven/toolchain/java/JavaToolchain.java

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -27,38 +27,4 @@
2727
* @deprecated Use {@link org.apache.maven.api.JavaToolchain} instead.
2828
*/
2929
@Deprecated(since = "4.0.0")
30-
public interface JavaToolchain extends Toolchain {
31-
// /**
32-
// * Returns a list of {@link java.io.File}s which represents the bootstrap libraries for the
33-
// * runtime environment. The Bootstrap libraries include libraries in JRE's
34-
// * extension directory, if there are any.
35-
// *
36-
// * @return List
37-
// */
38-
// List getBootstrapLibraries();
39-
//
40-
// /**
41-
// * Returns a list of {@link java.io.File}s which represent the libraries recognized by
42-
// * default by the platform. Usually it corresponds to contents of CLASSPATH
43-
// * environment variable.
44-
// *
45-
// * @return List
46-
// */
47-
// List getStandardLibraries();
48-
//
49-
// /**
50-
// * Returns a {@link java.io.File}s which represent the locations of the source of the JDK,
51-
// * or an empty collection when the location is not set or is invalid.
52-
// *
53-
// * @return List
54-
// */
55-
// List getSourceDirectories();
56-
//
57-
// /**
58-
// * Returns a {@link java.io.File}s which represent the locations of the Javadoc for this platform,
59-
// * or empty collection if the location is not set or invalid
60-
// *
61-
// * @return List
62-
// */
63-
// List getJavadocDirectories();
64-
}
30+
public interface JavaToolchain extends Toolchain {}

compat/maven-compat/src/test/java/org/apache/maven/ProjectDependenciesResolverTest.java

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -45,31 +45,6 @@ protected String getProjectsDirectory() {
4545
return "src/test/projects/project-dependencies-resolver";
4646
}
4747

48-
/*
49-
@Test
50-
public void testExclusionsInDependencies()
51-
throws Exception
52-
{
53-
MavenSession session = createMavenSession( null );
54-
MavenProject project = session.getCurrentProject();
55-
56-
Exclusion exclusion = new Exclusion();
57-
exclusion.setGroupId( "org.apache.maven.its" );
58-
exclusion.setArtifactId( "a" );
59-
60-
new ProjectBuilder( project ).addDependency( "org.apache.maven.its", "b", "0.1", Artifact.SCOPE_RUNTIME,
61-
exclusion );
62-
63-
Set<Artifact> artifactDependencies =
64-
resolver.resolve( project, Collections.singleton( Artifact.SCOPE_COMPILE ), session );
65-
assertEquals( 0, artifactDependencies.size() );
66-
67-
artifactDependencies = resolver.resolve( project, Collections.singleton( Artifact.SCOPE_RUNTIME ), session );
68-
assertEquals( 1, artifactDependencies.size() );
69-
assertEquals( "b", artifactDependencies.iterator().next().getArtifactId() );
70-
}
71-
*/
72-
7348
@Test
7449
void testSystemScopeDependencies() throws Exception {
7550
MavenSession session = createMavenSession(null);

compat/maven-compat/src/test/java/org/apache/maven/profiles/manager/DefaultProfileManagerTest.java

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import org.apache.maven.profiles.ProfileManager;
3131
import org.codehaus.plexus.PlexusContainer;
3232
import org.codehaus.plexus.testing.PlexusTest;
33-
import org.junit.jupiter.api.Disabled;
3433
import org.junit.jupiter.api.Test;
3534

3635
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -200,35 +199,4 @@ void testShouldOverrideAndDeactivateActiveProfile() throws Exception {
200199
assertNotNull(active);
201200
assertEquals(0, active.size());
202201
}
203-
204-
@Test
205-
@Disabled
206-
void testOsActivationProfile() throws Exception {
207-
/*
208-
Profile osActivated = new Profile();
209-
osActivated.setId( "os-profile" );
210-
211-
Activation osActivation = new Activation();
212-
213-
ActivationOS activationOS = new ActivationOS();
214-
215-
activationOS.setName( "!dddd" );
216-
217-
osActivation.setOs( activationOS );
218-
219-
osActivated.setActivation( osActivation );
220-
221-
Properties props = System.getProperties();
222-
ProfileActivationContext ctx = new ProfileActivationContext( props, false );
223-
224-
ProfileManager profileManager = new DefaultProfileManager( getContainer(), props );
225-
226-
profileManager.addProfile( osActivated );
227-
228-
List active = profileManager.getActiveProfiles( null );
229-
230-
assertNotNull( active );
231-
assertEquals( 1, active.size() );
232-
*/
233-
}
234202
}

0 commit comments

Comments
 (0)