cleanup: use streams

master
Egor.Ushakov 8 years ago
parent f466a2bc55
commit 9ee45b3f5a
  1. 9
      src/org/jetbrains/java/decompiler/main/ClassWriter.java

@ -651,15 +651,10 @@ public class ClassWriter {
if (attr != null) { if (attr != null) {
descriptor = GenericMain.parseMethodSignature(attr.getSignature()); descriptor = GenericMain.parseMethodSignature(attr.getSignature());
if (descriptor != null) { if (descriptor != null) {
int actualParams = md.params.length; long actualParams = md.params.length;
List<VarVersionPair> sigFields = methodWrapper.signatureFields; List<VarVersionPair> sigFields = methodWrapper.signatureFields;
if (sigFields != null) { if (sigFields != null) {
actualParams = 0; actualParams = sigFields.stream().filter(Objects::isNull).count();
for (VarVersionPair field : methodWrapper.signatureFields) {
if (field == null) {
actualParams++;
}
}
} }
else if (isEnum && init) actualParams -= 2; else if (isEnum && init) actualParams -= 2;
if (actualParams != descriptor.params.size()) { if (actualParams != descriptor.params.size()) {

Loading…
Cancel
Save