Avoid some redundant unboxing and object creation (#21909)
This commit is contained in:
parent
a30efacca4
commit
7cc9833606
|
@ -106,7 +106,7 @@ public class NodeExplanation implements Writeable, ToXContent {
|
||||||
}
|
}
|
||||||
builder.endObject(); // end store
|
builder.endObject(); // end store
|
||||||
builder.field("final_decision", finalDecision.toString());
|
builder.field("final_decision", finalDecision.toString());
|
||||||
builder.field("final_explanation", finalExplanation.toString());
|
builder.field("final_explanation", finalExplanation);
|
||||||
builder.field("weight", nodeWeight);
|
builder.field("weight", nodeWeight);
|
||||||
nodeDecision.toXContent(builder, params);
|
nodeDecision.toXContent(builder, params);
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ final class JNACLibrary {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected List<String> getFieldOrder() {
|
protected List<String> getFieldOrder() {
|
||||||
return Arrays.asList(new String[] { "rlim_cur", "rlim_max" });
|
return Arrays.asList("rlim_cur", "rlim_max");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -149,7 +149,7 @@ final class JNAKernel32Library {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected List<String> getFieldOrder() {
|
protected List<String> getFieldOrder() {
|
||||||
return Arrays.asList(new String[]{"BaseAddress", "AllocationBase", "AllocationProtect", "RegionSize", "State", "Protect", "Type"});
|
return Arrays.asList("BaseAddress", "AllocationBase", "AllocationProtect", "RegionSize", "State", "Protect", "Type");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -261,10 +261,8 @@ final class JNAKernel32Library {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected List<String> getFieldOrder() {
|
protected List<String> getFieldOrder() {
|
||||||
return Arrays.asList(new String[] {
|
return Arrays.asList("PerProcessUserTimeLimit", "PerJobUserTimeLimit", "LimitFlags", "MinimumWorkingSetSize",
|
||||||
"PerProcessUserTimeLimit", "PerJobUserTimeLimit", "LimitFlags", "MinimumWorkingSetSize",
|
"MaximumWorkingSetSize", "ActiveProcessLimit", "Affinity", "PriorityClass", "SchedulingClass");
|
||||||
"MaximumWorkingSetSize", "ActiveProcessLimit", "Affinity", "PriorityClass", "SchedulingClass"
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,9 +33,7 @@ public class JavaVersion implements Comparable<JavaVersion> {
|
||||||
}
|
}
|
||||||
|
|
||||||
private JavaVersion(List<Integer> version) {
|
private JavaVersion(List<Integer> version) {
|
||||||
if (version.size() >= 2
|
if (version.size() >= 2 && version.get(0) == 1 && version.get(1) == 8) {
|
||||||
&& version.get(0).intValue() == 1
|
|
||||||
&& version.get(1).intValue() == 8) {
|
|
||||||
// for Java 8 there is ambiguity since both 1.8 and 8 are supported,
|
// for Java 8 there is ambiguity since both 1.8 and 8 are supported,
|
||||||
// so we rewrite the former to the latter
|
// so we rewrite the former to the latter
|
||||||
version = new ArrayList<>(version.subList(1, version.size()));
|
version = new ArrayList<>(version.subList(1, version.size()));
|
||||||
|
|
|
@ -172,7 +172,7 @@ final class Seccomp {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected List<String> getFieldOrder() {
|
protected List<String> getFieldOrder() {
|
||||||
return Arrays.asList(new String[] { "len", "filter" });
|
return Arrays.asList("len", "filter");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -104,7 +104,7 @@ final class StartupException extends RuntimeException {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
consumer.accept("\tat " + line.toString());
|
consumer.accept("\tat " + line);
|
||||||
linesWritten++;
|
linesWritten++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue