Merge pull request #9 from iKarith/master
Fix my idiot attempt to fix this warning
This commit is contained in:
commit
5d9ac872fd
|
@ -49,8 +49,7 @@ public abstract class AppleImage {
|
||||||
public static AppleImage create(int width, int height) {
|
public static AppleImage create(int width, int height) {
|
||||||
String[] classes = {
|
String[] classes = {
|
||||||
"ImageIoImage", "SunJpegImage", "SwtImage" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
"ImageIoImage", "SunJpegImage", "SwtImage" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||||
Class<?> constructorArgType = AppleImage.class;
|
Class[] constructorArgClasses = new Class[] { int.class, int.class };
|
||||||
Class<?>[] constructorArgClasses = new Class[] { AppleImage.class };
|
|
||||||
Object[] constructorArgs = new Object[] {
|
Object[] constructorArgs = new Object[] {
|
||||||
new Integer(width), new Integer(height) };
|
new Integer(width), new Integer(height) };
|
||||||
for (int i=0; i<classes.length; i++) {
|
for (int i=0; i<classes.length; i++) {
|
||||||
|
@ -58,8 +57,9 @@ public abstract class AppleImage {
|
||||||
Class<?> appleImageClass = Class.forName(
|
Class<?> appleImageClass = Class.forName(
|
||||||
"com.webcodepro.applecommander.storage.filters.imagehandlers." //$NON-NLS-1$
|
"com.webcodepro.applecommander.storage.filters.imagehandlers." //$NON-NLS-1$
|
||||||
+ classes[i]);
|
+ classes[i]);
|
||||||
Constructor constructor =
|
Constructor<?> constructor =
|
||||||
constructorArgType.getConstructor(constructorArgClasses);
|
appleImageClass.getConstructor(constructorArgClasses);
|
||||||
|
|
||||||
AppleImage appleImage = (AppleImage)
|
AppleImage appleImage = (AppleImage)
|
||||||
constructor.newInstance(constructorArgs);
|
constructor.newInstance(constructorArgs);
|
||||||
return appleImage;
|
return appleImage;
|
||||||
|
|
Loading…
Reference in New Issue