Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleRevision.java12
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/builders/OSGiManifestBuilderFactory.java2
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/util/FilePath.java4
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/debug/EclipseDebugTrace.java26
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/debug/FrameworkDebugTraceEntry.java2
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxConfiguration.java4
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/FilterImpl.java27
7 files changed, 54 insertions, 23 deletions
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleRevision.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleRevision.java
index 67339d08a..801b08549 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleRevision.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleRevision.java
@@ -13,15 +13,21 @@
*******************************************************************************/
package org.eclipse.osgi.container;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
import java.util.Map.Entry;
+import java.util.Set;
import org.eclipse.osgi.container.ModuleRevisionBuilder.GenericInfo;
import org.eclipse.osgi.container.namespaces.EquinoxModuleDataNamespace;
import org.eclipse.osgi.internal.container.InternalUtils;
import org.osgi.framework.Bundle;
import org.osgi.framework.Version;
import org.osgi.framework.namespace.IdentityNamespace;
-import org.osgi.framework.wiring.*;
+import org.osgi.framework.wiring.BundleCapability;
+import org.osgi.framework.wiring.BundleRequirement;
+import org.osgi.framework.wiring.BundleRevision;
import org.osgi.resource.Capability;
import org.osgi.resource.Requirement;
@@ -208,7 +214,7 @@ public final class ModuleRevision implements BundleRevision {
return ""; //$NON-NLS-1$
String assignment = directives ? ":=" : "="; //$NON-NLS-1$ //$NON-NLS-2$
Set<Entry<String, V>> set = map.entrySet();
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
for (Entry<String, V> entry : set) {
sb.append("; "); //$NON-NLS-1$
String key = entry.getKey();
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/builders/OSGiManifestBuilderFactory.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/builders/OSGiManifestBuilderFactory.java
index 11da9b3ff..4f7cf5df0 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/builders/OSGiManifestBuilderFactory.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/builders/OSGiManifestBuilderFactory.java
@@ -719,7 +719,7 @@ public final class OSGiManifestBuilderFactory {
if (breeFilters.size() == 1) {
filterSpec = breeFilters.get(0);
} else {
- StringBuffer filterBuf = new StringBuffer("(|"); //$NON-NLS-1$
+ StringBuilder filterBuf = new StringBuilder("(|"); //$NON-NLS-1$
for (String breeFilter : breeFilters) {
filterBuf.append(breeFilter);
}
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/util/FilePath.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/util/FilePath.java
index af399cc04..60f9a43ec 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/util/FilePath.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/util/FilePath.java
@@ -210,7 +210,7 @@ public class FilePath {
int count = this.matchingFirstSegments(base);
if (baseCount == count && count == base.segments.length)
return base.hasTrailingSlash() ? ("." + SEPARATOR) : "."; //$NON-NLS-1$ //$NON-NLS-2$
- StringBuffer relative = new StringBuffer(); //
+ StringBuilder relative = new StringBuilder(); //
for (int j = 0; j < baseCount - count; j++)
relative.append(PARENT_DIR + SEPARATOR);
for (int i = 0; i < base.segments.length - count; i++) {
@@ -245,7 +245,7 @@ public class FilePath {
*/
@Override
public String toString() {
- StringBuffer result = new StringBuffer();
+ StringBuilder result = new StringBuilder();
if (device != null)
result.append(device);
if (isAbsolute())
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/debug/EclipseDebugTrace.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/debug/EclipseDebugTrace.java
index 18abfe93a..ad5b330b2 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/debug/EclipseDebugTrace.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/debug/EclipseDebugTrace.java
@@ -13,7 +13,15 @@
*******************************************************************************/
package org.eclipse.osgi.internal.debug;
-import java.io.*;
+import java.io.BufferedWriter;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FilterOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.PrintStream;
+import java.io.Writer;
import java.nio.charset.StandardCharsets;
import java.security.AccessController;
import java.text.MessageFormat;
@@ -193,7 +201,7 @@ class EclipseDebugTrace implements DebugTrace {
public void traceEntry(final String optionPath, final Object[] methodArguments) {
if (isDebuggingEnabled(optionPath)) {
- final StringBuffer messageBuffer = new StringBuffer(EclipseDebugTrace.MESSAGE_ENTER_METHOD_WITH_PARAMS);
+ final StringBuilder messageBuffer = new StringBuilder(EclipseDebugTrace.MESSAGE_ENTER_METHOD_WITH_PARAMS);
if (methodArguments != null) {
int i = 0;
while (i < methodArguments.length) {
@@ -237,7 +245,7 @@ class EclipseDebugTrace implements DebugTrace {
public void traceExit(final String optionPath, final Object result) {
if (isDebuggingEnabled(optionPath)) {
- final StringBuffer messageBuffer = new StringBuffer(EclipseDebugTrace.MESSAGE_EXIT_METHOD_WITH_RESULTS);
+ final StringBuilder messageBuffer = new StringBuilder(EclipseDebugTrace.MESSAGE_EXIT_METHOD_WITH_RESULTS);
if (result == null) {
messageBuffer.append(EclipseDebugTrace.NULL_VALUE);
} else {
@@ -257,7 +265,7 @@ class EclipseDebugTrace implements DebugTrace {
public void traceDumpStack(final String optionPath) {
if (isDebuggingEnabled(optionPath)) {
- final StringBuffer messageBuffer = new StringBuffer(EclipseDebugTrace.MESSAGE_THREAD_DUMP);
+ final StringBuilder messageBuffer = new StringBuilder(EclipseDebugTrace.MESSAGE_THREAD_DUMP);
StackTraceElement[] elements = new Exception().getStackTrace();
// the first element in this stack trace is going to be this class, so ignore it
// the second element in this stack trace is going to either be the caller or the trace class. Ignore it only if a traceClass is defined
@@ -288,7 +296,7 @@ class EclipseDebugTrace implements DebugTrace {
String argument = null;
if (!debugOptions.isVerbose()) {
- final StringBuffer classMethodName = new StringBuffer(record.getClassName());
+ final StringBuilder classMethodName = new StringBuilder(record.getClassName());
classMethodName.append("#"); //$NON-NLS-1$
classMethodName.append(record.getMethodName());
classMethodName.append(" "); //$NON-NLS-1$
@@ -309,7 +317,7 @@ class EclipseDebugTrace implements DebugTrace {
*/
private final String convertStackTraceElementsToString(final StackTraceElement[] elements) {
- final StringBuffer buffer = new StringBuffer();
+ final StringBuilder buffer = new StringBuilder();
if (elements != null) {
buffer.append("java.lang.Throwable: "); //$NON-NLS-1$
buffer.append(EclipseDebugTrace.LINE_SEPARATOR);
@@ -461,7 +469,7 @@ class EclipseDebugTrace implements DebugTrace {
*/
private void writeComment(final Writer traceWriter, final String comment) throws IOException {
- StringBuffer commentText = new StringBuffer(EclipseDebugTrace.TRACE_COMMENT);
+ StringBuilder commentText = new StringBuilder(EclipseDebugTrace.TRACE_COMMENT);
commentText.append(" "); //$NON-NLS-1$
commentText.append(comment);
commentText.append(EclipseDebugTrace.LINE_SEPARATOR);
@@ -534,7 +542,7 @@ class EclipseDebugTrace implements DebugTrace {
*/
private void writeMessage(final Writer traceWriter, final FrameworkDebugTraceEntry entry) throws IOException {
- final StringBuffer message = new StringBuffer(EclipseDebugTrace.TRACE_ELEMENT_DELIMITER);
+ final StringBuilder message = new StringBuilder(EclipseDebugTrace.TRACE_ELEMENT_DELIMITER);
message.append(" "); //$NON-NLS-1$
message.append(encodeText(entry.getThreadName()));
message.append(" "); //$NON-NLS-1$
@@ -601,7 +609,7 @@ class EclipseDebugTrace implements DebugTrace {
private static String encodeText(final String inputString) {
if (inputString == null || inputString.indexOf(TRACE_ELEMENT_DELIMITER) < 0)
return inputString;
- final StringBuffer tempBuffer = new StringBuffer(inputString);
+ final StringBuilder tempBuffer = new StringBuilder(inputString);
int currentIndex = tempBuffer.indexOf(TRACE_ELEMENT_DELIMITER);
while (currentIndex >= 0) {
tempBuffer.replace(currentIndex, currentIndex + TRACE_ELEMENT_DELIMITER.length(), TRACE_ELEMENT_DELIMITER_ENCODED);
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/debug/FrameworkDebugTraceEntry.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/debug/FrameworkDebugTraceEntry.java
index 13248d889..f46675223 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/debug/FrameworkDebugTraceEntry.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/debug/FrameworkDebugTraceEntry.java
@@ -148,7 +148,7 @@ public class FrameworkDebugTraceEntry {
@Override
public String toString() {
- final StringBuffer buffer = new StringBuffer(threadName);
+ final StringBuilder buffer = new StringBuilder(threadName);
buffer.append(" "); //$NON-NLS-1$
buffer.append(timestamp);
buffer.append(" "); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxConfiguration.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxConfiguration.java
index a6f8da3a6..13382c882 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxConfiguration.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxConfiguration.java
@@ -391,7 +391,7 @@ public class EquinoxConfiguration implements EnvironmentInfo {
}
public String substituteVars(String path, boolean preserveDelimiters) {
- StringBuffer buf = new StringBuffer(path.length());
+ StringBuilder buf = new StringBuilder(path.length());
StringTokenizer st = new StringTokenizer(path, VARIABLE_DELIM_STRING, true);
boolean varStarted = false; // indicates we are processing a var subtitute
String var = null; // the current var key
@@ -1107,7 +1107,7 @@ public class EquinoxConfiguration implements EnvironmentInfo {
return Integer.parseInt(value);
} catch (NumberFormatException e) {
// try up to the first non-number char
- StringBuffer sb = new StringBuffer(value.length());
+ StringBuilder sb = new StringBuilder(value.length());
char[] chars = value.toCharArray();
for (int i = 0; i < chars.length; i++) {
if (!Character.isDigit(chars[i]))
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/FilterImpl.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/FilterImpl.java
index f7eb91df4..f496852db 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/FilterImpl.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/FilterImpl.java
@@ -14,16 +14,33 @@
package org.eclipse.osgi.internal.framework;
-import java.lang.reflect.*;
+import java.lang.reflect.AccessibleObject;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
import java.security.AccessController;
import java.security.PrivilegedAction;
-import java.util.*;
+import java.util.AbstractMap;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Dictionary;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
import org.eclipse.osgi.framework.util.CaseInsensitiveDictionaryMap;
import org.eclipse.osgi.internal.debug.Debug;
import org.eclipse.osgi.internal.messages.Msg;
import org.eclipse.osgi.internal.serviceregistry.ServiceReferenceImpl;
import org.eclipse.osgi.util.NLS;
-import org.osgi.framework.*;
+import org.osgi.framework.Constants;
+import org.osgi.framework.Filter;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.Version;
/**
* RFC 1960-based Filter. Filter objects can be created by calling
@@ -349,8 +366,8 @@ public class FilterImpl implements Filter /* since Framework 1.1 */ {
*
* @return This <code>Filter</code>'s filter string.
*/
- private StringBuffer normalize() {
- StringBuffer sb = new StringBuffer();
+ private StringBuilder normalize() {
+ StringBuilder sb = new StringBuilder();
sb.append('(');
switch (op) {

Back to the top