-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restyle Eap7.4.x #20
Restyle Eap7.4.x #20
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,8 +48,8 @@ public interface CommonLogger extends WeldEnvironmentLogger { | |
|
||
@LogMessage(level = Level.WARN) | ||
@Message(id = 4, | ||
value = "Could not invoke JNLPClassLoader#getJarFile(URL) on " + | ||
"context class loader, expecting Web Start class loader", | ||
value = "Could not invoke JNLPClassLoader#getJarFile(URL) on " | ||
+ "context class loader, expecting Web Start class loader", | ||
format = Format.MESSAGE_FORMAT) | ||
void | ||
unexpectedClassLoader(@Cause Throwable cause); | ||
|
@@ -62,8 +62,8 @@ public interface CommonLogger extends WeldEnvironmentLogger { | |
|
||
@LogMessage(level = Level.WARN) | ||
@Message(id = 6, | ||
value = "Could not invoke JNLPClassLoader#getJarFile(URL) on " + | ||
"context class loader", | ||
value = "Could not invoke JNLPClassLoader#getJarFile(URL) on " | ||
+ "context class loader", | ||
format = Format.MESSAGE_FORMAT) | ||
void | ||
jnlpClassLoaderInvocationException(@Cause Throwable cause); | ||
Comment on lines
63
to
69
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The method Recommendation: |
||
|
@@ -78,16 +78,16 @@ public interface CommonLogger extends WeldEnvironmentLogger { | |
|
||
@LogMessage(level = Level.WARN) | ||
@Message(id = 10, | ||
value = "Could not open the stream on the url {0} when adding to " + | ||
"the jandex index.", | ||
value = "Could not open the stream on the url {0} when adding to " | ||
+ "the jandex index.", | ||
format = Format.MESSAGE_FORMAT) | ||
void | ||
couldNotOpenStreamForURL(Object param1, @Cause Throwable cause); | ||
|
||
@LogMessage(level = Level.WARN) | ||
@Message(id = 11, | ||
value = "Could not close the stream on the url {0} when adding to " + | ||
"the jandex index.", | ||
value = "Could not close the stream on the url {0} when adding to " | ||
+ "the jandex index.", | ||
format = Format.MESSAGE_FORMAT) | ||
void | ||
couldNotCloseStreamForURL(Object param1, @Cause Throwable cause); | ||
Comment on lines
78
to
93
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The methods Recommendation: Enhance the error messages to include suggestions for troubleshooting or more detailed descriptions of the error conditions. |
||
|
@@ -106,9 +106,9 @@ public interface CommonLogger extends WeldEnvironmentLogger { | |
|
||
@LogMessage(level = Level.INFO) | ||
@Message(id = 14, | ||
value = "Falling back to Java Reflection for " + | ||
"bean-discovery-mode=\"annotated\" discovery. Add " + | ||
"org.jboss:jandex to the classpath to speed-up startup.", | ||
value = "Falling back to Java Reflection for " | ||
+ "bean-discovery-mode=\"annotated\" discovery. Add " | ||
+ "org.jboss:jandex to the classpath to speed-up startup.", | ||
format = Format.MESSAGE_FORMAT) | ||
void | ||
reflectionFallback(); | ||
|
@@ -155,8 +155,8 @@ public interface CommonLogger extends WeldEnvironmentLogger { | |
|
||
@LogMessage(level = Level.DEBUG) | ||
@Message(id = 24, | ||
value = "Archive isolation enabled - creating multiple isolated " + | ||
"bean archives if needed", | ||
value = "Archive isolation enabled - creating multiple isolated " | ||
+ "bean archives if needed", | ||
format = Format.MESSAGE_FORMAT) | ||
void | ||
archiveIsolationEnabled(); | ||
|
@@ -190,8 +190,8 @@ public interface CommonLogger extends WeldEnvironmentLogger { | |
|
||
@LogMessage(level = Level.WARN) | ||
@Message(id = 31, | ||
value = "The bean archive reference {0} cannot be handled by any " + | ||
"BeanArchiveHandler: {1}", | ||
value = "The bean archive reference {0} cannot be handled by any " | ||
+ "BeanArchiveHandler: {1}", | ||
format = Format.MESSAGE_FORMAT) | ||
void | ||
beanArchiveReferenceCannotBeHandled(Object beanArchiveRef, Object handlers); | ||
|
@@ -203,8 +203,8 @@ public interface CommonLogger extends WeldEnvironmentLogger { | |
processingBeanArchiveReference(Object beanArchiveRef); | ||
|
||
@Message(id = 33, | ||
value = "Invalid bean archive scanning result - found multiple " + | ||
"results with the same reference: {0}", | ||
value = "Invalid bean archive scanning result - found multiple " | ||
+ "results with the same reference: {0}", | ||
format = Format.MESSAGE_FORMAT) | ||
IllegalStateException | ||
invalidScanningResult(Object beanArchiveRef); | ||
|
@@ -231,8 +231,8 @@ public interface CommonLogger extends WeldEnvironmentLogger { | |
unableToInitializeProbeComponent(Object component, @Cause Throwable cause); | ||
|
||
@Message(id = 38, | ||
value = "Development mode is enabled but the following Probe " + | ||
"component is not found on the classpath: {0}", | ||
value = "Development mode is enabled but the following Probe " | ||
+ "component is not found on the classpath: {0}", | ||
format = Format.MESSAGE_FORMAT) | ||
IllegalStateException | ||
probeComponentNotFoundOnClasspath(Object component); | ||
Comment on lines
231
to
238
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The methods Recommendation: Include recovery suggestions or additional context about the implications of these errors in the log messages. This could help in quicker resolution and understanding the severity of the issues. |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,8 +64,8 @@ public interface WeldSELogger extends WeldEnvironmentLogger { | |
|
||
@LogMessage(level = Level.INFO) | ||
@Message(id = 2006, | ||
value = "Multiple containers running - CDI.current() may not work " + | ||
"properly: {0}", | ||
value = "Multiple containers running - CDI.current() may not work " | ||
+ "properly: {0}", | ||
format = Format.MESSAGE_FORMAT) | ||
void | ||
multipleContainersRunning(Object ids); | ||
|
@@ -78,8 +78,8 @@ public interface WeldSELogger extends WeldEnvironmentLogger { | |
|
||
@LogMessage(level = Level.WARN) | ||
@Message(id = 2008, | ||
value = "Bean class {0} found in multiple bean archives - this " + | ||
"may result in incorrect behavior: {1}", | ||
value = "Bean class {0} found in multiple bean archives - this " | ||
+ "may result in incorrect behavior: {1}", | ||
format = Format.MESSAGE_FORMAT) | ||
void | ||
beanClassDeployedInMultipleBeanArchives(Object beanClass, Object bdas); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The methods There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Issue: Generic Object Type for ParametersThe methods Recommendation: |
||
|
@@ -99,8 +99,8 @@ public interface WeldSELogger extends WeldEnvironmentLogger { | |
observedTypeNotContonainerLifecycleEventType(Object type); | ||
|
||
@Message(id = 2011, | ||
value = "The observed type {0} does not match the container " + | ||
"lifecycle event type {1}", | ||
value = "The observed type {0} does not match the container " | ||
+ "lifecycle event type {1}", | ||
format = Format.MESSAGE_FORMAT) | ||
IllegalArgumentException | ||
observedTypeDoesNotMatchContonainerLifecycleEventType(Object type, | ||
Comment on lines
99
to
106
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The method |
||
|
@@ -118,49 +118,50 @@ public interface WeldSELogger extends WeldEnvironmentLogger { | |
|
||
@Message( | ||
id = 2014, | ||
value = "Weld SE container with id {0} has not yet validated the " + | ||
"deployment - methods for programmatic lookup cannot be used", | ||
value = "Weld SE container with id {0} has not yet validated the " | ||
+ "deployment - methods for programmatic lookup cannot be used", | ||
format = Format.MESSAGE_FORMAT) | ||
IllegalStateException | ||
weldContainerDeploymentNotValidated(Object id); | ||
|
||
@Message(id = 2015, | ||
value = "Bean discovery mode NONE is not a valid option for Weld " + | ||
"SE deployment archive - Weld SE container with id {0}.", | ||
value = "Bean discovery mode NONE is not a valid option for Weld " | ||
+ "SE deployment archive - Weld SE container with id {0}.", | ||
format = Format.MESSAGE_FORMAT) | ||
IllegalArgumentException | ||
beanArchiveWithModeNone(Object id); | ||
|
||
@Message( | ||
id = 2016, | ||
value = "Zero or more than one container is running - " + | ||
value = "Zero or more than one container is running - " | ||
+ | ||
"WeldContainer.current() cannot determine the current container.", | ||
format = Format.MESSAGE_FORMAT) | ||
IllegalStateException | ||
zeroOrMoreThanOneContainerRunning(); | ||
|
||
@Message(id = 2017, | ||
value = "Unexpected value for parameter " + | ||
"'org.jboss.weld.se.additionalBeanDefiningAnnotations'. " + | ||
"Expected java.util.Collection but found {0}. ", | ||
value = "Unexpected value for parameter " | ||
+ "'org.jboss.weld.se.additionalBeanDefiningAnnotations'. " | ||
+ "Expected java.util.Collection but found {0}. ", | ||
format = Format.MESSAGE_FORMAT) | ||
IllegalArgumentException | ||
unexpectedValueForAdditionalBeanDefiningAnnotations(Class clazz); | ||
|
||
@LogMessage(level = Level.WARN) | ||
@Message( | ||
id = 2018, | ||
value = "Skipping registration of additional bean defining annotation " + | ||
"via `org.jboss.weld.se.additionalBeanDefiningAnnotations`. " | ||
+ "Only values of type Class<? extends Annotation> are valid. " + | ||
"Found: {0}", | ||
value = "Skipping registration of additional bean defining annotation " | ||
+ "via `org.jboss.weld.se.additionalBeanDefiningAnnotations`. " | ||
+ "Only values of type Class<? extends Annotation> are valid. " | ||
+ "Found: {0}", | ||
format = Format.MESSAGE_FORMAT) | ||
void | ||
unexpectedItemsInValueCollection(Class clazz); | ||
|
||
@Message(id = 2019, | ||
value = "Failed to parse the following string as additional bean " + | ||
"defining annotation: {0}. The exception was: {1}", | ||
value = "Failed to parse the following string as additional bean " | ||
+ "defining annotation: {0}. The exception was: {1}", | ||
format = Format.MESSAGE_FORMAT) | ||
IllegalArgumentException | ||
failedToLoadClass(String className, String exception); | ||
Comment on lines
165
to
167
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Issue: Inclusion of Raw Exception MessagesThe method Recommendation: |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,8 +142,8 @@ public void testGetAfterDestroyingContextualInstance() { | |
// try to invoke Handle.get() again; this should throw an exception | ||
try { | ||
alphaHandle.get(); | ||
fail("Invoking Handle.get() after destroying contextual instance " + | ||
"should throw an exception."); | ||
fail("Invoking Handle.get() after destroying contextual instance " | ||
+ "should throw an exception."); | ||
Comment on lines
+145
to
+146
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The failure message in Recommended Change: fail("Expected IllegalStateException to be thrown when accessing a destroyed contextual instance via Handle.get(), but no exception was thrown.");
Comment on lines
+145
to
+146
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The failure message in Suggested Improvement: fail("Expected IllegalStateException when invoking get() on a destroyed contextual instance of Alpha."); |
||
} catch (IllegalStateException e) { | ||
// expected | ||
Comment on lines
147
to
148
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The catch block for Recommended Change: assertEquals("Expected message to indicate reason for IllegalStateException", expectedMessage, e.getMessage()); |
||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,15 +43,15 @@ public class FilterInjectionTest { | |
extendDefaultWebXml( | ||
"<filter><filter-name>Cat Filter</filter-name><filter-class>" + | ||
CatFilter.class.getName() + | ||
("</filter-class></filter><filter-mapping><filter-name>Cat " + | ||
"Filter</filter-name><url-pattern>/cat</url-pattern></" + | ||
"filter-mapping> <servlet><servlet-name>Wolverine " + | ||
"Servlet</servlet-name><servlet-class>") + | ||
("</filter-class></filter><filter-mapping><filter-name>Cat " | ||
+ "Filter</filter-name><url-pattern>/cat</url-pattern></" | ||
+ "filter-mapping> <servlet><servlet-name>Wolverine " | ||
+ "Servlet</servlet-name><servlet-class>") + | ||
WolverineServlet.class.getName() + | ||
("</servlet-class></servlet> " + | ||
"<servlet-mapping><servlet-name>Wolverine " + | ||
"Servlet</servlet-name><url-pattern>/</url-pattern></" + | ||
"servlet-mapping>")) | ||
("</servlet-class></servlet> " | ||
+ "<servlet-mapping><servlet-name>Wolverine " | ||
+ "Servlet</servlet-name><url-pattern>/</url-pattern></" | ||
+ "servlet-mapping>")) | ||
Comment on lines
43
to
+54
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The XML configuration for servlets and filters is constructed using string concatenation which is error-prone and hard to maintain. Consider using a dedicated XML builder or templating library to construct XML configurations. This approach would improve readability, reduce the risk of errors, and make the code easier to maintain and extend. For example, you could use
Comment on lines
43
to
+54
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The XML configuration for servlets and filters is constructed using string concatenation within the Java code, which can lead to maintainability issues. This method is error-prone and makes the code difficult to read and modify. Consider using a dedicated XML configuration file or a builder utility that ensures well-formed XML and improves code clarity. Recommended Solution:
|
||
.getBytes()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Change the code to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The XML string is converted to bytes every time the Recommended Solution:
|
||
|
||
@Deployment | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,12 +49,12 @@ public static WebArchive createTestArchive() { | |
Asset webXml = new ByteArrayAsset( | ||
extendDefaultWebXml( | ||
listeners.toString() + | ||
("<servlet><servlet-name>Bat " + | ||
"Servlet</servlet-name><servlet-class>") + | ||
("<servlet><servlet-name>Bat " | ||
+ "Servlet</servlet-name><servlet-class>") + | ||
BatServlet.class.getName() + | ||
("</servlet-class></servlet> <servlet-mapping><servlet-name>Bat " + | ||
"Servlet</servlet-name><url-pattern>/bat</url-pattern></" + | ||
"servlet-mapping>")) | ||
("</servlet-class></servlet> <servlet-mapping><servlet-name>Bat " | ||
+ "Servlet</servlet-name><url-pattern>/bat</url-pattern></" | ||
+ "servlet-mapping>")) | ||
Comment on lines
49
to
+57
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The construction of XML content through string concatenation (lines 49-57) is prone to errors and difficult to maintain. This approach can lead to issues such as typos, mismatched tags, or improperly formatted XML, which are hard to detect until runtime. Recommendation: Consider using a more structured approach to generate XML, such as utilizing an XML library (e.g.,
Comment on lines
49
to
+57
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The construction of XML content through string concatenation is error-prone and can lead to maintenance issues. It is recommended to use an XML builder or similar utility to construct XML documents. This approach enhances readability, reduces the risk of errors, and makes the code easier to maintain. Recommended Change: DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
Document doc = dBuilder.newDocument();
// build XML document with doc.createElement, etc. This method ensures that the XML is well-formed and easier to modify or extend in the future.
Comment on lines
49
to
+57
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Directly constructing XML from strings can expose the application to XML Injection, especially if any part of the XML structure is derived from untrusted sources. To mitigate this risk, ensure that any dynamic content is properly escaped or sanitized before inclusion in the XML structure. Recommended Change: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Micro-Learning Topic: XML injection (Detected by phrase)Matched on "XML Injection"XML injection is a vulnerability affecting the handling of XML documents used by an application. If an application uses unsafe inputs as part of an XML document, it may result in corrupted XML that changes the behaviour of application components that use the modified document. Where XML documents are accepted by an application, it may allow information disclosure, denial of service or unauthorised file access if certain XML processing is permitted. Try a challenge in Secure Code WarriorHelpful references
|
||
.getBytes()); | ||
return baseDeployment(webXml).addClasses( | ||
BatRequestListener.class, BatSessionListener.class, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,9 +43,9 @@ public class ServletInjectionTest { | |
extendDefaultWebXml( | ||
"<servlet><servlet-name>Rat Servlet</servlet-name><servlet-class>" + | ||
RatServlet.class.getName() + | ||
("</servlet-class></servlet> <servlet-mapping><servlet-name>Rat " + | ||
"Servlet</servlet-name><url-pattern>/rat</url-pattern></" + | ||
"servlet-mapping>")) | ||
("</servlet-class></servlet> <servlet-mapping><servlet-name>Rat " | ||
+ "Servlet</servlet-name><url-pattern>/rat</url-pattern></" | ||
+ "servlet-mapping>")) | ||
Comment on lines
43
to
+48
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The construction of XML using string concatenation is error-prone and hard to maintain. Consider using an XML construction library (like Example: DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
Document doc = dBuilder.newDocument();
Element rootElement = doc.createElement("servlet");
doc.appendChild(rootElement);
// add more elements This method also makes it easier to modify the XML structure in the future and provides built-in validation of the XML structure.
Comment on lines
43
to
+48
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Constructing XML through string concatenation as seen here can lead to errors and is hard to maintain, especially with more complex XML structures or dynamic content. Consider using a more robust method such as |
||
.getBytes()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The method |
||
|
||
@Deployment | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,7 +94,7 @@ public Set<Annotation> getQualifiers() { | |
|
||
@Override | ||
public String toString() { | ||
return "Implicit Bean [javax.enterprise.inject.spi.Bean] with qualifiers " + | ||
"[@Decorated]"; | ||
return "Implicit Bean [javax.enterprise.inject.spi.Bean] with qualifiers " | ||
+ "[@Decorated]"; | ||
Comment on lines
96
to
+98
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Recommendation: Modify the
Comment on lines
96
to
+98
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -244,8 +244,8 @@ static String getProxyName(String contextId, Class<?> proxiedBeanType, | |
Class<?> superInterface = typeInfo.getSuperInterface(); | ||
if (superInterface == null) { | ||
throw new IllegalArgumentException( | ||
"Proxied bean type cannot be java.lang.Object without an " + | ||
"interface"); | ||
"Proxied bean type cannot be java.lang.Object without an " | ||
+ "interface"); | ||
} else { | ||
String reason = getDefaultPackageReason(superInterface); | ||
if (reason != null) { | ||
Comment on lines
244
to
251
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The method |
||
|
@@ -379,8 +379,8 @@ public void addInterfacesFromTypeClosure(Set<? extends Type> typeClosure, | |
*/ | ||
public void addInterface(Class<?> newInterface) { | ||
if (!newInterface.isInterface()) { | ||
throw new IllegalArgumentException(newInterface + (" is not an " + | ||
"interface")); | ||
throw new IllegalArgumentException(newInterface + (" is not an " | ||
+ "interface")); | ||
} | ||
additionalInterfaces.add(newInterface); | ||
} | ||
Comment on lines
379
to
386
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The method
Comment on lines
379
to
386
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The exception thrown in throw new IllegalArgumentException(newInterface.getName() + " is not an interface"); This change would make the error messages more informative and helpful during development and debugging. |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,8 +74,8 @@ public Object run() throws Exception { | |
|
||
public ClassLoader getClassLoader(final Class<?> proxiedBeanType) { | ||
throw new UnsupportedOperationException( | ||
"WeldDefaultProxyServices.getClassLoader(Class<?>) is not " + | ||
"implemented."); | ||
"WeldDefaultProxyServices.getClassLoader(Class<?>) is not " | ||
+ "implemented."); | ||
} | ||
|
||
public Class<?> loadBeanClass(final String className) { | ||
Comment on lines
75
to
81
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The methods Recommendation:
Comment on lines
75
to
81
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The methods Recommendation:
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,8 +70,8 @@ protected int getThreadPoolSize() { | |
|
||
@Override | ||
public String toString() { | ||
return String.format("TimingOutFixedThreadPoolExecutorServices " + | ||
"[threadPoolSize=%s, keepAliveTime=%s]", | ||
return String.format("TimingOutFixedThreadPoolExecutorServices " | ||
+ "[threadPoolSize=%s, keepAliveTime=%s]", | ||
Comment on lines
+73
to
+74
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The use of Recommendation: Consider using string concatenation or Example: @Override
public String toString() {
return "TimingOutFixedThreadPoolExecutorServices [threadPoolSize=" + threadPoolSize + ", keepAliveTime=" + keepAliveTime + "]";
} |
||
threadPoolSize, keepAliveTime); | ||
Comment on lines
+73
to
75
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The use of Suggested Change: @Override
public String toString() {
StringBuilder sb = new StringBuilder("TimingOutFixedThreadPoolExecutorServices [threadPoolSize=");
sb.append(threadPoolSize);
sb.append(", keepAliveTime=");
sb.append(keepAliveTime);
sb.append("]");
return sb.toString();
}
Comment on lines
+74
to
75
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Direct access to the fields Suggested Change: @Override
public String toString() {
return String.format("TimingOutFixedThreadPoolExecutorServices [threadPoolSize=%s, keepAliveTime=%s]", getThreadPoolSize(), getKeepAliveTime());
} |
||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method
unexpectedClassLoader
logs a warning when an unexpected class loader is encountered, but it lacks parameters that could provide more context about the issue, such as the URL or specific class loader that was expected. This makes debugging more difficult.Recommendation:
Consider adding parameters to capture the URL and the expected class loader type. This would provide more actionable information in the log message, aiding in quicker resolution of issues.