Skip to content

Commit

Permalink
fixing stylecheck error by adding space before and after +/-
Browse files Browse the repository at this point in the history
  • Loading branch information
jiezheng5 committed Nov 7, 2021
1 parent 1cb2f23 commit e49a1d2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/java/org/jabref/model/entry/identifier/DOI.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ public DOI(String doi) {
// Remove whitespace
String trimmedDoi = doi.trim();

//jie add-------------------------
// jie add-------------------------
trimmedDoi = removeScharDOI(trimmedDoi);
//jie add done--------------------
// jie add done--------------------

// HTTP URL decoding
if (doi.matches(HTTP_EXP) || doi.matches(SHORT_DOI_HTTP_EXP)) {
Expand Down Expand Up @@ -152,9 +152,9 @@ public DOI(String doi) {
* @return an DOI string with the special character at the end removed
*/
public static String removeScharDOI(String doiStr) {
//jie add
// jie add
char[] lcharDoi = doiStr.toCharArray();
int i = lcharDoi.length-1;
int i = lcharDoi.length - 1;
// valid DOI characters are a-z(97-122), A-Z(65-90), 0-9(48-57), -(45), .(46), _(95), ;(59), ( (40), ) (41), /(47)
for (; i >= 0; i--) {
if ((lcharDoi[i] >= 45 && lcharDoi[i] <= 47) ||
Expand Down Expand Up @@ -183,7 +183,7 @@ public static String removeScharDOI(String doiStr) {
// break;
// }
// }
return doiStr.substring(0, i+1);
return doiStr.substring(0, i + 1);
}

/**
Expand Down

0 comments on commit e49a1d2

Please sign in to comment.