Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 347302 | Differences between
and this patch

Collapse All | Expand All

(-)ui/org/eclipse/jdt/internal/ui/preferences/NewJavaProjectPreferencePage.java (-12 / +9 lines)
Lines 8-13 Link Here
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
10
 *******************************************************************************/
11
// AW
11
package org.eclipse.jdt.internal.ui.preferences;
12
package org.eclipse.jdt.internal.ui.preferences;
12
13
13
import java.io.UnsupportedEncodingException;
14
import java.io.UnsupportedEncodingException;
Lines 65-76 Link Here
65
import org.eclipse.jdt.internal.ui.dialogs.StatusInfo;
66
import org.eclipse.jdt.internal.ui.dialogs.StatusInfo;
66
import org.eclipse.jdt.internal.ui.dialogs.StatusUtil;
67
import org.eclipse.jdt.internal.ui.dialogs.StatusUtil;
67
68
68
69
/*
69
/**
70
 * The page for defaults for classpath entries in new java projects.
70
 * The preference page for defaults for classpath entries in new java projects.
71
 * See PreferenceConstants to access or change these values through public API.
71
 * <p>
72
 * See {@link PreferenceConstants} on how to access or change these values through public API.
73
 * </p>
74
 */
72
 */
75
public class NewJavaProjectPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
73
public class NewJavaProjectPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
76
74
Lines 111-121 Link Here
111
109
112
	public static String decodeJRELibraryDescription(String encoded) {
110
	public static String decodeJRELibraryDescription(String encoded) {
113
		int end= encoded.indexOf(' ');
111
		int end= encoded.indexOf(' ');
114
		if (end == -1)
112
		if (end != -1) {
115
			return ""; //$NON-NLS-1$
113
			return decode(encoded.substring(0, end));
116
114
		}
117
		String decodedDescription= decode(encoded.substring(0, end));
115
		return ""; //$NON-NLS-1$
118
		return decodedDescription.length() > 0 ? decodedDescription : encoded;
119
	}
116
	}
120
117
121
	private static String decode(String str) {
118
	private static String decode(String str) {
Lines 180-186 Link Here
180
		StringBuffer buf= new StringBuffer();
177
		StringBuffer buf= new StringBuffer();
181
		for (int i= 0; i < cpentries.length; i++) {
178
		for (int i= 0; i < cpentries.length; i++) {
182
			IClasspathEntry entry= cpentries[i];
179
			IClasspathEntry entry= cpentries[i];
183
			buf.append(desc);
180
			buf.append(encode(desc));
184
			buf.append(' ');
181
			buf.append(' ');
185
			buf.append(entry.getEntryKind());
182
			buf.append(entry.getEntryKind());
186
			buf.append(' ');
183
			buf.append(' ');

Return to bug 347302