Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Keller2015-01-15 20:47:42 +0000
committerMarkus Keller2015-01-15 20:47:42 +0000
commit01d2aec6ff87feab0e11e6b8d5eae44d5bc548c7 (patch)
treeeb33aee33f34987851b7cb19c74abafa56f2b28f /org.eclipse.ua.tests/base
parenta8649f0ddf43acb7b6b732a1c8e5d2c5eeda5a87 (diff)
downloadeclipse.platform.ua-01d2aec6ff87feab0e11e6b8d5eae44d5bc548c7.tar.gz
eclipse.platform.ua-01d2aec6ff87feab0e11e6b8d5eae44d5bc548c7.tar.xz
eclipse.platform.ua-01d2aec6ff87feab0e11e6b8d5eae44d5bc548c7.zip
Diffstat (limited to 'org.eclipse.ua.tests/base')
-rw-r--r--org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/FileUtil.java4
-rw-r--r--org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/ResourceFinder.java8
-rw-r--r--org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/UATestContentProducer.java1
-rw-r--r--org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/XMLUtil.java5
4 files changed, 12 insertions, 6 deletions
diff --git a/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/FileUtil.java b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/FileUtil.java
index ac7056114..3335e6aca 100644
--- a/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/FileUtil.java
+++ b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/FileUtil.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2011 IBM Corporation and others.
+ * Copyright (c) 2005, 2015 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
@@ -63,7 +63,7 @@ public class FileUtil {
out.write(buffer, 0, num);
}
String result = new String(out.toByteArray(), "UTF-8");
- if (result != null) {
+ if (result.length() > 0) {
// filter windows-specific newline
result = result.replaceAll("\r", "");
}
diff --git a/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/ResourceFinder.java b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/ResourceFinder.java
index 43b1aebab..7cb43adb7 100644
--- a/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/ResourceFinder.java
+++ b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/ResourceFinder.java
@@ -64,15 +64,15 @@ public class ResourceFinder {
private static URL[] findFiles(File[] files, String suffix, boolean recursive) {
List<URL> list = new ArrayList<URL>();
if (files != null) {
- for (int i=0;i<files.length;++i) {
- if (files[i].isDirectory()) {
+ for (File file : files) {
+ if (file.isDirectory()) {
if (recursive) {
- list.addAll(Arrays.asList(findFiles(files[i].listFiles(), suffix, recursive)));
+ list.addAll(Arrays.asList(findFiles(file.listFiles(), suffix, recursive)));
}
}
else {
try {
- URL url = files[i].toURI().toURL();
+ URL url = file.toURI().toURL();
if (url.toString().endsWith(suffix)) {
list.add(url);
}
diff --git a/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/UATestContentProducer.java b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/UATestContentProducer.java
index ddf428f2a..c81b7c4c2 100644
--- a/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/UATestContentProducer.java
+++ b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/UATestContentProducer.java
@@ -20,6 +20,7 @@ import org.eclipse.help.internal.util.URLCoder;
public class UATestContentProducer implements IHelpContentProducer {
+ @Override
public InputStream getInputStream(String pluginId, String href,
Locale locale) {
if (href.startsWith("generated/")) {
diff --git a/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/XMLUtil.java b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/XMLUtil.java
index 1dd3cba09..ec2f86480 100644
--- a/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/XMLUtil.java
+++ b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/util/XMLUtil.java
@@ -73,6 +73,7 @@ public class XMLUtil extends Assert {
/* (non-Javadoc)
* @see org.xml.sax.helpers.DefaultHandler#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
*/
+ @Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
buf.append('<');
buf.append(qName);
@@ -98,6 +99,7 @@ public class XMLUtil extends Assert {
/* (non-Javadoc)
* @see org.xml.sax.helpers.DefaultHandler#endElement(java.lang.String, java.lang.String, java.lang.String)
*/
+ @Override
public void endElement(String uri, String localName, String qName) throws SAXException {
buf.append('<');
buf.append('/');
@@ -108,6 +110,7 @@ public class XMLUtil extends Assert {
/* (non-Javadoc)
* @see org.xml.sax.helpers.DefaultHandler#characters(char[], int, int)
*/
+ @Override
public void characters(char[] ch, int start, int length) throws SAXException {
buf.append(ch, start, length);
}
@@ -118,6 +121,7 @@ public class XMLUtil extends Assert {
*
* @see org.xml.sax.helpers.DefaultHandler#resolveEntity(java.lang.String, java.lang.String)
*/
+ @Override
public InputSource resolveEntity(String publicId, String systemId) throws SAXException {
try {
return entityResolver.resolveEntity(publicId, systemId);
@@ -126,6 +130,7 @@ public class XMLUtil extends Assert {
}
}
+ @Override
public String toString() {
return buf.toString();
}

Back to the top