View | Details | Raw Unified | Return to bug 136091 | Differences between
and this patch

Collapse All | Expand All

(-)model/org/eclipse/jdt/core/IJavaModelStatusConstants.java (-2 / +8 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
2
 * Copyright (c) 2000, 2011 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 314-320 Link Here
314
//	public static final int INVALID_COMPILER_OPTION = 1007;
314
//	public static final int INVALID_COMPILER_OPTION = 1007;
315
	/**
315
	/**
316
	 * <p>Status constant indicating that the attached javadoc content cannot be retrieved due to multiple reasons:
316
	 * <p>Status constant indicating that the attached javadoc content cannot be retrieved due to multiple reasons:
317
	 * invalid url, timed-out,...</p>
317
	 * invalid url, incorrect proxy, wrong authentication,...</p>
318
	 *
318
	 *
319
	 * @since 3.2
319
	 * @since 3.2
320
	 */
320
	 */
Lines 339-342 Link Here
339
	 * @since 3.4
339
	 * @since 3.4
340
	 */
340
	 */
341
	public static final int BAD_TEXT_EDIT_LOCATION = 1011;
341
	public static final int BAD_TEXT_EDIT_LOCATION = 1011;
342
	
343
	/**
344
	 * <p>Status constant indicating that the attached javadoc content cannot be retrieved due to timeout
345
	 * @since 3.7
346
	 */
347
	public static final int CANNOT_RETRIEVE_ATTACHED_JAVADOC_TIMEOUT = 1012;
342
}
348
}
(-)model/org/eclipse/jdt/internal/core/JavaElement.java (-1 / +5 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
2
 * Copyright (c) 2000, 2011 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 18-23 Link Here
18
import java.net.MalformedURLException;
18
import java.net.MalformedURLException;
19
import java.net.ProtocolException;
19
import java.net.ProtocolException;
20
import java.net.SocketException;
20
import java.net.SocketException;
21
import java.net.SocketTimeoutException;
21
import java.net.URL;
22
import java.net.URL;
22
import java.net.URLConnection;
23
import java.net.URLConnection;
23
import java.net.UnknownHostException;
24
import java.net.UnknownHostException;
Lines 732-737 Link Here
732
		try {
733
		try {
733
			URL docUrl = new URL(docUrlValue);
734
			URL docUrl = new URL(docUrlValue);
734
			URLConnection connection = docUrl.openConnection();
735
			URLConnection connection = docUrl.openConnection();
736
			connection.setReadTimeout(5000);
735
			if (connection instanceof JarURLConnection) {
737
			if (connection instanceof JarURLConnection) {
736
				connection2 = (JarURLConnection) connection;
738
				connection2 = (JarURLConnection) connection;
737
				// https://bugs.eclipse.org/bugs/show_bug.cgi?id=156307
739
				// https://bugs.eclipse.org/bugs/show_bug.cgi?id=156307
Lines 780-785 Link Here
780
					return new String(contents);
782
					return new String(contents);
781
				}
783
				}
782
			}
784
			}
785
		} catch (SocketTimeoutException e) {
786
			throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.CANNOT_RETRIEVE_ATTACHED_JAVADOC_TIMEOUT, this));
783
		} catch (MalformedURLException e) {
787
		} catch (MalformedURLException e) {
784
			throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.CANNOT_RETRIEVE_ATTACHED_JAVADOC, this));
788
			throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.CANNOT_RETRIEVE_ATTACHED_JAVADOC, this));
785
		} catch (FileNotFoundException e) {
789
		} catch (FileNotFoundException e) {
(-)model/org/eclipse/jdt/internal/core/JavaModelStatus.java (-1 / +13 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
2
 * Copyright (c) 2000, 2011 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 375-380 Link Here
375
						return Messages.bind(Messages.status_cannot_retrieve_attached_javadoc, this.string, "");//$NON-NLS-1$
375
						return Messages.bind(Messages.status_cannot_retrieve_attached_javadoc, this.string, "");//$NON-NLS-1$
376
					}
376
					}
377
					break;
377
					break;
378
					
379
				case CANNOT_RETRIEVE_ATTACHED_JAVADOC_TIMEOUT :
380
					if (this.elements != null && this.elements.length == 1) {
381
						if (this.string != null) {
382
							return Messages.bind(Messages.status_timeout_javadoc, ((JavaElement)this.elements[0]).toStringWithAncestors(), this.string);
383
						}
384
						return Messages.bind(Messages.status_timeout_javadoc, ((JavaElement)this.elements[0]).toStringWithAncestors(), ""); //$NON-NLS-1$
385
					}
386
					if (this.string != null) {
387
						return Messages.bind(Messages.status_timeout_javadoc, this.string, "");//$NON-NLS-1$
388
					}
389
					break;
378
390
379
				case UNKNOWN_JAVADOC_FORMAT :
391
				case UNKNOWN_JAVADOC_FORMAT :
380
					return Messages.bind(Messages.status_unknown_javadoc_format, ((JavaElement)this.elements[0]).toStringWithAncestors());
392
					return Messages.bind(Messages.status_unknown_javadoc_format, ((JavaElement)this.elements[0]).toStringWithAncestors());
(-)model/org/eclipse/jdt/internal/core/util/Messages.java (-1 / +2 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
2
 * Copyright (c) 2000, 2011 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 108-113 Link Here
108
	public static String build_prereqProjectMustBeRebuilt;
108
	public static String build_prereqProjectMustBeRebuilt;
109
	public static String build_abortDueToClasspathProblems;
109
	public static String build_abortDueToClasspathProblems;
110
	public static String status_cannot_retrieve_attached_javadoc;
110
	public static String status_cannot_retrieve_attached_javadoc;
111
	public static String status_timeout_javadoc;
111
	public static String status_cannotUseDeviceOnPath;
112
	public static String status_cannotUseDeviceOnPath;
112
	public static String status_coreException;
113
	public static String status_coreException;
113
	public static String status_defaultPackageReadOnly;
114
	public static String status_defaultPackageReadOnly;
(-)model/org/eclipse/jdt/internal/core/util/messages.properties (+1 lines)
Lines 125-130 Link Here
125
status_updateConflict = Update conflict
125
status_updateConflict = Update conflict
126
status_cannot_retrieve_attached_javadoc = Cannot retrieve the attached javadoc for {0}{1}
126
status_cannot_retrieve_attached_javadoc = Cannot retrieve the attached javadoc for {0}{1}
127
status_unknown_javadoc_format = Unknown javadoc format for {0}
127
status_unknown_javadoc_format = Unknown javadoc format for {0}
128
status_timeout_javadoc = Timed out while retrieving the attached javadoc for {0}{1} 
128
129
129
### classpath
130
### classpath
130
classpath_buildPath = Build path
131
classpath_buildPath = Build path

Return to bug 136091