Skip to content

Commit

Permalink
Processing feedback: use constants for repeated string
Browse files Browse the repository at this point in the history
Signed-off-by: arjantijms <[email protected]>
  • Loading branch information
arjantijms committed Apr 6, 2021
1 parent adc9d76 commit 9662738
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<Class<?>,EvaluatedType> immutableTypes =
Expand Down Expand Up @@ -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<Pair<Class<?>,List<Type>>,EvaluatedType> table =
new HashMap<Pair<Class<?>,List<Type>>,EvaluatedType>() ;

Expand All @@ -317,7 +320,7 @@ private Pair<Class<?>,List<Type>> 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 ) ;
}
Expand Down Expand Up @@ -604,7 +607,7 @@ private EvaluatedType visitWildcardType( WildcardType wt ) {
List<Type> 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) ;
}
Expand Down Expand Up @@ -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 ) ;
}
Expand Down

0 comments on commit 9662738

Please sign in to comment.