From: bdemsky Date: Fri, 13 Oct 2006 08:36:50 +0000 (+0000) Subject: Change ServerSocket class so we don't have to subclass it... X-Git-Tag: preEdgeChange~816 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a62aa1d7e273044fc3ad885b91433539bd2818c5;p=IRC.git Change ServerSocket class so we don't have to subclass it... --- diff --git a/Robust/src/ClassLibrary/ServerSocket.java b/Robust/src/ClassLibrary/ServerSocket.java index d99ff83e..51dd73e9 100644 --- a/Robust/src/ClassLibrary/ServerSocket.java +++ b/Robust/src/ClassLibrary/ServerSocket.java @@ -17,6 +17,12 @@ public class ServerSocket { return s; } + /* Lets caller pass in their own Socket object. */ + public void accept(Socket s) { + int newfd=nativeaccept(s); + s.setFD(newfd); + } + private native int nativeaccept(Socket s); public void close(); diff --git a/Robust/src/IR/Tree/SemanticCheck.java b/Robust/src/IR/Tree/SemanticCheck.java index a2cd5122..47dcc524 100644 --- a/Robust/src/IR/Tree/SemanticCheck.java +++ b/Robust/src/IR/Tree/SemanticCheck.java @@ -262,7 +262,10 @@ public class SemanticCheck { throw new Error("Illegal return appears in Task: "+d.getSymbol()); MethodDescriptor md=(MethodDescriptor)d; if (rn.getReturnExpression()!=null) - checkExpressionNode(md, nametable, rn.getReturnExpression(), md.getReturnType()); + if (md.getReturnType().isVoid()) + throw new Error(md+" is void"); + else + checkExpressionNode(md, nametable, rn.getReturnExpression(), md.getReturnType()); else if (md.getReturnType()!=null&&!md.getReturnType().isVoid()) throw new Error("Need to return something for "+md);