[jbosstools-commits] JBoss Tools SVN: r43722 - trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Fri Sep 14 19:08:35 EDT 2012


Author: dgolovin
Date: 2012-09-14 19:08:35 -0400 (Fri, 14 Sep 2012)
New Revision: 43722

Modified:
   trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/StringUtil.java
Log:
Java doc added for common StringUtil.java class

Modified: trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/StringUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/StringUtil.java	2012-09-14 22:58:24 UTC (rev 43721)
+++ trunk/common/plugins/org.jboss.tools.common.core/src/org/jboss/tools/common/util/StringUtil.java	2012-09-14 23:08:35 UTC (rev 43722)
@@ -24,23 +24,23 @@
 	/**
 	 * Cuts of the starting and ending quotes from a given text value
 	 * 
-	 * @param Quoted
-	 *            text value
-	 * @return Non-quoted text value
+	 * @param <code>text</code> - text to be trimmed
+	 * @return trimmed version of <code>text</code>
+	 * @throws <code>NullPointerException</code> - if <code>text</code> parameter is <code>null</code>
 	 */
-	public static String trimQuotes(String result) {
-		String temp = result;
+	public static String trimQuotes(String text) {
+		String temp = text;
 		if(!temp.isEmpty()) {
-			int start = 0, end = result.length();
-			char first = result.charAt(start);
-			char last = result.charAt(end - 1);
+			int start = 0, end = text.length();
+			final char first = text.charAt(start);
+			final char last = text.charAt(end - 1);
 			if (first == APO || first == QUOT) {
 				start++;
 			}
 			if ((last == APO || last == QUOT) && end>1) {
 				end--;
 			}
-			temp = result.substring(start, end);
+			temp = text.substring(start, end);
 		}
 		return temp;
 	}



More information about the jbosstools-commits mailing list