mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2025-08-05 04:25:29 -04:00
Merge pull request #505 from KoenDG/intellij_performance_analysis
Changes suggested by Intellij in the category "Performance".
This commit is contained in:
commit
306d8ac5f6
@ -922,7 +922,7 @@ public final class FileUtil {
|
||||
// A URL should never be able to represent an opaque URI, test anyway
|
||||
throw new IllegalArgumentException("URI is not hierarchical");
|
||||
}
|
||||
if (path.equals("")) {
|
||||
if (path.isEmpty()) {
|
||||
throw new IllegalArgumentException("URI path component is empty");
|
||||
}
|
||||
|
||||
|
@ -88,7 +88,7 @@ public final class BeanUtil {
|
||||
|
||||
while (begIdx < pProperty.length() && begIdx >= 0) {
|
||||
|
||||
endIdx = pProperty.indexOf(".", endIdx + 1);
|
||||
endIdx = pProperty.indexOf('.', endIdx + 1);
|
||||
if (endIdx > 0) {
|
||||
subProp = pProperty.substring(begIdx, endIdx);
|
||||
begIdx = endIdx + 1;
|
||||
@ -106,7 +106,7 @@ public final class BeanUtil {
|
||||
Class[] paramClass = new Class[0];
|
||||
|
||||
int begBracket;
|
||||
if ((begBracket = subProp.indexOf("[")) > 0) {
|
||||
if ((begBracket = subProp.indexOf('[')) > 0) {
|
||||
// An error if there is no matching bracket
|
||||
if (!subProp.endsWith("]")) {
|
||||
return null;
|
||||
|
@ -622,7 +622,7 @@ public class WildcardStringParser {
|
||||
buffer.append("\n");
|
||||
buffer.append(" Format: <state index>: <character> (<last free state>)");
|
||||
buffer.append("\n");
|
||||
buffer.append(" Number of strings parsed: " + totalNumberOfStringsParsed);
|
||||
buffer.append(" Number of strings parsed: ").append(totalNumberOfStringsParsed);
|
||||
buffer.append("\n");
|
||||
}
|
||||
return buffer.toString();
|
||||
|
@ -78,6 +78,7 @@ import java.awt.image.*;
|
||||
import java.io.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
@ -2627,7 +2628,7 @@ public final class PICTImageReader extends ImageReaderBase {
|
||||
|
||||
public Iterator<ImageTypeSpecifier> getImageTypes(int pIndex) throws IOException {
|
||||
// TODO: The images look slightly different in Preview.. Could indicate the color space is wrong...
|
||||
return Arrays.asList(
|
||||
return Collections.singletonList(
|
||||
ImageTypeSpecifiers.createPacked(
|
||||
ColorSpace.getInstance(ColorSpace.CS_sRGB),
|
||||
0xff0000, 0xff00, 0xff, 0xff000000, DataBuffer.TYPE_INT, false
|
||||
|
Loading…
x
Reference in New Issue
Block a user