mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-02 20:33:50 +07:00
Fixed Java 8+ compatibility
This commit is contained in:
parent
c678b53d3f
commit
34df9cca2c
@ -54,8 +54,20 @@ class CodeAnalyzerTreeScanner extends TreePathScanner<Object, Trees> {
|
||||
return false;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public boolean checkScope (Scope members) {
|
||||
for (Symbol s : members.getElements()) {
|
||||
Iterable<Symbol> it;
|
||||
try{
|
||||
it = (Iterable<Symbol>)members.getClass().getMethod("getElements").invoke(members);
|
||||
}catch(Throwable t){
|
||||
try{
|
||||
it = (Iterable<Symbol>)members.getClass().getMethod("getSymbols").invoke(members);
|
||||
}catch(Exception e){
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
for (Symbol s : it) {
|
||||
if (s instanceof MethodSymbol) {
|
||||
MethodSymbol ms = (MethodSymbol) s;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user