From 924c57be703d14869c75d3e906fb2b76bbf7eb5d Mon Sep 17 00:00:00 2001 From: leriomaggio Date: Sat, 28 Aug 2021 20:58:06 +0100 Subject: [PATCH] FIX typo, and renamed vars! --- .../src/main/java/forge/card/CardEdition.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/forge-core/src/main/java/forge/card/CardEdition.java b/forge-core/src/main/java/forge/card/CardEdition.java index ed9d8ed12b1..820c6865c30 100644 --- a/forge-core/src/main/java/forge/card/CardEdition.java +++ b/forge-core/src/main/java/forge/card/CardEdition.java @@ -211,22 +211,22 @@ public final class CardEdition implements Comparable { // Now, for proper sorting, let's zero-pad the collector number (if integer) int collNr; - String sortableCollNr = inputCollNumber; + String sortableCollNr; try { collNr = Integer.parseInt(inputCollNumber); sortableCollNr = String.format("%05d", collNr); } catch (NumberFormatException ex) { - String nonNumeric = sortableCollNr.replaceAll("[0-9]", ""); - String onlyNumeric = sortableCollNr.replaceAll("[^0-9]", ""); + String nonNumSub = inputCollNumber.replaceAll("[0-9]", ""); + String onlyNumSub = inputCollNumber.replaceAll("[^0-9]", ""); try { - collNr = Integer.parseInt(onlyNumeric); + collNr = Integer.parseInt(onlyNumSub); } catch (NumberFormatException exon) { collNr = 0; // this is the case of ONLY-letters collector numbers } - if ((collNr > 0) && (sortableCollNr.startsWith(onlyNumeric))) // e.g. 12a, 37+, 2018f, - sortableCollNr = String.format("%05d", collNr) + nonNumeric; + if ((collNr > 0) && (inputCollNumber.startsWith(onlyNumSub))) // e.g. 12a, 37+, 2018f, + sortableCollNr = String.format("%05d", collNr) + nonNumSub; else // e.g. WS6, S1 - sortableCollNr = nonNumeric + String.format("%05d", collNr); + sortableCollNr = nonNumSub + String.format("%05d", collNr); } sortableCollNumberLookup.put(inputCollNumber, sortableCollNr); return sortableCollNr;