diff options
author | nitind | 2010-08-20 12:12:59 +0000 |
---|---|---|
committer | nitind | 2010-08-20 12:12:59 +0000 |
commit | 8dcb70a4be330af63433b204ae8d5dcdaf3756a5 (patch) | |
tree | 5ae7ee3bddbcd0435f64d2bdca1dd310256692a1 /tests/org.eclipse.wst.xml.core.tests/src/org/eclipse/wst/xml/core/tests/util/StringCompareUtil.java | |
parent | cbc1243def8ae1f998954b51425f98f90ff20777 (diff) | |
download | webtools.sourceediting.tests-201008242000.tar.gz webtools.sourceediting.tests-201008242000.tar.xz webtools.sourceediting.tests-201008242000.zip |
This commit was manufactured by cvs2svn to create tag 'v201008242000'.v201008242000
Diffstat (limited to 'tests/org.eclipse.wst.xml.core.tests/src/org/eclipse/wst/xml/core/tests/util/StringCompareUtil.java')
-rw-r--r-- | tests/org.eclipse.wst.xml.core.tests/src/org/eclipse/wst/xml/core/tests/util/StringCompareUtil.java | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/tests/org.eclipse.wst.xml.core.tests/src/org/eclipse/wst/xml/core/tests/util/StringCompareUtil.java b/tests/org.eclipse.wst.xml.core.tests/src/org/eclipse/wst/xml/core/tests/util/StringCompareUtil.java deleted file mode 100644 index eb59c8299..000000000 --- a/tests/org.eclipse.wst.xml.core.tests/src/org/eclipse/wst/xml/core/tests/util/StringCompareUtil.java +++ /dev/null @@ -1,71 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.xml.core.tests.util; - -import java.io.IOException; -import java.io.StringReader; - -public class StringCompareUtil { - - public boolean equalsIgnoreLineSeperator(String string1, String string2) { - - if (string1 == null) - return false; - if (string2 == null) - return false; - - StringReader s1Reader = new StringReader(string1); - StringReader s2Reader = new StringReader(string2); - - // assume true unless find evidence to the contrary - boolean result = true; - int s1Char = -1; - int s2Char = -1; - do { - - s1Char = getNextChar(s1Reader); - - s2Char = getNextChar(s2Reader); - - if (s1Char != s2Char) { - result = false; - break; - } - } - while (s1Char != -1 && s2Char != -1); - - return result; - } - - /** - * Method getNextChar. - * @param s1Reader - * @return char - */ - private int getNextChar(StringReader reader) { - int nextChar = -1; - try { - nextChar = reader.read(); - while (isEOL(nextChar)) { - nextChar = reader.read(); - } - } - catch (IOException e) { - e.printStackTrace(); - } - return nextChar; - } - - private boolean isEOL(int aChar) { - return (aChar == '\n' || aChar == '\r'); - } - -} |