Skip to content

Commit

Permalink
Don't unlock import collection during AssignmentExprent writing
Browse files Browse the repository at this point in the history
  • Loading branch information
IotaBread committed Jan 21, 2024
1 parent eda1e66 commit bc48982
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit bc48982

Please sign in to comment.