mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2026-04-30 00:00:01 -04:00
Intellij suggested changes from static code analysis.
This commit is contained in:
+5
-5
@@ -84,7 +84,7 @@ abstract class DIBImageReader extends ImageReaderBase {
|
||||
|
||||
protected void resetMembers() {
|
||||
directory = null;
|
||||
|
||||
|
||||
headers.clear();
|
||||
descriptors.clear();
|
||||
|
||||
@@ -551,7 +551,7 @@ abstract class DIBImageReader extends ImageReaderBase {
|
||||
if (abortRequested()) {
|
||||
processReadAborted();
|
||||
break;
|
||||
}
|
||||
}
|
||||
processImageProgress(100 * y / (float) pBitmap.getHeight());
|
||||
}
|
||||
|
||||
@@ -591,7 +591,7 @@ abstract class DIBImageReader extends ImageReaderBase {
|
||||
|
||||
return directory.getEntry(pImageIndex);
|
||||
}
|
||||
|
||||
|
||||
/// Test code below, ignore.. :-)
|
||||
public static void main(final String[] pArgs) throws IOException {
|
||||
if (pArgs.length == 0) {
|
||||
@@ -701,10 +701,10 @@ abstract class DIBImageReader extends ImageReaderBase {
|
||||
}
|
||||
});
|
||||
|
||||
button.setText("" + image.getWidth() + "x" +
|
||||
button.setText(image.getWidth() + "x" +
|
||||
image.getHeight() + ": "
|
||||
+ ((image.getColorModel() instanceof IndexColorModel) ?
|
||||
"" + ((IndexColorModel) image.getColorModel()).getMapSize() :
|
||||
String.valueOf(((IndexColorModel) image.getColorModel()).getMapSize()) :
|
||||
"TrueColor"));
|
||||
|
||||
pParent.add(button);
|
||||
|
||||
+4
-4
@@ -60,10 +60,10 @@ public abstract class AbstractEntry implements Entry {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a format-native identifier.
|
||||
* For example {@code "2:00"} for IPTC "Record Version" field, or {@code "0x040c"} for PSD "Thumbnail" resource.
|
||||
* Returns a format-native identifier.
|
||||
* For example {@code "2:00"} for IPTC "Record Version" field, or {@code "0x040c"} for PSD "Thumbnail" resource.
|
||||
* This default implementation simply returns {@code String.valueOf(getIdentifier())}.
|
||||
*
|
||||
*
|
||||
* @return a format-native identifier.
|
||||
*/
|
||||
protected String getNativeIdentifier() {
|
||||
@@ -174,7 +174,7 @@ public abstract class AbstractEntry implements Entry {
|
||||
}
|
||||
|
||||
AbstractEntry other = (AbstractEntry) pOther;
|
||||
|
||||
|
||||
return identifier.equals(other.identifier) && (
|
||||
value == null && other.value == null || value != null && valueEquals(other)
|
||||
);
|
||||
|
||||
+2
-2
@@ -144,7 +144,7 @@ public final class XMPReader extends MetadataReader {
|
||||
parseAttributesForKnownElements(subsubdirs, node);
|
||||
|
||||
if (!subsubdirs.isEmpty()) {
|
||||
List<Entry> entries = new ArrayList<Entry>();
|
||||
List<Entry> entries = new ArrayList<>(subsubdirs.size());
|
||||
|
||||
for (Map.Entry<String, List<Entry>> entry : subsubdirs.entrySet()) {
|
||||
entries.addAll(entry.getValue());
|
||||
@@ -161,7 +161,7 @@ public final class XMPReader extends MetadataReader {
|
||||
}
|
||||
}
|
||||
|
||||
List<Directory> entries = new ArrayList<Directory>();
|
||||
List<Directory> entries = new ArrayList<Directory>(subdirs.size());
|
||||
|
||||
// TODO: Should we still allow asking for a subdirectory by item id?
|
||||
for (Map.Entry<String, List<Entry>> entry : subdirs.entrySet()) {
|
||||
|
||||
+3
-3
@@ -340,7 +340,7 @@ public final class ThumbsDBImageReader extends ImageReaderBase {
|
||||
// TODO: Rethink this...
|
||||
// Seems to be up to Windows and the installed programs what formats
|
||||
// are supported...
|
||||
// Some thumbs are just icons, and it might be better to use ImageIO to create thumbs for these... :-/
|
||||
// Some thumbs are just icons, and it might be better to use ImageIO to create thumbs for these... :-/
|
||||
// At least this seems fine for now
|
||||
String extension = FileUtil.getExtension(pFileName);
|
||||
if (StringUtil.isEmpty(extension)) {
|
||||
@@ -351,7 +351,7 @@ public final class ThumbsDBImageReader extends ImageReaderBase {
|
||||
return !"psd".equals(extension) && !"svg".equals(extension) && catalog != null && catalog.getIndex(pFileName) != -1;
|
||||
}
|
||||
|
||||
/// Test code below
|
||||
/// Test code below
|
||||
|
||||
public static void main(String[] pArgs) throws IOException {
|
||||
ThumbsDBImageReader reader = new ThumbsDBImageReader();
|
||||
@@ -421,7 +421,7 @@ public final class ThumbsDBImageReader extends ImageReaderBase {
|
||||
return SIZE;
|
||||
}
|
||||
});
|
||||
label.setText("" + image.getWidth() + "x" + image.getHeight() + ": " + pName);
|
||||
label.setText(image.getWidth() + "x" + image.getHeight() + ": " + pName);
|
||||
label.setToolTipText(image.toString());
|
||||
pParent.add(label);
|
||||
}
|
||||
|
||||
+3
-2
@@ -1144,10 +1144,11 @@ public final class TIFFImageMetadata extends AbstractMetadata {
|
||||
throw new IIOInvalidTreeException("Expected \"TIFFIFD\" node", ifdNode);
|
||||
}
|
||||
|
||||
List<Entry> entries = new ArrayList<>();
|
||||
NodeList nodes = ifdNode.getChildNodes();
|
||||
|
||||
for (int i = 0; i < nodes.getLength(); i++) {
|
||||
final int size = nodes.getLength();
|
||||
List<Entry> entries = new ArrayList<>(size);
|
||||
for (int i = 0; i < size; i++) {
|
||||
entries.add(toEntry(nodes.item(i)));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user