Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 180890 Details for
Bug 313916
[Net] core.net creates executable extensions early causing activation of ui.net
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
patch for head
patch.txt (text/plain), 17.37 KB, created by
Wojciech Galanciak
on 2010-10-14 11:50:06 EDT
(
hide
)
Description:
patch for head
Filename:
MIME Type:
Creator:
Wojciech Galanciak
Created:
2010-10-14 11:50:06 EDT
Size:
17.37 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.core.net >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.net/META-INF/MANIFEST.MF,v >retrieving revision 1.14 >diff -u -r1.14 MANIFEST.MF >--- META-INF/MANIFEST.MF 6 Jul 2009 14:43:33 -0000 1.14 >+++ META-INF/MANIFEST.MF 14 Oct 2010 15:48:42 -0000 >@@ -13,6 +13,7 @@ > org.eclipse.equinox.registry;bundle-version="3.4.0" > Bundle-ActivationPolicy: lazy > Export-Package: org.eclipse.core.internal.net;x-friends:="org.eclipse.ui.net", >+ org.eclipse.core.internal.net.auth;x-friends:="org.eclipse.ui.net", > org.eclipse.core.net.proxy > Bundle-RequiredExecutionEnvironment: J2SE-1.4, > CDC-1.1/Foundation-1.1 >Index: schema/authenticator.exsd >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.net/schema/authenticator.exsd,v >retrieving revision 1.1 >diff -u -r1.1 authenticator.exsd >--- schema/authenticator.exsd 26 Feb 2007 18:16:41 -0000 1.1 >+++ schema/authenticator.exsd 14 Oct 2010 15:48:42 -0000 >@@ -50,7 +50,7 @@ > > </documentation> > <appInfo> >- <meta.attribute kind="java" basedOn="java.net.Authenticator"/> >+ <meta.attribute kind="java" basedOn=":org.eclipse.core.internal.net.auth.IAuthenticator"/> > </appInfo> > </annotation> > </attribute> >Index: src/org/eclipse/core/internal/net/ProxyManager.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyManager.java,v >retrieving revision 1.27 >diff -u -r1.27 ProxyManager.java >--- src/org/eclipse/core/internal/net/ProxyManager.java 7 Oct 2010 11:24:26 -0000 1.27 >+++ src/org/eclipse/core/internal/net/ProxyManager.java 14 Oct 2010 15:48:42 -0000 >@@ -18,22 +18,17 @@ > import java.util.List; > import java.util.Properties; > >+import org.eclipse.core.internal.net.auth.ProxyAuthenticator; > import org.eclipse.core.net.proxy.IProxyChangeEvent; > import org.eclipse.core.net.proxy.IProxyChangeListener; > import org.eclipse.core.net.proxy.IProxyData; > import org.eclipse.core.net.proxy.IProxyService; > import org.eclipse.core.runtime.Assert; >-import org.eclipse.core.runtime.CoreException; >-import org.eclipse.core.runtime.IConfigurationElement; >-import org.eclipse.core.runtime.IExtension; > import org.eclipse.core.runtime.ISafeRunnable; >-import org.eclipse.core.runtime.IStatus; > import org.eclipse.core.runtime.ListenerList; >-import org.eclipse.core.runtime.RegistryFactory; > import org.eclipse.core.runtime.SafeRunner; > import org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener; > import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent; >-import org.eclipse.osgi.util.NLS; > import org.osgi.service.prefs.BackingStoreException; > > public class ProxyManager implements IProxyService, IPreferenceChangeListener { >@@ -272,7 +267,7 @@ > ProxyType type = proxies[i]; > type.initialize(); > } >- registerAuthenticator(); >+ Authenticator.setDefault(new ProxyAuthenticator()); > } > > public IProxyData getProxyData(String type) { >@@ -370,32 +365,6 @@ > return null; > } > >- private void registerAuthenticator() { >- Authenticator a = getPluggedInAuthenticator(); >- if (a != null) { >- Authenticator.setDefault(a); >- } >- } >- >- private Authenticator getPluggedInAuthenticator() { >- IExtension[] extensions = RegistryFactory.getRegistry().getExtensionPoint(Activator.ID, Activator.PT_AUTHENTICATOR).getExtensions(); >- if (extensions.length == 0) >- return null; >- IExtension extension = extensions[0]; >- IConfigurationElement[] configs = extension.getConfigurationElements(); >- if (configs.length == 0) { >- Activator.log(IStatus.ERROR, NLS.bind("Authenticator {0} is missing required fields", (new Object[] {extension.getUniqueIdentifier()})), null);//$NON-NLS-1$ >- return null; >- } >- try { >- IConfigurationElement config = configs[0]; >- return (Authenticator) config.createExecutableExtension("class");//$NON-NLS-1$ >- } catch (CoreException ex) { >- Activator.log(IStatus.ERROR, NLS.bind("Unable to instantiate authenticator {0}", (new Object[] {extension.getUniqueIdentifier()})), ex);//$NON-NLS-1$ >- return null; >- } >- } >- > private synchronized void checkMigrated() { > if (preferenceManager.isMigrated() || !Activator.getInstance().instanceLocationAvailable()) { > return; >Index: src/org/eclipse/core/internal/net/auth/Authentication.java >=================================================================== >RCS file: src/org/eclipse/core/internal/net/auth/Authentication.java >diff -N src/org/eclipse/core/internal/net/auth/Authentication.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/core/internal/net/auth/Authentication.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,36 @@ >+/******************************************************************************* >+ * Copyright (c) 2000, 2007 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.core.internal.net.auth; >+ >+/** >+ * Keeps user and password strings. >+ */ >+public class Authentication { >+ protected String user; >+ protected String password; >+ public Authentication(String user, String password){ >+ this.user = user; >+ this.password = password; >+ } >+ >+ /** >+ * @return Returns the password. >+ */ >+ public String getPassword() { >+ return password; >+ } >+ /** >+ * @return Returns the user. >+ */ >+ public String getUser() { >+ return user; >+ } >+} >Index: src/org/eclipse/core/internal/net/auth/IAuthenticator.java >=================================================================== >RCS file: src/org/eclipse/core/internal/net/auth/IAuthenticator.java >diff -N src/org/eclipse/core/internal/net/auth/IAuthenticator.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/core/internal/net/auth/IAuthenticator.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,15 @@ >+/******************************************************************************* >+ * Copyright (c) 2010 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.core.internal.net.auth; >+ >+public interface IAuthenticator { >+ Authentication getAuthentication(String host, String prompt); >+} >Index: src/org/eclipse/core/internal/net/auth/ProxyAuthenticator.java >=================================================================== >RCS file: src/org/eclipse/core/internal/net/auth/ProxyAuthenticator.java >diff -N src/org/eclipse/core/internal/net/auth/ProxyAuthenticator.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/core/internal/net/auth/ProxyAuthenticator.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,82 @@ >+/******************************************************************************* >+ * Copyright (c) 2010 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.core.internal.net.auth; >+ >+import java.net.*; >+ >+import org.eclipse.core.internal.net.Activator; >+import org.eclipse.core.runtime.CoreException; >+import org.eclipse.core.runtime.IConfigurationElement; >+import org.eclipse.core.runtime.IExtension; >+import org.eclipse.core.runtime.IStatus; >+import org.eclipse.core.runtime.RegistryFactory; >+import org.eclipse.osgi.util.NLS; >+ >+public class ProxyAuthenticator extends Authenticator { >+ >+ private IAuthenticator authenticator; >+ >+ /* >+ * @see Authenticator#getPasswordAuthentication() >+ */ >+ protected PasswordAuthentication getPasswordAuthentication() { >+ InetAddress address = getRequestingSite(); // can be null; >+ String prompt = getRequestingPrompt(); // realm or message, not documented that can be null >+ >+ // get the host name from the address since #getRequestingHost >+ // is not available in the foundation 1.0 class libraries >+ String hostString = null; >+ if (address != null) { >+ hostString = address.getHostName(); >+ } >+ if (hostString == null) { >+ hostString = ""; //$NON-NLS-1$ >+ } >+ String promptString = prompt; >+ if (prompt == null) { >+ promptString = ""; //$NON-NLS-1$ >+ } >+ if (hasAuthenticator()) { >+ Authentication auth = authenticator.getAuthentication(hostString, promptString); >+ if (auth != null) { >+ return new PasswordAuthentication(auth.getUser(), auth.getPassword().toCharArray()); >+ } >+ } >+ return null; >+ } >+ >+ private boolean hasAuthenticator() { >+ if (authenticator != null) { >+ return true; >+ } >+ IExtension[] extensions = RegistryFactory.getRegistry(). >+ getExtensionPoint(Activator.ID, Activator.PT_AUTHENTICATOR).getExtensions(); >+ if (extensions.length == 0) { >+ return false; >+ } >+ IExtension extension = extensions[0]; >+ IConfigurationElement[] configs = extension.getConfigurationElements(); >+ if (configs.length == 0) { >+ Activator.log(IStatus.ERROR, NLS.bind("Authenticator {0} is missing required fields", //$NON-NLS-1$ >+ (new Object[] {extension.getUniqueIdentifier()})), null); >+ return false; >+ } >+ try { >+ IConfigurationElement config = configs[0]; >+ authenticator = (IAuthenticator) config.createExecutableExtension("class");//$NON-NLS-1$ >+ return true; >+ } catch (CoreException ex) { >+ Activator.log(IStatus.ERROR, NLS.bind("Unable to instantiate authenticator {0}", //$NON-NLS-1$ >+ (new Object[] {extension.getUniqueIdentifier()})), ex); >+ return false; >+ } >+ } >+} >#P org.eclipse.ui.net >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.net/plugin.xml,v >retrieving revision 1.4 >diff -u -r1.4 plugin.xml >--- plugin.xml 30 Apr 2007 18:02:22 -0000 1.4 >+++ plugin.xml 14 Oct 2010 15:48:44 -0000 >@@ -22,7 +22,7 @@ > <extension > point="org.eclipse.core.net.authenticator"> > <authenticator >- class="org.eclipse.ui.internal.net.auth.NetAuthenticator"> >+ class="org.eclipse.ui.internal.net.auth.UIAuthenticator"> > </authenticator> > </extension> > >Index: src/org/eclipse/ui/internal/net/auth/Authentication.java >=================================================================== >RCS file: src/org/eclipse/ui/internal/net/auth/Authentication.java >diff -N src/org/eclipse/ui/internal/net/auth/Authentication.java >--- src/org/eclipse/ui/internal/net/auth/Authentication.java 26 Feb 2007 18:16:44 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,36 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2000, 2007 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 >- * http://www.eclipse.org/legal/epl-v10.html >- * >- * Contributors: >- * IBM Corporation - initial API and implementation >- *******************************************************************************/ >-package org.eclipse.ui.internal.net.auth; >- >-/** >- * Keeps user and password strings. >- */ >-public class Authentication { >- protected String user; >- protected String password; >- public Authentication(String user, String password){ >- this.user = user; >- this.password = password; >- } >- >- /** >- * @return Returns the password. >- */ >- public String getPassword() { >- return password; >- } >- /** >- * @return Returns the user. >- */ >- public String getUser() { >- return user; >- } >-} >Index: src/org/eclipse/ui/internal/net/auth/NetAuthenticator.java >=================================================================== >RCS file: src/org/eclipse/ui/internal/net/auth/NetAuthenticator.java >diff -N src/org/eclipse/ui/internal/net/auth/NetAuthenticator.java >--- src/org/eclipse/ui/internal/net/auth/NetAuthenticator.java 26 Feb 2007 18:16:44 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,49 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2000, 2007 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 >- * http://www.eclipse.org/legal/epl-v10.html >- * >- * Contributors: >- * IBM Corporation - initial API and implementation >- *******************************************************************************/ >-package org.eclipse.ui.internal.net.auth; >- >-import java.net.*; >- >-public class NetAuthenticator extends Authenticator { >- >- /* >- * @see Authenticator#getPasswordAuthentication() >- */ >- protected PasswordAuthentication getPasswordAuthentication() { >- // String protocol = getRequestingProtocol(); >- InetAddress address = getRequestingSite(); // can be null; >- // int port = getRequestingPort(); >- String prompt = getRequestingPrompt(); // realm or message, not documented that can be null >- // String scheme = getRequestingScheme(); // not documented that can be null >- >- // get the host name from the address since #getRequestingHost >- // is not available in the foundation 1.0 class libraries >- String hostString = null; >- if (address != null) { >- hostString = address.getHostName(); >- } >- if (hostString == null) { >- hostString = ""; //$NON-NLS-1$ >- } >- String promptString = prompt; >- if (prompt == null) { >- promptString = ""; //$NON-NLS-1$ >- } >- >- Authentication auth = UserValidationDialog.getAuthentication( >- hostString, promptString); >- if (auth != null) >- return new PasswordAuthentication(auth.getUser(), auth >- .getPassword().toCharArray()); >- else >- return null; >- } >-} >Index: src/org/eclipse/ui/internal/net/auth/UIAuthenticator.java >=================================================================== >RCS file: src/org/eclipse/ui/internal/net/auth/UIAuthenticator.java >diff -N src/org/eclipse/ui/internal/net/auth/UIAuthenticator.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/ui/internal/net/auth/UIAuthenticator.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,22 @@ >+/******************************************************************************* >+ * Copyright (c) 2010 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.ui.internal.net.auth; >+ >+import org.eclipse.core.internal.net.auth.Authentication; >+import org.eclipse.core.internal.net.auth.IAuthenticator; >+ >+public class UIAuthenticator implements IAuthenticator { >+ >+ public Authentication getAuthentication(String host, String prompt) { >+ return UserValidationDialog.getAuthentication(host, prompt); >+ } >+ >+} >Index: src/org/eclipse/ui/internal/net/auth/UserValidationDialog.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.net/src/org/eclipse/ui/internal/net/auth/UserValidationDialog.java,v >retrieving revision 1.2 >diff -u -r1.2 UserValidationDialog.java >--- src/org/eclipse/ui/internal/net/auth/UserValidationDialog.java 16 Mar 2007 20:25:12 -0000 1.2 >+++ src/org/eclipse/ui/internal/net/auth/UserValidationDialog.java 14 Oct 2010 15:48:45 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2007 IBM Corporation and others. >+ * Copyright (c) 2000, 2010 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 >@@ -10,6 +10,7 @@ > *******************************************************************************/ > package org.eclipse.ui.internal.net.auth; > >+import org.eclipse.core.internal.net.auth.Authentication; > import org.eclipse.jface.dialogs.Dialog; > import org.eclipse.jface.dialogs.IDialogConstants; > import org.eclipse.osgi.util.NLS;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 313916
:
179641
| 180890