diff --git a/libsrc/ffdec_lib/nbproject/ide-file-targets.xml b/libsrc/ffdec_lib/nbproject/ide-file-targets.xml index b091b0309..1d33cecc0 100644 --- a/libsrc/ffdec_lib/nbproject/ide-file-targets.xml +++ b/libsrc/ffdec_lib/nbproject/ide-file-targets.xml @@ -14,7 +14,7 @@ - + diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/IdentifiersDeobfuscation.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/IdentifiersDeobfuscation.java index f6845e380..ffc64c1c5 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/IdentifiersDeobfuscation.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/IdentifiersDeobfuscation.java @@ -87,7 +87,7 @@ public class IdentifiersDeobfuscation { if (s == null) { return false; } - String reservedWords[] = as3 ? reservedWordsAS3 : reservedWordsAS2; + String[] reservedWords = as3 ? reservedWordsAS3 : reservedWordsAS2; for (String rw : reservedWords) { if (rw.equals(s.trim())) { return true; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java index b726ce991..5a4ce7d9d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWF.java @@ -861,12 +861,12 @@ public final class SWF implements SWFContainerItem, Timelined { } } - /* preload shape tags - for (Tag tag : tags) { - if (tag instanceof ShapeTag) { - ((ShapeTag) tag).getShapes(); - } - }*/ + /*preload shape tags*/ + for (Tag tag : tags) { + if (tag instanceof ShapeTag) { + ((ShapeTag) tag).getShapes(); + } + } } @Override @@ -1063,7 +1063,7 @@ public final class SWF implements SWFContainerItem, Timelined { break; } case 'Z': { // ZWS - byte lzmaprop[] = new byte[9]; + byte[] lzmaprop = new byte[9]; is.read(lzmaprop); sis = new SWFInputStream(null, lzmaprop); sis.readUI32("LZMAsize"); // compressed LZMA data size = compressed SWF - 17 byte, diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/ZippedSWFBundle.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/ZippedSWFBundle.java index 13758ab77..d4be3ee22 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/ZippedSWFBundle.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/ZippedSWFBundle.java @@ -154,7 +154,7 @@ public class ZippedSWFBundle implements SWFBundle { ZipEntry entryIn; ZipEntry entryOut; - byte swfData[] = Helper.readStream(swfIs); + byte[] swfData = Helper.readStream(swfIs); try { while ((entryIn = zis.getNextEntry()) != null) { @@ -169,7 +169,7 @@ public class ZippedSWFBundle implements SWFBundle { zos.putNextEntry(entryOut); Helper.copyStream(src, zos, entryOut.getSize() == -1 ? Long.MAX_VALUE : entryOut.getSize()); zos.closeEntry(); - zis.closeEntry(); + zis.closeEntry(); } } finally { zis.close(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AVM2Item.java index e03381ab3..ed5d47968 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/AVM2Item.java @@ -132,7 +132,7 @@ public abstract class AVM2Item extends GraphTargetItem { ops.add(o); } } - int opArr[] = new int[ops.size()]; + int[] opArr = new int[ops.size()]; for (int i = 0; i < ops.size(); i++) { opArr[i] = ops.get(i); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/InitVectorAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/InitVectorAVM2Item.java index fd2906063..659707794 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/InitVectorAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/model/InitVectorAVM2Item.java @@ -52,7 +52,7 @@ public class InitVectorAVM2Item extends AVM2Item { List openedNamespaces; private int allNsSet(ABC abc) { - int nssa[] = new int[openedNamespaces.size()]; + int[] nssa = new int[openedNamespaces.size()]; for (int i = 0; i < openedNamespaces.size(); i++) { nssa[i] = openedNamespaces.get(i); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/pcode/ASM3Parser.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/pcode/ASM3Parser.java index 0a4c304e8..0084b9c3f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/pcode/ASM3Parser.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/pcode/ASM3Parser.java @@ -178,7 +178,7 @@ public class ASM3Parser { } loopn: for (int n = 1; n < constants.getNamespaceSetCount(); n++) { - int nss[] = constants.getNamespaceSet(n).namespaces; + int[] nss = constants.getNamespaceSet(n).namespaces; if (nss.length != namespaceList.size()) { continue; } @@ -189,7 +189,7 @@ public class ASM3Parser { } return n; } - int nss[] = new int[namespaceList.size()]; + int[] nss = new int[namespaceList.size()]; for (int i = 0; i < nss.length; i++) { nss[i] = namespaceList.get(i); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java index 9b06ad0ca..ef463b91d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/AVM2SourceGenerator.java @@ -158,7 +158,7 @@ public class AVM2SourceGenerator implements SourceGenerator { } public List generate(SourceGeneratorLocalData localData, GetDescendantsAVM2Item item) throws CompilationException { - int nssa[] = new int[item.openedNamespaces.size()]; + int[] nssa = new int[item.openedNamespaces.size()]; for (int i = 0; i < item.openedNamespaces.size(); i++) { nssa[i] = item.openedNamespaces.get(i); } @@ -332,7 +332,7 @@ public class AVM2SourceGenerator implements SourceGenerator { trueBody.addAll(toInsList(AssignableAVM2Item.getTemp(localData, this, xmlListReg))); trueBody.addAll(toInsList(AssignableAVM2Item.getTemp(localData, this, counterReg))); trueBody.addAll(toInsList(AssignableAVM2Item.getTemp(localData, this, tempVal1))); - int nss[] = new int[item.openedNamespaces.size()]; + int[] nss = new int[item.openedNamespaces.size()]; for (int i = 0; i < item.openedNamespaces.size(); i++) { nss[i] = item.openedNamespaces.get(i); } @@ -1583,9 +1583,9 @@ public class AVM2SourceGenerator implements SourceGenerator { } } - int param_types[] = new int[paramTypes.size()]; - ValueKind optional[] = new ValueKind[paramValues.size()]; - //int param_names[] = new int[paramNames.size()]; + int[] param_types = new int[paramTypes.size()]; + ValueKind[] optional = new ValueKind[paramValues.size()]; + //int[] param_names = new int[paramNames.size()]; for (int i = 0; i < paramTypes.size(); i++) { param_types[i] = typeName(localData, paramTypes.get(i)); //param_names[i] = str(paramNames.get(i)); @@ -1931,7 +1931,7 @@ public class AVM2SourceGenerator implements SourceGenerator { } TypeItem sup = (TypeItem) un; int propId = resolveType(localData, sup, abc, allABCs); - int nss[] = new int[]{abc.constants.constant_multiname.get(propId).namespace_index}; + int[] nss = new int[]{abc.constants.constant_multiname.get(propId).namespace_index}; return abc.constants.getMultinameId(new Multiname(Multiname.MULTINAME, abc.constants.constant_multiname.get(propId).name_index, 0, abc.constants.getNamespaceSetId(new NamespaceSet(nss), true), 0, new ArrayList()), true); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ConstructSomethingAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ConstructSomethingAVM2Item.java index 638565782..8a6d515f5 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ConstructSomethingAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ConstructSomethingAVM2Item.java @@ -50,7 +50,7 @@ public class ConstructSomethingAVM2Item extends CallAVM2Item { } private int allNsSetWithVec(ABC abc) { - int nssa[] = new int[openedNamespaces.size() + 1]; + int[] nssa = new int[openedNamespaces.size() + 1]; for (int i = 0; i < openedNamespaces.size(); i++) { nssa[i] = openedNamespaces.get(i); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/IndexAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/IndexAVM2Item.java index 038b65e20..c53214d2d 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/IndexAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/IndexAVM2Item.java @@ -64,7 +64,7 @@ public class IndexAVM2Item extends AssignableAVM2Item { } private int allNsSet(ABC abc) { - int nssa[] = new int[openedNamespaces.size()]; + int[] nssa = new int[openedNamespaces.size()]; for (int i = 0; i < openedNamespaces.size(); i++) { nssa[i] = openedNamespaces.get(i); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NameAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NameAVM2Item.java index 4846d65c9..b0d889609 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NameAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NameAVM2Item.java @@ -169,7 +169,7 @@ public class NameAVM2Item extends AssignableAVM2Item { } private int allNsSet(ABC abc) { - int nssa[] = new int[openedNamespaces.size()]; + int[] nssa = new int[openedNamespaces.size()]; for (int i = 0; i < openedNamespaces.size(); i++) { nssa[i] = openedNamespaces.get(i); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NamespacedAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NamespacedAVM2Item.java index 7c61316f4..610e6ccda 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NamespacedAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/NamespacedAVM2Item.java @@ -74,7 +74,7 @@ public class NamespacedAVM2Item extends AssignableAVM2Item { } private int allNsSet(ABC abc) { - int nssa[] = new int[openedNamespaces.size()]; + int[] nssa = new int[openedNamespaces.size()]; for (int i = 0; i < openedNamespaces.size(); i++) { nssa[i] = openedNamespaces.get(i); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PropertyAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PropertyAVM2Item.java index 6550ff4f3..42e9f8c95 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PropertyAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/PropertyAVM2Item.java @@ -95,7 +95,7 @@ public class PropertyAVM2Item extends AssignableAVM2Item { } private int allNsSet() { - int nssa[] = new int[openedNamespaces.size()]; + int[] nssa = new int[openedNamespaces.size()]; for (int i = 0; i < openedNamespaces.size(); i++) { nssa[i] = openedNamespaces.get(i); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/UnresolvedAVM2Item.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/UnresolvedAVM2Item.java index 27abcd1c9..eea4f3b21 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/UnresolvedAVM2Item.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/UnresolvedAVM2Item.java @@ -187,7 +187,7 @@ public class UnresolvedAVM2Item extends AssignableAVM2Item { } private int allNsSet(ABC abc) { - int nssa[] = new int[openedNamespaces.size()]; + int[] nssa = new int[openedNamespaces.size()]; for (int i = 0; i < openedNamespaces.size(); i++) { nssa[i] = openedNamespaces.get(i); } @@ -292,7 +292,7 @@ public class UnresolvedAVM2Item extends AssignableAVM2Item { public GraphTargetItem resolve(GraphTargetItem thisType, List paramTypes, List paramNames, ABC abc, List otherAbcs, List callStack, List variables) throws CompilationException { List parts = new ArrayList<>(); if (name.contains(".")) { - String partsArr[] = name.split("\\."); + String[] partsArr = name.split("\\."); parts.addAll(Arrays.asList(partsArr)); } else { parts.add(name); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/configuration/Configuration.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/configuration/Configuration.java index 36604444a..137001215 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/configuration/Configuration.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/configuration/Configuration.java @@ -730,7 +730,7 @@ public class Configuration { public static File getPlayerSWC() { File libsdir = getFlashLibPath(); if (libsdir != null && libsdir.exists()) { - File libs[] = libsdir.listFiles(new FilenameFilter() { + File[] libs = libsdir.listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String name) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/FrameExporter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/FrameExporter.java index f05c6851e..2c3dbd7c7 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/FrameExporter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/FrameExporter.java @@ -255,7 +255,7 @@ public class FrameExporter { try (FileOutputStream fos = new FileOutputStream(fh); FileInputStream fis = new FileInputStream(fmin)) { fos.write(Utf8Helper.getBytes(CanvasShapeExporter.getHtmlPrefix(width, height))); fos.write(Utf8Helper.getBytes(CanvasShapeExporter.getJsPrefix())); - byte buf[] = new byte[1000]; + byte[] buf = new byte[1000]; int cnt; while ((cnt = fis.read(buf)) > 0) { fos.write(buf, 0, cnt); @@ -337,14 +337,14 @@ public class FrameExporter { new RetryTask(new RunnableIOEx() { @Override public void run() throws IOException { - File f = new File(foutdir + File.separator + (fframes.get(fi) + 1) + ".png"); - try (FileOutputStream fos = new FileOutputStream(f)) { - ImageHelper.write(frameImages.next(), "PNG", fos); - } - ret.add(f); + File file = new File(foutdir + File.separator + (fframes.get(fi) + 1) + ".png"); + ImageHelper.write(frameImages.next(), "PNG", file); + ret.add(file); } }, handler).run(); } + + //ShapeExporterBase.clearCache(); break; case PDF: new RetryTask(new RunnableIOEx() { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/ImageExporter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/ImageExporter.java index a2d050e0e..784faecb0 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/ImageExporter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/ImageExporter.java @@ -28,7 +28,6 @@ import com.jpexs.decompiler.flash.tags.Tag; import com.jpexs.decompiler.flash.tags.base.ImageTag; import com.jpexs.helpers.Helper; import java.io.File; -import java.io.FileOutputStream; import java.io.IOException; import java.util.ArrayList; import java.util.List; @@ -92,9 +91,7 @@ public class ImageExporter { if (ffileFormat.equals("bmp")) { BMPFile.saveBitmap(imageTag.getImage().getBufferedImage(), file); } else { - try (FileOutputStream fos = new FileOutputStream(file)) { - ImageHelper.write(imageTag.getImage().getBufferedImage(), ffileFormat.toUpperCase(Locale.ENGLISH), fos); - } + ImageHelper.write(imageTag.getImage().getBufferedImage(), ffileFormat.toUpperCase(Locale.ENGLISH), file); } } }, handler).run(); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/ShapeExporter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/ShapeExporter.java index abd137151..e6a74eaab 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/ShapeExporter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/ShapeExporter.java @@ -127,9 +127,7 @@ public class ShapeExporter { m.scale(settings.zoom); st.toImage(0, 0, 0, new RenderContext(), img, m, new CXFORMWITHALPHA()); if (settings.mode == ShapeExportMode.PNG) { - try (FileOutputStream fos = new FileOutputStream(file)) { - ImageHelper.write(img.getBufferedImage(), "PNG", fos); - } + ImageHelper.write(img.getBufferedImage(), "PNG", file); } else { BMPFile.saveBitmap(img.getBufferedImage(), file); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/script/AS2ScriptExporter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/script/AS2ScriptExporter.java index 2a4d4c0c8..7311dfa7f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/script/AS2ScriptExporter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/script/AS2ScriptExporter.java @@ -47,6 +47,8 @@ import java.util.logging.Logger; */ public class AS2ScriptExporter { + private static final Logger logger = Logger.getLogger(AS2ScriptExporter.class.getName()); + public List exportAS2ScriptsTimeout(final AbortRetryIgnoreHandler handler, final String outdir, final Map asms, final ScriptExportMode exportMode, final EventListener evl) throws IOException { try { List result = CancellableWorker.call(new Callable>() { @@ -57,7 +59,10 @@ public class AS2ScriptExporter { } }, Configuration.exportTimeout.get(), TimeUnit.SECONDS); return result; - } catch (ExecutionException | InterruptedException | TimeoutException ex) { + } catch (TimeoutException ex) { + logger.log(Level.SEVERE, Helper.formatTimeToText(Configuration.exportTimeout.get()) + " ActionScript export limit reached", ex); + } catch (ExecutionException | InterruptedException ex) { + logger.log(Level.SEVERE, "Error during AS2 export", ex); } return new ArrayList<>(); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/ShapeExporterBase.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/ShapeExporterBase.java index 38393dbbd..c8105f2ef 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/ShapeExporterBase.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/ShapeExporterBase.java @@ -508,4 +508,8 @@ public abstract class ShapeExporterBase implements IShapeExporter { v1.add(v2.get(i)); } } + + public static void clearCache() { + exportDataCache.clear(); + } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/BMPFile.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/BMPFile.java index 396a3fbcc..24000ea88 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/BMPFile.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/BMPFile.java @@ -36,9 +36,9 @@ public class BMPFile extends Component { //--- Private variable declaration //--- Bitmap file header - private final byte bitmapFileHeader[] = new byte[14]; + private final byte[] bitmapFileHeader = new byte[14]; - private final byte bfType[] = {'B', 'M'}; + private final byte[] bfType = {'B', 'M'}; private int bfSize = 0; @@ -49,7 +49,7 @@ public class BMPFile extends Component { private final int bfOffBits = BITMAPFILEHEADER_SIZE + BITMAPINFOHEADER_SIZE; //--- Bitmap info header - private final byte bitmapInfoHeader[] = new byte[40]; + private final byte[] bitmapInfoHeader = new byte[40]; private final int biSize = BITMAPINFOHEADER_SIZE; @@ -74,7 +74,7 @@ public class BMPFile extends Component { private final int biClrImportant = 0; //--- Bitmap raw data - private int bitmap[]; + private int[] bitmap; //--- File section private FileOutputStream fo; @@ -148,7 +148,7 @@ public class BMPFile extends Component { int lastRowIndex; int pad; int padCount; - byte rgb[] = new byte[3]; + byte[] rgb = new byte[3]; size = (biWidth * biHeight); pad = (biWidth * 3) % 4; rowCount = 1; @@ -221,7 +221,7 @@ public class BMPFile extends Component { */ private byte[] intToWord(int parValue) { - byte retValue[] = new byte[2]; + byte[] retValue = new byte[2]; retValue[0] = (byte) (parValue & 0x00FF); retValue[1] = (byte) ((parValue >> 8) & 0x00FF); return (retValue); @@ -234,7 +234,7 @@ public class BMPFile extends Component { */ private byte[] intToDWord(int parValue) { - byte retValue[] = new byte[4]; + byte[] retValue = new byte[4]; retValue[0] = (byte) (parValue & 0x00FF); retValue[1] = (byte) ((parValue >> 8) & 0x000000FF); retValue[2] = (byte) ((parValue >> 16) & 0x000000FF); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/FontHelper.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/FontHelper.java index dc9825807..5244b0e2e 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/FontHelper.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/FontHelper.java @@ -56,7 +56,7 @@ public class FontHelper { */ public static Map> getInstalledFonts() { Map> ret = new HashMap<>(); - Font fonts[] = null; + Font[] fonts = null; try { @@ -194,7 +194,7 @@ public class FontHelper { withKerningAttrs.put(TextAttribute.KERNING, TextAttribute.KERNING_ON); Font withKerningFont = Font.getFont(withKerningAttrs); GlyphVector withKerningVector = withKerningFont.layoutGlyphVector(getFontRenderContext(withKerningFont), chars, 0, chars.length, Font.LAYOUT_LEFT_TO_RIGHT); - int withKerningX[] = new int[availableChars.size()]; + int[] withKerningX = new int[availableChars.size()]; for (int i = 0; i < availableChars.size(); i++) { withKerningX[i] = withKerningVector.getGlyphLogicalBounds(i * 2 + 1).getBounds().x; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/ImageHelper.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/ImageHelper.java index 41caf66c7..e631401dd 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/ImageHelper.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/helpers/ImageHelper.java @@ -18,6 +18,7 @@ package com.jpexs.decompiler.flash.helpers; import java.awt.image.BufferedImage; import java.io.ByteArrayOutputStream; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; @@ -47,6 +48,10 @@ public class ImageHelper { return in; } + public static void write(BufferedImage image, String formatName, File output) throws IOException { + ImageIO.write(image, formatName, output); + } + public static void write(BufferedImage image, String formatName, OutputStream output) throws IOException { ImageIO.write(image, formatName, output); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineSoundTag.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineSoundTag.java index 6e9a7bfdd..4e5878086 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineSoundTag.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/DefineSoundTag.java @@ -205,7 +205,7 @@ public class DefineSoundTag extends CharacterTag implements SoundTag { boolean newSoundSize = false; boolean newSoundType = false; long newSoundSampleCount = -1; - byte newSoundData[]; + byte[] newSoundData; switch (newSoundFormat) { case SoundFormat.FORMAT_UNCOMPRESSED_LITTLE_ENDIAN: try (AudioInputStream audioIs = AudioSystem.getAudioInputStream(new BufferedInputStream(is))) { @@ -238,7 +238,7 @@ public class DefineSoundTag extends CharacterTag implements SoundTag { case SoundFormat.FORMAT_MP3: BufferedInputStream bis = new BufferedInputStream(is); loadID3v2(bis); - byte mp3data[] = Helper.readStream(bis); + byte[] mp3data = Helper.readStream(bis); final int ID3_V1_LENTGH = 128; final int ID3_V1_EXT_LENGTH = 227; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalGradient.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalGradient.java index c623ae840..437f30a33 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalGradient.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalGradient.java @@ -61,7 +61,7 @@ public class DefineExternalGradient extends Tag { sos.writeUI16(gradientId); sos.writeUI16(bitmapsFormat); sos.writeUI16(gradientSize); - byte fileNameBytes[] = fileName.getBytes(); + byte[] fileNameBytes = fileName.getBytes(); sos.writeUI8(fileNameBytes.length); sos.write(fileNameBytes); } catch (IOException e) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage.java index 07a961bad..c20ba747f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage.java @@ -64,7 +64,7 @@ public class DefineExternalImage extends Tag { sos.writeUI16(bitmapFormat); sos.writeUI16(targetWidth); sos.writeUI16(targetHeight); - byte fileNameBytes[] = fileName.getBytes(); + byte[] fileNameBytes = fileName.getBytes(); sos.writeUI8(fileNameBytes.length); sos.write(fileNameBytes); } catch (IOException e) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage2.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage2.java index f4ac52254..6bbc27fe6 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage2.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineExternalImage2.java @@ -68,10 +68,10 @@ public class DefineExternalImage2 extends Tag { sos.writeUI16(bitmapFormat); sos.writeUI16(targetWidth); sos.writeUI16(targetHeight); - byte exportNameBytes[] = exportName.getBytes(); + byte[] exportNameBytes = exportName.getBytes(); sos.writeUI8(exportNameBytes.length); sos.write(exportNameBytes); - byte fileNameBytes[] = fileName.getBytes(); + byte[] fileNameBytes = fileName.getBytes(); sos.writeUI8(fileNameBytes.length); sos.write(fileNameBytes); if (extraData != null) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineGradientMap.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineGradientMap.java index b79635174..3173763fe 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineGradientMap.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/DefineGradientMap.java @@ -33,7 +33,7 @@ public class DefineGradientMap extends Tag { public static final int ID = 1004; - public int indices[]; + public int[] indices; /** * Gets data bytes diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/ExporterInfo.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/ExporterInfo.java index 8e690b729..f7ac579e9 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/ExporterInfo.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/ExporterInfo.java @@ -77,7 +77,7 @@ public class ExporterInfo extends Tag { sos.writeUI16(bitmapFormat); sos.writeUI8(prefix.length); sos.write(prefix); - byte swfNameBytes[] = swfName.getBytes(); + byte[] swfNameBytes = swfName.getBytes(); sos.writeUI8(swfNameBytes.length); sos.write(swfNameBytes); if (codeOffsets != null) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/FontTextureInfo.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/FontTextureInfo.java index 783d6cc69..357c3a76b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/FontTextureInfo.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/tags/gfx/FontTextureInfo.java @@ -52,9 +52,9 @@ public class FontTextureInfo extends Tag { public int nominalGlyphSz; - public TEXGLYPH texGlyphs[]; + public TEXGLYPH[] texGlyphs; - public FONTINFO fonts[]; + public FONTINFO[] fonts; public static final int TEXTURE_FORMAT_DEFAULT = 0; @@ -75,7 +75,7 @@ public class FontTextureInfo extends Tag { try { sos.writeUI32(textureID); sos.writeUI16(textureFormat); - byte fileNameBytes[] = fileName.getBytes(); + byte[] fileNameBytes = fileName.getBytes(); sos.writeUI8(fileNameBytes.length); sos.write(fileNameBytes); sos.writeUI16(textureWidth); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/CLIPACTIONRECORD.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/CLIPACTIONRECORD.java index 44e73439b..0bd1ed68b 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/CLIPACTIONRECORD.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/CLIPACTIONRECORD.java @@ -52,7 +52,7 @@ public class CLIPACTIONRECORD implements ASMSource, Serializable { } } - public static final String KEYNAMES[] = { + public static final String[] KEYNAMES = { null, "", "", diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/annotations/parser/ConditionEvaluator.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/annotations/parser/ConditionEvaluator.java index 2df70ac8a..51585a6e9 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/annotations/parser/ConditionEvaluator.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/annotations/parser/ConditionEvaluator.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.types.annotations.parser; import com.jpexs.decompiler.flash.types.annotations.Conditional; @@ -113,7 +114,7 @@ public class ConditionEvaluator { } private String prepareCond() { - String vals[] = cond.value(); + String[] vals = cond.value(); if (vals == null || vals.length == 0) { return ""; } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/filters/Filtering.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/filters/Filtering.java index ffac1febb..7416fc33f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/filters/Filtering.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/filters/Filtering.java @@ -254,9 +254,9 @@ public class Filtering { int width = src.getWidth(); int height = src.getHeight(); BufferedImage retImg = new BufferedImage(width, height, src.getType()); - int srcPixels[] = getRGB(src); + int[] srcPixels = getRGB(src); - int revPixels[] = new int[srcPixels.length]; + int[] revPixels = new int[srcPixels.length]; for (int i = 0; i < srcPixels.length; i++) { revPixels[i] = (srcPixels[i] & 0xffffff) + ((255 - ((srcPixels[i] >> 24) & 0xff)) << 24); } @@ -333,7 +333,7 @@ public class Filtering { break; } - int mask[] = null; + int[] mask = null; if (type == INNER) { mask = srcPixels; } @@ -348,7 +348,7 @@ public class Filtering { retc.drawImage(shadowIm, 0, 0, null); retc.drawImage(hilightIm, 0, 0, null); - int ret[] = getRGB(retImg); + int[] ret = getRGB(retImg); blur(ret, width, height, blurX, blurY, iterations, mask); for (int i = 0; i < srcPixels.length; i++) { @@ -390,7 +390,7 @@ public class Filtering { int width = src.getWidth(); int height = src.getHeight(); int[] srcPixels = getRGB(src); - int shadow[] = new int[srcPixels.length]; + int[] shadow = new int[srcPixels.length]; for (int i = 0; i < srcPixels.length; i++) { int alpha = (srcPixels[i] >> 24) & 0xff; if (inner) { @@ -450,13 +450,13 @@ public class Filtering { double angleRad = angle / 180 * Math.PI; double moveX = (distance * Math.cos(angleRad)); double moveY = (distance * Math.sin(angleRad)); - int srcPixels[] = getRGB(src); - int revPixels[] = new int[srcPixels.length]; + int[] srcPixels = getRGB(src); + int[] revPixels = new int[srcPixels.length]; for (int i = 0; i < srcPixels.length; i++) { revPixels[i] = (srcPixels[i] & 0xffffff) + ((255 - ((srcPixels[i] >> 24) & 0xff)) << 24); } - int shadow[] = new int[srcPixels.length]; + int[] shadow = new int[srcPixels.length]; for (int i = 0; i < srcPixels.length; i++) { shadow[i] = 0 + ((cut(strength * ((srcPixels[i] >> 24) & 0xff))) << 24); } @@ -464,7 +464,7 @@ public class Filtering { Color colorAlpha = new Color(0, 0, 0, 0); shadow = moveRGB(width, height, shadow, moveX, moveY, colorAlpha); - int mask[] = null; + int[] mask = null; if (type == INNER) { mask = srcPixels; } @@ -549,7 +549,7 @@ public class Filtering { changeColors.filter(sourceRaster, displayRaster); return new SerializableImage(src.getColorModel(), displayRaster, true, null);*/ BufferedImage dst = new BufferedImage(src.getWidth(), src.getHeight(), src.getType()); - int pixels[] = getRGB(src.getBufferedImage()).clone(); + int[] pixels = getRGB(src.getBufferedImage()).clone(); for (int i = 0; i < pixels.length; i++) { int rgb = pixels[i]; int a = (rgb >> 24) & 0xff; @@ -599,7 +599,7 @@ public class Filtering { int redAddTerm, int greenAddTerm, int blueAddTerm, int alphaAddTerm, int redMultTerm, int greenMultTerm, int blueMultTerm, int alphaMultTerm) { BufferedImage dst = new BufferedImage(src.getWidth(), src.getHeight(), src.getType()); - int pixels[] = getRGB(src.getBufferedImage()).clone(); + int[] pixels = getRGB(src.getBufferedImage()).clone(); for (int i = 0; i < pixels.length; i++) { int rgb = pixels[i]; int a = (rgb >> 24) & 0xff; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/EdgeType.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/EdgeType.java index 017315c69..4bea78b22 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/EdgeType.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/EdgeType.java @@ -28,7 +28,7 @@ import java.io.Serializable; */ public class EdgeType implements Serializable { - private static final int sizes[] = new int[]{1, 2, 1, 2, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 9}; + private static final int[] sizes = new int[]{1, 2, 1, 2, 1, 2, 3, 4, 2, 3, 4, 5, 6, 7, 8, 9}; private static final int Edge_H12 = 0; // 2 bytes @@ -70,7 +70,7 @@ public class EdgeType implements Serializable { private static final int Edge_Quad = 3; - public int data[]; + public int[] data; public EdgeType(boolean vertical, int v) { data = new int[]{vertical ? Edge_VLine : Edge_HLine, v}; @@ -163,7 +163,7 @@ public class EdgeType implements Serializable { int nb = sizes[firstByte & 0xF]; byte raw1, raw2, raw3, raw4, raw5, raw6, raw7, raw8, raw9; raw1 = (byte) sis.readUI8("byte1"); - int data[] = new int[5]; + int[] data = new int[5]; switch (firstByte & 0xF) { case Edge_H12: diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/FONTINFO.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/FONTINFO.java index 9546e333b..8ed292a5a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/FONTINFO.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/FONTINFO.java @@ -27,7 +27,7 @@ public class FONTINFO implements Serializable { public int fontId; - public GLYPHIDX glyphIndices[]; + public GLYPHIDX[] glyphIndices; public FONTINFO(int fontId, int numGlyphs, GLYPHIDX[] glyphIndices) { this.fontId = fontId; diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/FontType.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/FontType.java index 4c6545e7c..9f6ea84b8 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/FontType.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/gfx/FontType.java @@ -68,7 +68,7 @@ public class FontType implements Serializable { leading = sis.readSI16("leading"); long numGlyphs = sis.readUI32("numGlyphs"); long glyphBytesLen = sis.readUI32("glyphBytesLen"); - byte glyphBytes[] = new byte[(int) glyphBytesLen]; + byte[] glyphBytes = new byte[(int) glyphBytesLen]; sis.read(glyphBytes); glyphInfo = new ArrayList<>(); for (int i = 0; i < numGlyphs; i++) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/sound/MP3Decoder.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/sound/MP3Decoder.java index 3534a5241..d223017ba 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/sound/MP3Decoder.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/sound/MP3Decoder.java @@ -1,18 +1,19 @@ /* * Copyright (C) 2010-2015 JPEXS, All rights reserved. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public - * License along with this library. */ + * License along with this library. + */ package com.jpexs.decompiler.flash.types.sound; import com.jpexs.decompiler.flash.SWFInputStream; @@ -42,8 +43,8 @@ public class MP3Decoder extends SoundDecoder { Bitstream bitstream = new Bitstream(new ByteArrayInputStream(sis.readBytesEx(sis.available(), "soundStream"))); SampleBuffer buf; while ((buf = readFrame(decoder, bitstream)) != null) { - short audio[] = buf.getBuffer(); - byte d[] = new byte[buf.getBufferLength() * 2]; + short[] audio = buf.getBuffer(); + byte[] d = new byte[buf.getBufferLength() * 2]; for (int i = 0; i < buf.getBufferLength(); i++) { int s = audio[i]; d[i * 2] = (byte) (s & 0xff); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/sound/NellyMoserDecoder.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/sound/NellyMoserDecoder.java index d409b1c7a..9258aa4be 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/sound/NellyMoserDecoder.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/types/sound/NellyMoserDecoder.java @@ -40,7 +40,7 @@ public class NellyMoserDecoder extends SoundDecoder { @Override public void decode(SWFInputStream sis, OutputStream os) throws IOException { soundFormat.stereo = false; - float audioD[] = new float[NELLY_SAMPLES]; + float[] audioD = new float[NELLY_SAMPLES]; final float[] state = new float[64]; @@ -48,11 +48,11 @@ public class NellyMoserDecoder extends SoundDecoder { for (int j = 0; j < blockCount; j++) { byte[] block = sis.readBytesEx(NELLY_BLOCK_LEN, "block"); CodecImpl.decode(state, block, audioD); - short audio[] = new short[NELLY_SAMPLES]; + short[] audio = new short[NELLY_SAMPLES]; for (int i = 0; i < audioD.length; i++) { audio[i] = (short) (audioD[i]); } - byte d[] = new byte[audio.length * 2]; + byte[] d = new byte[audio.length * 2]; for (int i = 0; i < audio.length; i++) { int s = audio[i]; d[i * 2] = (byte) (s & 0xff); diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java index ad51dc2f6..1b333b323 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/xfl/XFLConverter.java @@ -1972,7 +1972,7 @@ public class XFLConverter { embeddedCharacters = embeddedCharacters.replace(".", ""); boolean hasAllRanges = false; for (int r = 0; r < CharacterRanges.rangeCount(); r++) { - int codes[] = CharacterRanges.rangeCodes(r); + int[] codes = CharacterRanges.rangeCodes(r); boolean hasAllInRange = true; for (int i = 0; i < codes.length; i++) { if (!fontChars.contains("" + (char) codes[i])) { diff --git a/libsrc/ffdec_lib/src/com/jpexs/helpers/FileHashMap.java b/libsrc/ffdec_lib/src/com/jpexs/helpers/FileHashMap.java index c25c8924f..8c1ad6eee 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/helpers/FileHashMap.java +++ b/libsrc/ffdec_lib/src/com/jpexs/helpers/FileHashMap.java @@ -159,7 +159,7 @@ public class FileHashMap extends AbstractMap implements Freed { long ofs = offsets.get(key); int len = lengths.get(key); file.seek(ofs); - byte data[] = new byte[len]; + byte[] data = new byte[len]; file.readFully(data); ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(data)); try { @@ -187,7 +187,7 @@ public class FileHashMap extends AbstractMap implements Freed { oos = new ObjectOutputStream(baos); oos.writeObject(value); oos.flush(); - byte data[] = baos.toByteArray(); + byte[] data = baos.toByteArray(); if (offsets.containsKey(key)) { long origOffset = offsets.get(key); int origLen = lengths.get(key); diff --git a/libsrc/ffdec_lib/src/com/jpexs/helpers/Helper.java b/libsrc/ffdec_lib/src/com/jpexs/helpers/Helper.java index b4ebe349b..2d1b953d5 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/helpers/Helper.java +++ b/libsrc/ffdec_lib/src/com/jpexs/helpers/Helper.java @@ -873,8 +873,8 @@ public class Helper { } public static String escapeHTML(String text) { - String from[] = new String[]{"&", "<", ">", "\"", "'", "/"}; - String to[] = new String[]{"&", "<", ">", """, "'", "/"}; + String[] from = new String[]{"&", "<", ">", "\"", "'", "/"}; + String[] to = new String[]{"&", "<", ">", """, "'", "/"}; for (int i = 0; i < from.length; i++) { text = text.replace(from[i], to[i]); } @@ -897,11 +897,14 @@ public class Helper { Area area = new Area(); Rectangle rectangle = new Rectangle(); int y1, y2; - for (int x = 0; x < image.getWidth(); x++) { + int width = image.getWidth(); + int height = image.getHeight(); + int[] imgData = image.getRGB(0, 0, width, height, null, 0, width); + for (int x = 0; x < width; x++) { y1 = Integer.MAX_VALUE; y2 = -1; - for (int y = 0; y < image.getHeight(); y++) { - int rgb = image.getRGB(x, y); + for (int y = 0; y < height; y++) { + int rgb = imgData[width * y + x]; rgb = rgb >>> 24; if (rgb > 0) { if (y1 == Integer.MAX_VALUE) { diff --git a/nbproject/ide-file-targets.xml b/nbproject/ide-file-targets.xml index dde69ded2..dc46d0689 100644 --- a/nbproject/ide-file-targets.xml +++ b/nbproject/ide-file-targets.xml @@ -14,7 +14,7 @@ - +