diff --git a/src/Acme/JPM/Encoders/GifEncoder.java b/src/Acme/JPM/Encoders/GifEncoder.java index 18022542..af24b1a8 100644 --- a/src/Acme/JPM/Encoders/GifEncoder.java +++ b/src/Acme/JPM/Encoders/GifEncoder.java @@ -116,7 +116,6 @@ public class GifEncoder extends ImageEncoder int index = 0; for ( int row = 0; row < height; ++row ) { - int rowOffset = row * width; for ( int col = 0; col < width; ++col ) { int rgb = rgbPixels[row][col]; diff --git a/src/helma/doc/DocFunction.java b/src/helma/doc/DocFunction.java index da12b16f..50a1ad0a 100644 --- a/src/helma/doc/DocFunction.java +++ b/src/helma/doc/DocFunction.java @@ -90,11 +90,11 @@ public class DocFunction extends DocFileElement { // if we're currently parsing a functionbody and come to the start // of the next function or eof -> read function body - if (curFunction != null && (tok== ts.FUNCTION || ts.eof())) { + if (curFunction != null && (tok== TokenStream.FUNCTION || ts.eof())) { curFunction.content = "function " + Util.getStringFromFile(location, curFunctionStart, endOfLastToken); } - if (tok == ts.FUNCTION) { + if (tok == TokenStream.FUNCTION) { // store the function start for parsing the function body later curFunctionStart = getPoint (ts); // get and chop the comment @@ -111,12 +111,12 @@ public class DocFunction extends DocFileElement { // subloop on the tokenstream: find the parameters of a function // only if it's a function (and not a macro or an action) if (curFunction.type == FUNCTION) { - while (!ts.eof() && tok != ts.RP) { + while (!ts.eof() && tok != TokenStream.RP) { // store the position of the last token endOfLastToken = getPoint (ts); // new token tok = ts.getToken(); - if (tok==ts.NAME) { + if (tok==TokenStream.NAME) { curFunction.addParameter (ts.getString()); } } diff --git a/src/helma/doc/DocSkin.java b/src/helma/doc/DocSkin.java index df4f8cdc..87fd186c 100644 --- a/src/helma/doc/DocSkin.java +++ b/src/helma/doc/DocSkin.java @@ -58,7 +58,6 @@ public class DocSkin extends DocFileElement { ArrayList partBuffer = new ArrayList(); char[] source = content.toCharArray(); int sourceLength = source.length; - int start = 0; for (int i = 0; i < (sourceLength - 1); i++) { if ((source[i] == '<') && (source[i + 1] == '%')) { @@ -92,8 +91,6 @@ public class DocSkin extends DocFileElement { partBuffer.add(str); } } - - start = j + 2; } i = j + 1; diff --git a/src/helma/framework/core/Application.java b/src/helma/framework/core/Application.java index 440fad5a..23fee26d 100644 --- a/src/helma/framework/core/Application.java +++ b/src/helma/framework/core/Application.java @@ -447,7 +447,7 @@ public final class Application implements IPathElement, Runnable { // give it 3 more tries, waiting 3 seconds each time. for (int i = 0; i < 4; i++) { try { - Thread.currentThread().sleep(3000); + Thread.sleep(3000); return (RequestEvaluator) freeThreads.pop(); } catch (EmptyStackException nothreads) { @@ -1450,7 +1450,7 @@ public final class Application implements IPathElement, Runnable { // sleep until the next full minute try { - worker.sleep(sleepInterval); + Thread.sleep(sleepInterval); } catch (InterruptedException x) { logEvent("Scheduler for " + name + " interrupted"); worker = null; diff --git a/src/helma/framework/core/RequestEvaluator.java b/src/helma/framework/core/RequestEvaluator.java index 00cbd00b..005201b8 100644 --- a/src/helma/framework/core/RequestEvaluator.java +++ b/src/helma/framework/core/RequestEvaluator.java @@ -103,8 +103,6 @@ public final class RequestEvaluator implements Runnable { * */ public void run() { - int txcount = 0; - // first, set a local variable to the current transactor thread so we know // when it's time to quit because another thread took over. Transactor localrtx = (Transactor) Thread.currentThread(); @@ -351,8 +349,7 @@ public final class RequestEvaluator implements Runnable { // wait a bit longer with each try int base = 800 * tries; - Thread.currentThread().sleep((long) (base + - (Math.random() * base * 2))); + Thread.sleep((long) (base + (Math.random() * base * 2))); } catch (Exception ignore) { } @@ -905,4 +902,5 @@ public final class RequestEvaluator implements Runnable { return null; } + } diff --git a/src/helma/framework/core/Skin.java b/src/helma/framework/core/Skin.java index 1f722510..b7e3f05b 100644 --- a/src/helma/framework/core/Skin.java +++ b/src/helma/framework/core/Skin.java @@ -87,8 +87,6 @@ public final class Skin { private void parse() { ArrayList partBuffer = new ArrayList(); - int start = 0; - for (int i = 0; i < (sourceLength - 1); i++) { if ((source[i] == '<') && (source[i + 1] == '%')) { // found macro start tag @@ -102,7 +100,6 @@ public final class Skin { if (j > (i + 2)) { partBuffer.add(new Macro(i, j + 2)); - start = j + 2; } i = j + 1; @@ -376,7 +373,7 @@ public final class Skin { public void render(RequestEvaluator reval, Object thisObject, Map paramObject, Map handlerCache) throws RedirectException { if ((sandbox != null) && !sandbox.contains(fullName)) { - String h = (handler == null) ? "global" : handler; + //String h = (handler == null) ? "global" : handler; reval.res.write("[Macro " + fullName + " not allowed in sandbox]"); diff --git a/src/helma/image/ImageWrapper.java b/src/helma/image/ImageWrapper.java index f59fa4d9..d81ef463 100644 --- a/src/helma/image/ImageWrapper.java +++ b/src/helma/image/ImageWrapper.java @@ -309,7 +309,6 @@ public abstract class ImageWrapper { StringTokenizer tk = new StringTokenizer(string); StringBuffer buffer = new StringBuffer(); int spaceWidth = metrics.stringWidth(" "); - int currentLine = 0; int currentWidth = 0; int maxWidth = w - 2; int maxHeight = (h + addedSpace) - 2; diff --git a/src/helma/main/Server.java b/src/helma/main/Server.java index 82a972f6..ec062ca9 100644 --- a/src/helma/main/Server.java +++ b/src/helma/main/Server.java @@ -545,11 +545,9 @@ public class Server implements IPathElement, Runnable { } } - int count = 0; - while (Thread.currentThread() == mainThread) { try { - mainThread.sleep(3000L); + Thread.sleep(3000L); } catch (InterruptedException ie) { } @@ -629,7 +627,7 @@ public class Server implements IPathElement, Runnable { addr = InetAddress.getLocalHost(); } try { - Socket socket = new Socket(addr, addrPort.getPort()); + new Socket(addr, addrPort.getPort()); } catch (IOException x) { // we couldn't connect to the socket because no server // is running on it yet. Everything's ok. diff --git a/src/helma/objectmodel/TransientNode.java b/src/helma/objectmodel/TransientNode.java index 6ef62cd1..f50c250b 100644 --- a/src/helma/objectmodel/TransientNode.java +++ b/src/helma/objectmodel/TransientNode.java @@ -167,7 +167,6 @@ public class TransientNode implements INode, Serializable { * @return ... */ public String getFullName(INode root) { - String fullname = ""; String divider = null; StringBuffer b = new StringBuffer(); TransientNode p = this; @@ -548,7 +547,7 @@ public class TransientNode implements INode, Serializable { } // nodes.remove (node); - Object what = nodeMap.remove(node.getName().toLowerCase()); + nodeMap.remove(node.getName().toLowerCase()); // Server.throwNodeEvent (new NodeEvent (node, NodeEvent.NODE_REMOVED)); // Server.throwNodeEvent (new NodeEvent (this, NodeEvent.SUBNODE_REMOVED, node)); @@ -923,7 +922,7 @@ public class TransientNode implements INode, Serializable { } try { - Property p = (Property) propMap.remove(propname.toLowerCase()); + propMap.remove(propname.toLowerCase()); lastmodified = System.currentTimeMillis(); } catch (Exception ignore) { diff --git a/src/helma/objectmodel/db/Node.java b/src/helma/objectmodel/db/Node.java index c3e9806f..c095c3bf 100644 --- a/src/helma/objectmodel/db/Node.java +++ b/src/helma/objectmodel/db/Node.java @@ -484,7 +484,6 @@ public final class Node implements INode, Serializable { * @return ... */ public String getFullName(INode root) { - String fullname = ""; String divider = null; StringBuffer b = new StringBuffer(); INode p = this; @@ -839,8 +838,6 @@ public final class Node implements INode, Serializable { node.makePersistentCapable(); } - String n = node.getName(); - // if (n.indexOf('/') > -1) // throw new RuntimeException ("\"/\" found in Node name."); // only mark this node as modified if subnodes are not in relational db @@ -1153,11 +1150,13 @@ public final class Node implements INode, Serializable { return null; } + /* DbMapping smap = null; if (dbmap != null) { smap = dbmap.getSubnodeMapping(); } + */ Node retval = null; @@ -1291,9 +1290,11 @@ public final class Node implements INode, Serializable { // check if the subnode is in relational db and has a link back to this // which needs to be unset + /* if (dbmap != null) { Relation srel = dbmap.getSubnodeRelation(); } + */ // check if subnodes are also accessed as properties. If so, also unset the property if ((dbmap != null) && (node.dbmap != null)) { diff --git a/src/helma/objectmodel/db/NodeManager.java b/src/helma/objectmodel/db/NodeManager.java index 4ee19119..36c5757e 100644 --- a/src/helma/objectmodel/db/NodeManager.java +++ b/src/helma/objectmodel/db/NodeManager.java @@ -183,8 +183,6 @@ public final class NodeManager { */ public void deleteNode(Node node) throws Exception { if (node != null) { - String id = node.getID(); - synchronized (this) { Transactor tx = (Transactor) Thread.currentThread(); @@ -362,7 +360,7 @@ public final class NodeManager { } else { // node fetched from db is null, cache result using nullNode synchronized (cache) { - Node oldnode = (Node) cache.put(key, new Node()); + cache.put(key, new Node()); // we ignore the case that onother thread has created the node in the meantime return null; diff --git a/src/helma/objectmodel/db/Relation.java b/src/helma/objectmodel/db/Relation.java index c989d551..b6e6c274 100644 --- a/src/helma/objectmodel/db/Relation.java +++ b/src/helma/objectmodel/db/Relation.java @@ -109,7 +109,6 @@ public final class Relation { //////////////////////////////////////////////////////////////////////////////////////////// public void update(String desc, Properties props) { Application app = ownType.getApplication(); - boolean notPrimitive = false; if ((desc == null) || "".equals(desc.trim())) { if (propName != null) { diff --git a/src/helma/objectmodel/db/Replicator.java b/src/helma/objectmodel/db/Replicator.java index b567923d..a4286ed2 100644 --- a/src/helma/objectmodel/db/Replicator.java +++ b/src/helma/objectmodel/db/Replicator.java @@ -91,7 +91,7 @@ public class Replicator implements Runnable { try { if (runner != null) { - runner.sleep(1000L); + Thread.sleep(1000L); } } catch (InterruptedException ir) { runner = null; diff --git a/src/helma/objectmodel/db/XmlDatabase.java b/src/helma/objectmodel/db/XmlDatabase.java index f72bf1b2..c4a6ddc5 100644 --- a/src/helma/objectmodel/db/XmlDatabase.java +++ b/src/helma/objectmodel/db/XmlDatabase.java @@ -18,10 +18,7 @@ package helma.objectmodel.db; import helma.objectmodel.*; import helma.objectmodel.dom.*; -import org.w3c.dom.Document; -import org.w3c.dom.Element; import java.io.*; -import java.util.Date; import javax.xml.parsers.ParserConfigurationException; import org.xml.sax.SAXException; @@ -200,7 +197,7 @@ public final class XmlDatabase implements IDatabase { writer.setMaxLevels(1); - boolean result = writer.write((Node) node); + writer.write((Node) node); writer.close(); } @@ -225,7 +222,7 @@ public final class XmlDatabase implements IDatabase { * * @param enc ... */ - public void setEncoding(String enc) { + public void setEncoding(String encoding) { this.encoding = encoding; } diff --git a/src/helma/scripting/rhino/GlobalObject.java b/src/helma/scripting/rhino/GlobalObject.java index a8550000..07e18b1c 100644 --- a/src/helma/scripting/rhino/GlobalObject.java +++ b/src/helma/scripting/rhino/GlobalObject.java @@ -24,6 +24,7 @@ import helma.objectmodel.db.*; import helma.util.HtmlEncoder; import helma.util.MimePart; import org.mozilla.javascript.*; + import java.util.HashMap; import java.util.Map; import java.util.Date; @@ -63,8 +64,8 @@ public class GlobalObject extends ScriptableObject { }; defineFunctionProperties(globalFuncs, GlobalObject.class, 0); - put("app", this, cx.toObject(new ApplicationBean(app), this)); - put("Xml", this, cx.toObject(new XmlObject(core), this)); + put("app", this, Context.toObject(new ApplicationBean(app), this)); + put("Xml", this, Context.toObject(new XmlObject(core), this)); } /** diff --git a/src/helma/scripting/rhino/HopObject.java b/src/helma/scripting/rhino/HopObject.java index 2622f6e3..56f08541 100644 --- a/src/helma/scripting/rhino/HopObject.java +++ b/src/helma/scripting/rhino/HopObject.java @@ -22,6 +22,7 @@ import helma.framework.core.*; import helma.objectmodel.*; import helma.objectmodel.db.*; import org.mozilla.javascript.*; + import java.lang.reflect.Method; import java.lang.reflect.Constructor; import java.util.ArrayList; @@ -91,7 +92,7 @@ public class HopObject extends ScriptableObject { for (int i=0; i 0) { CookieTrans[] resCookies = restrans.getCookies(); @@ -275,11 +273,11 @@ public abstract class AbstractServletClient extends HttpServlet { } catch (Exception x) { try { if (debug) { - sendError(response, response.SC_INTERNAL_SERVER_ERROR, + sendError(response, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Error in request handler:" + x); x.printStackTrace(); } else { - sendError(response, response.SC_INTERNAL_SERVER_ERROR, + sendError(response, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "The server encountered an error while processing your request. " + "Please check back later."); } @@ -403,9 +401,9 @@ public abstract class AbstractServletClient extends HttpServlet { // send status code 303 for HTTP 1.1, 302 otherwise if (isOneDotOne(req.getProtocol())) { - res.setStatus(res.SC_SEE_OTHER); + res.setStatus(HttpServletResponse.SC_SEE_OTHER); } else { - res.setStatus(res.SC_MOVED_TEMPORARILY); + res.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY); } res.setContentType("text/html"); @@ -577,7 +575,6 @@ public abstract class AbstractServletClient extends HttpServlet { public static void parseParameters(Map map, byte[] data, String encoding) throws UnsupportedEncodingException { if ((data != null) && (data.length > 0)) { - int pos = 0; int ix = 0; int ox = 0; String key = null; diff --git a/src/helma/util/Diff.java b/src/helma/util/Diff.java index 851b7d16..aa4d5f0d 100644 --- a/src/helma/util/Diff.java +++ b/src/helma/util/Diff.java @@ -1,4 +1,7 @@ /* $Log$ +/* Revision 1.1 2002/10/31 08:39:34 hannes +/* Added GNU Diff class from http://www.bmsi.com/java/#diff +/* * Revision 1.3 2000/03/03 21:58:03 stuart * move discard_confusing_lines and shift_boundaries to class file_data * @@ -312,7 +315,7 @@ public class Diff { int d = diag (xoff, xlim, yoff, ylim); int c = cost; - int f = fdiag[fdiagoff + d]; + //int f = fdiag[fdiagoff + d]; int b = bdiag[bdiagoff + d]; if (c == 1) diff --git a/src/helma/util/Logger.java b/src/helma/util/Logger.java index de756d7f..40a26add 100644 --- a/src/helma/util/Logger.java +++ b/src/helma/util/Logger.java @@ -473,8 +473,6 @@ public final class Logger { } public void run() { - long start = System.currentTimeMillis(); - try { GZIPOutputStream zip = new GZIPOutputStream(new FileOutputStream(temp)); BufferedInputStream in = new BufferedInputStream(new FileInputStream(file)); diff --git a/src/helma/util/XmlUtils.java b/src/helma/util/XmlUtils.java index e98e96a3..df05f497 100644 --- a/src/helma/util/XmlUtils.java +++ b/src/helma/util/XmlUtils.java @@ -64,7 +64,7 @@ public class XmlUtils { if (obj instanceof String) { try { // first try to interpret string as URL - URL url = new URL(obj.toString()); + new URL(obj.toString()); doc = parser.parse(obj.toString()); } catch (MalformedURLException nourl) {