@@ -104,7 +104,8 @@ else if (!this.defunctConfig.add(defunct)) {
104104 try {
105105 constructor = configClass .getDeclaredConstructor ();
106106 constructor .setAccessible (true );
107- } catch (Exception e ) {
107+ }
108+ catch (Exception e ) {
108109 problems .addError ("Configuration class [%s] does not have a no-arg constructor" , configClass .getName ());
109110 }
110111 this .constructor = constructor ;
@@ -127,7 +128,8 @@ else if (!this.defunctConfig.add(defunct)) {
127128 }
128129 }
129130
130- public static boolean isConfigClass (Class <?> classz ) {
131+ public static boolean isConfigClass (Class <?> classz )
132+ {
131133 for (Method method : classz .getDeclaredMethods ()) {
132134 if (method .isAnnotationPresent (Config .class )) {
133135 return true ;
@@ -188,7 +190,8 @@ private boolean validateAnnotations(Method configMethod)
188190 if (arrayEntry == null || arrayEntry .isEmpty ()) {
189191 problems .addError ("@LegacyConfig method [%s] annotation contains null or empty value" , configMethod .toGenericString ());
190192 isValid = false ;
191- } else if (arrayEntry .equals (config .value ())) {
193+ }
194+ else if (arrayEntry .equals (config .value ())) {
192195 problems .addError ("@Config property name '%s' appears in @LegacyConfig annotation for method [%s]" , config .value (), configMethod .toGenericString ());
193196 isValid = false ;
194197 }
@@ -343,7 +346,7 @@ private AttributeMetadata buildAttributeMetadata(Class<T> configClass, Method co
343346 }
344347
345348 if (defunctConfig .contains (propertyName )) {
346- problems .addError ("@Config property '%s' on method [%s] is defunct on class [%s]" , propertyName , configMethod , configClass );
349+ problems .addError ("@Config property '%s' on method [%s] is defunct on class [%s]" , propertyName , configMethod , configClass );
347350 }
348351
349352 // Add the injection point for the current setter/property
@@ -364,12 +367,18 @@ private AttributeMetadata buildAttributeMetadata(Class<T> configClass, Method co
364367 @ Override
365368 public boolean equals (Object o )
366369 {
367- if (this == o ) return true ;
368- if (o == null || getClass () != o .getClass ()) return false ;
370+ if (this == o ) {
371+ return true ;
372+ }
373+ if (o == null || getClass () != o .getClass ()) {
374+ return false ;
375+ }
369376
370377 ConfigurationMetadata <?> that = (ConfigurationMetadata <?>) o ;
371378
372- if (!configClass .equals (that .configClass )) return false ;
379+ if (!configClass .equals (that .configClass )) {
380+ return false ;
381+ }
373382
374383 return true ;
375384 }
@@ -453,13 +462,21 @@ public boolean isLegacy()
453462 @ Override
454463 public boolean equals (Object o )
455464 {
456- if (this == o ) return true ;
457- if (o == null || getClass () != o .getClass ()) return false ;
465+ if (this == o ) {
466+ return true ;
467+ }
468+ if (o == null || getClass () != o .getClass ()) {
469+ return false ;
470+ }
458471
459472 InjectionPointMetaData that = (InjectionPointMetaData ) o ;
460473
461- if (!configClass .equals (that .configClass )) return false ;
462- if (!property .equals (that .property )) return false ;
474+ if (!configClass .equals (that .configClass )) {
475+ return false ;
476+ }
477+ if (!property .equals (that .property )) {
478+ return false ;
479+ }
463480
464481 return true ;
465482 }
@@ -497,7 +514,7 @@ public static class AttributeMetadata
497514 private final MapClasses mapClasses ;
498515
499516 private AttributeMetadata (Class <?> configClass , String name , String description , boolean securitySensitive , @ Nullable MapClasses mapClasses , Method getter ,
500- InjectionPointMetaData injectionPoint , Set <InjectionPointMetaData > legacyInjectionPoints )
517+ InjectionPointMetaData injectionPoint , Set <InjectionPointMetaData > legacyInjectionPoints )
501518 {
502519 requireNonNull (configClass );
503520 requireNonNull (name );
@@ -559,13 +576,21 @@ public Set<InjectionPointMetaData> getLegacyInjectionPoints()
559576 @ Override
560577 public boolean equals (Object o )
561578 {
562- if (this == o ) return true ;
563- if (o == null || getClass () != o .getClass ()) return false ;
579+ if (this == o ) {
580+ return true ;
581+ }
582+ if (o == null || getClass () != o .getClass ()) {
583+ return false ;
584+ }
564585
565586 AttributeMetadata that = (AttributeMetadata ) o ;
566587
567- if (!configClass .equals (that .configClass )) return false ;
568- if (!name .equals (that .name )) return false ;
588+ if (!configClass .equals (that .configClass )) {
589+ return false ;
590+ }
591+ if (!name .equals (that .name )) {
592+ return false ;
593+ }
569594
570595 return true ;
571596 }
@@ -675,7 +700,7 @@ private static Collection<Method> findSensitiveConfigMethods(Class<?> configClas
675700 *
676701 * @param configClass the class to analyze
677702 * @return a map that associates a concrete method to the actual method tagged
678- * (which may belong to a different class in class hierarchy)
703+ * (which may belong to a different class in class hierarchy)
679704 */
680705 private static Collection <Method > findAnnotatedMethods (Class <?> configClass , Class <? extends java .lang .annotation .Annotation > annotation )
681706 {
@@ -711,7 +736,8 @@ public static Method findAnnotatedMethod(Class<?> configClass, Class<? extends j
711736 if (method != null && method .isAnnotationPresent (annotation )) {
712737 return method ;
713738 }
714- } catch (NoSuchMethodException e ) {
739+ }
740+ catch (NoSuchMethodException e ) {
715741 // ignore
716742 }
717743
@@ -747,29 +773,32 @@ private Set<InjectionPointMetaData> findLegacySetters(Class<?> configClass, Stri
747773 if (validateSetter (method )) {
748774 for (String property : method .getAnnotation (LegacyConfig .class ).value ()) {
749775 if (defunctConfig .contains (property )) {
750- problems .addError ("@LegacyConfig property '%s' on method [%s] is defunct on class [%s]" , property , method , configClass );
776+ problems .addError ("@LegacyConfig property '%s' on method [%s] is defunct on class [%s]" , property , method , configClass );
751777 }
752778
753779 if (!property .equals (propertyName )) {
754780 setters .add (InjectionPointMetaData .newLegacy (configClass , property , method ));
755- } else {
781+ }
782+ else {
756783 problems .addError ("@LegacyConfig property '%s' on method [%s] is replaced by @Config property of same name on method [%s]" ,
757784 property , method .toGenericString (), setterName );
758785 }
759786 }
760787 }
761- } else if (method .isAnnotationPresent (LegacyConfig .class )
788+ }
789+ else if (method .isAnnotationPresent (LegacyConfig .class )
762790 && method .getAnnotation (LegacyConfig .class ).replacedBy ().equals (propertyName )) {
763791 // Found @LegacyConfig setter linked by replacedBy() property
764792 if (validateSetter (method )) {
765793 for (String property : method .getAnnotation (LegacyConfig .class ).value ()) {
766794 if (defunctConfig .contains (property )) {
767- problems .addError ("@LegacyConfig property '%s' on method [%s] is defunct on class [%s]" , property , method , configClass );
795+ problems .addError ("@LegacyConfig property '%s' on method [%s] is defunct on class [%s]" , property , method , configClass );
768796 }
769797
770798 if (!property .equals (propertyName )) {
771799 setters .add (InjectionPointMetaData .newLegacy (configClass , property , method ));
772- } else {
800+ }
801+ else {
773802 problems .addError ("@LegacyConfig property '%s' on method [%s] is replaced by @Config property of same name on method [%s]" ,
774803 property , method .toGenericString (), setterName );
775804 }
@@ -795,7 +824,8 @@ private Method findGetter(Class<?> configClass, Method configMethod, String attr
795824 if (method .getName ().equals (getterName ) || method .getName ().equals (isName )) {
796825 if (isUsableMethod (method ) && !method .getReturnType ().equals (Void .TYPE ) && method .getParameterTypes ().length == 0 ) {
797826 getters .add (method );
798- } else {
827+ }
828+ else {
799829 unusableGetters .add (method );
800830 }
801831 }
0 commit comments