Skip to content

Commit c8a3ca3

Browse files
authored
Merge pull request #1002 from aalhossary/miscellaneous
Miscellaneous
2 parents 6c5761c + 5e37463 commit c8a3ca3

7 files changed

Lines changed: 13 additions & 17 deletions

File tree

biojava-core/src/test/java/org/biojava/nbio/core/alignment/matrices/SubstitutionMatrixTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ void getMatrixReturnsCopy(){
5454
void matrixToString(){
5555
String asString = sm.toString();
5656
// description + 5*2 for ATCGNatcgn + 1 header + 1 for '-'
57-
assertEquals(13, asString.split("\n").length);
58-
String header = asString.split("\r?\n")[1];
57+
assertEquals(13, asString.split("\\n").length);
58+
String header = asString.split("\\R")[1];
5959
assertTrue(header.replaceAll(" ","").matches("[ATCGatcgNn-]+"));
6060
}
6161

@@ -64,8 +64,8 @@ void matrixAsString(){
6464
String asString = sm.getMatrixAsString();
6565

6666
// 5*2 for ATCGNatcgn + 1 header + 1 for '-'
67-
assertEquals(12, asString.split("\n").length);
68-
String header = asString.split("\r?\n")[0];
67+
assertEquals(12, asString.split("\\n").length);
68+
String header = asString.split("\\R")[0];
6969
assertTrue(header.replaceAll(" ","").matches("[ATCGatcgNn-]+"));
7070
}
7171
}

biojava-core/src/test/java/org/biojava/nbio/core/sequence/io/FastaGeneWriterTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void basicGeneWriterTest() throws Exception {
5858
fastaWriter.process();
5959

6060
String output = new String(os.toByteArray(), "UTF-8");
61-
String [] lines = output.split("\n");
61+
String [] lines = output.split("\\R");
6262
assertEquals(4,lines.length);
6363
assertEquals(">gene1", lines[0]);
6464
assertEquals("ATATATATATaTATAtatat", lines[1]);

biojava-integrationtest/src/test/java/org/biojava/nbio/structure/test/align/FlipAFPChainTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,9 @@ public static void rotateAtoms2(AFPChain afpChain,Atom[] ca2){
185185
}
186186

187187

188-
private static final String newline = System.getProperty("line.separator");
189188
private void printFirstMismatch(String s1, String s2){
190-
String[] spl1 = s1.split(newline);
191-
String[] spl2 = s2.split(newline);
189+
String[] spl1 = s1.split("\\R");
190+
String[] spl2 = s2.split("\\R");
192191

193192
for (int i = 0 ; i < spl1.length ; i++){
194193

biojava-integrationtest/src/test/java/org/biojava/nbio/structure/test/align/fatcat/FlipAFPChainTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,9 @@ public static void rotateAtoms2(AFPChain afpChain,Atom[] ca2){
204204
}
205205

206206

207-
static final String newline = System.getProperty("line.separator");
208207
public void printFirstMismatch(String s1, String s2){
209-
String[] spl1 = s1.split(newline);
210-
String[] spl2 = s2.split(newline);
208+
String[] spl1 = s1.split("\\R");
209+
String[] spl2 = s2.split("\\R");
211210

212211
for (int i = 0 ; i < spl1.length ; i++){
213212

biojava-integrationtest/src/test/java/org/biojava/nbio/structure/test/align/fatcat/TestOutputStrings.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ public class TestOutputStrings {
2828
private static final String newline = System.getProperty("line.separator");
2929

3030
public void printFirstMismatch(String s1, String s2){
31-
String[] spl1 = s1.split(newline);
32-
String[] spl2 = s2.split(newline);
31+
String[] spl1 = s1.split("\\R");
32+
String[] spl2 = s2.split("\\R");
3333

3434
for (int i = 0 ; i < spl1.length ; i++){
3535

biojava-structure/src/main/java/org/biojava/nbio/structure/BondImpl.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,7 @@ public int getBondOrder() {
175175
/**
176176
* Gets the distance between the two atoms of this bond.
177177
* <p>
178-
* This distance is calculated by {@link Calc#getDistance(Atom, Atom)}, but
179-
* this method will suppress the empty threat of a
180-
* {@link StructureException} that method makes.
178+
* This distance is calculated by {@link Calc#getDistance(Atom, Atom)}.
181179
*
182180
* @return the distance between the two atoms of this bond.
183181
*/

biojava-structure/src/main/java/org/biojava/nbio/structure/HetatomImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public void addAtom(Atom atom){
168168
String altLocStr = "";
169169
char altLoc = atom.getAltLoc();
170170
if (altLoc != ' ') altLocStr = "(alt loc '" + altLoc + "')";
171-
logger.warn("An atom with name " + atom.getName() + " " + altLocStr + " is already present in group: " + this.toString() + ". The atom with serial " + atom.getPDBserial() + " will be ignored in look-ups.");
171+
logger.warn("An atom with name " + atom.getName() + " " + altLocStr + " is already present in group: " + this.toString() + ". The atom with serial " + existingAtom.getPDBserial() + " will be ignored in look-ups.");
172172
}
173173
}
174174
}

0 commit comments

Comments
 (0)