Author: fschumacher Date: Sun Dec 2 11:28:12 2018 New Revision: 1847986 URL: http://svn.apache.org/viewvc?rev=1847986&view=rev Log: With varargs there is no need for the arrays
Part of #435 and Bugzilla Id: 62972 Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/util/PowerTableModel.java Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/util/PowerTableModel.java URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/util/PowerTableModel.java?rev=1847986&r1=1847985&r2=1847986&view=diff ============================================================================== --- jmeter/trunk/src/core/org/apache/jmeter/gui/util/PowerTableModel.java (original) +++ jmeter/trunk/src/core/org/apache/jmeter/gui/util/PowerTableModel.java Sun Dec 2 11:28:12 2018 @@ -160,48 +160,48 @@ public class PowerTableModel extends Def return colClass.getDeclaredConstructor().newInstance(); } catch (Exception e) { try { - Constructor<?> constr = colClass.getConstructor(new Class[] { String.class }); - return constr.newInstance(new Object[] { "" }); + Constructor<?> constr = colClass.getConstructor(String.class); + return constr.newInstance(""); } catch (NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException ignored) { } try { - Constructor<?> constr = colClass.getConstructor(new Class[] { Integer.TYPE }); - return constr.newInstance(new Object[] { Integer.valueOf(0) }); + Constructor<?> constr = colClass.getConstructor(Integer.TYPE); + return constr.newInstance(Integer.valueOf(0)); } catch (NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException ignored) { } try { - Constructor<?> constr = colClass.getConstructor(new Class[] { Long.TYPE }); - return constr.newInstance(new Object[] { Long.valueOf(0L) }); + Constructor<?> constr = colClass.getConstructor(Long.TYPE); + return constr.newInstance(Long.valueOf(0L)); } catch (NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException ignored) { } try { - Constructor<?> constr = colClass.getConstructor(new Class[] { Boolean.TYPE }); - return constr.newInstance(new Object[] { Boolean.FALSE }); + Constructor<?> constr = colClass.getConstructor(Boolean.TYPE); + return constr.newInstance(Boolean.FALSE); } catch (NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException ignored) { } try { - Constructor<?> constr = colClass.getConstructor(new Class[] { Float.TYPE }); - return constr.newInstance(new Object[] { Float.valueOf(0F) }); + Constructor<?> constr = colClass.getConstructor(Float.TYPE); + return constr.newInstance(Float.valueOf(0F)); } catch (NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException ignored) { } try { - Constructor<?> constr = colClass.getConstructor(new Class[] { Double.TYPE }); - return constr.newInstance(new Object[] { Double.valueOf(0D) }); + Constructor<?> constr = colClass.getConstructor(Double.TYPE); + return constr.newInstance(Double.valueOf(0D)); } catch (NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException ignored) { } try { - Constructor<?> constr = colClass.getConstructor(new Class[] { Character.TYPE }); - return constr.newInstance(new Object[] { Character.valueOf(' ') }); + Constructor<?> constr = colClass.getConstructor(Character.TYPE); + return constr.newInstance(Character.valueOf(' ')); } catch (NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException ignored) { } try { - Constructor<?> constr = colClass.getConstructor(new Class[] { Byte.TYPE }); - return constr.newInstance(new Object[] { Byte.valueOf(Byte.MIN_VALUE) }); + Constructor<?> constr = colClass.getConstructor(Byte.TYPE); + return constr.newInstance(Byte.valueOf(Byte.MIN_VALUE)); } catch (NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException ignored) { } try { - Constructor<?> constr = colClass.getConstructor(new Class[] { Short.TYPE }); - return constr.newInstance(new Object[] { Short.valueOf(Short.MIN_VALUE) }); + Constructor<?> constr = colClass.getConstructor(Short.TYPE); + return constr.newInstance(Short.valueOf(Short.MIN_VALUE)); } catch (NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException ignored) { } }