Skip to content

Commit 1a36e34

Browse files
committed
comment
1 parent cfafcbe commit 1a36e34

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/org/jetbrains/java/decompiler/main/RecordHelper.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ public static void fixupCanonicalConstructor(MethodWrapper mw, StructClass cl) {
240240
varidx += md.params[i].stackSize;
241241
}
242242

243-
// Prune all field assignments from the canonical constructor;
243+
// Prune all field assignments from the canonical constructor
244244
if (isCompactCanonicalConstructor(mw)) {
245245
mw.getOrBuildGraph().iterateExprents(exprent -> {
246246
if (exprent instanceof AssignmentExprent assignmentExprent && assignmentExprent.getLeft() instanceof FieldExprent) {
@@ -253,6 +253,9 @@ public static void fixupCanonicalConstructor(MethodWrapper mw, StructClass cl) {
253253
}
254254
}
255255

256+
// Ideally this is iterated backwards.
257+
// However, what we do is check that the last exprents are field invocations to local variables.
258+
// (And that the name of the lvt matches the field)
256259
private static boolean isCompactCanonicalConstructor(MethodWrapper mw) {
257260
DirectGraph graph = mw.getOrBuildGraph();
258261
boolean[] valid = new boolean[1];
@@ -268,7 +271,4 @@ private static boolean isCompactCanonicalConstructor(MethodWrapper mw) {
268271
return valid[0];
269272
}
270273

271-
272-
273-
274274
}

0 commit comments

Comments
 (0)