Skip to content

Commit f7a42b4

Browse files
committed
still less warnings by eclipse
1 parent f83f2e6 commit f7a42b4

4 files changed

Lines changed: 26 additions & 27 deletions

File tree

logback-core/src/main/java/ch/qos/logback/core/joran/util/PropertySetter.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
public class PropertySetter extends ContextAwareBase {
5555

5656
protected Object obj;
57-
protected Class objClass;
57+
protected Class<?> objClass;
5858
protected PropertyDescriptor[] propertyDescriptors;
5959
protected MethodDescriptor[] methodDescriptors;
6060

@@ -145,7 +145,7 @@ public void setProperty(PropertyDescriptor prop, String name, String value)
145145
+ "].");
146146
}
147147

148-
Class[] paramTypes = setter.getParameterTypes();
148+
Class<?>[] paramTypes = setter.getParameterTypes();
149149

150150
if (paramTypes.length != 1) {
151151
throw new PropertySetterException("#params for setter != 1");
@@ -217,7 +217,7 @@ private Class<?> getParameterClassForMethod(Method method) {
217217
if (method == null) {
218218
return null;
219219
}
220-
Class[] classArray = method.getParameterTypes();
220+
Class<?>[] classArray = method.getParameterTypes();
221221
if (classArray.length != 1) {
222222
return null;
223223
} else {
@@ -266,15 +266,15 @@ private boolean isUnequivocallyInstantiable(Class<?> clazz) {
266266
}
267267
}
268268

269-
public Class getObjClass() {
269+
public Class<?> getObjClass() {
270270
return objClass;
271271
}
272272

273273
public void addComplexProperty(String name, Object complexProperty) {
274274
Method adderMethod = findAdderMethod(name);
275275
// first let us use the addXXX method
276276
if (adderMethod != null) {
277-
Class[] paramTypes = adderMethod.getParameterTypes();
277+
Class<?>[] paramTypes = adderMethod.getParameterTypes();
278278
if (!isSanityCheckSuccessful(name, adderMethod, paramTypes,
279279
complexProperty)) {
280280
return;
@@ -288,7 +288,7 @@ public void addComplexProperty(String name, Object complexProperty) {
288288

289289
void invokeMethodWithSingleParameterOnThisObject(Method method,
290290
Object parameter) {
291-
Class ccc = parameter.getClass();
291+
Class<?> ccc = parameter.getClass();
292292
try {
293293
method.invoke(this.obj, parameter);
294294
} catch (Exception e) {
@@ -312,7 +312,7 @@ public void addBasicProperty(String name, String strValue) {
312312
return;
313313
}
314314

315-
Class[] paramTypes = adderMethod.getParameterTypes();
315+
Class<?>[] paramTypes = adderMethod.getParameterTypes();
316316
isSanityCheckSuccessful(name, adderMethod, paramTypes, strValue);
317317

318318
Object arg;
@@ -347,7 +347,7 @@ public void setComplexProperty(String name, Object complexProperty) {
347347
return;
348348
}
349349

350-
Class[] paramTypes = setter.getParameterTypes();
350+
Class<?>[] paramTypes = setter.getParameterTypes();
351351

352352
if (!isSanityCheckSuccessful(name, setter, paramTypes, complexProperty)) {
353353
return;
@@ -363,7 +363,7 @@ public void setComplexProperty(String name, Object complexProperty) {
363363

364364
private boolean isSanityCheckSuccessful(String name, Method method,
365365
Class<?>[] params, Object complexProperty) {
366-
Class ccc = complexProperty.getClass();
366+
Class<?> ccc = complexProperty.getClass();
367367
if (params.length != 1) {
368368
addError("Wrong number of parameters in setter method for property ["
369369
+ name + "] in " + obj.getClass().getName());
@@ -446,7 +446,7 @@ <T extends Annotation> T getAnnotation(String name, Class<T> annonationClass,
446446
}
447447
}
448448

449-
Class getDefaultClassNameByAnnonation(String name, Method relevantMethod) {
449+
Class<?> getDefaultClassNameByAnnonation(String name, Method relevantMethod) {
450450
DefaultClass defaultClassAnnon = getAnnotation(name, DefaultClass.class,
451451
relevantMethod);
452452
if (defaultClassAnnon != null) {
@@ -455,7 +455,7 @@ Class getDefaultClassNameByAnnonation(String name, Method relevantMethod) {
455455
return null;
456456
}
457457

458-
Class getByConcreteType(String name, Method relevantMethod) {
458+
Class<?> getByConcreteType(String name, Method relevantMethod) {
459459

460460
Class<?> paramType = getParameterClassForMethod(relevantMethod);
461461
if (paramType == null) {
@@ -471,10 +471,10 @@ Class getByConcreteType(String name, Method relevantMethod) {
471471

472472
}
473473

474-
public Class getClassNameViaImplicitRules(String name,
474+
public Class<?> getClassNameViaImplicitRules(String name,
475475
AggregationType aggregationType, DefaultNestedComponentRegistry registry) {
476476

477-
Class registryResult = registry.findDefaultComponentType(obj.getClass(),
477+
Class<?> registryResult = registry.findDefaultComponentType(obj.getClass(),
478478
name);
479479
if (registryResult != null) {
480480
return registryResult;
@@ -484,7 +484,7 @@ public Class getClassNameViaImplicitRules(String name,
484484
if (relevantMethod == null) {
485485
return null;
486486
}
487-
Class byAnnotation = getDefaultClassNameByAnnonation(name, relevantMethod);
487+
Class<?> byAnnotation = getDefaultClassNameByAnnonation(name, relevantMethod);
488488
if (byAnnotation != null) {
489489
return byAnnotation;
490490
}

logback-core/src/main/java/ch/qos/logback/core/rolling/helper/FileStoreUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ static public boolean areOnSameFileStore(File a, File b) throws RolloverFailure
5555
// return fileStoreA.equals(fileStoreB);
5656

5757
try {
58-
Class pathClass = Class.forName(PATH_CLASS_STR);
59-
Class filesClass = Class.forName(FILES_CLASS_STR);
58+
Class<?> pathClass = Class.forName(PATH_CLASS_STR);
59+
Class<?> filesClass = Class.forName(FILES_CLASS_STR);
6060

6161
Method toPath = File.class.getMethod("toPath");
6262
Method getFileStoreMethod = filesClass.getMethod("getFileStore", pathClass);

logback-core/src/main/java/ch/qos/logback/core/util/IncompatibleClassException.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ public class IncompatibleClassException extends Exception {
1717

1818
private static final long serialVersionUID = -5823372159561159549L;
1919

20-
Class requestedClass;
21-
Class obtainedClass;
20+
Class<?> requestedClass;
21+
Class<?> obtainedClass;
2222

23-
IncompatibleClassException(Class requestedClass, Class obtainedClass) {
23+
IncompatibleClassException(Class<?> requestedClass, Class<?> obtainedClass) {
2424
super();
25-
this.requestedClass =requestedClass;
25+
this.requestedClass = requestedClass;
2626
this.obtainedClass = obtainedClass;
2727
}
2828
}

logback-core/src/main/java/ch/qos/logback/core/util/OptionHelper.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,43 +29,42 @@
2929
public class OptionHelper {
3030

3131
public static Object instantiateByClassName(String className,
32-
Class superClass, Context context) throws IncompatibleClassException,
32+
Class<?> superClass, Context context) throws IncompatibleClassException,
3333
DynamicClassLoadingException {
3434
ClassLoader classLoader = Loader.getClassLoaderOfObject(context);
3535
return instantiateByClassName(className, superClass, classLoader);
3636
}
3737

3838
public static Object instantiateByClassNameAndParameter(String className,
39-
Class superClass, Context context, Class type, Object param) throws IncompatibleClassException,
39+
Class<?> superClass, Context context, Class<?> type, Object param) throws IncompatibleClassException,
4040
DynamicClassLoadingException {
4141
ClassLoader classLoader = Loader.getClassLoaderOfObject(context);
4242
return instantiateByClassNameAndParameter(className, superClass, classLoader, type, param);
4343
}
4444

45-
@SuppressWarnings("unchecked")
4645
public static Object instantiateByClassName(String className,
47-
Class superClass, ClassLoader classLoader)
46+
Class<?> superClass, ClassLoader classLoader)
4847
throws IncompatibleClassException, DynamicClassLoadingException {
4948
return instantiateByClassNameAndParameter(className, superClass, classLoader, null, null);
5049
}
5150

5251
public static Object instantiateByClassNameAndParameter(String className,
53-
Class superClass, ClassLoader classLoader, Class type, Object parameter)
52+
Class<?> superClass, ClassLoader classLoader, Class<?> type, Object parameter)
5453
throws IncompatibleClassException, DynamicClassLoadingException {
5554

5655
if (className == null) {
5756
throw new NullPointerException();
5857
}
5958
try {
60-
Class classObj = null;
59+
Class<?> classObj = null;
6160
classObj = classLoader.loadClass(className);
6261
if (!superClass.isAssignableFrom(classObj)) {
6362
throw new IncompatibleClassException(superClass, classObj);
6463
}
6564
if (type == null) {
6665
return classObj.newInstance();
6766
} else {
68-
Constructor constructor = classObj.getConstructor(type);
67+
Constructor<?> constructor = classObj.getConstructor(type);
6968
return constructor.newInstance(parameter);
7069
}
7170
} catch (IncompatibleClassException ice) {

0 commit comments

Comments
 (0)