Bug 355400 - org.eclipse.equinox.internal.security.storage.Base64 is not
threadsafe
diff --git a/bundles/org.eclipse.equinox.security/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.security/META-INF/MANIFEST.MF
index e00573c..f516eee 100644
--- a/bundles/org.eclipse.equinox.security/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.security/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.equinox.security;singleton:=true
-Bundle-Version: 1.1.0.qualifier
+Bundle-Version: 1.1.1.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-Activator: org.eclipse.equinox.internal.security.auth.AuthPlugin
diff --git a/bundles/org.eclipse.equinox.security/src/org/eclipse/equinox/internal/security/storage/Base64.java b/bundles/org.eclipse.equinox.security/src/org/eclipse/equinox/internal/security/storage/Base64.java
index 362039e..b374d4d 100644
--- a/bundles/org.eclipse.equinox.security/src/org/eclipse/equinox/internal/security/storage/Base64.java
+++ b/bundles/org.eclipse.equinox.security/src/org/eclipse/equinox/internal/security/storage/Base64.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
+ * Copyright (c) 2008, 2011 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
@@ -25,10 +25,9 @@
final static private byte BASE64_PADDING = 126;
final static private byte BASE64_INVALID = 127;
- static private byte[] decodeTable = null;
+ final static private byte[] decodeTable = new byte[256];
- synchronized static private void init() {
- decodeTable = new byte[256];
+ static {
for (int i = 0; i < 256; i++)
decodeTable[i] = BASE64_INVALID;
@@ -47,8 +46,6 @@
static public byte[] decode(String str) {
if (str == null)
return null;
- if (decodeTable == null)
- init();
// eliminate all unexpected characters (might have EOLs inserted)
char[] source = str.toCharArray();