Skip to content

Commit 0ad0181

Browse files
Flossyclaude
andcommitted
fix: Address code review findings from commit 7caee47
## Dead Code Removal - Removed unused LOGGER field and getLogger() method from PropertyUtil - Removed unused imports: java.util.logging.Level and java.util.logging.Logger - Removed testPrivateGetLogger() test that verified dead code ## Documentation Consistency - Added @SInCE 1.0 tags to all FileException non-deprecated constructors - Matches CommonsIOException pattern for API version tracking - Addresses issue #142 (missing @SInCE tags) ## Log-and-Throw Anti-Pattern Fix - Removed redundant logging in SoapUtil.getSoapFactory() - Follows same "log or throw, not both" principle as commit 7caee47 - Maintains consistency with PropertyUtil refactoring ## Test Results - All 286 tests pass (was 287, removed 1 dead code test) - No compilation errors - Consistent exception handling patterns across codebase Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 7caee47 commit 0ad0181

4 files changed

Lines changed: 3 additions & 26 deletions

File tree

src/main/java/org/flossware/commons/io/FileException.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public FileException() {
4343
* Sets the message.
4444
*
4545
* @param message detail message.
46+
* @since 1.0
4647
*/
4748
public FileException(final String message) {
4849
super(message);
@@ -52,6 +53,7 @@ public FileException(final String message) {
5253
* Sets the cause of why self is being raised.
5354
*
5455
* @param cause the cause of why self is being raised.
56+
* @since 1.0
5557
*/
5658
public FileException(final Throwable cause) {
5759
super(cause);
@@ -62,6 +64,7 @@ public FileException(final Throwable cause) {
6264
*
6365
* @param message detail message.
6466
* @param cause the cause of why self is being raised.
67+
* @since 1.0
6568
*/
6669
public FileException(final String message, final Throwable cause) {
6770
super(message, cause);

src/main/java/org/flossware/commons/util/PropertyUtil.java

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
import java.io.Reader;
2525
import java.util.Objects;
2626
import java.util.Properties;
27-
import java.util.logging.Level;
28-
import java.util.logging.Logger;
2927
import org.flossware.commons.io.FileException;
3028
import org.flossware.commons.io.CommonsIOException;
3129

@@ -35,21 +33,6 @@
3533
* @author Scot P. Floess
3634
*/
3735
public final class PropertyUtil {
38-
/**
39-
* Our logger.
40-
*/
41-
private static final Logger LOGGER = Logger.getLogger(PropertyUtil.class.getName());
42-
43-
44-
/**
45-
* Return the logger.
46-
*
47-
* @return our logger.
48-
*/
49-
private static Logger getLogger() {
50-
return LOGGER;
51-
}
52-
5336
/**
5437
* Default constructor not allowed.
5538
*/

src/main/java/org/flossware/commons/util/SoapUtil.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ public static SOAPFactory getSoapFactory() {
5757
try {
5858
return SOAPFactory.newInstance();
5959
} catch (final SOAPException soapException) {
60-
LOGGER.log(Level.SEVERE, "Could not instantiate soap factory!", soapException);
6160
throw new SoapException("Could not instantiate soap factory!", soapException);
6261
}
6362
}

src/test/java/org/flossware/commons/util/PropertyUtilTest.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,4 @@ void testPrivateConstructor() throws Exception {
197197
assertTrue(exception.getCause() instanceof AssertionError);
198198
assertEquals("Utility class - do not instantiate", exception.getCause().getMessage());
199199
}
200-
201-
@Test
202-
void testPrivateGetLogger() throws Exception {
203-
java.lang.reflect.Method method = PropertyUtil.class.getDeclaredMethod("getLogger");
204-
method.setAccessible(true);
205-
Object logger = method.invoke(null);
206-
assertNotNull(logger);
207-
}
208200
}

0 commit comments

Comments
 (0)