* @param b
* @throws IOException
*/
- public void write(@SuppressWarnings("unused") int b) throws IOException {
+ public void write(int b) throws IOException {
// NOOP
}
/**
* @param b
* @throws IOException
*/
- public void write(@SuppressWarnings("unused") byte b[]) throws IOException {
- // NOOP
+ public void write(byte b[]) throws IOException {
+ // NOOP
}
/**
*
* @param len
* @throws IOException
*/
- public void write(@SuppressWarnings("unused") byte b[],
- @SuppressWarnings("unused") int off,
- @SuppressWarnings("unused") int len) throws IOException {/* NOOP */}
+ public void write(byte b[], int off, int len) throws IOException {
+ // NOOP
+ }
@Override
public void flushBuffer() throws IOException {/* NOOP */}
@Override
* int or boolean we'll convert value to the right type before) - that means
* you can have setDebug(1).
*/
+ @SuppressWarnings("null")
public static boolean setProperty(Object o, String name, String value) {
if (log.isDebugEnabled())
log.debug("IntrospectionUtils: setProperty(" +
params[1] = value;
if (setPropertyMethodBool != null) {
try {
- return (Boolean) setPropertyMethodBool.invoke(o, params);
+ return ((Boolean) setPropertyMethodBool.invoke(o,
+ params)).booleanValue();
}catch (IllegalArgumentException biae) {
//the boolean method had the wrong
//parameter types. lets try the other
return methods;
}
+ @SuppressWarnings("null")
public static Method findMethod(Class<?> c, String name,
Class<?> params[]) {
Method methods[] = findMethods(c);
m.invoke(c, new Object[] { args });
}
- public static Object callMethod1(Object target, String methodN,
- Object param1, String typeParam1, ClassLoader cl) throws Exception {
- if (target == null || param1 == null) {
- if (log.isDebugEnabled())
- log.debug("IntrospectionUtils: Assert: Illegal params " +
- target + " " + param1);
- }
- if (log.isDebugEnabled())
- log.debug("IntrospectionUtils: callMethod1 " +
- target.getClass().getName() + " " +
- param1.getClass().getName() + " " + typeParam1);
-
- Class<?> params[] = new Class[1];
- if (typeParam1 == null)
- params[0] = param1.getClass();
- else
- params[0] = cl.loadClass(typeParam1);
- Method m = findMethod(target.getClass(), methodN, params);
- if (m == null)
- throw new NoSuchMethodException(target.getClass().getName() + " "
- + methodN);
- return m.invoke(target, new Object[] { param1 });
- }
-
public static Object callMethod0(Object target, String methodN)
throws Exception {
if (target == null) {