From 712866866f2055ee9f8add16272974fe7a4172d9 Mon Sep 17 00:00:00 2001 From: Goktug Gokdogan Date: Wed, 19 Feb 2025 16:09:37 -0800 Subject: [PATCH] Slightly change the ordering cancellation check. This main reasoning is to keep its timing consistent with other frontends. PiperOrigin-RevId: 728854490 --- .../j2cl/transpiler/frontend/jdt/CompilationUnitBuilder.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/transpiler/java/com/google/j2cl/transpiler/frontend/jdt/CompilationUnitBuilder.java b/transpiler/java/com/google/j2cl/transpiler/frontend/jdt/CompilationUnitBuilder.java index 27c95017d8..1143e7e726 100644 --- a/transpiler/java/com/google/j2cl/transpiler/frontend/jdt/CompilationUnitBuilder.java +++ b/transpiler/java/com/google/j2cl/transpiler/frontend/jdt/CompilationUnitBuilder.java @@ -225,8 +225,8 @@ private Type convertType( } private void convertTypeBody(Type type, List bodyDeclarations) { + problems.abortIfCancelled(); for (BodyDeclaration bodyDeclaration : bodyDeclarations) { - problems.abortIfCancelled(); if (bodyDeclaration instanceof FieldDeclaration) { FieldDeclaration fieldDeclaration = (FieldDeclaration) bodyDeclaration; type.addMembers(convert(fieldDeclaration)); @@ -254,8 +254,8 @@ private void convertTypeBody(Type type, List bodyDeclarations) "Unexpected type for BodyDeclaration: %s, in type: %s", bodyDeclaration.getClass().getName(), type.getDeclaration().getQualifiedSourceName()); } + problems.abortIfCancelled(); } - problems.abortIfCancelled(); } private Field convert(EnumConstantDeclaration enumConstantDeclaration) {