mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2025-08-03 03:25:28 -04:00
Intellij suggested changes from static code analysis.
This commit is contained in:
parent
b6773f6983
commit
aff31ebd1b
@ -129,8 +129,7 @@ public class Time {
|
||||
* @see #toString(String)
|
||||
*/
|
||||
public String toString() {
|
||||
return "" + getMinutes() + ":"
|
||||
+ (getSeconds() < 10 ? "0" : "") + getSeconds();
|
||||
return getMinutes() + ":" + (getSeconds() < 10 ? "0" : "") + getSeconds();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -404,7 +404,7 @@ class SecondsFormatter extends TimeFormatter {
|
||||
|
||||
// Else return it with leading 0's
|
||||
//return StringUtil.formatNumber(t.getSeconds(), digits);
|
||||
return StringUtil.pad("" + t.getSeconds(), digits, "0", true);
|
||||
return StringUtil.pad(String.valueOf(t.getSeconds()), digits, "0", true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -425,7 +425,7 @@ class MinutesFormatter extends TimeFormatter {
|
||||
|
||||
// Else return it with leading 0's
|
||||
//return StringUtil.formatNumber(t.getMinutes(), digits);
|
||||
return StringUtil.pad("" + t.getMinutes(), digits, "0", true);
|
||||
return StringUtil.pad(String.valueOf(t.getMinutes()), digits, "0", true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -200,11 +200,10 @@ public final class TIFFUtilities {
|
||||
}
|
||||
|
||||
public static List<TIFFPage> getPages(ImageInputStream imageInput) throws IOException {
|
||||
ArrayList<TIFFPage> pages = new ArrayList<TIFFPage>();
|
||||
|
||||
CompoundDirectory IFDs = (CompoundDirectory) new TIFFReader().read(imageInput);
|
||||
|
||||
int pageCount = IFDs.directoryCount();
|
||||
final int pageCount = IFDs.directoryCount();
|
||||
List<TIFFPage> pages = new ArrayList<>(pageCount);
|
||||
for (int pageIndex = 0; pageIndex < pageCount; pageIndex++) {
|
||||
pages.add(new TIFFPage(IFDs.getDirectory(pageIndex), imageInput));
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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()) {
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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)));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user