public class Thread {
- public native void start(int mid);
+ /* Don't allow overriding this method. If you do, it will break dispatch
+ * because we don't have the type information necessary. */
+
+ public final native void start(int mid);
public native static void sleep(long millis);
return ((value&NATIVE)!=0);
}
+ public boolean isFinal() {
+ return ((value&FINAL)!=0);
+ }
+
public String toString() {
String st="";
if ((value&PUBLIC)!=0)
checkTask(td);
}
-
}
public void checkTypeDescriptor(TypeDescriptor td) {
}
public void checkMethodBody(ClassDescriptor cd, MethodDescriptor md) {
- //System.out.println("Processing method:"+md);
+ ClassDescriptor superdesc=cd.getSuperDesc();
+ if (superdesc!=null) {
+ Set possiblematches=superdesc.getMethodTable().getSet(md.getSymbol());
+ for(Iterator methodit=possiblematches.iterator();methodit.hasNext();) {
+ MethodDescriptor matchmd=(MethodDescriptor)methodit.next();
+ if (md.matches(matchmd)) {
+ if (matchmd.getModifiers().isFinal()) {
+ throw new Error("Try to override final method in method:"+md+" declared in "+cd);
+ }
+ }
+ }
+ }
BlockNode bn=state.getMethodBody(md);
checkBlockNode(md, md.getParameterTable(),bn);
}
#ifdef DSTM
void CALL12(___Thread______start____I, int ___mid___, struct ___Thread___ * ___this___, int ___mid___) {
- startRemoteThread((unsigned int *)VAR(___this___), ___mid___);
+ startRemoteThread((unsigned int)VAR(___this___), ___mid___);
}
#endif