Skip to content

Commit 1f7aa87

Browse files
committed
Better API name
1 parent ea48fc2 commit 1f7aa87

2 files changed

Lines changed: 20 additions & 20 deletions

File tree

src/main/java/org/apache/commons/cli/TypeHandler.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,15 @@ public class TypeHandler {
5353
resetConverters();
5454
}
5555

56+
/**
57+
* Unregisters all Converters.
58+
*
59+
* @since 1.7.0
60+
*/
61+
public static void clear() {
62+
converterMap.clear();
63+
}
64+
5665
/**
5766
* Returns the class whose name is {@code className}.
5867
*
@@ -210,15 +219,6 @@ private static <T> T createValueUnchecked(final String string, final Class<T> cl
210219
return converterMap.getOrDefault(clazz, Converter.DEFAULT);
211220
}
212221

213-
/**
214-
* Unregisters all Converters.
215-
*
216-
* @since 1.7.0
217-
*/
218-
public static void noConverters() {
219-
converterMap.clear();
220-
}
221-
222222
/**
223223
* Returns the opened FileInputStream represented by {@code string}.
224224
*

src/test/java/org/apache/commons/cli/TypeHandlerTest.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -172,26 +172,26 @@ public void createValueTests(final String str, final Class<?> type, final Object
172172
}
173173

174174
@Test
175-
public void testCreateValueExistingFile() throws Exception {
176-
try (FileInputStream result = TypeHandler.createValue(
177-
"src/test/resources/org/apache/commons/cli/existing-readable.file",
178-
PatternOptionBuilder.EXISTING_FILE_VALUE)) {
179-
assertNotNull(result);
180-
}
181-
}
182-
183-
@Test
184-
public void testNoConverters() {
175+
public void testClear() {
185176
assertEquals(Converter.NUMBER, TypeHandler.getConverter(Number.class));
186177
try {
187-
TypeHandler.noConverters();
178+
TypeHandler.clear();
188179
assertEquals(Converter.DEFAULT, TypeHandler.getConverter(Number.class));
189180
} finally {
190181
TypeHandler.resetConverters();
191182
assertEquals(Converter.NUMBER, TypeHandler.getConverter(Number.class));
192183
}
193184
}
194185

186+
@Test
187+
public void testCreateValueExistingFile() throws Exception {
188+
try (FileInputStream result = TypeHandler.createValue(
189+
"src/test/resources/org/apache/commons/cli/existing-readable.file",
190+
PatternOptionBuilder.EXISTING_FILE_VALUE)) {
191+
assertNotNull(result);
192+
}
193+
}
194+
195195
/* proof of equality for later tests */
196196
@Test
197197
public void testnstantiableEquals() {

0 commit comments

Comments
 (0)