diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/AssignmentExprent.java b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/AssignmentExprent.java index 51b0753d8d..4f9b84d6d2 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/exps/AssignmentExprent.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/exps/AssignmentExprent.java @@ -141,9 +141,10 @@ public TextBuffer toJava(int indent) { // We must lock the collector: this prevents the retrieval of the cast type name to impact the import list. // This is fine as we're only using the cast type name to ensure that it's not the unrepresentable type. + boolean lockedImports = DecompilerContext.getImportCollector().isWriteLocked(); DecompilerContext.getImportCollector().setWriteLocked(true); String castName = ExprProcessor.getCastTypeName(leftType); - DecompilerContext.getImportCollector().setWriteLocked(false); + DecompilerContext.getImportCollector().setWriteLocked(lockedImports); if (castName.equals(ExprProcessor.UNREPRESENTABLE_TYPE_STRING)) { // Unrepresentable, go ahead and just put the type on the right. The lhs (if a variable) should know about its type and change itself to "var" accordingly.