@Test public void testStripDiscriminator() { Assert.assertEquals(NumericLiteralSupport.stripDiscriminator("3"), "3"); Assert.assertEquals(NumericLiteralSupport.stripDiscriminator("abc"), "abc"); Assert.assertEquals(NumericLiteralSupport.stripDiscriminator("abcf"), "abc"); Assert.assertEquals(NumericLiteralSupport.stripDiscriminator("abcF"), "abc"); Assert.assertEquals(NumericLiteralSupport.stripDiscriminator("abcd"), "abc"); Assert.assertEquals(NumericLiteralSupport.stripDiscriminator("abcD"), "abc"); }
public static String stripDiscriminator(String literalValue) { int length = literalValue.length(); if (length < 2) { return literalValue; } char lastChar = literalValue.charAt(length - 1); if (lastChar == 'f' || lastChar == 'F' || lastChar == 'd' || lastChar == 'D') { return literalValue.substring(0, length - 1); } return literalValue; }
NumericLiteralSupport { public static String stripDiscriminator(String literalValue) { int length = literalValue.length(); if (length < 2) { return literalValue; } char lastChar = literalValue.charAt(length - 1); if (lastChar == 'f' || lastChar == 'F' || lastChar == 'd' || lastChar == 'D') { return literalValue.substring(0, length - 1); } return literalValue; } }
NumericLiteralSupport { public static String stripDiscriminator(String literalValue) { int length = literalValue.length(); if (length < 2) { return literalValue; } char lastChar = literalValue.charAt(length - 1); if (lastChar == 'f' || lastChar == 'F' || lastChar == 'd' || lastChar == 'D') { return literalValue.substring(0, length - 1); } return literalValue; } private  NumericLiteralSupport(); }
NumericLiteralSupport { public static String stripDiscriminator(String literalValue) { int length = literalValue.length(); if (length < 2) { return literalValue; } char lastChar = literalValue.charAt(length - 1); if (lastChar == 'f' || lastChar == 'F' || lastChar == 'd' || lastChar == 'D') { return literalValue.substring(0, length - 1); } return literalValue; } private  NumericLiteralSupport(); static String stripDiscriminator(String literalValue); static boolean isHexLiteral(String numericLiteral); static boolean hasHexIndicator(String literalValue); static BigDecimal parseBigDecimal(Object baseValue); static boolean isDecimalDiscriminated(String literalValue); static boolean isFloatDiscriminated(String literalValue); }
NumericLiteralSupport { public static String stripDiscriminator(String literalValue) { int length = literalValue.length(); if (length < 2) { return literalValue; } char lastChar = literalValue.charAt(length - 1); if (lastChar == 'f' || lastChar == 'F' || lastChar == 'd' || lastChar == 'D') { return literalValue.substring(0, length - 1); } return literalValue; } private  NumericLiteralSupport(); static String stripDiscriminator(String literalValue); static boolean isHexLiteral(String numericLiteral); static boolean hasHexIndicator(String literalValue); static BigDecimal parseBigDecimal(Object baseValue); static boolean isDecimalDiscriminated(String literalValue); static boolean isFloatDiscriminated(String literalValue); static final String FLOAT_DISCRIMINATOR; static final String DECIMAL_DISCRIMINATOR; }