Pankraz76 commented on code in PR #11284:
URL: https://github.com/apache/maven/pull/11284#discussion_r2436217257
##########
api/maven-api-xml/src/main/java/org/apache/maven/api/xml/XmlNode.java:
##########
@@ -527,7 +527,7 @@ private String toStringObject() {
w = addToStringField(sb, value, o -> !o.isEmpty(), "value", w);
w = addToStringField(sb, attributes, o -> !o.isEmpty(),
"attributes", w);
w = addToStringField(sb, children, o -> !o.isEmpty(),
"children", w);
- w = addToStringField(sb, inputLocation, Objects::nonNull,
"inputLocation", w);
+ addToStringField(sb, inputLocation, Objects::nonNull,
"inputLocation", w);
Review Comment:
this shoud fail
[ReturnValueIgnored](https://errorprone.info/bugpattern/ReturnValueIgnored) but
thats another story.
##########
impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelObjectPool.java:
##########
@@ -142,9 +131,9 @@ private Cache.ReferenceType
getReferenceTypeForClass(Class<?> objectType) {
*/
private Cache.ReferenceType getDefaultReferenceType() {
try {
- String referenceTypeProperty =
-
getProperty(Constants.MAVEN_MODEL_PROCESSOR_REFERENCE_TYPE,
Cache.ReferenceType.HARD.name());
Review Comment:
some personal unrelated inline could revoke could keep to avoid coupling.
##########
impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelObjectPool.java:
##########
@@ -77,10 +77,12 @@ public <T> T process(T object) {
}
Class<?> objectType = object.getClass();
- String simpleClassName = objectType.getSimpleName();
// Check if this object type should be pooled (read configuration
dynamically)
- if (!getPooledTypes(properties).contains(simpleClassName)) {
Review Comment:
inline method resolves the unused stuff.
##########
impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelObjectPool.java:
##########
@@ -91,27 +93,14 @@ public <T> T process(T object) {
}
private String getProperty(String name, String defaultValue) {
- Object value = properties.get(name);
- return value instanceof String str ? str : defaultValue;
- }
-
- /**
- * Gets the set of object types that should be pooled.
- */
- private Set<String> getPooledTypes(Map<?, ?> properties) {
Review Comment:
properties seems to be ignored.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]