eclipse-jdt / eclipse-jdt/eclipse.jdt.core

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

Open
#3,245 1 comment 0 reactions 1 assignee Claimed by @srikanth-sankaran View on GitHub
Modernization
Dominant language
Java
Stars
237
Forks
195
Avg merge
1d 12h
Merged PRs (30d)
47

Description

While working on the PR https://github.com/eclipse-jdt/eclipse.jdt.core/pull/3242 for https://github.com/eclipse-jdt/eclipse.jdt.core/issues/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
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.