Closed amir9979 closed 3 years ago
valid,type,issue,module,commit,parent,testcase,has_test_annotation,traces,bugged_components,description,extra_description,blamed_components,diff
True,Regression,-1,commons-lang,54e63005446a2b0a4255ba16838122c5808ef886,0343b4fda87161265acf30d5ee61e525e751358d,org.apache.commons.lang3.text.StrLookupTest.testSystemPropertiesLookupUpdatedProperty,False,[],,,,org.apache.commons.lang3.text.strlookup.copyproperties(properties)@org.apache.commons.lang3.text.strlookup.systempropertieslookup(),"u'diff --git a/src/test/java/org/apache/commons/lang3/text/StrLookupTest.java b/src/test/java/org/apache/commons/lang3/text/StrLookupTest.java\nindex 121dbff22..9190185bd 100644\n--- a/src/test/java/org/apache/commons/lang3/text/StrLookupTest.java\n+++ b/src/test/java/org/apache/commons/lang3/text/StrLookupTest.java\n@@ -5,9 +5,9 @@\n The ASF licenses this file to You under the Apache License, Version 2.0\n (the ""License""); you may not use this file except in compliance with\n the License. You may obtain a copy of the License at\n- \n+ \n http://www.apache.org/licenses/LICENSE-2.0\n- \n+ \n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an ""AS IS"" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n@@ -22,6 +22,7 @@ import static org.junit.Assert.fail;\n \n import java.util.HashMap;\n import java.util.Map;\n+import java.util.Properties;\n \n import org.junit.Test;\n \n@@ -51,20 +52,45 @@ public class StrLookupTest {\n }\n }\n \n+ /\n+ Tests that a lookup object for system properties can deal with a full\n+ replacement of the system properties object. This test is related to\n+ LANG-1055.\n+ /\n @Test\n- public void testSystemPropertiesLookupNotSingleton() {\n+ public void testSystemPropertiesLookupReplacedProperties() {\n+ Properties oldProperties = System.getProperties();\n final String osName = ""os.name"";\n- final String originalOsName = System.getProperty(osName);\n+ final String newOsName = oldProperties.getProperty(osName) + ""_changed"";\n \n- StrLookup
valid,type,issue,module,commit,parent,testcase,has_test_annotation,traces,bugged_components,description,extra_description,blamed_components,diff True,Delta,-1,commons-lang,39380da86acc717f419da48f070f8cf7d9f9ec94,474a837858a8e7a98316f97e9ed387d0161015f2,org.apache.commons.lang3.builder.ReflectionToStringBuilderTest.testConstructorWithNullObject,False,[],,,,"org.apache.commons.lang3.builder.reflectiontostringbuilder.reflectiontostringbuilder(object,tostringstyle)@org.apache.commons.lang3.builder.reflectiontostringbuilder.reflectiontostringbuilder(object)@org.apache.commons.lang3.builder.reflectiontostringbuilder.reflectiontostringbuilder(object,tostringstyle,stringbuffer)",u''
valid,type,issue,module,commit,parent,testcase,has_test_annotation,traces,bugged_components,description,extra_description,blamed_components,diff
True,Regression,-1,commons-lang,e2c0ea4374c02539ad9bc6c4328b74f25eb72405,63d8a025e6f38ddfc966c4104ac783bcb59031e0,org.apache.commons.lang3.reflect.TypeUtilsTest.testLang1114,False,[],,,,"org.apache.commons.lang3.reflect.typeutils.equals(wildcardtype,type)","u'diff --git a/src/test/java/org/apache/commons/lang3/reflect/TypeUtilsTest.java b/src/test/java/org/apache/commons/lang3/reflect/TypeUtilsTest.java\nindex 60c8b4897..56b23a241 100644\n--- a/src/test/java/org/apache/commons/lang3/reflect/TypeUtilsTest.java\n+++ b/src/test/java/org/apache/commons/lang3/reflect/TypeUtilsTest.java\n@@ -97,6 +97,8 @@ public class TypeUtilsTest {\n \n public static Comparable
valid,type,issue,module,commit,parent,testcase,has_test_annotation,traces,bugged_components,description,extra_description,blamed_components,diff True,Delta,-1,commons-lang,bbfa8eb7df16baf17239b412ff7efa11c7e0926b,7bb99bcb6bf0942c55a092c3d9274e2b080d4e95,org.apache.commons.lang3.time.FastDateFormatTest.testParseSync,False,[],,,,"org.apache.commons.lang3.time.fastdateparser.getstrategy(string,calendar)@org.apache.commons.lang3.time.fastdateprinter.parsepattern()","u'diff --git a/src/test/java/org/apache/commons/lang3/time/FastDateParserTest.java b/src/test/java/org/apache/commons/lang3/time/FastDateParserTest.java\nindex 076a20e71..c5cd0768c 100644\n--- a/src/test/java/org/apache/commons/lang3/time/FastDateParserTest.java\n+++ b/src/test/java/org/apache/commons/lang3/time/FastDateParserTest.java\n@@ -56,6 +56,7 @@ public class FastDateParserTest {\n private static final TimeZone REYKJAVIK = TimeZone.getTimeZone(""Atlantic/Reykjavik"");\n private static final TimeZone NEW_YORK = TimeZone.getTimeZone(""America/New_York"");\n private static final TimeZone GMT = TimeZone.getTimeZone(""GMT"");\n+ private static final TimeZone INDIA = TimeZone.getTimeZone(""Asia/Calcutta"");\n \n private static final Locale SWEDEN = new Locale(""sv"", ""SE"");\n \n@@ -556,4 +557,63 @@ public class FastDateParserTest {\n assertEquals(expected.getTime(), fdp.parse(""14MAY2014""));\n assertEquals(expected.getTime(), fdp.parse(""14May2014""));\n }\n+ \n+\t@Test(expected = IllegalArgumentException.class)\n+\tpublic void test1806Argument() {\n+\t\tgetInstance(""XXXX"");\n+\t}\n+\n+\tprivate static Calendar initializeCalendar(TimeZone tz) {\n+\t\tCalendar cal = Calendar.getInstance(tz);\n+\t\tcal.set(Calendar.YEAR, 2001);\n+\t\tcal.set(Calendar.MONTH, 1); // not daylight savings\n+\t\tcal.set(Calendar.DAY_OF_MONTH, 4);\n+\t\tcal.set(Calendar.HOUR_OF_DAY, 12);\n+\t\tcal.set(Calendar.MINUTE, 8);\n+\t\tcal.set(Calendar.SECOND, 56);\n+\t\tcal.set(Calendar.MILLISECOND, 235);\n+\t\treturn cal;\n+\t}\n+\n+\tprivate static enum Expected1806 {\n+\t\tIndia(INDIA, ""+05"", ""+0530"", ""+05:30"", true), \n+\t\tGreenwich(GMT, ""Z"", ""Z"", ""Z"", false), \n+\t\tNewYork(NEW_YORK, ""-05"", ""-0500"", ""-05:00"", false);\n+\n+\t\tprivate Expected1806(TimeZone zone, String one, String two, String three, boolean hasHalfHourOffset) {\n+\t\t\tthis.zone = zone;\n+\t\t\tthis.one = one;\n+\t\t\tthis.two = two;\n+\t\t\tthis.three = three;\n+\t\t\tthis.offset = hasHalfHourOffset ?30601000 :0;\n+\t\t}\n+\n+\t\tfinal TimeZone zone;\n+\t\tfinal String one;\n+\t\tfinal String two;\n+\t\tfinal String three;\n+\t\tfinal long offset;\n+\t}\n+\t\n+\t@Test\n+\tpublic void test1806() throws ParseException {\n+\t\tString formatStub = ""yyyy-MM-dd\'T\'HH:mm:ss.SSS"";\n+\t\tString dateStub = ""2001-02-04T12:08:56.235"";\n+\t\t\n+\t\tfor (Expected1806 trial : Expected1806.values()) {\n+\t\t\tCalendar cal = initializeCalendar(trial.zone);\n+\n+\t\t\tString message = trial.zone.getDisplayName()+"";"";\n+\t\t\t\n+\t\t\tDateParser parser = getInstance(formatStub+""X"", trial.zone);\n+\t\t\tassertEquals(message+trial.one, cal.getTime().getTime(), parser.parse(dateStub+trial.one).getTime()-trial.offset);\n+\n+\t\t\tparser = getInstance(formatStub+""XX"", trial.zone);\n+\t\t\tassertEquals(message+trial.two, cal.getTime(), parser.parse(dateStub+trial.two));\n+\n+\t\t\tparser = getInstance(formatStub+""XXX"", trial.zone);\n+\t\t\tassertEquals(message+trial.three, cal.getTime(), parser.parse(dateStub+trial.three));\n+\t\t}\n+\t}\n+\n }\ndiff --git a/src/test/java/org/apache/commons/lang3/time/FastDatePrinterTest.java b/src/test/java/org/apache/commons/lang3/time/FastDatePrinterTest.java\nindex f87b9c2e5..538e6df55 100644\n--- a/src/test/java/org/apache/commons/lang3/time/FastDatePrinterTest.java\n+++ b/src/test/java/org/apache/commons/lang3/time/FastDatePrinterTest.java\n@@ -19,6 +19,7 @@ package org.apache.commons.lang3.time;\n import static org.junit.Assert.*;\n \n import java.io.Serializable;\n+import java.text.ParseException;\n import java.text.SimpleDateFormat;\n import java.util.Calendar;\n import java.util.Date;\n@@ -39,6 +40,8 @@ public class FastDatePrinterTest {\n \n private static final String YYYY_MM_DD = ""yyyy/MM/dd"";\n private static final TimeZone NEW_YORK = TimeZone.getTimeZone(""America/New_York"");\n+ private static final TimeZone GMT = TimeZone.getTimeZone(""GMT"");\n+ private static final TimeZone INDIA = TimeZone.getTimeZone(""Asia/Calcutta"");\n private static final Locale SWEDEN = new Locale(""sv"", ""SE"");\n \n DatePrinter getInstance(final String format) {\n@@ -272,4 +275,55 @@ public class FastDatePrinterTest {\n FastDateFormat colonFormat = FastDateFormat.getInstance(""ZZZ"");\n assertEquals(""+00:00"", colonFormat.format(c));\n }\n+\n+\tprivate static Calendar initializeCalendar(TimeZone tz) {\n+\t\tCalendar cal = Calendar.getInstance(tz);\n+\t\tcal.set(Calendar.YEAR, 2001);\n+\t\tcal.set(Calendar.MONTH, 1); // not daylight savings\n+\t\tcal.set(Calendar.DAY_OF_MONTH, 4);\n+\t\tcal.set(Calendar.HOUR_OF_DAY, 12);\n+\t\tcal.set(Calendar.MINUTE, 8);\n+\t\tcal.set(Calendar.SECOND, 56);\n+\t\tcal.set(Calendar.MILLISECOND, 235);\n+\t\treturn cal;\n+\t}\n+\n+\t@Test(expected = IllegalArgumentException.class)\n+\tpublic void test1806Argument() {\n+\t\tgetInstance(""XXXX"");\n+\t}\n+\n+\tprivate static enum Expected1806 {\n+\t\tIndia(INDIA, ""+05"", ""+0530"", ""+05:30""), Greenwich(GMT, ""Z"", ""Z"", ""Z""), NewYork(\n+\t\t\t\tNEW_YORK, ""-05"", ""-0500"", ""-05:00"");\n+\n+\t\tprivate Expected1806(TimeZone zone, String one, String two, String three) {\n+\t\t\tthis.zone = zone;\n+\t\t\tthis.one = one;\n+\t\t\tthis.two = two;\n+\t\t\tthis.three = three;\n+\t\t}\n+\n+\t\tfinal TimeZone zone;\n+\t\tfinal String one;\n+\t\tfinal String two;\n+\t\tfinal String three;\n+\t}\n+\n+\n+\t@Test\n+\tpublic void test1806() throws ParseException {\n+\t\tfor (Expected1806 trial : Expected1806.values()) {\n+\t\t\tCalendar cal = initializeCalendar(trial.zone);\n+\n+\t\t\tDatePrinter printer = getInstance(""X"", trial.zone);\n+\t\t\tassertEquals(trial.one, printer.format(cal));\n+\n+\t\t\tprinter = getInstance(""XX"", trial.zone);\n+\t\t\tassertEquals(trial.two, printer.format(cal));\n+\n+\t\t\tprinter = getInstance(""XXX"", trial.zone);\n+\t\t\tassertEquals(trial.three, printer.format(cal));\n+\t\t}\n+\t}\n }'"
valid,type,issue,module,commit,parent,testcase,has_test_annotation,traces,bugged_components,description,extra_description,blamed_components,diff True,Regression,-1,commons-lang,45a6467088a08e447d7f2983551021b91c70ab49,61836183b1d84a18dbcc084d1f41bcecf752f9fd,org.apache.commons.lang3.math.NumberUtilsTest.testLang1087,False,[],,,,org.apache.commons.lang3.math.numberutils.createnumber(string),"u'diff --git a/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java b/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java\nindex 7a99a0b33..132d71ef9 100644\n--- a/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java\n+++ b/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java\n@@ -245,6 +245,19 @@ public class NumberUtilsTest {\n assertNotNull(bigNum);\n assertEquals(BigDecimal.class, bigNum.getClass());\n }\n+ \n+ @Test\n+ public void testLang1087(){\n+ // no sign cases\n+ assertEquals(Float.class, NumberUtils.createNumber(""0.0"").getClass());\n+ assertEquals(Float.valueOf(""0.0""), NumberUtils.createNumber(""0.0""));\n+ // explicit positive sign cases\n+ assertEquals(Float.class, NumberUtils.createNumber(""+0.0"").getClass());\n+ assertEquals(Float.valueOf(""+0.0""), NumberUtils.createNumber(""+0.0""));\n+ // negative sign cases\n+ assertEquals(Float.class, NumberUtils.createNumber(""-0.0"").getClass());\n+ assertEquals(Float.valueOf(""-0.0""), NumberUtils.createNumber(""-0.0""));\n+ }\n \n @Test\n public void TestLang747() {'"
valid,type,issue,module,commit,parent,testcase,has_test_annotation,traces,bugged_components,description,extra_description,blamed_components,diff True,Delta,-1,commons-lang,c8e61afdb89c58ea8ffaf04593da41ff0888d30e,c3b1fefbad0c67c8556ba6b4573f135197f87598,org.apache.commons.lang3.math.NumberUtilsTest.testIsNumber,False,[],,,,org.apache.commons.lang3.math.numberutils.iscreatable(string),"u'diff --git a/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java b/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java\nindex 20d87fe30..376a57916 100644\n--- a/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java\n+++ b/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java\n@@ -1326,6 +1326,10 @@ public void testIsNumber() {\n compareIsNumberWithCreateNumber(""-1234"", true);\n compareIsNumberWithCreateNumber(""-1234.5"", true);\n compareIsNumberWithCreateNumber(""-.12345"", true);\n+ compareIsNumberWithCreateNumber(""-0001.12345"", true);\n+ compareIsNumberWithCreateNumber(""-000.12345"", true);\n+ compareIsNumberWithCreateNumber(""+00.12345"", true);\n+ compareIsNumberWithCreateNumber(""+0002.12345"", true);\n compareIsNumberWithCreateNumber(""-1234E5"", true);\n compareIsNumberWithCreateNumber(""0"", true);\n compareIsNumberWithCreateNumber(""-0"", true);\n@@ -1342,6 +1346,7 @@ public void testIsNumber() {\n compareIsNumberWithCreateNumber("" "", false);\n compareIsNumberWithCreateNumber(""\r\n\t"", false);\n compareIsNumberWithCreateNumber(""--2.3"", false);\n+\n compareIsNumberWithCreateNumber("".12.3"", false);\n compareIsNumberWithCreateNumber(""-123E"", false);\n compareIsNumberWithCreateNumber(""-123E+-212"", false);\n@@ -1352,6 +1357,8 @@ public void testIsNumber() {\n compareIsNumberWithCreateNumber(""-0ABC123"", false);\n compareIsNumberWithCreateNumber(""123.4E-D"", false);\n compareIsNumberWithCreateNumber(""123.4ED"", false);\n+ compareIsNumberWithCreateNumber(""+000E.12345"", false);\n+ compareIsNumberWithCreateNumber(""-000E.12345"", false);\n compareIsNumberWithCreateNumber(""1234E5l"", false);\n compareIsNumberWithCreateNumber(""11a"", false);\n compareIsNumberWithCreateNumber(""1a"", false);'"
valid,type,issue,module,commit,parent,testcase,has_test_annotation,traces,bugged_components,description,extra_description,blamed_components,diff True,Regression,-1,commons-lang,63f1d6b83bc10a2880f5ec17a172fab284d2eff5,cc991feadbcee678635f7831ad8091ab8698d508,org.apache.commons.lang3.text.StrLookupTest.testSystemPropertiesLookupNotSingleton,False,[],,,,org.apache.commons.lang3.text.strlookup.systempropertieslookup(),"u'diff --git a/src/test/java/org/apache/commons/lang3/text/StrLookupTest.java b/src/test/java/org/apache/commons/lang3/text/StrLookupTest.java\nindex e45a324c8..e6ccccc01 100644\n--- a/src/test/java/org/apache/commons/lang3/text/StrLookupTest.java\n+++ b/src/test/java/org/apache/commons/lang3/text/StrLookupTest.java\n@@ -53,6 +53,22 @@ public class StrLookupTest {\n }\n }\n \n+ @Test\n+ public void testSystemPropertiesLookupNotSingleton() {\n+ final String osName = ""os.name"";\n+ final String originalOsName = System.getProperty(osName);\n+\n+ StrLookup properties1 = StrLookup.systemPropertiesLookup();\n+ assertEquals(originalOsName, properties1.lookup(osName));\n+\n+ final String differentOsName = ""HAL-9000"";\n+ System.setProperty(osName, differentOsName);\n+ StrLookup properties2 = StrLookup.systemPropertiesLookup();\n+\n+ assertEquals(originalOsName, properties1.lookup(osName));\n+ assertEquals(differentOsName, properties2.lookup(osName));\n+ }\n+\n @Test\n public void testMapLookup() {\n final Map<String, Object> map = new HashMap<String, Object>();'"
valid,type,issue,module,commit,parent,testcase,has_test_annotation,traces,bugged_components,description,extra_description,blamed_components,diff True,Delta,-1,commons-lang,6240a05c12914083adbe8c7c53e7e40ef42931dd,673dbc5794906825c48545eb7ef76fb544754999,org.apache.commons.lang3.math.NumberUtilsTest.testIsParsable,False,[],,,,org.apache.commons.lang3.math.numberutils.isparsable(string),"u'diff --git a/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java b/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java\nindex 96b7a7334..e9ec47da8 100644\n--- a/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java\n+++ b/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java\n@@ -1268,7 +1268,12 @@ public class NumberUtilsTest {\n assertFalse( NumberUtils.isParsable(""64L"") );\n assertTrue( NumberUtils.isParsable(""64.2"") );\n assertTrue( NumberUtils.isParsable(""64"") );\n- assertTrue(NumberUtils.isParsable(""018""));\n+ assertTrue( NumberUtils.isParsable(""018"") );\n+ assertTrue( NumberUtils.isParsable("".18"") );\n+ assertTrue( NumberUtils.isParsable(""-65"") );\n+ assertTrue( NumberUtils.isParsable(""-018"") );\n+ assertTrue( NumberUtils.isParsable(""-018.2"") );\n+ assertTrue( NumberUtils.isParsable(""-.236"") );\n }\n \n private boolean checkCreateNumber(final String val) {'"
valid,type,issue,module,commit,parent,testcase,has_test_annotation,traces,bugged_components,description,extra_description,blamed_components,diff True,Delta,-1,commons-lang,8d6bc0ca625f3a1a98b486541fa613b2fac4b41c,7fd021d82ff431fb31f42bc6c5c44a3b979cb426,org.apache.commons.lang3.math.NumberUtilsTest.testCreateNumber,False,[],,,,org.apache.commons.lang3.math.numberutils.createnumber(string),"u'diff --git a/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java b/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java\nindex 236084b7c..e2143bdc6 100644\n--- a/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java\n+++ b/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java\n@@ -242,6 +242,10 @@ public void testCreateNumber() {\n final Number bigNum = NumberUtils.createNumber(""-1.1E-700F"");\n assertNotNull(bigNum);\n assertEquals(BigDecimal.class, bigNum.getClass());\n+ \n+ // LANG-1018\n+ assertEquals(""createNumber(String) LANG-1018 failed"",\n+ Double.valueOf(""-160952.54""), NumberUtils.createNumber(""-160952.54""));\n }\n \n @Test'"
The issue you have reported seems to be resolved now. The extracted data can be found at releases by number commons-lang_372.
3