From 9662738b88bdc6ebc812d4b5b0cf60bc8eaf5390 Mon Sep 17 00:00:00 2001 From: arjantijms Date: Tue, 6 Apr 2021 16:32:35 +0200 Subject: [PATCH] Processing feedback: use constants for repeated string Signed-off-by: arjantijms --- .../org/glassfish/gmbal/typelib/TypeEvaluator.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/impl/src/main/java/org/glassfish/gmbal/typelib/TypeEvaluator.java b/impl/src/main/java/org/glassfish/gmbal/typelib/TypeEvaluator.java index e047217..680a692 100644 --- a/impl/src/main/java/org/glassfish/gmbal/typelib/TypeEvaluator.java +++ b/impl/src/main/java/org/glassfish/gmbal/typelib/TypeEvaluator.java @@ -10,7 +10,6 @@ package org.glassfish.gmbal.typelib; -import static java.lang.Boolean.FALSE; import static java.lang.reflect.Modifier.PUBLIC; import java.lang.reflect.Field; @@ -55,6 +54,9 @@ @TraceTypelib @TraceTypelibEval public class TypeEvaluator { + + private static final String ORG_GLASSFISH_GMBAL_NO_MULTIPLE_UPPER_BOUNDS_EXCEPTION = "org.glassfish.gmbal.no.multipleUpperBoundsException"; + private TypeEvaluator() {} private static Map,EvaluatedType> immutableTypes = @@ -307,6 +309,7 @@ public static synchronized EvaluatedType getEvaluatedType( Class cls ) { // (and each instance of Enum MUST evaluate to the same ECD, or we get // infinite recursion). private static class PartialDefinitions { + private Map,List>,EvaluatedType> table = new HashMap,List>,EvaluatedType>() ; @@ -317,7 +320,7 @@ private Pair,List> getKey( Class cls ) { Type[] bounds = tv.getBounds() ; if (bounds.length > 0) { if (bounds.length > 1) { - if (!Boolean.valueOf(System.getProperty("org.glassfish.gmbal.no.multipleUpperBoundsException"))) { + if (!Boolean.valueOf(System.getProperty(ORG_GLASSFISH_GMBAL_NO_MULTIPLE_UPPER_BOUNDS_EXCEPTION))) { throw Exceptions.self .multipleUpperBoundsNotSupported( tv ) ; } @@ -604,7 +607,7 @@ private EvaluatedType visitWildcardType( WildcardType wt ) { List ub = Arrays.asList( wt.getUpperBounds() ) ; if (ub.size() > 0) { if (ub.size() > 1) { - if (!Boolean.valueOf(System.getProperty("org.glassfish.gmbal.no.multipleUpperBoundsException"))) { + if (!Boolean.valueOf(System.getProperty(ORG_GLASSFISH_GMBAL_NO_MULTIPLE_UPPER_BOUNDS_EXCEPTION))) { throw Exceptions.self.multipleUpperBoundsNotSupported( wt) ; } @@ -633,7 +636,7 @@ private EvaluatedType lookup( TypeVariable tvar ) { Type[] bounds = tvar.getBounds() ; if (bounds.length > 0) { if (bounds.length > 1) { - if (!Boolean.valueOf(System.getProperty("org.glassfish.gmbal.no.multipleUpperBoundsException"))) { + if (!Boolean.valueOf(System.getProperty(ORG_GLASSFISH_GMBAL_NO_MULTIPLE_UPPER_BOUNDS_EXCEPTION))) { throw Exceptions.self .multipleUpperBoundsNotSupported( tvar ) ; }