Skip to content

[4.35+][Experimental] Could modelling SynchronizedStatement as a subclass of TryStatement lead to simpler code/nomenclature? #3245

Description

@srikanth-sankaran

While working on the PR #3242 for #3240 - I get the sense that modelling org.eclipse.jdt.internal.compiler.ast.SynchronizedStatement as a subclass of org.eclipse.jdt.internal.compiler.ast.TryStatement could lead to much simpler nomenclature and readable code (for flow analysis phase)

A synchronized statement such as:

    synchronized(expression) {
        // block body
    }

should be modellable as:

    try {
        // obtain monitor
       {
           // block body
       }
    } catch (Throwable any) {
         throw any;
    } finally {
        // release monitor
    }

Metadata

Metadata

Labels

ModernizationHigh value non-critical path refactoring efforts

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions