Skip to content

Commit 2eaa8a9

Browse files
committed
Cosmetics
1 parent c83ece2 commit 2eaa8a9

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

biojava-structure/src/main/java/org/biojava/nbio/structure/io/EntityFinder.java

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
import java.util.Comparator;
4444
import java.util.HashMap;
4545
import java.util.List;
46-
import java.util.Map;
4746
import java.util.Set;
4847
import java.util.TreeMap;
4948
import java.util.TreeSet;
@@ -91,9 +90,7 @@ public class EntityFinder {
9190
public static List<EntityInfo> findPolyEntities(List<List<Chain>> polyModels) {
9291
TreeMap<String,EntityInfo> chainIds2entities = findEntitiesFromAlignment(polyModels);
9392

94-
List<EntityInfo> entities = findUniqueEntities(chainIds2entities);
95-
96-
return entities;
93+
return findUniqueEntities(chainIds2entities);
9794
}
9895

9996
/**
@@ -102,7 +99,7 @@ public static List<EntityInfo> findPolyEntities(List<List<Chain>> polyModels) {
10299
*/
103100
private static List<EntityInfo> findUniqueEntities(TreeMap<String,EntityInfo> chainIds2entities) {
104101

105-
List<EntityInfo> list = new ArrayList<EntityInfo>();
102+
List<EntityInfo> list = new ArrayList<>();
106103

107104
for (EntityInfo cluster:chainIds2entities.values()) {
108105
boolean present = false;
@@ -131,12 +128,7 @@ public static void createPurelyNonPolyEntities(List<List<Chain>> nonPolyModels,
131128
// let's find first the max entity id to assign entity ids to the newly found entities
132129
int maxMolId = 0;
133130
if (!entities.isEmpty()) {
134-
maxMolId = Collections.max(entities, new Comparator<EntityInfo>() {
135-
@Override
136-
public int compare(EntityInfo o1, EntityInfo o2) {
137-
return new Integer(o1.getMolId()).compareTo(o2.getMolId());
138-
}
139-
}).getMolId();
131+
maxMolId = Collections.max(entities, Comparator.comparingInt(EntityInfo::getMolId)).getMolId();
140132
}
141133
// we go one over the max
142134
int molId = maxMolId + 1;
@@ -181,7 +173,6 @@ public int compare(EntityInfo o1, EntityInfo o2) {
181173

182174
}
183175

184-
185176
}
186177

187178
private static EntityInfo findNonPolyEntityWithDescription(String description, List<EntityInfo> nonPolyEntities) {
@@ -221,7 +212,6 @@ private static boolean areResNumbersAligned(Chain c1, Chain c2) {
221212
} catch (StructureException e) {
222213
// the group doesn't exist (no density) in the chain, go on
223214
countNonExisting++;
224-
continue;
225215
}
226216
}
227217

0 commit comments

Comments
 (0)