mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2025-01-08 16:04:10 -08:00
Merge branch 'master' of https://github.com/konsoletyper/teavm
This commit is contained in:
commit
61a0fcfb9c
|
@ -28,6 +28,7 @@ import org.teavm.callgraph.CallGraphNode;
|
||||||
import org.teavm.callgraph.CallSite;
|
import org.teavm.callgraph.CallSite;
|
||||||
import org.teavm.diagnostics.Diagnostics;
|
import org.teavm.diagnostics.Diagnostics;
|
||||||
import org.teavm.interop.Async;
|
import org.teavm.interop.Async;
|
||||||
|
import org.teavm.interop.SuppressSyncErrors;
|
||||||
import org.teavm.interop.Sync;
|
import org.teavm.interop.Sync;
|
||||||
import org.teavm.model.CallLocation;
|
import org.teavm.model.CallLocation;
|
||||||
import org.teavm.model.ClassReader;
|
import org.teavm.model.ClassReader;
|
||||||
|
@ -156,9 +157,17 @@ public class AsyncMethodFinder {
|
||||||
}
|
}
|
||||||
if (method.getAnnotations().get(Sync.class.getName()) != null
|
if (method.getAnnotations().get(Sync.class.getName()) != null
|
||||||
|| method.getAnnotations().get(InjectedBy.class.getName()) != null) {
|
|| method.getAnnotations().get(InjectedBy.class.getName()) != null) {
|
||||||
diagnostics.error(new CallLocation(methodRef), "Method {{m0}} is claimed to be synchronous, "
|
if (method.getAnnotations().get(SuppressSyncErrors.class.getName()) == null) {
|
||||||
+ "but it is has invocations of asynchronous methods:" + stack.toString(), methodRef);
|
diagnostics.error(new CallLocation(methodRef), "Method {{m0}} is claimed to be "
|
||||||
return;
|
+ "synchronous, but it is has invocations of asynchronous methods:"
|
||||||
|
+ stack.toString(), methodRef);
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
diagnostics.warning(new CallLocation(methodRef), "Error as Warning because "
|
||||||
|
+ " Method {{m0}} has @SuppressSyncErrors annoation. Method {{m0}} "
|
||||||
|
+ "is claimed to be synchronous, but it is has invocations of "
|
||||||
|
+ "asynchronous methods:" + stack.toString(), methodRef);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for (CallSite callSite : node.getCallerCallSites()) {
|
for (CallSite callSite : node.getCallerCallSites()) {
|
||||||
MethodReference nextMethod = callSite.getCaller().getMethod();
|
MethodReference nextMethod = callSite.getCaller().getMethod();
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2016 Alexey Andreev.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.teavm.interop;
|
||||||
|
|
||||||
|
import java.lang.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Steve Hannah
|
||||||
|
*/
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@Target(ElementType.METHOD)
|
||||||
|
public @interface SuppressSyncErrors {
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user