Skip to content

Commit d1f6150

Browse files
committed
Remove dead code
1 parent 0b1b720 commit d1f6150

File tree

1 file changed

+0
-34
lines changed

1 file changed

+0
-34
lines changed

sbm-support-rewrite/src/main/java/org/springframework/sbm/parsers/BuildFileParser.java

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -124,22 +124,8 @@ private Map<Path, Xml.Document> createResult(Path basePath, List<Resource> pomFi
124124
return parsedPoms.stream()
125125
.map(pom -> mapResourceToDocument(basePath, pom, pomFiles))
126126
.collect(Collectors.toMap(e-> ResourceUtil.getPath(e.getKey()), e -> e.getValue()));
127-
128-
129-
130-
// return pomFiles.stream()
131-
// .map(pom -> mapResourceToDocument(basePath, pom, parsedPoms))
132-
// .sorted(this::sortMap)
133-
// .collect(Collectors.toMap(l -> l.getKey(), l -> l.getValue()));
134127
}
135128

136-
private int sortMap(Map.Entry<Resource, Xml.Document> e1, Map.Entry<Resource, Xml.Document> e2) {
137-
Path path1 = ResourceUtil.getPath(e1.getKey());
138-
Path path2 = ResourceUtil.getPath(e2.getKey());
139-
return path1.compareTo(path2);
140-
}
141-
142-
143129
private Map.Entry<Resource, Xml.Document> mapResourceToDocument(Path basePath, SourceFile pom, List<Resource> parsedPoms) {
144130
Xml.Document doc = (Xml.Document) pom;
145131
Resource resource = parsedPoms.stream()
@@ -149,17 +135,6 @@ private Map.Entry<Resource, Xml.Document> mapResourceToDocument(Path basePath, S
149135
return Map.entry(resource, doc);
150136
}
151137

152-
private static Map.Entry<Resource, Xml.Document> mapResourceToDocument(Path basePath, Resource pom, List<SourceFile> parsedPoms) {
153-
Xml.Document sourceFile = parsedPoms
154-
.stream()
155-
.filter(p -> basePath.resolve(p.getSourcePath()).normalize().toString().equals(ResourceUtil.getPath(pom).toString()))
156-
.filter(Xml.Document.class::isInstance)
157-
.map(Xml.Document.class::cast)
158-
.findFirst()
159-
.get();
160-
return Map.entry(pom, sourceFile);
161-
}
162-
163138
private List<SourceFile> parsePoms(Path baseDir, List<Resource> pomFiles, MavenParser.Builder mavenParserBuilder, ExecutionContext executionContext) {
164139
Iterable<Parser.Input> pomFileInputs = pomFiles.stream()
165140
.map(p -> new Parser.Input(ResourceUtil.getPath(p), () -> ResourceUtil.getInputStream(p)))
@@ -209,15 +184,6 @@ private void initializeMavenSettings(ExecutionContext executionContext) {
209184

210185
}
211186

212-
private List<Resource> collectUpstreamPomFiles(List<Resource> pomFiles) {
213-
// pomFiles.stream()
214-
// .map(mavenModelReader::readModel)
215-
// .map(Model::)
216-
// return pomFiles;
217-
// FIXME: implement
218-
return null;
219-
}
220-
221187
public List<Resource> filterAndSortBuildFiles(List<Resource> resources) {
222188
return resources.stream()
223189
.filter(r -> "pom.xml".equals(ResourceUtil.getPath(r).toFile().getName()))

0 commit comments

Comments
 (0)