File tree Expand file tree Collapse file tree
plugin/src/main/java/io/jenkins/plugins/casc/impl/configurators Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -94,19 +94,18 @@ private Class<?> extractDescriptorTypeParameter(Class<?> clazz) {
9494 && Descriptor .class .isAssignableFrom (rawClass )) {
9595
9696 Type [] args = pt .getActualTypeArguments ();
97- if (args .length == 0 ) {
98- return null ;
99- }
10097
101- Type typeArg = args [0 ];
98+ if (args .length > 0 ) {
99+ Type typeArg = args [0 ];
102100
103- if (typeArg instanceof Class <?> clazzArg ) {
104- return clazzArg ;
105- }
101+ if (typeArg instanceof Class <?> clazzArg ) {
102+ return clazzArg ;
103+ }
106104
107- if (typeArg instanceof ParameterizedType nestedPt
108- && nestedPt .getRawType () instanceof Class <?> nestedClass ) {
109- return nestedClass ;
105+ if (typeArg instanceof ParameterizedType nestedPt
106+ && nestedPt .getRawType () instanceof Class <?> nestedClass ) {
107+ return nestedClass ;
108+ }
110109 }
111110 }
112111 clazz = clazz .getSuperclass ();
@@ -115,9 +114,6 @@ private Class<?> extractDescriptorTypeParameter(Class<?> clazz) {
115114 }
116115
117116 private static String fromPascalCaseToCamelCase (String s ) {
118- if (s == null || s .isEmpty ()) {
119- throw new IllegalStateException ("Cannot derive configurator name from an empty class name" );
120- }
121117 StringBuilder sb = new StringBuilder (s );
122118 sb .setCharAt (0 , Character .toLowerCase (s .charAt (0 )));
123119 return sb .toString ();
You can’t perform that action at this time.
0 commit comments