mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
contract inference: don't go inside try because catch/finally clauses can change the outcome completely
This commit is contained in:
-13
@@ -334,19 +334,6 @@ class ContractInferenceFromSourceTest extends LightCodeInsightFixtureTestCase {
|
||||
assert c == ['null -> null']
|
||||
}
|
||||
|
||||
public void "test go inside try"() {
|
||||
def c = inferContracts("""
|
||||
final Object foo(Object bar) {
|
||||
try {
|
||||
if (bar == null) return null;
|
||||
bar = smth(bar);
|
||||
} finally {}
|
||||
return new String("abc");
|
||||
}
|
||||
""")
|
||||
assert c == ['null -> null']
|
||||
}
|
||||
|
||||
public void "test use invoked method notnull"() {
|
||||
def c = inferContracts("""
|
||||
final Object foo(Object bar) {
|
||||
|
||||
Reference in New Issue
Block a user