### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: model/org/eclipse/jdt/core/IJavaModelStatusConstants.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaModelStatusConstants.java,v retrieving revision 1.44 diff -u -r1.44 IJavaModelStatusConstants.java --- model/org/eclipse/jdt/core/IJavaModelStatusConstants.java 27 Aug 2009 15:27:02 -0000 1.44 +++ model/org/eclipse/jdt/core/IJavaModelStatusConstants.java 12 Jan 2011 12:13:20 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 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 @@ -314,7 +314,7 @@ // public static final int INVALID_COMPILER_OPTION = 1007; /** *

Status constant indicating that the attached javadoc content cannot be retrieved due to multiple reasons: - * invalid url, timed-out,...

+ * invalid url, incorrect proxy, wrong authentication,...

* * @since 3.2 */ @@ -339,4 +339,10 @@ * @since 3.4 */ public static final int BAD_TEXT_EDIT_LOCATION = 1011; + + /** + *

Status constant indicating that the attached javadoc content cannot be retrieved due to timeout + * @since 3.7 + */ + public static final int CANNOT_RETRIEVE_ATTACHED_JAVADOC_TIMEOUT = 1012; } Index: model/org/eclipse/jdt/internal/core/JavaElement.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaElement.java,v retrieving revision 1.138 diff -u -r1.138 JavaElement.java --- model/org/eclipse/jdt/internal/core/JavaElement.java 30 Mar 2010 05:39:36 -0000 1.138 +++ model/org/eclipse/jdt/internal/core/JavaElement.java 12 Jan 2011 12:13:20 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. + * Copyright (c) 2000, 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 @@ -18,6 +18,7 @@ import java.net.MalformedURLException; import java.net.ProtocolException; import java.net.SocketException; +import java.net.SocketTimeoutException; import java.net.URL; import java.net.URLConnection; import java.net.UnknownHostException; @@ -732,6 +733,7 @@ try { URL docUrl = new URL(docUrlValue); URLConnection connection = docUrl.openConnection(); + connection.setReadTimeout(5000); if (connection instanceof JarURLConnection) { connection2 = (JarURLConnection) connection; // https://bugs.eclipse.org/bugs/show_bug.cgi?id=156307 @@ -780,6 +782,8 @@ return new String(contents); } } + } catch (SocketTimeoutException e) { + throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.CANNOT_RETRIEVE_ATTACHED_JAVADOC_TIMEOUT, this)); } catch (MalformedURLException e) { throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.CANNOT_RETRIEVE_ATTACHED_JAVADOC, this)); } catch (FileNotFoundException e) { Index: model/org/eclipse/jdt/internal/core/JavaModelStatus.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelStatus.java,v retrieving revision 1.48 diff -u -r1.48 JavaModelStatus.java --- model/org/eclipse/jdt/internal/core/JavaModelStatus.java 7 Mar 2009 01:08:08 -0000 1.48 +++ model/org/eclipse/jdt/internal/core/JavaModelStatus.java 12 Jan 2011 12:13:20 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 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 @@ -375,6 +375,18 @@ return Messages.bind(Messages.status_cannot_retrieve_attached_javadoc, this.string, "");//$NON-NLS-1$ } break; + + case CANNOT_RETRIEVE_ATTACHED_JAVADOC_TIMEOUT : + if (this.elements != null && this.elements.length == 1) { + if (this.string != null) { + return Messages.bind(Messages.status_timeout_javadoc, ((JavaElement)this.elements[0]).toStringWithAncestors(), this.string); + } + return Messages.bind(Messages.status_timeout_javadoc, ((JavaElement)this.elements[0]).toStringWithAncestors(), ""); //$NON-NLS-1$ + } + if (this.string != null) { + return Messages.bind(Messages.status_timeout_javadoc, this.string, "");//$NON-NLS-1$ + } + break; case UNKNOWN_JAVADOC_FORMAT : return Messages.bind(Messages.status_unknown_javadoc_format, ((JavaElement)this.elements[0]).toStringWithAncestors()); Index: model/org/eclipse/jdt/internal/core/util/Messages.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Messages.java,v retrieving revision 1.30 diff -u -r1.30 Messages.java --- model/org/eclipse/jdt/internal/core/util/Messages.java 30 Nov 2010 15:06:55 -0000 1.30 +++ model/org/eclipse/jdt/internal/core/util/Messages.java 12 Jan 2011 12:13:20 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 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 @@ -108,6 +108,7 @@ public static String build_prereqProjectMustBeRebuilt; public static String build_abortDueToClasspathProblems; public static String status_cannot_retrieve_attached_javadoc; + public static String status_timeout_javadoc; public static String status_cannotUseDeviceOnPath; public static String status_coreException; public static String status_defaultPackageReadOnly; Index: model/org/eclipse/jdt/internal/core/util/messages.properties =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/messages.properties,v retrieving revision 1.82 diff -u -r1.82 messages.properties --- model/org/eclipse/jdt/internal/core/util/messages.properties 30 Nov 2010 15:06:55 -0000 1.82 +++ model/org/eclipse/jdt/internal/core/util/messages.properties 12 Jan 2011 12:13:20 -0000 @@ -125,6 +125,7 @@ status_updateConflict = Update conflict status_cannot_retrieve_attached_javadoc = Cannot retrieve the attached javadoc for {0}{1} status_unknown_javadoc_format = Unknown javadoc format for {0} +status_timeout_javadoc = Timed out while retrieving the attached javadoc for {0}{1} ### classpath classpath_buildPath = Build path