Intellij suggested changes from static code analysis.

This commit is contained in:
Koen De Groote
2020-01-28 16:18:07 +01:00
parent b6773f6983
commit aff31ebd1b
8 changed files with 46 additions and 47 deletions
@@ -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)
);
@@ -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()) {