Return-Path: Delivered-To: apmail-jakarta-ant-dev-archive@apache.org Received: (qmail 71308 invoked from network); 14 Feb 2002 20:50:44 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 14 Feb 2002 20:50:44 -0000 Received: (qmail 11415 invoked by uid 97); 14 Feb 2002 20:50:44 -0000 Delivered-To: qmlist-jakarta-archive-ant-dev@jakarta.apache.org Received: (qmail 11380 invoked by uid 97); 14 Feb 2002 20:50:43 -0000 Mailing-List: contact ant-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list ant-dev@jakarta.apache.org Received: (qmail 11363 invoked by uid 97); 14 Feb 2002 20:50:43 -0000 Date: 14 Feb 2002 20:50:36 -0000 Message-ID: <20020214205036.36443.qmail@icarus.apache.org> From: umagesh@apache.org To: jakarta-ant-cvs@apache.org Subject: cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/i18n Translate.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N umagesh 02/02/14 12:50:36 Modified: src/main/org/apache/tools/ant/taskdefs/optional/i18n Translate.java Log: Remove unused local variable. Revision Changes Path 1.8 +47 -48 jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/i18n/Translate.java Index: Translate.java =================================================================== RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/i18n/Translate.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- Translate.java 25 Jan 2002 16:15:44 -0000 1.7 +++ Translate.java 14 Feb 2002 20:50:36 -0000 1.8 @@ -1,7 +1,7 @@ /* * The Apache Software License, Version 1.1 * - * Copyright (c) 2001 The Apache Software Foundation. All rights + * Copyright (c) 2001-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without @@ -391,18 +391,18 @@ /** * Process each file that makes up this bundle. */ - private void processBundle(String bundleFile, int i, - boolean checkLoaded) throws BuildException { - bundleFile += ".properties"; + private void processBundle(final String bundleFile, final int i, + final boolean checkLoaded) throws BuildException { + String l_BundleFile = bundleFile + ".properties"; FileInputStream ins = null; try { - ins = new FileInputStream(bundleFile); + ins = new FileInputStream(l_BundleFile); loaded = true; - bundleLastModified[i] = new File(bundleFile).lastModified(); - log("Using " + bundleFile, Project.MSG_DEBUG); + bundleLastModified[i] = new File(l_BundleFile).lastModified(); + log("Using " + l_BundleFile, Project.MSG_DEBUG); loadResourceMap(ins); } catch (IOException ioe) { - log(bundleFile + " not found.", Project.MSG_DEBUG); + log(l_BundleFile + " not found.", Project.MSG_DEBUG); //if all resource files associated with this bundle //have been scanned for and still not able to //find a single resrouce file, throw exception @@ -524,50 +524,49 @@ srcEncoding)); String line; while((line = in.readLine()) != null) { - StringBuffer newline = new StringBuffer(line); int startIndex = -1; int endIndex = -1; - outer: while (true) { - startIndex = line.indexOf(startToken, endIndex + 1); - if (startIndex < 0 || - startIndex + 1 >= line.length()) { - break; - } - endIndex = line.indexOf(endToken, startIndex + 1); - if (endIndex < 0) { - break; - } - String matches = line.substring(startIndex + 1, - endIndex); - //If there is a white space or = or :, then - //it isn't to be treated as a valid key. - for (int k = 0; k < matches.length(); k++) { - char c = matches.charAt(k); - if (c == ':' || - c == '=' || - Character.isSpaceChar(c)) { - endIndex = endIndex - 1; - continue outer; +outer: while (true) { + startIndex = line.indexOf(startToken, endIndex + 1); + if (startIndex < 0 || + startIndex + 1 >= line.length()) { + break; + } + endIndex = line.indexOf(endToken, startIndex + 1); + if (endIndex < 0) { + break; + } + String matches = line.substring(startIndex + 1, + endIndex); + //If there is a white space or = or :, then + //it isn't to be treated as a valid key. + for (int k = 0; k < matches.length(); k++) { + char c = matches.charAt(k); + if (c == ':' || + c == '=' || + Character.isSpaceChar(c)) { + endIndex = endIndex - 1; + continue outer; + } + } + String replace = null; + replace = (String) resourceMap.get(matches); + //If the key hasn't been loaded into resourceMap, + //use the key itself as the value also. + if (replace == null) { + log("Warning: The key: " + matches + + " hasn't been defined.", + Project.MSG_DEBUG); + replace = matches; + } + line = line.substring(0, startIndex) + + replace + + line.substring(endIndex + 1); + endIndex = startIndex + replace.length() + 1; + if (endIndex + 1 >= line.length()) { + break; } } - String replace = null; - replace = (String) resourceMap.get(matches); - //If the key hasn't been loaded into resourceMap, - //use the key itself as the value also. - if (replace == null) { - log("Warning: The key: " + matches - + " hasn't been defined.", - Project.MSG_DEBUG); - replace = matches; - } - line = line.substring(0, startIndex) - + replace - + line.substring(endIndex + 1); - endIndex = startIndex + replace.length() + 1; - if (endIndex + 1 >= line.length()) { - break; - } - } out.write(line); out.newLine(); } -- To unsubscribe, e-mail: For additional commands, e-mail: