Skip to content

Commit

Permalink
Normalize inline comments
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Jan 31, 2024
1 parent 31dcc2a commit fb722ab
Show file tree
Hide file tree
Showing 11 changed files with 98 additions and 104 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ public void tearDown() {
*/
public void testCollection(final LazyDynaList list, final Class<?> testClass, final DynaClass testDynaClass, final Object wrongBean) {

// ----- Create Collection & Array of Maps -----
// Create Collection & Array of Maps
final int size = 5;
final List<Object> testList = new ArrayList<>(size);
final TreeMap<?, ?>[] testArray = new TreeMap[size];
Expand All @@ -331,7 +331,7 @@ public void testCollection(final LazyDynaList list, final Class<?> testClass, fi
testList.add(testArray[i]);
}

// ----- Create LazyArrayList from Collection -----
// Create LazyArrayList from Collection
LazyDynaList lazyList = new LazyDynaList(testList);
assertEquals("1. check size", size, lazyList.size());

Expand All @@ -346,7 +346,7 @@ public void testCollection(final LazyDynaList list, final Class<?> testClass, fi
assertEquals("5." + i + " Map error ", "val" + i, mapArray[i].get("prop" + i));
}

// ----- Create LazyArrayList from Array -----
// Create LazyArrayList from Array
lazyList = new LazyDynaList(testArray);
assertEquals("6. check size", size, lazyList.size());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3092,7 +3092,7 @@ public void testSetMappedMap() {
*/
public void testSetMappedPeriods() {

// -------- PropertyUtils.setMappedProperty()--------
// PropertyUtils.setMappedProperty()--------
bean.setMappedProperty("key.with.a.dot", "Special Value");
assertEquals("Can retrieve directly (A)", "Special Value", bean.getMappedProperty("key.with.a.dot"));

Expand All @@ -3103,7 +3103,7 @@ public void testSetMappedPeriods() {
fail("Thew exception: " + e);
}

// -------- PropertyUtils.setNestedProperty() --------
// PropertyUtils.setNestedProperty()
bean.setMappedProperty("key.with.a.dot", "Special Value");
assertEquals("Can retrieve directly (B)", "Special Value", bean.getMappedProperty("key.with.a.dot"));
try {
Expand All @@ -3113,7 +3113,7 @@ public void testSetMappedPeriods() {
fail("Thew exception: " + e);
}

// -------- PropertyUtils.setNestedProperty() --------
// PropertyUtils.setNestedProperty()
final TestBean testBean = new TestBean();
bean.setMappedObjects("nested.property", testBean);
assertEquals("Can retrieve directly (C)", "This is a string", testBean.getStringProperty());
Expand All @@ -3124,7 +3124,7 @@ public void testSetMappedPeriods() {
fail("Thew exception: " + e);
}

// -------- PropertyUtils.setNestedProperty() --------
// PropertyUtils.setNestedProperty()
bean.getNested().setMappedProperty("Mapped Key", "Nested Mapped Value");
try {
assertEquals("Can retrieve via getNestedProperty (D)", "Nested Mapped Value",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void tearDown() {
*/
public void testConstructor_2() {

// ------------- Construct using default locale ------------
// Construct using default locale
converter = BigDecimalLocaleConverter.builder().get();

// Perform Tests
Expand All @@ -73,7 +73,7 @@ public void testConstructor_2() {
*/
public void testConstructor_3() {

// ------------- Construct using localized pattern (default locale) --------
// Construct using localized pattern (default locale)
converter = BigDecimalLocaleConverter.builder().setLocalizedPattern(true).get();

// Perform Tests
Expand All @@ -89,7 +89,7 @@ public void testConstructor_3() {
*/
public void testConstructor_4() {

// ------------- Construct using specified Locale --------
// Construct using specified Locale
converter = BigDecimalLocaleConverter.builder().setLocale(localizedLocale).get();

// Perform Tests
Expand All @@ -105,7 +105,7 @@ public void testConstructor_4() {
*/
public void testConstructor_5() {

// ------------- Construct using specified Locale --------
// Construct using specified Locale
converter = BigDecimalLocaleConverter.builder().setLocale(localizedLocale).setLocalizedPattern(true).get();

// Perform Tests
Expand All @@ -121,7 +121,7 @@ public void testConstructor_5() {
*/
public void testConstructor_6() {

// ------------- Construct using specified Locale --------
// Construct using specified Locale
converter = BigDecimalLocaleConverter.builder().setLocale(localizedLocale).setPattern(defaultDecimalPattern).get();

// Perform Tests
Expand All @@ -137,7 +137,7 @@ public void testConstructor_6() {
*/
public void testConstructor_7() {

// ------------- Construct using specified Locale --------
// Construct using specified Locale
converter = BigDecimalLocaleConverter.builder().setLocale(localizedLocale).setPattern(localizedDecimalPattern).setLocalizedPattern(true).get();

// Perform Tests
Expand All @@ -153,7 +153,7 @@ public void testConstructor_7() {
*/
public void testConstructor_8() {

// ------------- Construct using specified Locale --------
// Construct using specified Locale
converter = BigDecimalLocaleConverter.builder().setDefault(defaultValue).get();

// Perform Tests
Expand All @@ -169,7 +169,7 @@ public void testConstructor_8() {
*/
public void testConstructor_9() {

// ------------- Construct using specified Locale --------
// Construct using specified Locale
converter = BigDecimalLocaleConverter.builder().setDefault(defaultValue).setLocalizedPattern(true).get();

// Perform Tests
Expand All @@ -185,7 +185,7 @@ public void testConstructor_9() {
*/
public void testConstructorMain() {

// ------------- Construct with localized pattern ------------
// Construct with localized pattern
converter = BigDecimalLocaleConverter.builder().setDefault(defaultValue).setLocale(localizedLocale).setPattern(localizedDecimalPattern)
.setLocalizedPattern(true).get();

Expand All @@ -194,33 +194,27 @@ public void testConstructorMain() {
convertInvalid(converter, "(A)", defaultValue);
convertNull(converter, "(A)", defaultValue);

// **************************************************************************
// Convert value in the wrong format - maybe you would expect it to throw an
// exception and return the default - it doesn't, DecimalFormat parses it
// quite happily turning "1,234.56" into "1.234"
// I guess this is one of the limitations of DecimalFormat
// **************************************************************************
convertValueNoPattern(converter, "(B)", defaultDecimalValue, new BigDecimal("1.234"));

// **************************************************************************
// Convert with non-localized pattern - this causes an exception in parse()
// but it gets swallowed in convert() method and returns default.
// **** IS THIS THE EXPECTED BEHAVIOUR? ****
// Maybe if the pattern is no good, we should use a default pattern rather
// than just returning the default value.
// **************************************************************************
convertValueWithPattern(converter, "(B)", localizedDecimalValue, defaultDecimalPattern, defaultValue);

// **************************************************************************
// Convert with specified type
//
// BaseLocaleConverter completely ignores the type - so even if we specify
// Double.class here it still returns a BigDecimal.
// **** This has been changed due to BEANUTILS-449 ****
// **************************************************************************
// convertValueToType(converter, "(B)", Double.class, localizedDecimalValue, localizedDecimalPattern, expectedValue);

// ------------- Construct with non-localized pattern ------------
// Construct with non-localized pattern
converter = BigDecimalLocaleConverter.builder().setDefault(defaultValue).setLocale(localizedLocale).setPattern(defaultDecimalPattern)
.setLocalizedPattern(false).get();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void tearDown() {
*/
public void testConstructor_2() {

// ------------- Construct using default locale ------------
// Construct using default locale
converter = BigIntegerLocaleConverter.builder().get();

// Perform Tests
Expand All @@ -73,7 +73,7 @@ public void testConstructor_2() {
*/
public void testConstructor_3() {

// ------------- Construct using localized pattern (default locale) --------
// Construct using localized pattern (default locale)
converter = BigIntegerLocaleConverter.builder().setLocalizedPattern(true).get();

// Perform Tests
Expand All @@ -89,7 +89,7 @@ public void testConstructor_3() {
*/
public void testConstructor_4() {

// ------------- Construct using specified Locale --------
// Construct using specified Locale
converter = BigIntegerLocaleConverter.builder().setLocale(localizedLocale).get();

// Perform Tests
Expand All @@ -105,7 +105,7 @@ public void testConstructor_4() {
*/
public void testConstructor_5() {

// ------------- Construct using specified Locale --------
// Construct using specified Locale
converter = BigIntegerLocaleConverter.builder().setLocale(localizedLocale).setLocalizedPattern(true).get();

// Perform Tests
Expand All @@ -121,7 +121,7 @@ public void testConstructor_5() {
*/
public void testConstructor_6() {

// ------------- Construct using specified Locale --------
// Construct using specified Locale
converter = BigIntegerLocaleConverter.builder().setLocale(localizedLocale).setPattern(defaultIntegerPattern).get();

// Perform Tests
Expand All @@ -137,7 +137,7 @@ public void testConstructor_6() {
*/
public void testConstructor_7() {

// ------------- Construct using specified Locale --------
// Construct using specified Locale
converter = BigIntegerLocaleConverter.builder().setLocale(localizedLocale).setPattern(localizedIntegerPattern).setLocalizedPattern(true).get();

// Perform Tests
Expand All @@ -153,7 +153,7 @@ public void testConstructor_7() {
*/
public void testConstructor_8() {

// ------------- Construct using specified Locale --------
// Construct using specified Locale
converter = BigIntegerLocaleConverter.builder().setDefault(defaultValue).get();

// Perform Tests
Expand All @@ -169,7 +169,7 @@ public void testConstructor_8() {
*/
public void testConstructor_9() {

// ------------- Construct using specified Locale --------
// Construct using specified Locale
converter = BigIntegerLocaleConverter.builder().setDefault(defaultValue).setLocalizedPattern(true).get();

// Perform Tests
Expand All @@ -185,7 +185,7 @@ public void testConstructor_9() {
*/
public void testConstructorMain() {

// ------------- Construct with localized pattern ------------
// Construct with localized pattern
converter = BigIntegerLocaleConverter.builder().setDefault(defaultValue).setLocale(localizedLocale).setPattern(localizedIntegerPattern)
.setLocalizedPattern(true).get();

Expand Down Expand Up @@ -219,7 +219,7 @@ public void testConstructorMain() {
// **************************************************************************
// convertValueToType(converter, "(B)", Double.class, localizedIntegerValue, localizedIntegerPattern, expectedValue);

// ------------- Construct with non-localized pattern ------------
// Construct with non-localized pattern
converter = BigIntegerLocaleConverter.builder().setDefault(defaultValue).setLocale(localizedLocale).setPattern(defaultIntegerPattern)
.setLocalizedPattern(false).get();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void tearDown() {
*/
public void testConstructor_2() {

// ------------- Construct using default locale ------------
// Construct using default locale
converter = ByteLocaleConverter.builder().get();

// Perform Tests
Expand All @@ -84,7 +84,7 @@ public void testConstructor_2() {
*/
public void testConstructor_3() {

// ------------- Construct using localized pattern (default locale) --------
// Construct using localized pattern (default locale)
converter = ByteLocaleConverter.builder().setLocalizedPattern(true).get();

// Perform Tests
Expand All @@ -100,7 +100,7 @@ public void testConstructor_3() {
*/
public void testConstructor_4() {

// ------------- Construct using specified Locale --------
// Construct using specified Locale
converter = ByteLocaleConverter.builder().setLocale(localizedLocale).get();

// Perform Tests
Expand All @@ -116,7 +116,7 @@ public void testConstructor_4() {
*/
public void testConstructor_5() {

// ------------- Construct using specified Locale --------
// Construct using specified Locale
converter = ByteLocaleConverter.builder().setLocale(localizedLocale).setLocalizedPattern(true).get();

// Perform Tests
Expand All @@ -132,7 +132,7 @@ public void testConstructor_5() {
*/
public void testConstructor_6() {

// ------------- Construct using specified Locale --------
// Construct using specified Locale
converter = ByteLocaleConverter.builder().setLocale(localizedLocale).setPattern(defaultIntegerPattern).get();

// Perform Tests
Expand All @@ -148,7 +148,7 @@ public void testConstructor_6() {
*/
public void testConstructor_7() {

// ------------- Construct using specified Locale --------
// Construct using specified Locale
converter = ByteLocaleConverter.builder().setLocale(localizedLocale).setPattern(localizedIntegerPattern).setLocalizedPattern(true).get();

// Perform Tests
Expand All @@ -164,7 +164,7 @@ public void testConstructor_7() {
*/
public void testConstructor_8() {

// ------------- Construct using specified Locale --------
// Construct using specified Locale
converter = ByteLocaleConverter.builder().setDefault(defaultValue).get();

// Perform Tests
Expand All @@ -180,7 +180,7 @@ public void testConstructor_8() {
*/
public void testConstructor_9() {

// ------------- Construct using specified Locale --------
// Construct using specified Locale
converter = ByteLocaleConverter.builder().setDefault(defaultValue).setLocalizedPattern(true).get();

// Perform Tests
Expand All @@ -196,7 +196,7 @@ public void testConstructor_9() {
*/
public void testConstructorMain() {

// ------------- Construct with localized pattern ------------
// Construct with localized pattern
converter = ByteLocaleConverter.builder().setDefault(defaultValue).setLocale(localizedLocale).setPattern(localizedIntegerPattern)
.setLocalizedPattern(true).get();

Expand Down Expand Up @@ -228,7 +228,7 @@ public void testConstructorMain() {
// **************************************************************************
// convertValueToType(converter, "(B)", Double.class, localizedIntegerValue, localizedIntegerPattern, expectedValue);

// ------------- Construct with non-localized pattern ------------
// Construct with non-localized pattern
converter = ByteLocaleConverter.builder().setDefault(defaultValue).setLocale(localizedLocale).setPattern(defaultIntegerPattern)
.setLocalizedPattern(false).get();

Expand Down
Loading

0 comments on commit fb722ab

Please sign in to comment.