diff options
Diffstat (limited to 'bundles/org.eclipse.osgi/container')
123 files changed, 823 insertions, 0 deletions
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/adaptor/EclipseStarter.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/adaptor/EclipseStarter.java index a1179ba10..343ce3dea 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/adaptor/EclipseStarter.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/adaptor/EclipseStarter.java @@ -1152,11 +1152,13 @@ public class EclipseStarter { this.frameworkEventType = frameworkEventType; } + @Override public void bundleChanged(BundleEvent event) { if (event.getBundle().getBundleId() == 0 && event.getType() == BundleEvent.STOPPING) semaphore.release(); } + @Override public void frameworkEvent(FrameworkEvent event) { if (event.getType() == frameworkEventType) semaphore.release(); @@ -1417,6 +1419,7 @@ public class EclipseStarter { for (Iterator<Runnable> it = shutdownHandlers.iterator(); it.hasNext();) { final Runnable handler = it.next(); BundleListener listener = new BundleListener() { + @Override public void bundleChanged(BundleEvent event) { if (event.getBundle() == systemBundle && event.getType() == BundleEvent.STOPPED) { handler.run(); diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/internal/adaptor/DefaultStartupMonitor.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/internal/adaptor/DefaultStartupMonitor.java index b38cc4d4a..583ddd593 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/internal/adaptor/DefaultStartupMonitor.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/internal/adaptor/DefaultStartupMonitor.java @@ -48,6 +48,7 @@ public class DefaultStartupMonitor implements StartupMonitor { /* (non-Javadoc) * @see org.eclipse.core.runtime.adaptor.StartupMonitor#update() */ + @Override public void update() { if (updateMethod != null) { try { @@ -60,6 +61,7 @@ public class DefaultStartupMonitor implements StartupMonitor { } } + @Override public void applicationRunning() { if (EclipseStarter.debug) { String timeString = equinoxConfig.getConfiguration("eclipse.startTime"); //$NON-NLS-1$ diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/internal/adaptor/EclipseAppLauncher.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/internal/adaptor/EclipseAppLauncher.java index fd334e548..ffc771cc1 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/internal/adaptor/EclipseAppLauncher.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/internal/adaptor/EclipseAppLauncher.java @@ -148,6 +148,7 @@ public class EclipseAppLauncher implements ApplicationLauncher { return null; } + @Override public void launch(ParameterizedRunnable app, Object applicationContext) { waitForAppLock.tryAcquire(); // clear out any pending apps notifications if (!runningLock.tryAcquire()) // check to see if an application is currently running @@ -158,6 +159,7 @@ public class EclipseAppLauncher implements ApplicationLauncher { runningLock.release(); // release the running lock } + @Override public void shutdown() { // this method will aquire and keep the runningLock to prevent // all future application launches. diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleRequirement.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleRequirement.java index 330a2407b..4cacf4e60 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleRequirement.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleRequirement.java @@ -85,6 +85,7 @@ public class ModuleRequirement implements BundleRequirement { return revision; } + @Override public String toString() { return namespace + ModuleRevision.toString(attributes, false) + ModuleRevision.toString(directives, true); } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleRevisions.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleRevisions.java index 9d66c8de9..00af04e86 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleRevisions.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleRevisions.java @@ -127,6 +127,7 @@ public final class ModuleRevisions implements BundleRevisions { } } + @Override public String toString() { return "moduleID=" + module.getId(); //$NON-NLS-1$ } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleWire.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleWire.java index b32588eab..1de66ab12 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleWire.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/container/ModuleWire.java @@ -72,6 +72,7 @@ public final class ModuleWire implements BundleWire { return hostingRequirer; } + @Override public String toString() { return getRequirement() + " -> " + getCapability(); //$NON-NLS-1$ } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/util/ArrayMap.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/util/ArrayMap.java index 3ee64b64b..fd94dfc67 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/util/ArrayMap.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/util/ArrayMap.java @@ -61,6 +61,7 @@ public class ArrayMap<K, V> implements Collection<K> { } } + @Override public boolean remove(Object key) { int index = keys.indexOf(key); if (index < 0) @@ -70,6 +71,7 @@ public class ArrayMap<K, V> implements Collection<K> { return true; } + @Override public void clear() { keys.clear(); values.clear(); @@ -83,32 +85,39 @@ public class ArrayMap<K, V> implements Collection<K> { return new ArrayList<>(values); } + @Override public int size() { return keys.size(); } + @Override public boolean isEmpty() { return keys.isEmpty(); } + @Override public boolean contains(Object o) { return keys.contains(o); } + @Override public Iterator<K> iterator() { final Iterator<K> keyIter = keys.iterator(); final Iterator<V> valueIter = values.iterator(); return new Iterator<K>() { + @Override public boolean hasNext() { return keyIter.hasNext(); } + @Override public K next() { valueIter.next(); return keyIter.next(); } + @Override public void remove() { valueIter.remove(); keyIter.remove(); @@ -116,26 +125,32 @@ public class ArrayMap<K, V> implements Collection<K> { }; } + @Override public Object[] toArray() { return keys.toArray(); } + @Override public <T> T[] toArray(T[] a) { return keys.toArray(a); } + @Override public boolean add(K o) { throw new UnsupportedOperationException(); } + @Override public boolean containsAll(Collection<?> c) { throw new UnsupportedOperationException(); } + @Override public boolean addAll(Collection<? extends K> c) { throw new UnsupportedOperationException(); } + @Override public boolean removeAll(Collection<?> c) { boolean result = false; for (Object key : c) @@ -143,6 +158,7 @@ public class ArrayMap<K, V> implements Collection<K> { return result; } + @Override public boolean retainAll(Collection<?> c) { boolean result = false; Object[] keyArray = keys.toArray(); diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/util/FilePath.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/util/FilePath.java index bcd99d310..af399cc04 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/util/FilePath.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/util/FilePath.java @@ -243,6 +243,7 @@ public class FilePath { * * @return a string representation of this path */ + @Override public String toString() { StringBuffer result = new StringBuffer(); if (device != null) diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/util/Headers.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/util/Headers.java index 6f51ebdea..02ea3af36 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/util/Headers.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/util/Headers.java @@ -76,6 +76,7 @@ public class Headers<K, V> extends Dictionary<K, V> implements Map<K, V> { /** * Case-preserved keys. */ + @Override public synchronized Enumeration<K> keys() { return new ArrayEnumeration<>(headers, size); } @@ -83,6 +84,7 @@ public class Headers<K, V> extends Dictionary<K, V> implements Map<K, V> { /** * Values. */ + @Override public synchronized Enumeration<V> elements() { return new ArrayEnumeration<>(values, size); } @@ -141,6 +143,7 @@ public class Headers<K, V> extends Dictionary<K, V> implements Map<K, V> { * * @param key name. */ + @Override public synchronized V get(Object key) { int i = -1; if ((i = getIndex(key)) != -1) @@ -213,6 +216,7 @@ public class Headers<K, V> extends Dictionary<K, V> implements Map<K, V> { * * @return the number of keys in this dictionary. */ + @Override public synchronized int size() { return size; } @@ -225,6 +229,7 @@ public class Headers<K, V> extends Dictionary<K, V> implements Map<K, V> { * @return <code>true</code> if this dictionary maps no keys to values; * <code>false</code> otherwise. */ + @Override public synchronized boolean isEmpty() { return size == 0; } @@ -236,6 +241,7 @@ public class Headers<K, V> extends Dictionary<K, V> implements Map<K, V> { * @param value header value. * @throws UnsupportedOperationException */ + @Override public synchronized V put(K key, V value) { if (readOnly) throw new UnsupportedOperationException(); @@ -248,10 +254,12 @@ public class Headers<K, V> extends Dictionary<K, V> implements Map<K, V> { * @param key header name. * @throws UnsupportedOperationException */ + @Override public V remove(Object key) { throw new UnsupportedOperationException(); } + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append('{'); @@ -301,40 +309,49 @@ public class Headers<K, V> extends Dictionary<K, V> implements Map<K, V> { System.arraycopy(array, 0, this.array, 0, this.array.length); } + @Override public boolean hasMoreElements() { return cur < array.length; } + @Override public E nextElement() { return array[cur++]; } } + @Override public synchronized void clear() { if (readOnly) throw new UnsupportedOperationException(); } + @Override public synchronized boolean containsKey(Object key) { return getIndex(key) >= 0; } + @Override public boolean containsValue(Object value) { throw new UnsupportedOperationException(); } + @Override public Set<Map.Entry<K, V>> entrySet() { throw new UnsupportedOperationException(); } + @Override public Set<K> keySet() { throw new UnsupportedOperationException(); } + @Override public void putAll(Map<? extends K, ? extends V> c) { throw new UnsupportedOperationException(); } + @Override public Collection<V> values() { throw new UnsupportedOperationException(); } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/util/SecureAction.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/util/SecureAction.java index 9ef065a04..89684a902 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/util/SecureAction.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/util/SecureAction.java @@ -34,6 +34,7 @@ public class SecureAction { // This ClassLoader is used in loadSystemClass if System.getClassLoader() returns null static final ClassLoader bootClassLoader = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() { + @Override public ClassLoader run() { return new ClassLoader(Object.class.getClassLoader()) { /* boot class loader */}; } @@ -59,6 +60,7 @@ public class SecureAction { */ public static PrivilegedAction<SecureAction> createSecureAction() { return new PrivilegedAction<SecureAction>() { + @Override public SecureAction run() { return new SecureAction(); } @@ -75,6 +77,7 @@ public class SecureAction { if (System.getSecurityManager() == null) return System.getProperty(property); return AccessController.doPrivileged(new PrivilegedAction<String>() { + @Override public String run() { return System.getProperty(property); } @@ -90,6 +93,7 @@ public class SecureAction { if (System.getSecurityManager() == null) return System.getProperties(); return AccessController.doPrivileged(new PrivilegedAction<Properties>() { + @Override public Properties run() { return System.getProperties(); } @@ -108,6 +112,7 @@ public class SecureAction { return new FileInputStream(file); try { return AccessController.doPrivileged(new PrivilegedExceptionAction<FileInputStream>() { + @Override public FileInputStream run() throws FileNotFoundException { return new FileInputStream(file); } @@ -132,6 +137,7 @@ public class SecureAction { return new FileOutputStream(file.getAbsolutePath(), append); try { return AccessController.doPrivileged(new PrivilegedExceptionAction<FileOutputStream>() { + @Override public FileOutputStream run() throws FileNotFoundException { return new FileOutputStream(file.getAbsolutePath(), append); } @@ -153,6 +159,7 @@ public class SecureAction { if (System.getSecurityManager() == null) return file.length(); return AccessController.doPrivileged(new PrivilegedAction<Long>() { + @Override public Long run() { return new Long(file.length()); } @@ -171,6 +178,7 @@ public class SecureAction { return file.getCanonicalPath(); try { return AccessController.doPrivileged(new PrivilegedExceptionAction<String>() { + @Override public String run() throws IOException { return file.getCanonicalPath(); } @@ -192,6 +200,7 @@ public class SecureAction { if (System.getSecurityManager() == null) return file.getAbsoluteFile(); return AccessController.doPrivileged(new PrivilegedAction<File>() { + @Override public File run() { return file.getAbsoluteFile(); } @@ -209,6 +218,7 @@ public class SecureAction { return file.getCanonicalFile(); try { return AccessController.doPrivileged(new PrivilegedExceptionAction<File>() { + @Override public File run() throws IOException { return file.getCanonicalFile(); } @@ -230,6 +240,7 @@ public class SecureAction { if (System.getSecurityManager() == null) return file.exists(); return AccessController.doPrivileged(new PrivilegedAction<Boolean>() { + @Override public Boolean run() { return file.exists() ? Boolean.TRUE : Boolean.FALSE; } @@ -240,6 +251,7 @@ public class SecureAction { if (System.getSecurityManager() == null) return file.mkdirs(); return AccessController.doPrivileged(new PrivilegedAction<Boolean>() { + @Override public Boolean run() { return file.mkdirs() ? Boolean.TRUE : Boolean.FALSE; } @@ -256,6 +268,7 @@ public class SecureAction { if (System.getSecurityManager() == null) return file.isDirectory(); return AccessController.doPrivileged(new PrivilegedAction<Boolean>() { + @Override public Boolean run() { return file.isDirectory() ? Boolean.TRUE : Boolean.FALSE; } @@ -272,6 +285,7 @@ public class SecureAction { if (System.getSecurityManager() == null) return file.lastModified(); return AccessController.doPrivileged(new PrivilegedAction<Long>() { + @Override public Long run() { return new Long(file.lastModified()); } @@ -288,6 +302,7 @@ public class SecureAction { if (System.getSecurityManager() == null) return file.list(); return AccessController.doPrivileged(new PrivilegedAction<String[]>() { + @Override public String[] run() { return file.list(); } @@ -307,6 +322,7 @@ public class SecureAction { return new ZipFile(file); try { return AccessController.doPrivileged(new PrivilegedExceptionAction<ZipFile>() { + @Override public ZipFile run() throws IOException { return new ZipFile(file); } @@ -341,6 +357,7 @@ public class SecureAction { return new URL(protocol, host, port, file, handler); try { return AccessController.doPrivileged(new PrivilegedExceptionAction<URL>() { + @Override public URL run() throws MalformedURLException { return new URL(protocol, host, port, file, handler); } @@ -364,6 +381,7 @@ public class SecureAction { if (System.getSecurityManager() == null) return createThread0(target, name, contextLoader); return AccessController.doPrivileged(new PrivilegedAction<Thread>() { + @Override public Thread run() { return createThread0(target, name, contextLoader); } @@ -388,6 +406,7 @@ public class SecureAction { if (System.getSecurityManager() == null) return context.getService(reference); return AccessController.doPrivileged(new PrivilegedAction<S>() { + @Override public S run() { return context.getService(reference); } @@ -406,6 +425,7 @@ public class SecureAction { return Class.forName(name); try { return AccessController.doPrivileged(new PrivilegedExceptionAction<Class<?>>() { + @Override public Class<?> run() throws Exception { return Class.forName(name); } @@ -431,6 +451,7 @@ public class SecureAction { } try { return AccessController.doPrivileged(new PrivilegedExceptionAction<Class<?>>() { + @Override public Class<?> run() throws Exception { ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader(); return (systemClassLoader != null) ? systemClassLoader.loadClass(name) : bootClassLoader.loadClass(name); @@ -453,6 +474,7 @@ public class SecureAction { return; } AccessController.doPrivileged(new PrivilegedAction<Void>() { + @Override public Void run() { tracker.open(); return null; @@ -473,6 +495,7 @@ public class SecureAction { } try { AccessController.doPrivileged(new PrivilegedExceptionAction<Void>() { + @Override public Void run() throws BundleException { module.start(options); return null; @@ -491,6 +514,7 @@ public class SecureAction { return bundle.getBundleContext(); } return AccessController.doPrivileged(new PrivilegedAction<BundleContext>() { + @Override public BundleContext run() { return bundle.getBundleContext(); } @@ -502,6 +526,7 @@ public class SecureAction { return bundle.getLocation(); } return AccessController.doPrivileged(new PrivilegedAction<String>() { + @Override public String run() { return bundle.getLocation(); } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/cds/CDSBundleEntry.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/cds/CDSBundleEntry.java index 59a214041..be275411d 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/cds/CDSBundleEntry.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/cds/CDSBundleEntry.java @@ -56,6 +56,7 @@ public class CDSBundleEntry extends BundleEntry { * * This should is likely never to be called. */ + @Override public URL getFileURL() { return wrapped.getFileURL(); } @@ -66,6 +67,7 @@ public class CDSBundleEntry extends BundleEntry { * wraps the classbytes into a ByteArrayInputStream. This should not be used * by classloading. */ + @Override public InputStream getInputStream() throws IOException { // someone is trying to get the real bytes of the class file!! // just return the entry from the wrapped file instead of the magic cookie @@ -79,6 +81,7 @@ public class CDSBundleEntry extends BundleEntry { * the class during class loading. * if classbytes is null, it gets the contents from actual BundleEntry and caches it in classbytes. */ + @Override public byte[] getBytes() throws IOException { if (classbytes == null) { classbytes = wrapped.getBytes(); @@ -94,18 +97,22 @@ public class CDSBundleEntry extends BundleEntry { * * This should is likely never to be called. */ + @Override public URL getLocalURL() { return wrapped.getLocalURL(); } + @Override public String getName() { return path; } + @Override public long getSize() { return wrapped.getSize(); } + @Override public long getTime() { return wrapped.getTime(); } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/cds/CDSBundleFile.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/cds/CDSBundleFile.java index 941a4118e..b6cdf28d0 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/cds/CDSBundleFile.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/cds/CDSBundleFile.java @@ -67,6 +67,7 @@ public class CDSBundleFile extends BundleFileWrapper { * If the path is for a class, it will look for the magic cookie in the * shared classes cache. If found, the bytes representing the magic cookie are stored in CDSBundleEntry object. */ + @Override public BundleEntry getEntry(String path) { BundleEntry wrappedEntry = super.getEntry(path); if (wrappedEntry == null) { diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/cds/CDSHookConfigurator.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/cds/CDSHookConfigurator.java index 9891f4cb5..fdd59114e 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/cds/CDSHookConfigurator.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/cds/CDSHookConfigurator.java @@ -35,6 +35,7 @@ public class CDSHookConfigurator implements HookConfigurator { private static final String OLD_CDS_CONFIGURATOR = "com.ibm.cds.CDSHookConfigurator"; //$NON-NLS-1$ private static final String J9_SHARED_CLASS_HELPER_CLASS = "com.ibm.oti.shared.SharedClassHelperFactory"; //$NON-NLS-1$ + @Override public void addHooks(HookRegistry hookRegistry) { boolean disableCDS = Boolean.valueOf(hookRegistry.getConfiguration().getProperty(DISABLE_CDS)); if (disableCDS) { diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/cds/CDSHookImpls.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/cds/CDSHookImpls.java index bde9bde34..18a05b257 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/cds/CDSHookImpls.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/cds/CDSHookImpls.java @@ -73,6 +73,7 @@ public class CDSHookImpls extends ClassLoaderHook implements BundleFileWrapperFa return cdsBundleFile; } + @Override public void recordClassDefine(String name, Class<?> clazz, byte[] classbytes, ClasspathEntry classpathEntry, BundleEntry entry, ClasspathManager manager) { // only attempt to record the class define if: // 1) the class was found (clazz != null) // 2) the class has the magic class number CAFEBABE indicating a real class @@ -139,6 +140,7 @@ public class CDSHookImpls extends ClassLoaderHook implements BundleFileWrapperFa return (classbytes[0] & 0xCA) == 0xCA && (classbytes[1] & 0xFE) == 0xFE && (classbytes[2] & 0xBA) == 0xBA && (classbytes[3] & 0xBE) == 0xBE; } + @Override public void classLoaderCreated(ModuleClassLoader classLoader) { // try to get the url helper for this class loader if (factory == null) { @@ -185,6 +187,7 @@ public class CDSHookImpls extends ClassLoaderHook implements BundleFileWrapperFa } } + @Override public boolean addClassPathEntry(ArrayList<ClasspathEntry> cpEntries, String cp, ClasspathManager hostmanager, Generation sourceGeneration) { CDSBundleFile hostFile = getCDSBundleFile(hostmanager.getGeneration().getBundleFile()); CDSBundleFile sourceFile = getCDSBundleFile(sourceGeneration.getBundleFile()); @@ -200,6 +203,7 @@ public class CDSHookImpls extends ClassLoaderHook implements BundleFileWrapperFa } //////////////// BundleFileWrapperFactoryHook ////////////// + @Override public BundleFileWrapper wrapBundleFile(BundleFile bundleFile, Generation generation, boolean base) { // wrap the real bundle file for purposes of loading shared classes. CDSBundleFile newBundleFile; diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/container/EquinoxReentrantLock.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/container/EquinoxReentrantLock.java index a9a772e8e..dd193b438 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/container/EquinoxReentrantLock.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/container/EquinoxReentrantLock.java @@ -21,6 +21,7 @@ import java.util.concurrent.locks.ReentrantLock; public final class EquinoxReentrantLock extends ReentrantLock { private static final long serialVersionUID = 1L; + @Override final public Thread getOwner() { return super.getOwner(); } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/container/LockSet.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/container/LockSet.java index 5b751e34a..531fe026a 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/container/LockSet.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/container/LockSet.java @@ -52,6 +52,7 @@ public class LockSet<T> { lock.unlock(); } + @Override public String toString() { return lock.toString(); } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/debug/EclipseDebugTrace.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/debug/EclipseDebugTrace.java index 22118f543..18abfe93a 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/debug/EclipseDebugTrace.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/debug/EclipseDebugTrace.java @@ -137,6 +137,7 @@ class EclipseDebugTrace implements DebugTrace { * (non-Javadoc) * @see org.eclipse.osgi.framework.debug.FrameworkDebugTrace#trace(java.lang.String, java.lang.String) */ + @Override public void trace(final String optionPath, final String message) { if (isDebuggingEnabled(optionPath)) { @@ -149,6 +150,7 @@ class EclipseDebugTrace implements DebugTrace { * (non-Javadoc) * @see org.eclipse.osgi.framework.debug.FrameworkDebugTrace#trace(java.lang.String, java.lang.String, java.lang.Throwable) */ + @Override public void trace(final String optionPath, final String message, final Throwable error) { if (isDebuggingEnabled(optionPath)) { @@ -161,6 +163,7 @@ class EclipseDebugTrace implements DebugTrace { * (non-Javadoc) * @see org.eclipse.osgi.framework.debug.FrameworkDebugTrace#traceEntry(java.lang.String) */ + @Override public void traceEntry(final String optionPath) { if (isDebuggingEnabled(optionPath)) { @@ -174,6 +177,7 @@ class EclipseDebugTrace implements DebugTrace { * (non-Javadoc) * @see org.eclipse.osgi.framework.debug.FrameworkDebugTrace#traceEntry(java.lang.String, java.lang.Object) */ + @Override public void traceEntry(final String optionPath, final Object methodArgument) { if (isDebuggingEnabled(optionPath)) { @@ -185,6 +189,7 @@ class EclipseDebugTrace implements DebugTrace { * (non-Javadoc) * @see org.eclipse.osgi.framework.debug.FrameworkDebugTrace#traceEntry(java.lang.String, java.lang.Object[]) */ + @Override public void traceEntry(final String optionPath, final Object[] methodArguments) { if (isDebuggingEnabled(optionPath)) { @@ -214,6 +219,7 @@ class EclipseDebugTrace implements DebugTrace { * (non-Javadoc) * @see org.eclipse.osgi.framework.debug.FrameworkDebugTrace#traceExit(java.lang.String) */ + @Override public void traceExit(final String optionPath) { if (isDebuggingEnabled(optionPath)) { @@ -227,6 +233,7 @@ class EclipseDebugTrace implements DebugTrace { * (non-Javadoc) * @see org.eclipse.osgi.framework.debug.FrameworkDebugTrace#traceExit(java.lang.String, java.lang.Object) */ + @Override public void traceExit(final String optionPath, final Object result) { if (isDebuggingEnabled(optionPath)) { @@ -246,6 +253,7 @@ class EclipseDebugTrace implements DebugTrace { * (non-Javadoc) * @see org.eclipse.osgi.framework.debug.FrameworkDebugTrace#traceDumpStack(java.lang.String) */ + @Override public void traceDumpStack(final String optionPath) { if (isDebuggingEnabled(optionPath)) { diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/debug/FrameworkDebugOptions.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/debug/FrameworkDebugOptions.java index 9a316f10f..c2d7209e3 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/debug/FrameworkDebugOptions.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/debug/FrameworkDebugOptions.java @@ -120,6 +120,7 @@ public class FrameworkDebugOptions implements DebugOptions, ServiceTrackerCustom /** * @see DebugOptions#getBooleanOption(String, boolean) */ + @Override public boolean getBooleanOption(String option, boolean defaultValue) { String optionValue = getOption(option); return optionValue != null ? optionValue.equalsIgnoreCase("true") : defaultValue; //$NON-NLS-1$ @@ -128,6 +129,7 @@ public class FrameworkDebugOptions implements DebugOptions, ServiceTrackerCustom /** * @see DebugOptions#getOption(String) */ + @Override public String getOption(String option) { return getOption(option, null); } @@ -135,6 +137,7 @@ public class FrameworkDebugOptions implements DebugOptions, ServiceTrackerCustom /** * @see DebugOptions#getOption(String, String) */ + @Override public String getOption(String option, String defaultValue) { synchronized (lock) { if (options != null) { @@ -147,6 +150,7 @@ public class FrameworkDebugOptions implements DebugOptions, ServiceTrackerCustom /** * @see DebugOptions#getIntegerOption(String, int) */ + @Override public int getIntegerOption(String option, int defaultValue) { String value = getOption(option); try { @@ -157,6 +161,7 @@ public class FrameworkDebugOptions implements DebugOptions, ServiceTrackerCustom } @SuppressWarnings({"unchecked", "rawtypes"}) + @Override public Map<String, String> getOptions() { Map<String, String> snapShot = new HashMap<>(); synchronized (lock) { @@ -197,6 +202,7 @@ public class FrameworkDebugOptions implements DebugOptions, ServiceTrackerCustom * (non-Javadoc) * @see org.eclipse.osgi.service.debug.DebugOptions#removeOption(java.lang.String) */ + @Override public void removeOption(String option) { if (option == null) return; @@ -216,6 +222,7 @@ public class FrameworkDebugOptions implements DebugOptions, ServiceTrackerCustom * (non-Javadoc) * @see org.eclipse.osgi.service.debug.DebugOptions#setOption(java.lang.String, java.lang.String) */ + @Override public void setOption(String option, String value) { if (option == null || value == null) { @@ -256,6 +263,7 @@ public class FrameworkDebugOptions implements DebugOptions, ServiceTrackerCustom } @SuppressWarnings("cast") + @Override public void setOptions(Map<String, String> ops) { if (ops == null) throw new IllegalArgumentException("The options must not be null."); //$NON-NLS-1$ @@ -306,6 +314,7 @@ public class FrameworkDebugOptions implements DebugOptions, ServiceTrackerCustom * (non-Javadoc) * @see org.eclipse.osgi.service.debug.DebugOptions#isDebugEnabled() */ + @Override public boolean isDebugEnabled() { synchronized (lock) { return options != null; @@ -316,6 +325,7 @@ public class FrameworkDebugOptions implements DebugOptions, ServiceTrackerCustom * (non-Javadoc) * @see org.eclipse.osgi.service.debug.DebugOptions#setDebugEnabled() */ + @Override public void setDebugEnabled(boolean enabled) { boolean fireChangedEvent = false; synchronized (lock) { @@ -359,6 +369,7 @@ public class FrameworkDebugOptions implements DebugOptions, ServiceTrackerCustom * (non-Javadoc) * @see org.eclipse.osgi.service.debug.DebugOptions#createTrace(java.lang.String) */ + @Override public final DebugTrace newDebugTrace(String bundleSymbolicName) { return this.newDebugTrace(bundleSymbolicName, null); @@ -368,6 +379,7 @@ public class FrameworkDebugOptions implements DebugOptions, ServiceTrackerCustom * (non-Javadoc) * @see org.eclipse.osgi.service.debug.DebugOptions#createTrace(java.lang.String, java.lang.Class) */ + @Override public final DebugTrace newDebugTrace(String bundleSymbolicName, Class<?> traceEntryClass) { DebugTrace debugTrace = null; @@ -385,6 +397,7 @@ public class FrameworkDebugOptions implements DebugOptions, ServiceTrackerCustom * (non-Javadoc) * @see org.eclipse.osgi.service.debug.DebugOptions#getFile() */ + @Override public final File getFile() { return this.outFile; @@ -394,6 +407,7 @@ public class FrameworkDebugOptions implements DebugOptions, ServiceTrackerCustom * (non-Javadoc) * @see org.eclipse.osgi.service.debug.DebugOptions#setFile(java.io.File) */ + @Override public void setFile(final File traceFile) { synchronized (lock) { this.outFile = traceFile; @@ -478,16 +492,19 @@ public class FrameworkDebugOptions implements DebugOptions, ServiceTrackerCustom } } + @Override public DebugOptionsListener addingService(ServiceReference<DebugOptionsListener> reference) { DebugOptionsListener listener = context.getService(reference); listener.optionsChanged(this); return listener; } + @Override public void modifiedService(ServiceReference<DebugOptionsListener> reference, DebugOptionsListener service) { // nothing } + @Override public void removedService(ServiceReference<DebugOptionsListener> reference, DebugOptionsListener service) { context.ungetService(reference); } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/debug/FrameworkDebugTraceEntry.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/debug/FrameworkDebugTraceEntry.java index 13be6bf18..13248d889 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/debug/FrameworkDebugTraceEntry.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/debug/FrameworkDebugTraceEntry.java @@ -145,6 +145,7 @@ public class FrameworkDebugTraceEntry { * * @see java.lang.Object#toString() */ + @Override public String toString() { final StringBuffer buffer = new StringBuffer(threadName); diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/BundleContextImpl.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/BundleContextImpl.java index 06781879e..2c5a22106 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/BundleContextImpl.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/BundleContextImpl.java @@ -147,6 +147,7 @@ public class BundleContextImpl implements BundleContext, EventDispatcher<Object, * @return The value of the requested property, or <code>null</code> if * the property is undefined. */ + @Override public String getProperty(String key) { SecurityManager sm = System.getSecurityManager(); @@ -162,6 +163,7 @@ public class BundleContextImpl implements BundleContext, EventDispatcher<Object, * * @return The context bundle's Bundle object. */ + @Override public Bundle getBundle() { checkValid(); @@ -172,10 +174,12 @@ public class BundleContextImpl implements BundleContext, EventDispatcher<Object, return bundle; } + @Override public Bundle installBundle(String location) throws BundleException { return installBundle(location, null); } + @Override public Bundle installBundle(String location, InputStream in) throws BundleException { checkValid(); try { @@ -195,6 +199,7 @@ public class BundleContextImpl implements BundleContext, EventDispatcher<Object, * @return A Bundle object, or <code>null</code> * if the identifier doesn't match any installed bundle. */ + @Override public Bundle getBundle(long id) { Module m = container.getStorage().getModuleContainer().getModule(id); if (m == null) { @@ -210,6 +215,7 @@ public class BundleContextImpl implements BundleContext, EventDispatcher<Object, return m.getBundle(); } + @Override public Bundle getBundle(String location) { Module m = container.getStorage().getModuleContainer().getModule(location); return m == null ? null : m.getBundle(); @@ -224,6 +230,7 @@ public class BundleContextImpl implements BundleContext, EventDispatcher<Object, * @return An array of {@link Bundle} objects, one * object per installed bundle. */ + @Override public Bundle[] getBundles() { List<Module> modules = container.getStorage().getModuleContainer().getModules(); List<Bundle> bundles = new ArrayList<>(modules.size()); @@ -246,6 +253,7 @@ public class BundleContextImpl implements BundleContext, EventDispatcher<Object, notifyFindHooksPriviledged(context, shrinkable); } else { AccessController.doPrivileged(new PrivilegedAction<Void>() { + @Override public Void run() { notifyFindHooksPriviledged(context, shrinkable); return null; @@ -259,16 +267,19 @@ public class BundleContextImpl implements BundleContext, EventDispatcher<Object, Debug.println("notifyBundleFindHooks(" + allBundles + ")"); //$NON-NLS-1$ //$NON-NLS-2$ } container.getServiceRegistry().notifyHooksPrivileged(new HookContext() { + @Override public void call(Object hook, ServiceRegistration<?> hookRegistration) throws Exception { if (hook instanceof FindHook) { ((FindHook) hook).find(context, allBundles); } } + @Override public String getHookClassName() { return findHookName; } + @Override public String getHookMethodName() { return "find"; //$NON-NLS-1$ } @@ -280,6 +291,7 @@ public class BundleContextImpl implements BundleContext, EventDispatcher<Object, }); } + @Override public void addServiceListener(ServiceListener listener, String filter) throws InvalidSyntaxException { checkValid(); @@ -298,6 +310,7 @@ public class BundleContextImpl implements BundleContext, EventDispatcher<Object, * * @see #addServiceListener(ServiceListener, String) */ + @Override public void addServiceListener(ServiceListener listener) { try { addServiceListener(listener, null); @@ -322,6 +335,7 @@ public class BundleContextImpl implements BundleContext, EventDispatcher<Object, * @exception java.lang.IllegalStateException * If the bundle context has stopped. */ + @Override public void removeServiceListener(ServiceListener listener) { checkValid(); @@ -345,6 +359,7 @@ public class BundleContextImpl implements BundleContext, EventDispatcher<Object, * @see BundleEvent * @see BundleListener */ + @Override public void addBundleListener(BundleListener listener) { checkValid(); if (listener == null) { @@ -372,6 +387,7 @@ public class BundleContextImpl implements BundleContext, EventDispatcher<Object, * @exception java.lang.IllegalStateException * If the bundle context has stopped. */ + @Override public void removeBundleListener(BundleListener listener) { checkValid(); if (listener == null) { @@ -399,6 +415,7 @@ public class BundleContextImpl implements BundleContext, EventDispatcher<Object, * @see FrameworkEvent * @see FrameworkListener */ + @Override public void addFrameworkListener(FrameworkListener listener) { checkValid(); if (listener == null) { @@ -426,6 +443,7 @@ public class BundleContextImpl implements BundleContext, EventDispatcher<Object, * @exception java.lang.IllegalStateException * If the bundle context has stopped. */ + @Override public void removeFrameworkListener(FrameworkListener listener) { checkValid(); if (listener == null) { @@ -501,6 +519,7 @@ public class BundleContextImpl implements BundleContext, EventDispatcher<Object, * @see ServiceRegistration * @see ServiceFactory */ + @Override public ServiceRegistration<?> registerService(String[] clazzes, Object service, Dictionary<String, ?> properties) { checkValid(); return container.getServiceRegistry().registerService(this, clazzes, service, properties); @@ -518,6 +537,7 @@ public class BundleContextImpl implements BundleContext, EventDispatcher<Object, * * @see #registerService(java.lang.String[], java.lang.Object, java.util.Dictionary) */ + @Override public ServiceRegistration<?> registerService(String clazz, Object service, Dictionary<String, ?> properties) { String[] clazzes = new String[] {clazz}; @@ -567,11 +587,13 @@ public class BundleContextImpl implements BundleContext, EventDispatcher<Object, * @exception InvalidSyntaxException If <tt>filter</tt> contains * an invalid filter string which cannot be parsed. */ + @Override public ServiceReference<?>[] getServiceReferences(String clazz, String filter) throws InvalidSyntaxException { checkValid(); return container.getServiceRegistry().getServiceReferences(this, clazz, filter, false); } + @Override public ServiceReference<?>[] getAllServiceReferences(String clazz, String filter) throws InvalidSyntaxException { checkValid(); return container.getServiceRegistry().getServiceReferences(this, clazz, filter, true); @@ -597,6 +619,7 @@ public class BundleContextImpl implements BundleContext, EventDispatcher<Object, * if no services are registered which implement the named class. * @see #getServiceReferences */ + @Override public ServiceReference<?> getServiceReference(String clazz) { checkValid(); @@ -653,6 +676,7 @@ public class BundleContextImpl implements BundleContext, EventDispatcher<Object, * @see #ungetService * @see ServiceFactory */ + @Override public <S> S getService(ServiceReference<S> reference) { checkValid(); if (reference == null) @@ -697,6 +721,7 @@ public class BundleContextImpl implements BundleContext, EventDispatcher<Object, * @see #getService * @see ServiceFactory */ + @Override public boolean ungetService(ServiceReference<?> reference) { checkValid(); @@ -727,6 +752,7 @@ public class BundleContextImpl implements BundleContext, EventDispatcher<Object, * @exception java.lang.IllegalStateException * If the bundle context has stopped. */ + @Override public File getDataFile(String filename) { checkValid(); @@ -806,6 +832,7 @@ public class BundleContextImpl implements BundleContext, EventDispatcher<Object, private void startActivator(final BundleActivator bundleActivator) throws BundleException { try { AccessController.doPrivileged(new PrivilegedExceptionAction<Void>() { + @Override public Void run() throws Exception { if (bundleActivator != null) { // make sure the context class loader is set correctly @@ -862,6 +889,7 @@ public class BundleContextImpl implements BundleContext, EventDispatcher<Object, try { final BundleActivator bundleActivator = activator; AccessController.doPrivileged(new PrivilegedExceptionAction<Void>() { + @Override public Void run() throws Exception { if (bundleActivator != null) { // make sure the context class loader is set correctly @@ -926,6 +954,7 @@ public class BundleContextImpl implements BundleContext, EventDispatcher<Object, * @param action Event class type * @param object Event object */ + @Override public void dispatchEvent(Object originalListener, Object l, int action, Object object) { Object previousTCCL = setContextFinder(); try { @@ -1007,6 +1036,7 @@ public class BundleContextImpl implements BundleContext, EventDispatcher<Object, * @exception InvalidSyntaxException If the filter parameter contains * an invalid filter string which cannot be parsed. */ + @Override public Filter createFilter(String filter) throws InvalidSyntaxException { checkValid(); @@ -1035,24 +1065,28 @@ public class BundleContextImpl implements BundleContext, EventDispatcher<Object, return valid; } + @Override public <S> ServiceRegistration<S> registerService(Class<S> clazz, S service, Dictionary<String, ?> properties) { @SuppressWarnings("unchecked") ServiceRegistration<S> registration = (ServiceRegistration<S>) registerService(clazz.getName(), service, properties); return registration; } + @Override public <S> ServiceRegistration<S> registerService(Class<S> clazz, ServiceFactory<S> factory, Dictionary<String, ?> properties) { @SuppressWarnings("unchecked") ServiceRegistration<S> registration = (ServiceRegistration<S>) registerService(clazz.getName(), factory, properties); return registration; } + @Override public <S> ServiceReference<S> getServiceReference(Class<S> clazz) { @SuppressWarnings("unchecked") ServiceReference<S> reference = (ServiceReference<S>) getServiceReference(clazz.getName()); return reference; } + @Override public <S> Collection<ServiceReference<S>> getServiceReferences(Class<S> clazz, String filter) throws InvalidSyntaxException { @SuppressWarnings("unchecked") ServiceReference<S>[] refs = (ServiceReference<S>[]) getServiceReferences(clazz.getName(), filter); diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/ContextFinder.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/ContextFinder.java index 318e537e5..aece758f9 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/ContextFinder.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/ContextFinder.java @@ -23,6 +23,7 @@ import org.eclipse.osgi.internal.loader.ModuleClassLoader; public class ContextFinder extends ClassLoader implements PrivilegedAction<List<ClassLoader>> { static final class Finder extends SecurityManager { + @Override public Class<?>[] getClassContext() { return super.getClassContext(); } @@ -35,6 +36,7 @@ public class ContextFinder extends ClassLoader implements PrivilegedAction<List< static Finder contextFinder; static { AccessController.doPrivileged(new PrivilegedAction<Void>() { + @Override public Void run() { finderClassLoader = ContextFinder.class.getClassLoader(); contextFinder = new Finder(); @@ -95,6 +97,7 @@ public class ContextFinder extends ClassLoader implements PrivilegedAction<List< return AccessController.doPrivileged(this); } + @Override public List<ClassLoader> run() { return basicFindClassLoaders(); } @@ -118,6 +121,7 @@ public class ContextFinder extends ClassLoader implements PrivilegedAction<List< cycleDetector.get().remove(name); } + @Override protected Class<?> loadClass(String arg0, boolean arg1) throws ClassNotFoundException { //Shortcut cycle if (startLoading(arg0) == false) @@ -138,6 +142,7 @@ public class ContextFinder extends ClassLoader implements PrivilegedAction<List< } } + @Override public URL getResource(String arg0) { //Shortcut cycle if (startLoading(arg0) == false) @@ -156,6 +161,7 @@ public class ContextFinder extends ClassLoader implements PrivilegedAction<List< } } + @Override public Enumeration<URL> getResources(String arg0) throws IOException { //Shortcut cycle if (startLoading(arg0) == false) { diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxBundle.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxBundle.java index 74438c56a..b3f4a48e8 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxBundle.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxBundle.java @@ -101,10 +101,12 @@ public class EquinoxBundle implements Bundle, BundleReference { this.headers = headers; } + @Override public Enumeration<String> elements() { return headers.elements(); } + @Override public String get(Object key) { if (!(key instanceof String)) return null; @@ -139,22 +141,27 @@ public class EquinoxBundle implements Bundle, BundleReference { return result; } + @Override public boolean isEmpty() { return headers.isEmpty(); } + @Override public Enumeration<String> keys() { return headers.keys(); } + @Override public String put(String key, String value) { return headers.put(key, value); } + @Override public String remove(Object key) { return headers.remove(key); } + @Override public int size() { return headers.size(); } @@ -257,6 +264,7 @@ public class EquinoxBundle implements Bundle, BundleReference { this.init((FrameworkListener[]) null); } + @Override public void init(FrameworkListener... listeners) throws BundleException { if (listeners != null) { if (getEquinoxContainer().getConfiguration().getDebug().DEBUG_SYSTEM_BUNDLE) { @@ -1053,6 +1061,7 @@ public class EquinoxBundle implements Bundle, BundleReference { return equinoxContainer; } + @Override public String toString() { String name = getSymbolicName(); if (name == null) diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxConfiguration.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxConfiguration.java index f1f5b43e7..cdf363c88 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxConfiguration.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxConfiguration.java @@ -682,38 +682,47 @@ public class EquinoxConfiguration implements EnvironmentInfo { return inCheckConfigurationMode; } + @Override public boolean inDevelopmentMode() { return inDevelopmentMode; } + @Override public boolean inDebugMode() { return debugOptions.isDebugEnabled(); } + @Override public String[] getCommandLineArgs() { return allArgs; } + @Override public String[] getFrameworkArgs() { return frameworkArgs; } + @Override public String[] getNonFrameworkArgs() { return appArgs; } + @Override public String getOSArch() { return getConfiguration(PROP_OSGI_ARCH); } + @Override public String getNL() { return getConfiguration(PROP_OSGI_NL); } + @Override public String getOS() { return getConfiguration(PROP_OSGI_OS); } + @Override public String getWS() { return getConfiguration(PROP_OSGI_WS); } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxEventPublisher.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxEventPublisher.java index 192965a82..064983f21 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxEventPublisher.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxEventPublisher.java @@ -140,6 +140,7 @@ public class EquinoxEventPublisher { publishBundleEventPrivileged(event); } else { AccessController.doPrivileged(new PrivilegedAction<Void>() { + @Override public Void run() { publishBundleEventPrivileged(event); return null; @@ -254,16 +255,19 @@ public class EquinoxEventPublisher { ServiceRegistry serviceRegistry = container.getServiceRegistry(); if (serviceRegistry != null) { serviceRegistry.notifyHooksPrivileged(new HookContext() { + @Override public void call(Object hook, ServiceRegistration<?> hookRegistration) throws Exception { if (hook instanceof EventHook) { ((EventHook) hook).event(event, result); } } + @Override public String getHookClassName() { return eventHookName; } + @Override public String getHookMethodName() { return "event"; //$NON-NLS-1$ } @@ -298,6 +302,7 @@ public class EquinoxEventPublisher { publishFrameworkEventPrivileged(event, listeners); } else { AccessController.doPrivileged(new PrivilegedAction<Void>() { + @Override public Void run() { publishFrameworkEventPrivileged(event, listeners); return null; diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/FilterImpl.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/FilterImpl.java index eb10f3b86..f7eb91df4 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/FilterImpl.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/FilterImpl.java @@ -162,6 +162,7 @@ public class FilterImpl implements Filter /* since Framework 1.1 */ { * @return {@code true} if the service's properties match this * {@code Filter}; {@code false} otherwise. */ + @Override public boolean match(ServiceReference<?> reference) { if (reference instanceof ServiceReferenceImpl) { return matches(((ServiceReferenceImpl<?>) reference).getRegistration().getProperties()); @@ -181,6 +182,7 @@ public class FilterImpl implements Filter /* since Framework 1.1 */ { * @throws IllegalArgumentException If {@code dictionary} contains case * variants of the same key name. */ + @Override public boolean match(Dictionary<String, ?> dictionary) { if (dictionary == null) { return matches(null); @@ -199,6 +201,7 @@ public class FilterImpl implements Filter /* since Framework 1.1 */ { * filter; {@code false} otherwise. * @since 1.3 */ + @Override public boolean matchCase(Dictionary<String, ?> dictionary) { switch (op) { case AND : { @@ -265,6 +268,7 @@ public class FilterImpl implements Filter /* since Framework 1.1 */ { * {@code false} otherwise. * @since 1.6 */ + @Override public boolean matches(Map<String, ?> map) { switch (op) { case AND : { @@ -328,6 +332,7 @@ public class FilterImpl implements Filter /* since Framework 1.1 */ { * @return Filter string. */ + @Override public String toString() { String result = filterString; if (result == null) { @@ -446,6 +451,7 @@ public class FilterImpl implements Filter /* since Framework 1.1 */ { * returns <code>this.toString().equals(obj.toString()</code>; * <code>false</code> otherwise. */ + @Override public boolean equals(Object obj) { if (obj == this) { return true; @@ -464,6 +470,7 @@ public class FilterImpl implements Filter /* since Framework 1.1 */ { * @return The hashCode of the filter string; that is, * <code>this.toString().hashCode()</code>. */ + @Override public int hashCode() { return this.toString().hashCode(); } @@ -1785,6 +1792,7 @@ public class FilterImpl implements Filter /* since Framework 1.1 */ { this.accessible = accessible; } + @Override public Void run() { accessible.setAccessible(true); return null; @@ -1798,6 +1806,7 @@ public class FilterImpl implements Filter /* since Framework 1.1 */ { private char rightRule = 0; private Collection<Version> excludes = new ArrayList<>(0); + @Override public String toString() { if (rightVersion == null) { return leftVersion.toString(); diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/OSGiFrameworkHooks.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/OSGiFrameworkHooks.java index 22f98d3b8..bc4cf7d27 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/OSGiFrameworkHooks.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/OSGiFrameworkHooks.java @@ -104,6 +104,7 @@ class OSGiFrameworkHooks { notifyCollisionHooksPriviledged(operationType, target, shrinkable); } else { AccessController.doPrivileged(new PrivilegedAction<Void>() { + @Override public Void run() { notifyCollisionHooksPriviledged(operationType, target, shrinkable); return null; @@ -119,16 +120,19 @@ class OSGiFrameworkHooks { ServiceRegistry registry = container.getServiceRegistry(); if (registry != null) { registry.notifyHooksPrivileged(new HookContext() { + @Override public void call(Object hook, ServiceRegistration<?> hookRegistration) throws Exception { if (hook instanceof CollisionHook) { ((CollisionHook) hook).filterCollisions(operationType, target, collisionCandidates); } } + @Override public String getHookClassName() { return collisionHookName; } + @Override public String getHookMethodName() { return "filterCollisions"; //$NON-NLS-1$ } @@ -203,6 +207,7 @@ class OSGiFrameworkHooks { } + @Override public ResolverHook begin(Collection<BundleRevision> triggers) { if (debug.DEBUG_HOOKS) { Debug.println("ResolverHook.begin"); //$NON-NLS-1$ @@ -252,6 +257,7 @@ class OSGiFrameworkHooks { this.systemModule = systemModule; } + @Override public void filterResolvable(Collection<BundleRevision> candidates) { if (debug.DEBUG_HOOKS) { Debug.println("ResolverHook.filterResolvable(" + candidates + ")"); //$NON-NLS-1$ //$NON-NLS-2$ @@ -291,6 +297,7 @@ class OSGiFrameworkHooks { return systemModule == null || !Module.RESOLVED_SET.contains(systemModule.getState()) || (systemModule.getState().equals(State.STARTING) && inInit); } + @Override public void filterSingletonCollisions(BundleCapability singleton, Collection<BundleCapability> collisionCandidates) { if (debug.DEBUG_HOOKS) { Debug.println("ResolverHook.filterSingletonCollisions(" + singleton + ", " + collisionCandidates + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ @@ -312,6 +319,7 @@ class OSGiFrameworkHooks { } } + @Override public void filterMatches(BundleRequirement requirement, Collection<BundleCapability> candidates) { if (debug.DEBUG_HOOKS) { Debug.println("ResolverHook.filterMatches(" + requirement + ", " + candidates + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ @@ -333,6 +341,7 @@ class OSGiFrameworkHooks { } } + @Override public void end() { if (debug.DEBUG_HOOKS) { Debug.println("ResolverHook.end"); //$NON-NLS-1$ diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/SystemBundleActivator.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/SystemBundleActivator.java index 0a3d865d5..9e9b97276 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/SystemBundleActivator.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/SystemBundleActivator.java @@ -56,6 +56,7 @@ public class SystemBundleActivator implements BundleActivator { private SecurityManager setSecurityManagner; @SuppressWarnings("deprecation") + @Override public void start(BundleContext bc) throws Exception { registrations.clear(); EquinoxBundle bundle = (EquinoxBundle) bc.getBundle(); @@ -183,6 +184,7 @@ public class SystemBundleActivator implements BundleActivator { } } + @Override public void stop(BundleContext bc) throws Exception { EquinoxBundle bundle = (EquinoxBundle) bc.getBundle(); diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/XMLParsingServiceFactory.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/XMLParsingServiceFactory.java index 8a095ed3e..fbeb96e62 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/XMLParsingServiceFactory.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/XMLParsingServiceFactory.java @@ -27,6 +27,7 @@ class XMLParsingServiceFactory implements ServiceFactory<Object> { this.setTccl = setTccl; } + @Override public Object getService(Bundle bundle, ServiceRegistration<Object> registration) { if (!setTccl || bundle == null) return createService(); @@ -59,6 +60,7 @@ class XMLParsingServiceFactory implements ServiceFactory<Object> { return DocumentBuilderFactory.newInstance(); } + @Override public void ungetService(Bundle bundle, ServiceRegistration<Object> registration, Object service) { // Do nothing. } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/legacy/PackageAdminImpl.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/legacy/PackageAdminImpl.java index c6d03ad38..3a9fcd420 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/legacy/PackageAdminImpl.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/legacy/PackageAdminImpl.java @@ -76,6 +76,7 @@ public class PackageAdminImpl implements PackageAdmin { this.clazz = clazz; } + @Override public Bundle run() { return impl.getBundlePriv(clazz); } @@ -90,6 +91,7 @@ public class PackageAdminImpl implements PackageAdmin { this.container = container; } + @Override public ExportedPackage[] getExportedPackages(Bundle bundle) { if (bundle == null) { return getExportedPackages((String) null); @@ -112,6 +114,7 @@ public class PackageAdminImpl implements PackageAdmin { return allExports.isEmpty() ? null : allExports.toArray(new ExportedPackage[allExports.size()]); } + @Override public ExportedPackage getExportedPackage(String name) { ExportedPackage[] allExports = getExportedPackages(name); if (allExports == null) @@ -132,6 +135,7 @@ public class PackageAdminImpl implements PackageAdmin { return result; } + @Override public ExportedPackage[] getExportedPackages(String name) { String filter = "(" + PackageNamespace.PACKAGE_NAMESPACE + "=" + (name == null ? "*" : name) + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$//$NON-NLS-4$ Map<String, String> directives = Collections.<String, String> singletonMap(Namespace.REQUIREMENT_FILTER_DIRECTIVE, filter); @@ -170,14 +174,17 @@ public class PackageAdminImpl implements PackageAdmin { return (result.size() == 0 ? null : result.toArray(new ExportedPackage[result.size()])); } + @Override public void refreshPackages(Bundle[] input) { container.getFrameworkWiring().refreshBundles(input == null ? null : Arrays.asList(input)); } + @Override public boolean resolveBundles(Bundle[] input) { return container.getFrameworkWiring().resolveBundles(input == null ? null : Arrays.asList(input)); } + @Override public RequiredBundle[] getRequiredBundles(String symbolicName) { String filter = "(" + BundleNamespace.BUNDLE_NAMESPACE + "=" + (symbolicName == null ? "*" : symbolicName) + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$//$NON-NLS-4$ Map<String, String> directives = Collections.<String, String> singletonMap(Namespace.REQUIREMENT_FILTER_DIRECTIVE, filter); @@ -195,6 +202,7 @@ public class PackageAdminImpl implements PackageAdmin { return result.isEmpty() ? null : result.toArray(new RequiredBundle[result.size()]); } + @Override public Bundle[] getBundles(String symbolicName, String versionRange) { if (symbolicName == null) { throw new IllegalArgumentException(); @@ -233,6 +241,7 @@ public class PackageAdminImpl implements PackageAdmin { return sorted.toArray(new Bundle[sorted.size()]); } + @Override public Bundle[] getFragments(Bundle bundle) { ModuleWiring wiring = getWiring(bundle); if (wiring == null) { @@ -253,6 +262,7 @@ public class PackageAdminImpl implements PackageAdmin { return fragments.isEmpty() ? null : fragments.toArray(new Bundle[fragments.size()]); } + @Override public Bundle[] getHosts(Bundle bundle) { ModuleWiring wiring = getWiring(bundle); if (wiring == null) { @@ -298,12 +308,14 @@ public class PackageAdminImpl implements PackageAdmin { return null; } + @Override public Bundle getBundle(final Class<?> clazz) { if (System.getSecurityManager() == null) return getBundlePriv(clazz); return AccessController.doPrivileged(new GetBundleAction(this, clazz)); } + @Override public int getBundleType(Bundle bundle) { Module module = StartLevelImpl.getModule(bundle); if (module == null) { @@ -334,16 +346,19 @@ public class PackageAdminImpl implements PackageAdmin { this.providerWiring = providerWiring; } + @Override public String getName() { return (String) packageCapability.getAttributes().get(PackageNamespace.PACKAGE_NAMESPACE); } + @Override public Bundle getExportingBundle() { if (!providerWiring.isInUse()) return null; return providerWiring.getBundle(); } + @Override public Bundle[] getImportingBundles() { if (!providerWiring.isInUse()) { return null; @@ -408,19 +423,23 @@ public class PackageAdminImpl implements PackageAdmin { /** * @deprecated */ + @Override public String getSpecificationVersion() { return getVersion().toString(); } + @Override public Version getVersion() { Version version = (Version) packageCapability.getAttributes().get(PackageNamespace.CAPABILITY_VERSION_ATTRIBUTE); return version == null ? Version.emptyVersion : version; } + @Override public boolean isRemovalPending() { return !providerWiring.isCurrent(); } + @Override public String toString() { return packageCapability.toString(); } @@ -484,10 +503,12 @@ public class PackageAdminImpl implements PackageAdmin { return version == null ? Version.emptyVersion : version; } + @Override public boolean isRemovalPending() { return !providerWiring.isCurrent(); } + @Override public String toString() { return bundleCapability.toString(); } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/hooks/DevClassLoadingHook.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/hooks/DevClassLoadingHook.java index ece877b41..861a8d428 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/hooks/DevClassLoadingHook.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/hooks/DevClassLoadingHook.java @@ -101,14 +101,17 @@ public class DevClassLoadingHook extends ClassLoaderHook implements KeyedElement return fromFragment ? null : hostGeneration; } + @Override public boolean compare(KeyedElement other) { return other.getKey() == KEY; } + @Override public Object getKey() { return KEY; } + @Override public int getKeyHashCode() { return HASHCODE; } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/BundleLoader.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/BundleLoader.java index 9d8cfad81..b0e08c00e 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/BundleLoader.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/BundleLoader.java @@ -75,6 +75,7 @@ public class BundleLoader extends ModuleLoader { public final static String JAVA_PACKAGE = "java."; //$NON-NLS-1$ public final static ClassContext CLASS_CONTEXT = AccessController.doPrivileged(new PrivilegedAction<ClassContext>() { + @Override public ClassContext run() { return new ClassContext(); } @@ -590,6 +591,7 @@ public class BundleLoader extends ModuleLoader { if (System.getSecurityManager() == null) return clazz.getClassLoader(); return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() { + @Override public ClassLoader run() { return clazz.getClassLoader(); } @@ -891,6 +893,7 @@ public class BundleLoader extends ModuleLoader { * Return a string representation of this loader. * @return String */ + @Override public final String toString() { ModuleRevision revision = wiring.getRevision(); String name = revision.getSymbolicName(); @@ -1248,6 +1251,7 @@ public class BundleLoader extends ModuleLoader { static final class ClassContext extends SecurityManager { // need to make this method public + @Override public Class<?>[] getClassContext() { return super.getClassContext(); } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/EquinoxClassLoader.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/EquinoxClassLoader.java index 73ceb783d..cefca1e0e 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/EquinoxClassLoader.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/EquinoxClassLoader.java @@ -47,18 +47,22 @@ public class EquinoxClassLoader extends ModuleClassLoader { this.isRegisteredAsParallel = (ModuleClassLoader.REGISTERED_AS_PARALLEL && EQUINOX_REGISTERED_AS_PARALLEL) || this.configuration.PARALLEL_CAPABLE; } + @Override protected final Generation getGeneration() { return this.generation; } + @Override public final ClasspathManager getClasspathManager() { return manager; } + @Override public final boolean isRegisteredAsParallel() { return isRegisteredAsParallel; } + @Override public final BundleLoader getBundleLoader() { return delegate; } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/ModuleClassLoader.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/ModuleClassLoader.java index 89eaa42b7..61bfd8927 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/ModuleClassLoader.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/ModuleClassLoader.java @@ -43,6 +43,7 @@ public abstract class ModuleClassLoader extends ClassLoader implements BundleRef this.generation = generation; } + @Override public Bundle getBundle() { return generation.getRevision().getBundle(); } @@ -145,6 +146,7 @@ public abstract class ModuleClassLoader extends ClassLoader implements BundleRef * @return The Class object. * @throws ClassNotFoundException if the class is not found. */ + @Override protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException { if (getDebug().DEBUG_LOADER) Debug.println("ModuleClassLoader[" + getBundleLoader() + "].loadClass(" + name + ")"); //$NON-NLS-1$ //$NON-NLS-2$//$NON-NLS-3$ @@ -189,6 +191,7 @@ public abstract class ModuleClassLoader extends ClassLoader implements BundleRef * @param name The resource path to get. * @return The URL of the resource or null if it does not exist. */ + @Override public URL getResource(String name) { if (getDebug().DEBUG_LOADER) { Debug.println("ModuleClassLoader[" + getBundleLoader() + "].getResource(" + name + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ @@ -224,6 +227,7 @@ public abstract class ModuleClassLoader extends ClassLoader implements BundleRef * @param name The resource path to get. * @return The Enumeration of the resource URLs. */ + @Override public Enumeration<URL> getResources(String name) throws IOException { if (getDebug().DEBUG_LOADER) { Debug.println("ModuleClassLoader[" + getBundleLoader() + "].getResources(" + name + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ @@ -248,6 +252,7 @@ public abstract class ModuleClassLoader extends ClassLoader implements BundleRef * @param libname The library to find. * @return The absolution path to the library or null if not found */ + @Override protected String findLibrary(String libname) { // let the manager find the library for us return getClasspathManager().findLibrary(libname); @@ -368,6 +373,7 @@ public abstract class ModuleClassLoader extends ClassLoader implements BundleRef } } + @Override public Bundle getBundle() { return getGeneration().getRevision().getBundle(); } @@ -384,6 +390,7 @@ public abstract class ModuleClassLoader extends ClassLoader implements BundleRef return getClasspathManager().listLocalResources(path, filePattern, options); } + @Override public String toString() { Bundle b = getBundle(); StringBuffer result = new StringBuffer(super.toString()); diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/SystemBundleLoader.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/SystemBundleLoader.java index 9495b5b86..e8c7f730f 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/SystemBundleLoader.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/SystemBundleLoader.java @@ -46,6 +46,7 @@ public class SystemBundleLoader extends BundleLoader { * The ClassLoader that loads OSGi framework classes is used to find the class. * This method never gets called because there is no BundleClassLoader for the framework. */ + @Override public Class<?> findClass(String name) throws ClassNotFoundException { Class<?> result = findLocalClass(name); if (result == null) @@ -56,6 +57,7 @@ public class SystemBundleLoader extends BundleLoader { /** * The ClassLoader that loads OSGi framework classes is used to find the class. */ + @Override public Class<?> findLocalClass(String name) { try { return classLoader.loadClass(name); @@ -68,6 +70,7 @@ public class SystemBundleLoader extends BundleLoader { /** * The ClassLoader that loads OSGi framework classes is used to find the resource. */ + @Override public URL findLocalResource(String name) { return classLoader.getResource(name); } @@ -75,6 +78,7 @@ public class SystemBundleLoader extends BundleLoader { /** * The ClassLoader that loads OSGi framework classes is used to find the resource. */ + @Override public Enumeration<URL> findLocalResources(String name) { try { return classLoader.getResources(name); @@ -88,6 +92,7 @@ public class SystemBundleLoader extends BundleLoader { * The ClassLoader that loads OSGi framework classes is used to find the resource. * This method never gets called because there is no ModuleClassLoader for the framework. */ + @Override public URL findResource(String name) { return findLocalResource(name); } @@ -97,6 +102,7 @@ public class SystemBundleLoader extends BundleLoader { * This method never gets called because there is no ModuleClassLoader for the framework. * @throws IOException */ + @Override public Enumeration<URL> findResources(String name) throws IOException { return findLocalResources(name); } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/buddy/DependentPolicy.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/buddy/DependentPolicy.java index 66df2f971..838d9d52c 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/buddy/DependentPolicy.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/buddy/DependentPolicy.java @@ -44,6 +44,7 @@ public class DependentPolicy implements IBuddyPolicy { allDependents = null; } + @Override public Class<?> loadClass(String name) { if (allDependents == null) return null; @@ -72,6 +73,7 @@ public class DependentPolicy implements IBuddyPolicy { } } + @Override public URL loadResource(String name) { if (allDependents == null) return null; @@ -91,6 +93,7 @@ public class DependentPolicy implements IBuddyPolicy { return result; } + @Override public Enumeration<URL> loadResources(String name) { if (allDependents == null) return null; diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/buddy/GlobalPolicy.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/buddy/GlobalPolicy.java index 7f1433c28..c1a3eb807 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/buddy/GlobalPolicy.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/buddy/GlobalPolicy.java @@ -34,6 +34,7 @@ public class GlobalPolicy implements IBuddyPolicy { this.admin = admin; } + @Override public Class<?> loadClass(String name) { ExportedPackage pkg = admin.getExportedPackage(BundleLoader.getPackageName(name)); if (pkg == null) @@ -45,6 +46,7 @@ public class GlobalPolicy implements IBuddyPolicy { } } + @Override public URL loadResource(String name) { //get all exported packages that match the resource's package ExportedPackage pkg = admin.getExportedPackage(BundleLoader.getResourcePackageName(name)); @@ -53,6 +55,7 @@ public class GlobalPolicy implements IBuddyPolicy { return pkg.getExportingBundle().getResource(name); } + @Override public Enumeration<URL> loadResources(String name) { //get all exported packages that match the resource's package ExportedPackage[] pkgs = admin.getExportedPackages(BundleLoader.getResourcePackageName(name)); diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/buddy/PolicyHandler.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/buddy/PolicyHandler.java index f1ee4f95d..462e61939 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/buddy/PolicyHandler.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/buddy/PolicyHandler.java @@ -214,6 +214,7 @@ public class PolicyHandler implements SynchronousBundleListener { context.removeBundleListener(this); } + @Override public void bundleChanged(BundleEvent event) { if ((event.getType() & (BundleEvent.RESOLVED | BundleEvent.UNRESOLVED)) == 0) return; diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/buddy/RegisteredPolicy.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/buddy/RegisteredPolicy.java index c4e2d7852..3546bb4c2 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/buddy/RegisteredPolicy.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/buddy/RegisteredPolicy.java @@ -62,6 +62,7 @@ public class RegisteredPolicy extends DependentPolicy { allDependents = null; } + @Override public Class<?> loadClass(String name) { if (allDependents == null) return null; @@ -83,6 +84,7 @@ public class RegisteredPolicy extends DependentPolicy { return result; } + @Override public URL loadResource(String name) { if (allDependents == null) return null; @@ -99,6 +101,7 @@ public class RegisteredPolicy extends DependentPolicy { return result; } + @Override public Enumeration<URL> loadResources(String name) { if (allDependents == null) return null; diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/buddy/SystemPolicy.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/buddy/SystemPolicy.java index 8b91caec5..6b471d4b1 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/buddy/SystemPolicy.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/buddy/SystemPolicy.java @@ -34,6 +34,7 @@ public class SystemPolicy implements IBuddyPolicy { if (instances[type] == null) { instances[type] = new SystemPolicy(); instances[type].classLoader = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() { + @Override public ClassLoader run() { return createClassLoader(type); } @@ -68,6 +69,7 @@ public class SystemPolicy implements IBuddyPolicy { return null; } + @Override public Class<?> loadClass(String name) { try { return classLoader.loadClass(name); @@ -76,10 +78,12 @@ public class SystemPolicy implements IBuddyPolicy { } } + @Override public URL loadResource(String name) { return classLoader.getResource(name); } + @Override public Enumeration<URL> loadResources(String name) { try { return classLoader.getResources(name); diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/sources/FilteredSourcePackage.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/sources/FilteredSourcePackage.java index 815678fc4..18e58fa57 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/sources/FilteredSourcePackage.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/sources/FilteredSourcePackage.java @@ -29,18 +29,21 @@ public class FilteredSourcePackage extends SingleSourcePackage { this.excludes = excludes != null ? ManifestElement.getArrayFromList(excludes) : null; } + @Override public URL getResource(String name) { if (isFiltered(name, getId())) return null; return super.getResource(name); } + @Override public Enumeration<URL> getResources(String name) { if (isFiltered(name, getId())) return null; return super.getResources(name); } + @Override public Class<?> loadClass(String name) throws ClassNotFoundException { if (isFiltered(name, getId())) return null; diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/sources/MultiSourcePackage.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/sources/MultiSourcePackage.java index 07beab28c..b5b4779e5 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/sources/MultiSourcePackage.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/sources/MultiSourcePackage.java @@ -25,10 +25,12 @@ public class MultiSourcePackage extends PackageSource { this.suppliers = suppliers; } + @Override public SingleSourcePackage[] getSuppliers() { return suppliers; } + @Override public Class<?> loadClass(String name) throws ClassNotFoundException { Class<?> result = null; for (int i = 0; i < suppliers.length; i++) { @@ -39,6 +41,7 @@ public class MultiSourcePackage extends PackageSource { return result; } + @Override public URL getResource(String name) { URL result = null; for (int i = 0; i < suppliers.length; i++) { @@ -49,6 +52,7 @@ public class MultiSourcePackage extends PackageSource { return result; } + @Override public Enumeration<URL> getResources(String name) { Enumeration<URL> results = null; for (int i = 0; i < suppliers.length; i++) diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/sources/NullPackageSource.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/sources/NullPackageSource.java index d397e4140..3e8c15125 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/sources/NullPackageSource.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/sources/NullPackageSource.java @@ -33,22 +33,27 @@ public class NullPackageSource extends PackageSource { super(name); } + @Override public SingleSourcePackage[] getSuppliers() { return null; } + @Override public boolean isNullSource() { return true; } + @Override public Class<?> loadClass(String name) { return null; } + @Override public URL getResource(String name) { return null; } + @Override public Enumeration<URL> getResources(String name) { return null; } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/sources/SingleSourcePackage.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/sources/SingleSourcePackage.java index 713ff6ebb..a686cd84e 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/sources/SingleSourcePackage.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/sources/SingleSourcePackage.java @@ -27,6 +27,7 @@ public class SingleSourcePackage extends PackageSource { this.supplier = supplier; } + @Override public SingleSourcePackage[] getSuppliers() { return new SingleSourcePackage[] {this}; } @@ -35,18 +36,22 @@ public class SingleSourcePackage extends PackageSource { return supplier; } + @Override public Class<?> loadClass(String name) throws ClassNotFoundException { return supplier.findLocalClass(name); } + @Override public URL getResource(String name) { return supplier.findLocalResource(name); } + @Override public Enumeration<URL> getResources(String name) { return supplier.findLocalResources(name); } + @Override public boolean equals(Object source) { if (this == source) return true; @@ -57,6 +62,7 @@ public class SingleSourcePackage extends PackageSource { return supplier == singleSource.supplier && id == singleSource.getId(); } + @Override public int hashCode() { final int prime = 31; int result = 1; diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/location/BasicLocation.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/location/BasicLocation.java index 0bad33be3..45c38d584 100755 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/location/BasicLocation.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/location/BasicLocation.java @@ -62,18 +62,22 @@ public class BasicLocation implements Location { this.debug = debug; } + @Override public boolean allowsDefault() { return defaultValue != null; } + @Override public URL getDefault() { return defaultValue; } + @Override public synchronized Location getParentLocation() { return parent; } + @Override public synchronized URL getURL() { if (location == null && defaultValue != null) { if (debug.get()) { @@ -88,10 +92,12 @@ public class BasicLocation implements Location { return location; } + @Override public synchronized boolean isSet() { return location != null; } + @Override public boolean isReadOnly() { return isReadOnly; } @@ -99,6 +105,7 @@ public class BasicLocation implements Location { /** * @deprecated */ + @Override public boolean setURL(URL value, boolean lock) throws IllegalStateException { try { return set(value, lock); @@ -107,10 +114,12 @@ public class BasicLocation implements Location { } } + @Override public synchronized boolean set(URL value, boolean lock) throws IllegalStateException, IOException { return set(value, lock, null); } + @Override public synchronized boolean set(URL value, boolean lock, String lockFilePath) throws IllegalStateException, IOException { if (location != null) throw new IllegalStateException(Msg.ECLIPSE_CANNOT_CHANGE_LOCATION); @@ -150,12 +159,14 @@ public class BasicLocation implements Location { parent = value; } + @Override public synchronized boolean lock() throws IOException { if (!isSet()) throw new IOException(Msg.location_notSet); return lock(lockFile, location); } + @Override public synchronized boolean isLocked() throws IOException { if (!isSet()) return false; @@ -216,17 +227,20 @@ public class BasicLocation implements Location { locker = LocationHelper.createLocker(lock, lockMode, debug.get()); } + @Override public synchronized void release() { if (locker != null) locker.release(); } + @Override public Location createLocation(Location parentLocation, URL defaultLocation, boolean readonly) { BasicLocation result = new BasicLocation(null, defaultLocation, readonly, dataAreaPrefix, configValues, container, debug); result.setParent(parentLocation); return result; } + @Override public URL getDataArea(String filename) throws IOException { URL base = getURL(); if (base == null) diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/EquinoxLogFactory.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/EquinoxLogFactory.java index 5a734f99c..d2fb48fce 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/EquinoxLogFactory.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/EquinoxLogFactory.java @@ -30,6 +30,7 @@ class EquinoxLogFactory implements ServiceFactory<FrameworkLog> { this.logManager = logManager; } + @Override public FrameworkLog getService(final Bundle bundle, ServiceRegistration<FrameworkLog> registration) { return createFrameworkLog(bundle, defaultWriter); } @@ -39,22 +40,27 @@ class EquinoxLogFactory implements ServiceFactory<FrameworkLog> { final Logger logger = bundle == null ? logManager.getSystemBundleLog().getLogger(eclipseWriter.getLoggerName()) : logManager.getSystemBundleLog().getLogger(bundle, logWriter.getLoggerName()); return new FrameworkLog() { + @Override public void setWriter(Writer newWriter, boolean append) { logWriter.setWriter(newWriter, append); } + @Override public void setFile(File newFile, boolean append) throws IOException { logWriter.setFile(newFile, append); } + @Override public void setConsoleLog(boolean consoleLog) { logWriter.setConsoleLog(consoleLog); } + @Override public void log(FrameworkLogEntry logEntry) { logger.log(logEntry, convertLevel(logEntry), logEntry.getMessage(), logEntry.getThrowable()); } + @Override public void log(FrameworkEvent frameworkEvent) { Bundle b = frameworkEvent.getBundle(); Throwable t = frameworkEvent.getThrowable(); @@ -77,16 +83,19 @@ class EquinoxLogFactory implements ServiceFactory<FrameworkLog> { log(logEntry); } + @Override public File getFile() { return logWriter.getFile(); } + @Override public void close() { logWriter.close(); } }; } + @Override public void ungetService(Bundle bundle, ServiceRegistration<FrameworkLog> registration, FrameworkLog service) { // nothing } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/EquinoxLogWriter.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/EquinoxLogWriter.java index 30e3d1048..f8c758785 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/EquinoxLogWriter.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/EquinoxLogWriter.java @@ -711,6 +711,7 @@ class EquinoxLogWriter implements SynchronousLogListener, LogFilter { return (fwkEntrySeverity & logLevel) != 0; } + @Override public boolean isLoggable(Bundle bundle, String loggableName, int loggableLevel) { if (!enabled) return false; @@ -727,6 +728,7 @@ class EquinoxLogWriter implements SynchronousLogListener, LogFilter { return loggableLevel == LogService.LOG_ERROR; } + @Override public void logged(LogEntry entry) { if (!(entry instanceof ExtendedLogEntry)) // TODO this should never happen diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/EventAdminAdapter.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/EventAdminAdapter.java index b07a9a1c5..0ed74014c 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/EventAdminAdapter.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/EventAdminAdapter.java @@ -51,6 +51,7 @@ public class EventAdminAdapter implements ServiceTrackerCustomizer<Object, Objec eventHandlerTracker.close(); } + @Override public Object addingService(ServiceReference<Object> reference) { Object toTrack = null; Object objectClass = reference.getProperty(Constants.OBJECTCLASS); @@ -76,11 +77,13 @@ public class EventAdminAdapter implements ServiceTrackerCustomizer<Object, Objec return toTrack; } + @Override public void modifiedService(ServiceReference<Object> reference, Object tracked) { removedService(reference, tracked); addingService(reference); } + @Override public void removedService(ServiceReference<Object> reference, Object tracked) { if (tracked == eventAdmin) { eventAdmin = null; diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/EventAdminLogListener.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/EventAdminLogListener.java index fb752e0be..2147981af 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/EventAdminLogListener.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/EventAdminLogListener.java @@ -61,6 +61,7 @@ public class EventAdminLogListener implements SynchronousLogListener { event = eventClass.getConstructor(String.class, Dictionary.class); } + @Override public void logged(LogEntry entry) { try { Object convertedEvent = convertEvent(entry); diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogEntryImpl.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogEntryImpl.java index 20b41b7ad..13b5c50de 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogEntryImpl.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogEntryImpl.java @@ -81,47 +81,58 @@ public class ExtendedLogEntryImpl implements ExtendedLogEntry, LogEntry { this.stackTraceElement = stackTraceElement; } + @Override public String getLoggerName() { return loggerName; } + @Override public long getSequenceNumber() { return sequenceNumber; } + @Override public long getThreadId() { return threadId; } + @Override public String getThreadName() { return threadName; } + @Override public Bundle getBundle() { return bundle; } + @Override public Throwable getException() { return throwable; } @SuppressWarnings("deprecation") + @Override public int getLevel() { return level; } + @Override public String getMessage() { return message; } + @Override public ServiceReference<?> getServiceReference() { return ref; } + @Override public long getTime() { return time; } + @Override public Object getContext() { return contextObject; } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogReaderServiceFactory.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogReaderServiceFactory.java index 620e31ba1..cca82e301 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogReaderServiceFactory.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogReaderServiceFactory.java @@ -51,6 +51,7 @@ public class ExtendedLogReaderServiceFactory implements ServiceFactory<ExtendedL this.listener = listener; } + @Override public void run() { safeLogged(listener, logEntry); } @@ -60,6 +61,7 @@ public class ExtendedLogReaderServiceFactory implements ServiceFactory<ExtendedL private static final Enumeration<LogEntry> EMPTY_ENUMERATION = Collections.enumeration(Collections.EMPTY_LIST); static final LogFilter NULL_LOGGER_FILTER = new LogFilter() { + @Override public boolean isLoggable(Bundle b, String loggerName, int logLevel) { return true; } @@ -137,10 +139,12 @@ public class ExtendedLogReaderServiceFactory implements ServiceFactory<ExtendedL return defaultLevel; } + @Override public ExtendedLogReaderServiceImpl getService(Bundle bundle, ServiceRegistration<ExtendedLogReaderServiceImpl> registration) { return new ExtendedLogReaderServiceImpl(this); } + @Override public void ungetService(Bundle bundle, ServiceRegistration<ExtendedLogReaderServiceImpl> registration, ExtendedLogReaderServiceImpl service) { service.shutdown(); } @@ -148,6 +152,7 @@ public class ExtendedLogReaderServiceFactory implements ServiceFactory<ExtendedL boolean isLoggable(final Bundle bundle, final String name, final int level) { if (System.getSecurityManager() != null) { return AccessController.doPrivileged(new PrivilegedAction<Boolean>() { + @Override public Boolean run() { return isLoggablePrivileged(bundle, name, level); } @@ -210,6 +215,7 @@ public class ExtendedLogReaderServiceFactory implements ServiceFactory<ExtendedL void log(final Bundle bundle, final String name, final StackTraceElement stackTraceElement, final Object context, final LogLevel logLevelEnum, final int level, final String message, final ServiceReference<?> ref, final Throwable exception) { if (System.getSecurityManager() != null) { AccessController.doPrivileged(new PrivilegedAction<Void>() { + @Override public Void run() { logPrivileged(bundle, name, stackTraceElement, context, logLevelEnum, level, message, ref, exception); return null; diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogReaderServiceImpl.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogReaderServiceImpl.java index 83bf52cdf..273f9fcf9 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogReaderServiceImpl.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogReaderServiceImpl.java @@ -25,6 +25,7 @@ public class ExtendedLogReaderServiceImpl implements ExtendedLogReaderService { this.factory = factory; } + @Override public synchronized void addLogListener(LogListener listener, LogFilter filter) { checkShutdown(); if (listener == null) @@ -37,15 +38,18 @@ public class ExtendedLogReaderServiceImpl implements ExtendedLogReaderService { factory.addLogListener(listener, filter); } + @Override public void addLogListener(LogListener listener) { addLogListener(listener, ExtendedLogReaderServiceFactory.NULL_LOGGER_FILTER); } + @Override public Enumeration<LogEntry> getLog() { checkShutdown(); return factory.getLog(); } + @Override public synchronized void removeLogListener(LogListener listener) { checkShutdown(); if (listener == null) diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogServiceFactory.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogServiceFactory.java index 18b068a53..75e2d9d5f 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogServiceFactory.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogServiceFactory.java @@ -43,16 +43,19 @@ public class ExtendedLogServiceFactory implements ServiceFactory<ExtendedLogServ } + @Override public ExtendedLogServiceImpl getService(Bundle bundle, ServiceRegistration<ExtendedLogService> registration) { return getLogService(bundle); } + @Override public void ungetService(Bundle bundle, ServiceRegistration<ExtendedLogService> registration, ExtendedLogService service) { // do nothing // Notice that we do not remove the the LogService impl for the bundle because other bundles // still need to be able to get the cached loggers for a bundle. } + @Override public void bundleChanged(BundleEvent event) { if (event.getType() == BundleEvent.UNINSTALLED) removeLogService(event.getBundle()); diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogServiceImpl.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogServiceImpl.java index 1e2c701d5..ad2fa6978 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogServiceImpl.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogServiceImpl.java @@ -36,37 +36,45 @@ public class ExtendedLogServiceImpl implements ExtendedLogService { } @SuppressWarnings("deprecation") + @Override public void log(int level, String message) { log(null, level, message, null); } @SuppressWarnings("deprecation") + @Override public void log(int level, String message, Throwable exception) { log(null, level, message, exception); } @SuppressWarnings("deprecation") + @Override public void log(ServiceReference<?> sr, int level, String message) { log(sr, level, message, null); } @SuppressWarnings("deprecation") + @Override public void log(ServiceReference<?> sr, int level, String message, Throwable exception) { getLogger((String) null).log(sr, level, message, exception); } + @Override public void log(Object context, int level, String message) { log(context, level, message, null); } + @Override public void log(Object context, int level, String message, Throwable exception) { getLogger((String) null).log(context, level, message, exception); } + @Override public Logger getLogger(String name) { return (Logger) getLogger(name, org.osgi.service.log.Logger.class); } + @Override public Logger getLogger(Bundle logBundle, String name) { if (logBundle == null || logBundle == bundle) return getLogger(name); @@ -85,10 +93,12 @@ public class ExtendedLogServiceImpl implements ExtendedLogService { return bundleLogService.getLogger(name, loggerType); } + @Override public String getName() { return getLogger((String) null).getName(); } + @Override public boolean isLoggable(int level) { return getLogger((String) null).isLoggable(level); } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/LogServiceManager.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/LogServiceManager.java index 15098738f..38bdb07d7 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/LogServiceManager.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/LogServiceManager.java @@ -126,6 +126,7 @@ public class LogServiceManager implements SynchronousBundleListener, FrameworkLi * */ @SuppressWarnings("deprecation") + @Override public void bundleChanged(BundleEvent event) { Bundle bundle = event.getBundle(); String bsn = (bundle == null) ? null : bundle.getSymbolicName(); @@ -141,6 +142,7 @@ public class LogServiceManager implements SynchronousBundleListener, FrameworkLi * ServiceListener.serviceChanged method. * */ + @Override public void serviceChanged(ServiceEvent event) { ServiceReference<?> reference = event.getServiceReference(); Bundle bundle = reference.getBundle(); @@ -160,6 +162,7 @@ public class LogServiceManager implements SynchronousBundleListener, FrameworkLi * */ @SuppressWarnings("deprecation") + @Override public void frameworkEvent(FrameworkEvent event) { Bundle bundle = event.getBundle(); int eventType = event.getType(); @@ -272,119 +275,148 @@ public class LogServiceManager implements SynchronousBundleListener, FrameworkLi static class MockSystemBundle implements Bundle { + @Override public int compareTo(Bundle o) { long idcomp = getBundleId() - o.getBundleId(); return (idcomp < 0L) ? -1 : ((idcomp > 0L) ? 1 : 0); } + @Override public int getState() { return Bundle.RESOLVED; } + @Override public void start(int options) { // nothing } + @Override public void start() { // nothing } + @Override public void stop(int options) { // nothing } + @Override public void stop() { // nothing } + @Override public void update(InputStream input) { // nothing } + @Override public void update() { // nothing } + @Override public void uninstall() { // nothing } + @Override public Dictionary<String, String> getHeaders() { return new Hashtable<>(); } + @Override public long getBundleId() { return 0; } + @Override public String getLocation() { return Constants.SYSTEM_BUNDLE_LOCATION; } + @Override public ServiceReference<?>[] getRegisteredServices() { return null; } + @Override public ServiceReference<?>[] getServicesInUse() { return null; } + @Override public boolean hasPermission(Object permission) { return true; } + @Override public URL getResource(String name) { return null; } + @Override public Dictionary<String, String> getHeaders(String locale) { return null; } + @Override public String getSymbolicName() { return EquinoxContainer.NAME; } + @Override public Class<?> loadClass(String name) throws ClassNotFoundException { throw new ClassNotFoundException(); } + @Override public Enumeration<URL> getResources(String name) { return null; } + @Override public Enumeration<String> getEntryPaths(String path) { return null; } + @Override public URL getEntry(String path) { return null; } + @Override public long getLastModified() { return System.currentTimeMillis(); } + @Override public Enumeration<URL> findEntries(String path, String filePattern, boolean recurse) { return null; } + @Override public BundleContext getBundleContext() { return null; } + @Override public Map<X509Certificate, List<X509Certificate>> getSignerCertificates(int signersType) { return new HashMap<>(); } + @Override public Version getVersion() { return new Version(0, 0, 0); } + @Override public <A> A adapt(Class<A> type) { return null; } + @Override public File getDataFile(String filename) { return null; } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/LoggerImpl.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/LoggerImpl.java index 801d62564..dafdcdcce 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/LoggerImpl.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/LoggerImpl.java @@ -34,36 +34,44 @@ public class LoggerImpl implements Logger { applyLoggerContext(loggerContext); } + @Override public String getName() { return name; } + @Override public boolean isLoggable(int level) { return logServiceImpl.isLoggable(name, level); } + @Override public void log(int level, String message) { log(null, level, message, null); } + @Override public void log(int level, String message, Throwable exception) { log(null, level, message, exception); } @SuppressWarnings("rawtypes") + @Override public void log(ServiceReference sr, int level, String message) { log(sr, null, level, message, sr, null); } @SuppressWarnings("rawtypes") + @Override public void log(ServiceReference sr, int level, String message, Throwable exception) { log(sr, null, level, message, sr, exception); } + @Override public void log(Object context, int level, String message) { log(context, level, message, null); } + @Override public void log(Object context, int level, String message, Throwable exception) { log(context, null, level, message, null, exception); } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/BundlePermissions.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/BundlePermissions.java index ac183fb0e..6168edb5a 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/BundlePermissions.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/BundlePermissions.java @@ -24,10 +24,12 @@ public final class BundlePermissions extends PermissionCollection { // Note that this forces the Enumeration inner class to be loaded as soon as possible (see bug 119069) static final Enumeration<Permission> EMPTY_ENUMERATION = new Enumeration<Permission>() { + @Override public boolean hasMoreElements() { return false; } + @Override public Permission nextElement() { throw new NoSuchElementException(); } @@ -48,6 +50,7 @@ public final class BundlePermissions extends PermissionCollection { setReadOnly(); // collections are managed with ConditionalPermissionAdmin } + @Override public void add(Permission permission) { throw new SecurityException(); } @@ -68,6 +71,7 @@ public final class BundlePermissions extends PermissionCollection { wovenPermissions.add(permission); } + @Override public Enumeration<Permission> elements() { // TODO return an empty enumeration for now; // It does not seem possible to do this properly with multiple exports and conditional permissions. @@ -75,6 +79,7 @@ public final class BundlePermissions extends PermissionCollection { return EMPTY_ENUMERATION; } + @Override public boolean implies(Permission permission) { // first check implied permissions if ((impliedPermissions != null) && impliedPermissions.implies(permission)) diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/EquinoxSecurityManager.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/EquinoxSecurityManager.java index 914fa71a9..1b2b333e8 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/EquinoxSecurityManager.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/EquinoxSecurityManager.java @@ -59,6 +59,7 @@ public class EquinoxSecurityManager extends SecurityManager { this.context = context; } + @Override public Void run() { fsm.internalCheckPermission(perm, context); return null; @@ -87,6 +88,7 @@ public class EquinoxSecurityManager extends SecurityManager { return localCheckContext.get() != null; } + @Override public void checkPermission(Permission perm, Object context) { AccessController.doPrivileged(new CheckPermissionAction(this, perm, context)); } @@ -185,10 +187,12 @@ public class EquinoxSecurityManager extends SecurityManager { return decision.decision; } + @Override public void checkPermission(Permission perm) { checkPermission(perm, getSecurityContext()); } + @Override public Object getSecurityContext() { return AccessController.getContext(); } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/PermissionInfoCollection.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/PermissionInfoCollection.java index 6006f687a..eadf1e3c7 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/PermissionInfoCollection.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/PermissionInfoCollection.java @@ -42,15 +42,18 @@ public final class PermissionInfoCollection extends PermissionCollection { setReadOnly(); // collections are managed with ConditionalPermissionAdmin } + @Override public void add(Permission arg0) { throw new SecurityException(); } + @Override public Enumeration<Permission> elements() { // TODO return an empty enumeration for now; return BundlePermissions.EMPTY_ENUMERATION; } + @Override public boolean implies(Permission perm) { if (hasAllPermission) return true; diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/PermissionsHash.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/PermissionsHash.java index a8695a160..bdc384a22 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/PermissionsHash.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/PermissionsHash.java @@ -56,6 +56,7 @@ class PermissionsHash extends PermissionCollection { * @exception IllegalStateException * if the collection is read only. */ + @Override public void add(Permission perm) { if (isReadOnly()) { throw new SecurityException(); @@ -71,6 +72,7 @@ class PermissionsHash extends PermissionCollection { * @return Enumeration * the permissions in the receiver. */ + @Override public Enumeration<Permission> elements() { return perms.keys(); } @@ -86,6 +88,7 @@ class PermissionsHash extends PermissionCollection { * @param perm java.security.Permission * the permission to check */ + @Override public boolean implies(Permission perm) { Permission p = perms.get(perm); diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/SecurityAdmin.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/SecurityAdmin.java index f3406d335..5e75d8aa3 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/SecurityAdmin.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/SecurityAdmin.java @@ -175,6 +175,7 @@ public final class SecurityAdmin implements PermissionAdmin, ConditionalPermissi return false; } + @Override public PermissionInfo[] getDefaultPermissions() { synchronized (lock) { if (permAdminDefaults == null) @@ -183,6 +184,7 @@ public final class SecurityAdmin implements PermissionAdmin, ConditionalPermissi } } + @Override public String[] getLocations() { synchronized (lock) { String[] results = permAdminTable.getLocations(); @@ -190,12 +192,14 @@ public final class SecurityAdmin implements PermissionAdmin, ConditionalPermissi } } + @Override public PermissionInfo[] getPermissions(String location) { synchronized (lock) { return permAdminTable.getPermissions(location); } } + @Override public void setDefaultPermissions(PermissionInfo[] permissions) { checkAllPermission(); synchronized (lock) { @@ -222,6 +226,7 @@ public final class SecurityAdmin implements PermissionAdmin, ConditionalPermissi return encoded; } + @Override public void setPermissions(String location, PermissionInfo[] permissions) { checkAllPermission(); synchronized (lock) { @@ -252,24 +257,29 @@ public final class SecurityAdmin implements PermissionAdmin, ConditionalPermissi /** * @deprecated */ + @Override public ConditionalPermissionInfo addConditionalPermissionInfo(ConditionInfo[] conds, PermissionInfo[] perms) { return setConditionalPermissionInfo(null, conds, perms, true); } + @Override public ConditionalPermissionInfo newConditionalPermissionInfo(String name, ConditionInfo[] conditions, PermissionInfo[] permissions, String decision) { return new SecurityRowSnapShot(name, conditions, permissions, decision); } + @Override public ConditionalPermissionInfo newConditionalPermissionInfo(String encoded) { return SecurityRow.createSecurityRowSnapShot(encoded); } + @Override public ConditionalPermissionUpdate newConditionalPermissionUpdate() { synchronized (lock) { return new SecurityTableUpdate(this, condAdminTable.getRows(), timeStamp); } } + @Override public AccessControlContext getAccessControlContext(String[] signers) { SecurityAdmin snapShot = getSnapShot(); return new AccessControlContext(new ProtectionDomain[] {createProtectionDomain(createMockBundle(signers), snapShot)}); @@ -278,6 +288,7 @@ public final class SecurityAdmin implements PermissionAdmin, ConditionalPermissi /** * @deprecated */ + @Override public ConditionalPermissionInfo getConditionalPermissionInfo(String name) { synchronized (lock) { return condAdminTable.getRow(name); @@ -287,6 +298,7 @@ public final class SecurityAdmin implements PermissionAdmin, ConditionalPermissi /** * @deprecated */ + @Override public Enumeration<ConditionalPermissionInfo> getConditionalPermissionInfos() { // could implement our own Enumeration, but we don't care about performance here. Just do something simple: synchronized (lock) { @@ -301,6 +313,7 @@ public final class SecurityAdmin implements PermissionAdmin, ConditionalPermissi /** * @deprecated */ + @Override public ConditionalPermissionInfo setConditionalPermissionInfo(String name, ConditionInfo[] conds, PermissionInfo[] perms) { return setConditionalPermissionInfo(name, conds, perms, true); } @@ -531,46 +544,57 @@ public final class SecurityAdmin implements PermissionAdmin, ConditionalPermissi this.signers = signers; } + @Override public Enumeration<URL> findEntries(String path, String filePattern, boolean recurse) { return null; } + @Override public BundleContext getBundleContext() { return null; } + @Override public long getBundleId() { return -1; } + @Override public URL getEntry(String path) { return null; } + @Override public Enumeration<String> getEntryPaths(String path) { return null; } + @Override public Dictionary<String, String> getHeaders() { return new Hashtable<>(); } + @Override public Dictionary<String, String> getHeaders(String locale) { return getHeaders(); } + @Override public long getLastModified() { return 0; } + @Override public String getLocation() { return ""; //$NON-NLS-1$ } + @Override public ServiceReference<?>[] getRegisteredServices() { return null; } + @Override public URL getResource(String name) { return null; } @@ -578,30 +602,37 @@ public final class SecurityAdmin implements PermissionAdmin, ConditionalPermissi /** * @throws IOException */ + @Override public Enumeration<URL> getResources(String name) throws IOException { return null; } + @Override public ServiceReference<?>[] getServicesInUse() { return null; } + @Override public Map<X509Certificate, List<X509Certificate>> getSignerCertificates(int signersType) { return new HashMap<>(signers); } + @Override public int getState() { return Bundle.UNINSTALLED; } + @Override public String getSymbolicName() { return null; } + @Override public Version getVersion() { return Version.emptyVersion; } + @Override public boolean hasPermission(Object permission) { return false; } @@ -609,6 +640,7 @@ public final class SecurityAdmin implements PermissionAdmin, ConditionalPermissi /** * @throws ClassNotFoundException */ + @Override public Class<?> loadClass(String name) throws ClassNotFoundException { throw new IllegalStateException(); } @@ -616,6 +648,7 @@ public final class SecurityAdmin implements PermissionAdmin, ConditionalPermissi /** * @throws BundleException */ + @Override public void start(int options) throws BundleException { throw new IllegalStateException(); } @@ -623,6 +656,7 @@ public final class SecurityAdmin implements PermissionAdmin, ConditionalPermissi /** * @throws BundleException */ + @Override public void start() throws BundleException { throw new IllegalStateException(); } @@ -630,6 +664,7 @@ public final class SecurityAdmin implements PermissionAdmin, ConditionalPermissi /** * @throws BundleException */ + @Override public void stop(int options) throws BundleException { throw new IllegalStateException(); } @@ -637,6 +672,7 @@ public final class SecurityAdmin implements PermissionAdmin, ConditionalPermissi /** * @throws BundleException */ + @Override public void stop() throws BundleException { throw new IllegalStateException(); } @@ -644,6 +680,7 @@ public final class SecurityAdmin implements PermissionAdmin, ConditionalPermissi /** * @throws BundleException */ + @Override public void uninstall() throws BundleException { throw new IllegalStateException(); } @@ -651,6 +688,7 @@ public final class SecurityAdmin implements PermissionAdmin, ConditionalPermissi /** * @throws BundleException */ + @Override public void update() throws BundleException { throw new IllegalStateException(); } @@ -658,18 +696,22 @@ public final class SecurityAdmin implements PermissionAdmin, ConditionalPermissi /** * @throws BundleException */ + @Override public void update(InputStream in) throws BundleException { throw new IllegalStateException(); } + @Override public int compareTo(Bundle o) { return 0; } + @Override public <A> A adapt(Class<A> type) { throw new IllegalStateException(); } + @Override public File getDataFile(String filename) { return null; } @@ -684,10 +726,12 @@ public final class SecurityAdmin implements PermissionAdmin, ConditionalPermissi this.issuer = issuer; } + @Override public Principal getSubjectDN() { return subject; } + @Override public boolean equals(Object obj) { if (this == obj) return true; @@ -696,10 +740,12 @@ public final class SecurityAdmin implements PermissionAdmin, ConditionalPermissi return false; } + @Override public int hashCode() { return subject.hashCode() + issuer.hashCode(); } + @Override public String toString() { return subject.toString(); } @@ -708,6 +754,7 @@ public final class SecurityAdmin implements PermissionAdmin, ConditionalPermissi * @throws CertificateExpiredException * @throws java.security.cert.CertificateNotYetValidException */ + @Override public void checkValidity() throws CertificateExpiredException, java.security.cert.CertificateNotYetValidException { throw new UnsupportedOperationException(); } @@ -716,54 +763,67 @@ public final class SecurityAdmin implements PermissionAdmin, ConditionalPermissi * @throws java.security.cert.CertificateExpiredException * @throws java.security.cert.CertificateNotYetValidException */ + @Override public void checkValidity(Date var0) throws java.security.cert.CertificateExpiredException, java.security.cert.CertificateNotYetValidException { throw new UnsupportedOperationException(); } + @Override public int getBasicConstraints() { throw new UnsupportedOperationException(); } + @Override public Principal getIssuerDN() { return issuer; } + @Override public boolean[] getIssuerUniqueID() { throw new UnsupportedOperationException(); } + @Override public boolean[] getKeyUsage() { throw new UnsupportedOperationException(); } + @Override public Date getNotAfter() { throw new UnsupportedOperationException(); } + @Override public Date getNotBefore() { throw new UnsupportedOperationException(); } + @Override public BigInteger getSerialNumber() { throw new UnsupportedOperationException(); } + @Override public String getSigAlgName() { throw new UnsupportedOperationException(); } + @Override public String getSigAlgOID() { throw new UnsupportedOperationException(); } + @Override public byte[] getSigAlgParams() { throw new UnsupportedOperationException(); } + @Override public byte[] getSignature() { throw new UnsupportedOperationException(); } + @Override public boolean[] getSubjectUniqueID() { throw new UnsupportedOperationException(); } @@ -771,10 +831,12 @@ public final class SecurityAdmin implements PermissionAdmin, ConditionalPermissi /** * @throws CertificateEncodingException */ + @Override public byte[] getTBSCertificate() throws CertificateEncodingException { throw new UnsupportedOperationException(); } + @Override public int getVersion() { throw new UnsupportedOperationException(); } @@ -782,10 +844,12 @@ public final class SecurityAdmin implements PermissionAdmin, ConditionalPermissi /** * @throws CertificateEncodingException */ + @Override public byte[] getEncoded() throws CertificateEncodingException { throw new UnsupportedOperationException(); } + @Override public PublicKey getPublicKey() { throw new UnsupportedOperationException(); } @@ -797,6 +861,7 @@ public final class SecurityAdmin implements PermissionAdmin, ConditionalPermissi * @throws java.security.SignatureException * @throws java.security.cert.CertificateException */ + @Override public void verify(PublicKey var0) throws java.security.InvalidKeyException, java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.security.SignatureException, java.security.cert.CertificateException { throw new UnsupportedOperationException(); } @@ -808,22 +873,27 @@ public final class SecurityAdmin implements PermissionAdmin, ConditionalPermissi * @throws SignatureException * @throws CertificateException */ + @Override public void verify(PublicKey var0, String var1) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchProviderException, SignatureException, CertificateException { throw new UnsupportedOperationException(); } + @Override public Set<String> getCriticalExtensionOIDs() { throw new UnsupportedOperationException(); } + @Override public byte[] getExtensionValue(String var0) { throw new UnsupportedOperationException(); } + @Override public Set<String> getNonCriticalExtensionOIDs() { throw new UnsupportedOperationException(); } + @Override public boolean hasUnsupportedCriticalExtension() { throw new UnsupportedOperationException(); } @@ -836,10 +906,12 @@ public final class SecurityAdmin implements PermissionAdmin, ConditionalPermissi this.name = name; } + @Override public String getName() { return name; } + @Override public boolean equals(Object obj) { if (this == obj) { return true; @@ -850,10 +922,12 @@ public final class SecurityAdmin implements PermissionAdmin, ConditionalPermissi return false; } + @Override public int hashCode() { return name.hashCode(); } + @Override public String toString() { return getName(); } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/SecurityRow.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/SecurityRow.java index 33d4003b8..0c09613d2 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/SecurityRow.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/SecurityRow.java @@ -217,10 +217,12 @@ public final class SecurityRow implements ConditionalPermissionInfo { return output.toString(); } + @Override public String getName() { return name; } + @Override public ConditionInfo[] getConditionInfos() { // must make a copy for the public API method to prevent modification return (ConditionInfo[]) cloneArray(conditionInfos); @@ -230,10 +232,12 @@ public final class SecurityRow implements ConditionalPermissionInfo { return conditionInfos; } + @Override public String getAccessDecision() { return deny ? ConditionalPermissionInfo.DENY : ConditionalPermissionInfo.ALLOW; } + @Override public PermissionInfo[] getPermissionInfos() { // must make a copy for the public API method to prevent modification return (PermissionInfo[]) cloneArray(permissionInfoCollection.getPermissionInfos()); @@ -246,6 +250,7 @@ public final class SecurityRow implements ConditionalPermissionInfo { /** * @deprecated */ + @Override public void delete() { securityAdmin.delete(this, true); } @@ -394,14 +399,17 @@ public final class SecurityRow implements ConditionalPermissionInfo { return permissionInfoCollection.implies(permission) ? (deny ? DECISION_DENIED : DECISION_GRANTED) : DECISION_ABSTAIN; } + @Override public String toString() { return getEncoded(); } + @Override public String getEncoded() { return getEncoded(name, conditionInfos, internalGetPermissionInfos(), deny); } + @Override public boolean equals(Object obj) { // doing the simple (slow) thing for now if (obj == this) @@ -412,6 +420,7 @@ public final class SecurityRow implements ConditionalPermissionInfo { return getEncoded().equals(((ConditionalPermissionInfo) obj).getEncoded()); } + @Override public int hashCode() { return getHashCode(name, internalGetConditionInfos(), internalGetPermissionInfos(), getAccessDecision()); } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/SecurityRowSnapShot.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/SecurityRowSnapShot.java index d13a28c95..e9c0b1b86 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/SecurityRowSnapShot.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/SecurityRowSnapShot.java @@ -40,18 +40,22 @@ public class SecurityRowSnapShot implements ConditionalPermissionInfo { this.decision = decision; } + @Override public ConditionInfo[] getConditionInfos() { return (ConditionInfo[]) SecurityRow.cloneArray(conditionInfos); } + @Override public String getAccessDecision() { return decision; } + @Override public String getName() { return name; } + @Override public PermissionInfo[] getPermissionInfos() { return (PermissionInfo[]) SecurityRow.cloneArray(permissionInfos); } @@ -59,18 +63,22 @@ public class SecurityRowSnapShot implements ConditionalPermissionInfo { /** * @deprecated */ + @Override public void delete() { throw new UnsupportedOperationException(); } + @Override public String toString() { return getEncoded(); } + @Override public String getEncoded() { return SecurityRow.getEncoded(name, conditionInfos, permissionInfos, DENY.equalsIgnoreCase(decision)); } + @Override public boolean equals(Object obj) { // doing the simple (slow) thing for now if (obj == this) @@ -81,6 +89,7 @@ public class SecurityRowSnapShot implements ConditionalPermissionInfo { return getEncoded().equals(((ConditionalPermissionInfo) obj).getEncoded()); } + @Override public int hashCode() { return SecurityRow.getHashCode(name, conditionInfos, permissionInfos, getAccessDecision()); } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/SecurityTable.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/SecurityTable.java index afd1c9c63..7ddaadc83 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/SecurityTable.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/SecurityTable.java @@ -188,14 +188,17 @@ public class SecurityTable extends PermissionCollection { return encoded; } + @Override public void add(Permission permission) { throw new SecurityException(); } + @Override public Enumeration<Permission> elements() { return BundlePermissions.EMPTY_ENUMERATION; } + @Override public boolean implies(Permission permission) { return (evaluate(null, permission) & SecurityTable.GRANTED) != 0; } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/SecurityTableUpdate.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/SecurityTableUpdate.java index 431a1d1a5..4a45087ab 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/SecurityTableUpdate.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/SecurityTableUpdate.java @@ -35,10 +35,12 @@ public class SecurityTableUpdate implements ConditionalPermissionUpdate { this.rows.add(new SecurityRowSnapShot(rows[i].getName(), rows[i].internalGetConditionInfos(), rows[i].internalGetPermissionInfos(), rows[i].getAccessDecision())); } + @Override public boolean commit() { return securityAdmin.commit(rows, timeStamp); } + @Override public List<ConditionalPermissionInfo> getConditionalPermissionInfos() { // it is fine to return the internal list; it is a snap shot and we allow clients to modify it. return rows; diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/provisional/service/security/AuthorizationEngine.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/provisional/service/security/AuthorizationEngine.java index 3ac578d06..0d148788a 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/provisional/service/security/AuthorizationEngine.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/provisional/service/security/AuthorizationEngine.java @@ -84,6 +84,7 @@ public abstract class AuthorizationEngine { abstract public int getStatus(); class AuthEventDispatcher implements EventDispatcher<AuthorizationListener, Object, AuthorizationEvent> { + @Override public void dispatchEvent(AuthorizationListener eventListener, Object listenerObject, int eventAction, AuthorizationEvent eventObject) { eventListener.authorizationEvent(eventObject); } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/service/security/KeyStoreTrustEngine.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/service/security/KeyStoreTrustEngine.java index a465e39a9..4295da3f1 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/service/security/KeyStoreTrustEngine.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/service/security/KeyStoreTrustEngine.java @@ -109,6 +109,7 @@ public class KeyStoreTrustEngine extends TrustEngine { return keyStore; } + @Override public Certificate findTrustAnchor(Certificate[] certChain) throws IOException { if (certChain == null || certChain.length == 0) @@ -175,6 +176,7 @@ public class KeyStoreTrustEngine extends TrustEngine { } } + @Override protected String doAddTrustAnchor(Certificate cert, String alias) throws IOException, GeneralSecurityException { if (isReadOnly()) throw new IOException(SignedContentMessages.Default_Trust_Read_Only); @@ -204,6 +206,7 @@ public class KeyStoreTrustEngine extends TrustEngine { return alias; } + @Override protected void doRemoveTrustAnchor(Certificate cert) throws IOException, GeneralSecurityException { if (isReadOnly()) throw new IOException(SignedContentMessages.Default_Trust_Read_Only); @@ -224,6 +227,7 @@ public class KeyStoreTrustEngine extends TrustEngine { } } + @Override protected void doRemoveTrustAnchor(String alias) throws IOException, GeneralSecurityException { if (alias == null) { @@ -248,6 +252,7 @@ public class KeyStoreTrustEngine extends TrustEngine { } } + @Override public Certificate getTrustAnchor(String alias) throws IOException, GeneralSecurityException { if (alias == null) { @@ -264,6 +269,7 @@ public class KeyStoreTrustEngine extends TrustEngine { } } + @Override public String[] getAliases() throws IOException, GeneralSecurityException { List<String> returnList = new ArrayList<>(); @@ -334,10 +340,12 @@ public class KeyStoreTrustEngine extends TrustEngine { return new FileOutputStream(file); } + @Override public boolean isReadOnly() { return getPassword() == null || !(new File(path).canWrite()); } + @Override public String getName() { return name; } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/FilteredServiceListener.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/FilteredServiceListener.java index b8bb40dab..1a6638366 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/FilteredServiceListener.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/FilteredServiceListener.java @@ -76,6 +76,7 @@ class FilteredServiceListener implements ServiceListener, ListenerHook.ListenerI * * @param event The <code>ServiceEvent</code> object. */ + @Override public void serviceChanged(ServiceEvent event) { ServiceReferenceImpl<?> reference = (ServiceReferenceImpl<?>) event.getServiceReference(); @@ -145,6 +146,7 @@ class FilteredServiceListener implements ServiceListener, ListenerHook.ListenerI * * @return The string representation of this listener. */ + @Override public String toString() { String filterString = getFilter(); if (filterString == null) { @@ -158,6 +160,7 @@ class FilteredServiceListener implements ServiceListener, ListenerHook.ListenerI * @return The context of the bundle which added the service listener. * @see org.osgi.framework.hooks.service.ListenerHook.ListenerInfo#getBundleContext() */ + @Override public BundleContext getBundleContext() { return context; } @@ -168,6 +171,7 @@ class FilteredServiceListener implements ServiceListener, ListenerHook.ListenerI * be <code>null</code> if the listener was added without a filter. * @see org.osgi.framework.hooks.service.ListenerHook.ListenerInfo#getFilter() */ + @Override public String getFilter() { if (filter != null) { return filter.toString(); @@ -185,6 +189,7 @@ class FilteredServiceListener implements ServiceListener, ListenerHook.ListenerI * @return <code>false</code> if the listener has not been been removed, * <code>true</code> otherwise. */ + @Override public boolean isRemoved() { return removed; } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ServiceFactoryUse.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ServiceFactoryUse.java index 4865b3cd3..cd55b5b54 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ServiceFactoryUse.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ServiceFactoryUse.java @@ -211,6 +211,7 @@ public class ServiceFactoryUse<S> extends ServiceUse<S> { final S service; try { service = AccessController.doPrivileged(new PrivilegedAction<S>() { + @Override public S run() { return factory.getService(context.getBundleImpl(), registration); } @@ -259,6 +260,7 @@ public class ServiceFactoryUse<S> extends ServiceUse<S> { void factoryUngetService(final S service) { try { AccessController.doPrivileged(new PrivilegedAction<Void>() { + @Override public Void run() { factory.ungetService(context.getBundleImpl(), registration, service); return null; diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ServiceReferenceImpl.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ServiceReferenceImpl.java index 82d6ab97c..a1887a767 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ServiceReferenceImpl.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ServiceReferenceImpl.java @@ -80,6 +80,7 @@ public class ServiceReferenceImpl<S> implements ServiceReference<S> { * @return The property value to which the key is mapped; <code>null</code> * if there is no property named after the key. */ + @Override public Object getProperty(String key) { return registration.getProperty(key); } @@ -104,6 +105,7 @@ public class ServiceReferenceImpl<S> implements ServiceReference<S> { * * @return An array of property keys. */ + @Override public String[] getPropertyKeys() { return registration.getPropertyKeys(); } @@ -122,6 +124,7 @@ public class ServiceReferenceImpl<S> implements ServiceReference<S> { * that service has already been unregistered. * @see BundleContext#registerService(String[],Object,java.util.Dictionary) */ + @Override public Bundle getBundle() { return registration.getBundle(); } @@ -138,6 +141,7 @@ public class ServiceReferenceImpl<S> implements ServiceReference<S> { * * @since 1.1 */ + @Override public Bundle[] getUsingBundles() { return registration.getUsingBundles(); } @@ -169,6 +173,7 @@ public class ServiceReferenceImpl<S> implements ServiceReference<S> { * * @since 1.3 */ + @Override public boolean isAssignableTo(Bundle bundle, String className) { return registration.isAssignableTo(bundle, className); } @@ -198,6 +203,7 @@ public class ServiceReferenceImpl<S> implements ServiceReference<S> { * greater than the specified <code>ServiceReference</code>. * @since 1.4 */ + @Override public int compareTo(Object object) { ServiceRegistrationImpl<?> other = ((ServiceReferenceImpl<?>) object).registration; @@ -225,6 +231,7 @@ public class ServiceReferenceImpl<S> implements ServiceReference<S> { * * @return a hash code value for this object. */ + @Override public int hashCode() { return registration.hashCode(); } @@ -236,6 +243,7 @@ public class ServiceReferenceImpl<S> implements ServiceReference<S> { * @return <code>true</code> if this object is the same as the obj * argument; <code>false</code> otherwise. */ + @Override public boolean equals(Object obj) { if (obj == this) { return true; @@ -255,6 +263,7 @@ public class ServiceReferenceImpl<S> implements ServiceReference<S> { * * @return String */ + @Override public String toString() { return registration.toString(); } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ServiceRegistrationImpl.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ServiceRegistrationImpl.java index 49b7f7dba..9c9f09bd0 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ServiceRegistrationImpl.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ServiceRegistrationImpl.java @@ -152,6 +152,7 @@ public class ServiceRegistrationImpl<S> implements ServiceRegistration<S>, Compa * @exception IllegalArgumentException If the <tt>properties</tt> * parameter contains case variants of the same key name. */ + @Override public void setProperties(Dictionary<String, ?> props) { final ServiceReferenceImpl<S> ref; final Map<String, Object> previousProperties; @@ -201,6 +202,7 @@ public class ServiceRegistrationImpl<S> implements ServiceRegistration<S>, Compa * this ServiceRegistration has already been unregistered. * @see BundleContextImpl#ungetService */ + @Override public void unregister() { final ServiceReferenceImpl<S> ref; synchronized (registry) { @@ -273,6 +275,7 @@ public class ServiceRegistrationImpl<S> implements ServiceRegistration<S>, Compa * this ServiceRegistration has already been unregistered. * @return A {@link ServiceReferenceImpl} object. */ + @Override public ServiceReference<S> getReference() { return getReferenceImpl(); } @@ -691,6 +694,7 @@ public class ServiceRegistrationImpl<S> implements ServiceRegistration<S>, Compa * * @return String representation of this object. */ + @Override public String toString() { int size = clazzes.length; StringBuilder sb = new StringBuilder(50 * size); @@ -724,6 +728,7 @@ public class ServiceRegistrationImpl<S> implements ServiceRegistration<S>, Compa * <code>ServiceRegistrationImpl</code> is greater than, equal to, or * less than the specified <code>ServiceRegistrationImpl</code>. */ + @Override public int compareTo(ServiceRegistrationImpl<?> other) { final int thisRanking = this.getRanking(); final int otherRanking = other.getRanking(); diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ServiceRegistry.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ServiceRegistry.java index 63d22c60e..5d4da714c 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ServiceRegistry.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ServiceRegistry.java @@ -804,6 +804,7 @@ public class ServiceRegistry { publishServiceEventPrivileged(event); } else { AccessController.doPrivileged(new PrivilegedAction<Void>() { + @Override public Void run() { publishServiceEventPrivileged(event); return null; @@ -1107,6 +1108,7 @@ public class ServiceRegistry { */ static String checkServiceClass(final String[] clazzes, final Object serviceObject) { ClassLoader cl = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() { + @Override public ClassLoader run() { return serviceObject.getClass().getClassLoader(); } @@ -1164,6 +1166,7 @@ public class ServiceRegistry { notifyFindHooksPrivileged(context, clazz, filterstring, allservices, result); } else { AccessController.doPrivileged(new PrivilegedAction<Void>() { + @Override public Void run() { notifyFindHooksPrivileged(context, clazz, filterstring, allservices, result); return null; @@ -1177,16 +1180,19 @@ public class ServiceRegistry { Debug.println("notifyServiceFindHooks(" + context.getBundleImpl() + "," + clazz + "," + filterstring + "," + allservices + "," + result + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ } notifyHooksPrivileged(new HookContext() { + @Override public void call(Object hook, ServiceRegistration<?> hookRegistration) throws Exception { if (hook instanceof FindHook) { ((FindHook) hook).find(context, clazz, filterstring, allservices, result); } } + @Override public String getHookClassName() { return findHookName; } + @Override public String getHookMethodName() { return "find"; //$NON-NLS-1$ } @@ -1212,16 +1218,19 @@ public class ServiceRegistry { } notifyHooksPrivileged(new HookContext() { @SuppressWarnings("deprecation") + @Override public void call(Object hook, ServiceRegistration<?> hookRegistration) throws Exception { if (hook instanceof EventHook) { ((EventHook) hook).event(event, result); } } + @Override public String getHookClassName() { return eventHookName; } + @Override public String getHookMethodName() { return "event"; //$NON-NLS-1$ } @@ -1246,16 +1255,19 @@ public class ServiceRegistry { Debug.println("notifyServiceEventListenerHooks(" + event.getType() + ":" + event.getServiceReference() + "," + result + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ } notifyHooksPrivileged(new HookContext() { + @Override public void call(Object hook, ServiceRegistration<?> hookRegistration) throws Exception { if (hook instanceof EventListenerHook) { ((EventListenerHook) hook).event(event, result); } } + @Override public String getHookClassName() { return eventListenerHookName; } + @Override public String getHookMethodName() { return "event"; //$NON-NLS-1$ } @@ -1324,6 +1336,7 @@ public class ServiceRegistry { notifyNewListenerHookPrivileged(registration); } else { AccessController.doPrivileged(new PrivilegedAction<Void>() { + @Override public Void run() { notifyNewListenerHookPrivileged(registration); return null; @@ -1350,16 +1363,19 @@ public class ServiceRegistry { final Collection<ListenerInfo> listeners = Collections.unmodifiableCollection(addedListeners); notifyHookPrivileged(systemBundleContext, registration, new HookContext() { + @Override public void call(Object hook, ServiceRegistration<?> hookRegistration) throws Exception { if (hook instanceof ListenerHook) { ((ListenerHook) hook).added(listeners); } } + @Override public String getHookClassName() { return listenerHookName; } + @Override public String getHookMethodName() { return "added"; //$NON-NLS-1$ } @@ -1386,6 +1402,7 @@ public class ServiceRegistry { notifyListenerHooksPrivileged(listeners, added); } else { AccessController.doPrivileged(new PrivilegedAction<Void>() { + @Override public Void run() { notifyListenerHooksPrivileged(listeners, added); return null; @@ -1402,6 +1419,7 @@ public class ServiceRegistry { } notifyHooksPrivileged(new HookContext() { + @Override public void call(Object hook, ServiceRegistration<?> hookRegistration) throws Exception { if (hook instanceof ListenerHook) { if (added) { @@ -1412,10 +1430,12 @@ public class ServiceRegistry { } } + @Override public String getHookClassName() { return listenerHookName; } + @Override public String getHookMethodName() { return added ? "added" : "removed"; //$NON-NLS-1$ //$NON-NLS-2$ } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ShrinkableCollection.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ShrinkableCollection.java index 59fbb049a..43e41bd11 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ShrinkableCollection.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ShrinkableCollection.java @@ -95,14 +95,17 @@ public class ShrinkableCollection<E> implements Collection<E> { return true; } + @Override public boolean add(E e) { throw new UnsupportedOperationException(); } + @Override public boolean addAll(Collection<? extends E> c) { throw new UnsupportedOperationException(); } + @Override public void clear() { collection.clear(); for (Collection<? extends E> c : list) { @@ -110,18 +113,22 @@ public class ShrinkableCollection<E> implements Collection<E> { } } + @Override public boolean contains(Object o) { return collection.contains(o); } + @Override public boolean containsAll(Collection<?> c) { return collection.containsAll(c); } + @Override public boolean isEmpty() { return collection.isEmpty(); } + @Override public Iterator<E> iterator() { @SuppressWarnings("unchecked") final Iterator<E> iter = (Iterator<E>) collection.iterator(); @@ -132,15 +139,18 @@ public class ShrinkableCollection<E> implements Collection<E> { return new Iterator<E>() { private E last; + @Override public boolean hasNext() { return iter.hasNext(); } + @Override public E next() { last = iter.next(); return last; } + @Override public void remove() { iter.remove(); for (Collection<? extends E> c : collections) { @@ -150,6 +160,7 @@ public class ShrinkableCollection<E> implements Collection<E> { }; } + @Override public boolean remove(Object o) { final boolean result = collection.remove(o); if (result) { @@ -160,6 +171,7 @@ public class ShrinkableCollection<E> implements Collection<E> { return result; } + @Override public boolean removeAll(Collection<?> c) { final boolean result = collection.removeAll(c); if (result) { @@ -170,6 +182,7 @@ public class ShrinkableCollection<E> implements Collection<E> { return result; } + @Override public boolean retainAll(Collection<?> c) { final boolean result = collection.retainAll(c); if (result) { @@ -180,18 +193,22 @@ public class ShrinkableCollection<E> implements Collection<E> { return result; } + @Override public int size() { return collection.size(); } + @Override public Object[] toArray() { return collection.toArray(); } + @Override public <T> T[] toArray(T[] var0) { return collection.toArray(var0); } + @Override public String toString() { return collection.toString(); } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ShrinkableEntrySetValueCollection.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ShrinkableEntrySetValueCollection.java index ed177886b..9df2bb5df 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ShrinkableEntrySetValueCollection.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ShrinkableEntrySetValueCollection.java @@ -26,18 +26,22 @@ public class ShrinkableEntrySetValueCollection<E> extends AbstractCollection<E> entrySet = e; } + @Override public void clear() { entrySet.clear(); } + @Override public boolean isEmpty() { return entrySet.isEmpty(); } + @Override public Iterator<E> iterator() { return new ValueIterator<>(entrySet.iterator()); } + @Override public int size() { return entrySet.size(); } @@ -52,15 +56,18 @@ public class ShrinkableEntrySetValueCollection<E> extends AbstractCollection<E> iter = i; } + @Override public boolean hasNext() { return iter.hasNext(); } + @Override public E next() { final Map.Entry<?, ? extends E> entry = iter.next(); return entry.getValue(); } + @Override public void remove() { iter.remove(); } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ShrinkableValueCollectionMap.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ShrinkableValueCollectionMap.java index d4033f7fd..b3190bad0 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ShrinkableValueCollectionMap.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/ShrinkableValueCollectionMap.java @@ -28,6 +28,7 @@ public class ShrinkableValueCollectionMap<K, V> extends AbstractMap<K, Collectio values = null; } + @Override public void clear() { map.clear(); if (values != null) { @@ -35,10 +36,12 @@ public class ShrinkableValueCollectionMap<K, V> extends AbstractMap<K, Collectio } } + @Override public boolean containsKey(Object key) { return map.containsKey(key); } + @Override public boolean containsValue(Object value) { /* Since values are collections and the collection has identity equality, * there is no way any value could be contained in this map unless that @@ -50,10 +53,12 @@ public class ShrinkableValueCollectionMap<K, V> extends AbstractMap<K, Collectio return values.containsValue(value); } + @Override public Set<Map.Entry<K, Collection<V>>> entrySet() { return new EntrySet(); } + @Override public Collection<V> get(Object key) { Collection<V> value = null; if (values != null) { @@ -73,10 +78,12 @@ public class ShrinkableValueCollectionMap<K, V> extends AbstractMap<K, Collectio return value; } + @Override public boolean isEmpty() { return map.isEmpty(); } + @Override public Collection<V> remove(Object key) { Set<? extends Map.Entry<?, ? extends V>> entrySet = map.remove(key); Collection<V> value = null; @@ -89,6 +96,7 @@ public class ShrinkableValueCollectionMap<K, V> extends AbstractMap<K, Collectio return value; } + @Override public int size() { return map.size(); } @@ -101,10 +109,12 @@ public class ShrinkableValueCollectionMap<K, V> extends AbstractMap<K, Collectio super(); } + @Override public Iterator<Map.Entry<K, Collection<V>>> iterator() { return new EntryIterator(); } + @Override public int size() { return ShrinkableValueCollectionMap.this.size(); } @@ -121,15 +131,18 @@ public class ShrinkableValueCollectionMap<K, V> extends AbstractMap<K, Collectio iter = map.keySet().iterator(); } + @Override public boolean hasNext() { return iter.hasNext(); } + @Override public Map.Entry<K, Collection<V>> next() { last = iter.next(); return new Entry(last); } + @Override public void remove() { iter.remove(); if (values != null) { @@ -149,10 +162,12 @@ public class ShrinkableValueCollectionMap<K, V> extends AbstractMap<K, Collectio key = k; } + @Override public K getKey() { return key; } + @Override public Collection<V> getValue() { if (value == null) { value = ShrinkableValueCollectionMap.this.get(key); @@ -160,18 +175,22 @@ public class ShrinkableValueCollectionMap<K, V> extends AbstractMap<K, Collectio return value; } + @Override public Collection<V> setValue(Collection<V> value) { throw new UnsupportedOperationException(); // entries cannot be modified. } + @Override public String toString() { return getKey() + "=" + getValue(); //$NON-NLS-1$ } + @Override public int hashCode() { return hash(getKey()) ^ hash(getValue()); } + @Override public boolean equals(Object obj) { if (obj == this) { return true; diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/BERProcessor.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/BERProcessor.java index dc314670d..5da9c8e93 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/BERProcessor.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/BERProcessor.java @@ -150,6 +150,7 @@ public class BERProcessor { * @return a String representation of the current BER structure. * @see java.lang.Object#toString() */ + @Override public String toString() { StringBuffer sb = new StringBuffer(); switch (classOfTag) { diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/DigestedInputStream.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/DigestedInputStream.java index 12119b52c..e871bc5f9 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/DigestedInputStream.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/DigestedInputStream.java @@ -61,6 +61,7 @@ class DigestedInputStream extends FilterInputStream { /** * Not supported. */ + @Override public synchronized void mark(int readlimit) { // Noop, we don't want to support this } @@ -68,6 +69,7 @@ class DigestedInputStream extends FilterInputStream { /** * Always returns false. */ + @Override public boolean markSupported() { return false; } @@ -82,6 +84,7 @@ class DigestedInputStream extends FilterInputStream { * expected digests. * @see java.io.InputStream#read() */ + @Override public int read() throws IOException { if (remaining <= 0) return -1; @@ -118,6 +121,7 @@ class DigestedInputStream extends FilterInputStream { * expected digests. * @see java.io.InputStream#read() */ + @Override public int read(byte[] b, int off, int len) throws IOException { if (remaining <= 0) return -1; @@ -141,6 +145,7 @@ class DigestedInputStream extends FilterInputStream { * @throws IOException always thrown if this method is called since mark/reset is not supported. * @see java.io.InputStream#reset() */ + @Override public synchronized void reset() throws IOException { // Throw IOException, we don't want to support this throw new IOException("Reset not supported"); //$NON-NLS-1$ @@ -149,6 +154,7 @@ class DigestedInputStream extends FilterInputStream { /** * This method is implemented as a read into a bitbucket. */ + @Override public long skip(long n) throws IOException { byte buffer[] = new byte[4096]; long count = 0; diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignedBundleFile.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignedBundleFile.java index 2629971b9..7e9d88cea 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignedBundleFile.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignedBundleFile.java @@ -50,6 +50,7 @@ public class SignedBundleFile extends BundleFileWrapper implements SignedContent } } + @Override public BundleEntry getEntry(String path) { // strip off leading slashes so we can ensure the path matches the one provided in the manifest. if (path.length() > 0 && path.charAt(0) == '/') @@ -85,6 +86,7 @@ public class SignedBundleFile extends BundleFileWrapper implements SignedContent this.nestedEntry = nestedEntry; } + @Override public InputStream getInputStream() throws IOException { InputStream in = signedContent.getDigestInputStream(nestedEntry); if (in == null) @@ -92,22 +94,27 @@ public class SignedBundleFile extends BundleFileWrapper implements SignedContent return in; } + @Override public long getSize() { return nestedEntry.getSize(); } + @Override public String getName() { return nestedEntry.getName(); } + @Override public long getTime() { return nestedEntry.getTime(); } + @Override public URL getLocalURL() { return nestedEntry.getLocalURL(); } + @Override public URL getFileURL() { return nestedEntry.getFileURL(); } @@ -118,30 +125,37 @@ public class SignedBundleFile extends BundleFileWrapper implements SignedContent return signedContent; } + @Override public SignedContentEntry[] getSignedEntries() { return signedContent == null ? null : signedContent.getSignedEntries(); } + @Override public SignedContentEntry getSignedEntry(String name) { return signedContent == null ? null : signedContent.getSignedEntry(name); } + @Override public SignerInfo[] getSignerInfos() { return signedContent == null ? null : signedContent.getSignerInfos(); } + @Override public Date getSigningTime(SignerInfo signerInfo) { return signedContent == null ? null : signedContent.getSigningTime(signerInfo); } + @Override public SignerInfo getTSASignerInfo(SignerInfo signerInfo) { return signedContent == null ? null : signedContent.getTSASignerInfo(signerInfo); } + @Override public boolean isSigned() { return signedContent == null ? false : signedContent.isSigned(); } + @Override public void checkValidity(SignerInfo signerInfo) throws CertificateExpiredException, CertificateNotYetValidException { if (signedContent != null) signedContent.checkValidity(signerInfo); diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignedBundleHook.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignedBundleHook.java index 913d60a11..a9f1a37a3 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignedBundleHook.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignedBundleHook.java @@ -151,6 +151,7 @@ public class SignedBundleHook implements ActivatorHookFactory, BundleFileWrapper } } + @Override public BundleFileWrapper wrapBundleFile(BundleFile bundleFile, Generation generation, boolean base) { try { if (bundleFile != null) { @@ -179,6 +180,7 @@ public class SignedBundleHook implements ActivatorHookFactory, BundleFileWrapper return null; } + @Override public void addHooks(HookRegistry hookRegistry) { container = hookRegistry.getContainer(); hookRegistry.addActivatorHookFactory(this); @@ -201,6 +203,7 @@ public class SignedBundleHook implements ActivatorHookFactory, BundleFileWrapper } } + @Override public SignedContent getSignedContent(File content) throws IOException, InvalidKeyException, SignatureException, CertificateException, NoSuchAlgorithmException, NoSuchProviderException { if (content == null) throw new IllegalArgumentException("null content"); //$NON-NLS-1$ @@ -231,6 +234,7 @@ public class SignedBundleHook implements ActivatorHookFactory, BundleFileWrapper return new SignedContentFile(result.getSignedContent()); } + @Override public SignedContent getSignedContent(Bundle bundle) throws IOException, InvalidKeyException, SignatureException, CertificateException, NoSuchAlgorithmException, NoSuchProviderException, IllegalArgumentException { final Generation generation = (Generation) ((EquinoxBundle) bundle).getModule().getCurrentRevision().getRevisionInfo(); StorageHookImpl hook = generation.getStorageHook(SignedStorageHook.class); @@ -242,6 +246,7 @@ public class SignedBundleHook implements ActivatorHookFactory, BundleFileWrapper return getSignedContent(generation.getBundleFile().getBaseFile()); try { return AccessController.doPrivileged(new PrivilegedExceptionAction<SignedContent>() { + @Override public SignedContent run() throws Exception { return getSignedContent(generation.getBundleFile().getBaseFile()); } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignedContentFile.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignedContentFile.java index f0c19a28a..b80afe18e 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignedContentFile.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignedContentFile.java @@ -39,10 +39,12 @@ public class SignedContentFile implements SignedContent { this.signedContent = signedContent; } + @Override public void checkValidity(SignerInfo signerInfo) throws CertificateExpiredException, CertificateNotYetValidException { signedContent.checkValidity(signerInfo); } + @Override public synchronized SignedContentEntry[] getSignedEntries() { SignedContentEntry[] entries = signedContent.getSignedEntries(); if (signedContent == null) @@ -66,6 +68,7 @@ public class SignedContentFile implements SignedContent { return results; } + @Override public synchronized SignedContentEntry getSignedEntry(String name) { if (getEntryExceptions(false) == null) getSignedEntries(); // populate the entry exceptions @@ -73,18 +76,22 @@ public class SignedContentFile implements SignedContent { return entry == null ? null : new SignedContentFileEntry(entry); } + @Override public SignerInfo[] getSignerInfos() { return signedContent.getSignerInfos(); } + @Override public Date getSigningTime(SignerInfo signerInfo) { return signedContent.getSigningTime(signerInfo); } + @Override public SignerInfo getTSASignerInfo(SignerInfo signerInfo) { return signedContent.getTSASignerInfo(signerInfo); } + @Override public boolean isSigned() { return signedContent.isSigned(); } @@ -102,18 +109,22 @@ public class SignedContentFile implements SignedContent { this.entry = entry; } + @Override public String getName() { return entry.getName(); } + @Override public SignerInfo[] getSignerInfos() { return entry.getSignerInfos(); } + @Override public boolean isSigned() { return entry.isSigned(); } + @Override public void verify() throws IOException, InvalidContentException { // check the entry exceptions map for the entry name Map<String, Throwable> exceptions = getEntryExceptions(false); diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignedContentImpl.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignedContentImpl.java index bb1fa4ccc..f224b2109 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignedContentImpl.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignedContentImpl.java @@ -39,6 +39,7 @@ public class SignedContentImpl implements SignedContent { this.contentMDResults = contentMDResults; } + @Override public SignedContentEntry[] getSignedEntries() { if (contentMDResults == null) return new SignedContentEntry[0]; @@ -51,6 +52,7 @@ public class SignedContentImpl implements SignedContent { return results.toArray(new SignedContentEntry[results.size()]); } + @Override public SignedContentEntry getSignedEntry(String name) { if (contentMDResults == null) return null; @@ -58,10 +60,12 @@ public class SignedContentImpl implements SignedContent { return mdResult == null ? null : new SignedContentEntryImpl(name, (SignerInfo[]) mdResult[0]); } + @Override public SignerInfo[] getSignerInfos() { return signerInfos; } + @Override public Date getSigningTime(SignerInfo signerInfo) { if (tsaSignerInfos == null) return null; @@ -69,6 +73,7 @@ public class SignedContentImpl implements SignedContent { return tsaInfo == null ? null : (Date) tsaInfo[1]; } + @Override public SignerInfo getTSASignerInfo(SignerInfo signerInfo) { if (tsaSignerInfos == null) return null; @@ -76,10 +81,12 @@ public class SignedContentImpl implements SignedContent { return tsaInfo == null ? null : (SignerInfo) tsaInfo[0]; } + @Override public boolean isSigned() { return signerInfos.length > 0; } + @Override public void checkValidity(SignerInfo signer) throws CertificateExpiredException, CertificateNotYetValidException { Date signingTime = getSigningTime(signer); if (checkedValid) @@ -146,18 +153,22 @@ public class SignedContentImpl implements SignedContent { this.entrySigners = entrySigners == null ? EMPTY_SIGNERINFO : entrySigners; } + @Override public String getName() { return entryName; } + @Override public SignerInfo[] getSignerInfos() { return entrySigners; } + @Override public boolean isSigned() { return entrySigners.length > 0; } + @Override public void verify() throws IOException, InvalidContentException { BundleFile currentContent = content; if (currentContent == null) diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignedStorageHook.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignedStorageHook.java index ddadafab3..af70b9207 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignedStorageHook.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignedStorageHook.java @@ -24,6 +24,7 @@ import org.osgi.framework.BundleException; public class SignedStorageHook extends StorageHookFactory<List<SignerInfo>, List<SignerInfo>, SignedStorageHook.StorageHookImpl> { private static final int STORAGE_VERSION = 4; + @Override public int getStorageVersion() { return STORAGE_VERSION; } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignerInfoImpl.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignerInfoImpl.java index b0368061e..d9c760965 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignerInfoImpl.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignerInfoImpl.java @@ -26,14 +26,17 @@ public class SignerInfoImpl implements SignerInfo { this.mdAlgorithm = mdAlgorithm; } + @Override public Certificate[] getCertificateChain() { return chain; } + @Override public Certificate getTrustAnchor() { return trustAnchor; } + @Override public boolean isTrusted() { return trustAnchor != null; } @@ -42,10 +45,12 @@ public class SignerInfoImpl implements SignerInfo { this.trustAnchor = trustAnchor; } + @Override public String getMessageDigestAlgorithm() { return mdAlgorithm; } + @Override public int hashCode() { int result = mdAlgorithm.hashCode(); for (int i = 0; i < chain.length; i++) @@ -56,6 +61,7 @@ public class SignerInfoImpl implements SignerInfo { return result; } + @Override public boolean equals(Object obj) { if (!(obj instanceof SignerInfo)) return false; diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/ContentHandlerFactoryImpl.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/ContentHandlerFactoryImpl.java index 0105f2dd9..c1166cba7 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/ContentHandlerFactoryImpl.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/ContentHandlerFactoryImpl.java @@ -64,6 +64,7 @@ public class ContentHandlerFactoryImpl extends MultiplexingFactory implements ja * @see java.net.ContentHandlerFactory#createContentHandler(String) */ //TODO method is too long... consider reducing indentation (returning quickly) and moving complex steps to private methods + @Override public ContentHandler createContentHandler(String contentType) { //first, we check to see if there exists a built in content handler for //this content type. we can not overwrite built in ContentHandlers @@ -158,10 +159,12 @@ public class ContentHandlerFactoryImpl extends MultiplexingFactory implements ja } } + @Override public Object getParentFactory() { return parentFactory; } + @Override public void setParentFactory(Object parentFactory) { if (this.parentFactory == null) // only allow it to be set once this.parentFactory = (java.net.ContentHandlerFactory) parentFactory; diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/ContentHandlerProxy.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/ContentHandlerProxy.java index 768cdfc81..8b8b18bc7 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/ContentHandlerProxy.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/ContentHandlerProxy.java @@ -71,6 +71,7 @@ public class ContentHandlerProxy extends ContentHandler implements ServiceTracke /** * @see org.osgi.util.tracker.ServiceTrackerCustomizer#addingService(ServiceReference) */ + @Override public ServiceReference<ContentHandler> addingService(ServiceReference<ContentHandler> reference) { //check to see if our contentType is being registered by another service Object prop = reference.getProperty(URLConstants.URL_CONTENT_MIMETYPE); @@ -99,6 +100,7 @@ public class ContentHandlerProxy extends ContentHandler implements ServiceTracke * @see org.osgi.util.tracker.ServiceTrackerCustomizer#modifiedService(ServiceReference, Object) */ + @Override public void modifiedService(ServiceReference<ContentHandler> reference, ServiceReference<ContentHandler> service) { int newrank = getRank(reference); if (reference == contentHandlerServiceReference) { @@ -121,6 +123,7 @@ public class ContentHandlerProxy extends ContentHandler implements ServiceTracke /** * @see org.osgi.util.tracker.ServiceTrackerCustomizer#removedService(ServiceReference, Object) */ + @Override public void removedService(ServiceReference<ContentHandler> reference, ServiceReference<ContentHandler> service) { //check to see if our URLStreamHandler was unregistered. if (reference != contentHandlerServiceReference) @@ -136,6 +139,7 @@ public class ContentHandlerProxy extends ContentHandler implements ServiceTracke * @see java.net.ContentHandler#getContent(URLConnection) */ + @Override public Object getContent(URLConnection uConn) throws IOException { return realHandler.getContent(uConn); } @@ -152,6 +156,7 @@ public class ContentHandlerProxy extends ContentHandler implements ServiceTracke /** * @see java.net.ContentHandler#getContent(URLConnection) */ + @Override public Object getContent(URLConnection uConn) throws IOException { return uConn.getInputStream(); } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/MultiplexingContentHandler.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/MultiplexingContentHandler.java index 7ee72500c..87ea74c33 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/MultiplexingContentHandler.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/MultiplexingContentHandler.java @@ -25,6 +25,7 @@ public class MultiplexingContentHandler extends ContentHandler { this.factory = factory; } + @Override public Object getContent(URLConnection uConn) throws IOException { ContentHandler handler = factory.findAuthorizedContentHandler(contentType); if (handler != null) diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/MultiplexingFactory.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/MultiplexingFactory.java index 50e8444ea..ae6084145 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/MultiplexingFactory.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/MultiplexingFactory.java @@ -71,6 +71,7 @@ public abstract class MultiplexingFactory { // used to get access to the protected SecurityManager#getClassContext method static class InternalSecurityManager extends SecurityManager { + @Override public Class<?>[] getClassContext() { return super.getClassContext(); } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/MultiplexingURLStreamHandler.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/MultiplexingURLStreamHandler.java index 2c00720a3..4ce1cb433 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/MultiplexingURLStreamHandler.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/MultiplexingURLStreamHandler.java @@ -95,6 +95,7 @@ public class MultiplexingURLStreamHandler extends URLStreamHandler { initializeMethods(factory); } + @Override protected URLConnection openConnection(URL url) throws IOException { URLStreamHandler handler = findAuthorizedURLStreamHandler(protocol); if (handler != null) { @@ -130,6 +131,7 @@ public class MultiplexingURLStreamHandler extends URLStreamHandler { throw new MalformedURLException(); } + @Override protected boolean equals(URL url1, URL url2) { URLStreamHandler handler = findAuthorizedURLStreamHandler(protocol); if (handler != null) { @@ -145,6 +147,7 @@ public class MultiplexingURLStreamHandler extends URLStreamHandler { throw new IllegalStateException(); } + @Override protected int getDefaultPort() { URLStreamHandler handler = findAuthorizedURLStreamHandler(protocol); if (handler != null) { @@ -160,6 +163,7 @@ public class MultiplexingURLStreamHandler extends URLStreamHandler { throw new IllegalStateException(); } + @Override protected InetAddress getHostAddress(URL url) { URLStreamHandler handler = findAuthorizedURLStreamHandler(protocol); if (handler != null) { @@ -175,6 +179,7 @@ public class MultiplexingURLStreamHandler extends URLStreamHandler { throw new IllegalStateException(); } + @Override protected int hashCode(URL url) { URLStreamHandler handler = findAuthorizedURLStreamHandler(protocol); if (handler != null) { @@ -190,6 +195,7 @@ public class MultiplexingURLStreamHandler extends URLStreamHandler { throw new IllegalStateException(); } + @Override protected boolean hostsEqual(URL url1, URL url2) { URLStreamHandler handler = findAuthorizedURLStreamHandler(protocol); if (handler != null) { @@ -205,6 +211,7 @@ public class MultiplexingURLStreamHandler extends URLStreamHandler { throw new IllegalStateException(); } + @Override protected void parseURL(URL arg0, String arg1, int arg2, int arg3) { URLStreamHandler handler = factory.findAuthorizedURLStreamHandler(protocol); if (handler != null) { @@ -223,6 +230,7 @@ public class MultiplexingURLStreamHandler extends URLStreamHandler { throw new IllegalStateException(); } + @Override protected boolean sameFile(URL url1, URL url2) { URLStreamHandler handler = findAuthorizedURLStreamHandler(protocol); if (handler != null) { @@ -238,6 +246,7 @@ public class MultiplexingURLStreamHandler extends URLStreamHandler { throw new IllegalStateException(); } + @Override protected void setURL(URL arg0, String arg1, String arg2, int arg3, String arg4, String arg5, String arg6, String arg7, String arg8) { URLStreamHandler handler = findAuthorizedURLStreamHandler(protocol); if (handler != null) { @@ -256,6 +265,7 @@ public class MultiplexingURLStreamHandler extends URLStreamHandler { throw new IllegalStateException(); } + @Override protected String toExternalForm(URL url) { URLStreamHandler handler = findAuthorizedURLStreamHandler(protocol); if (handler != null) { diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/NullURLStreamHandlerService.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/NullURLStreamHandlerService.java index 20e84e934..474a7e942 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/NullURLStreamHandlerService.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/NullURLStreamHandlerService.java @@ -30,30 +30,37 @@ import org.osgi.service.url.URLStreamHandlerSetter; public class NullURLStreamHandlerService implements URLStreamHandlerService { + @Override public URLConnection openConnection(URL u) throws IOException { throw new MalformedURLException(); } + @Override public boolean equals(URL url1, URL url2) { throw new IllegalStateException(); } + @Override public int getDefaultPort() { throw new IllegalStateException(); } + @Override public InetAddress getHostAddress(URL url) { throw new IllegalStateException(); } + @Override public int hashCode(URL url) { throw new IllegalStateException(); } + @Override public boolean hostsEqual(URL url1, URL url2) { throw new IllegalStateException(); } + @Override public boolean sameFile(URL url1, URL url2) { throw new IllegalStateException(); } @@ -66,10 +73,12 @@ public class NullURLStreamHandlerService implements URLStreamHandlerService { throw new IllegalStateException(); } + @Override public String toExternalForm(URL url) { throw new IllegalStateException(); } + @Override public void parseURL(URLStreamHandlerSetter realHandler, URL u, String spec, int start, int limit) { throw new IllegalStateException(); } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/URLStreamHandlerFactoryImpl.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/URLStreamHandlerFactoryImpl.java index 0fb9bc382..1131d7e98 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/URLStreamHandlerFactoryImpl.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/URLStreamHandlerFactoryImpl.java @@ -89,6 +89,7 @@ public class URLStreamHandlerFactoryImpl extends MultiplexingFactory implements * @param protocol The desired protocol * @return a URLStreamHandler for the specific protocol. */ + @Override public URLStreamHandler createURLStreamHandler(String protocol) { // Check if we are recursing if (isRecursive(protocol)) @@ -201,10 +202,12 @@ public class URLStreamHandlerFactoryImpl extends MultiplexingFactory implements } } + @Override public Object getParentFactory() { return parentFactory; } + @Override public void setParentFactory(Object parentFactory) { if (this.parentFactory == null) // only allow it to be set once this.parentFactory = (URLStreamHandlerFactory) parentFactory; diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/URLStreamHandlerProxy.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/URLStreamHandlerProxy.java index ea9e1c8ca..f8efc54b3 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/URLStreamHandlerProxy.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/URLStreamHandlerProxy.java @@ -78,6 +78,7 @@ public class URLStreamHandlerProxy extends URLStreamHandler implements ServiceTr /** * @see java.net.URLStreamHandler#equals(URL, URL) */ + @Override protected boolean equals(URL url1, URL url2) { return realHandlerService.equals(url1, url2); } @@ -85,6 +86,7 @@ public class URLStreamHandlerProxy extends URLStreamHandler implements ServiceTr /** * @see java.net.URLStreamHandler#getDefaultPort() */ + @Override protected int getDefaultPort() { return realHandlerService.getDefaultPort(); } @@ -92,6 +94,7 @@ public class URLStreamHandlerProxy extends URLStreamHandler implements ServiceTr /** * @see java.net.URLStreamHandler#getHostAddress(URL) */ + @Override protected InetAddress getHostAddress(URL url) { return realHandlerService.getHostAddress(url); } @@ -99,6 +102,7 @@ public class URLStreamHandlerProxy extends URLStreamHandler implements ServiceTr /** * @see java.net.URLStreamHandler#hashCode(URL) */ + @Override protected int hashCode(URL url) { return realHandlerService.hashCode(url); } @@ -106,6 +110,7 @@ public class URLStreamHandlerProxy extends URLStreamHandler implements ServiceTr /** * @see java.net.URLStreamHandler#hostsEqual(URL, URL) */ + @Override protected boolean hostsEqual(URL url1, URL url2) { return realHandlerService.hostsEqual(url1, url2); } @@ -113,6 +118,7 @@ public class URLStreamHandlerProxy extends URLStreamHandler implements ServiceTr /** * @see java.net.URLStreamHandler#openConnection(URL) */ + @Override protected URLConnection openConnection(URL url) throws IOException { return realHandlerService.openConnection(url); } @@ -120,6 +126,7 @@ public class URLStreamHandlerProxy extends URLStreamHandler implements ServiceTr /** * @see java.net.URLStreamHandler#parseURL(URL, String, int, int) */ + @Override protected void parseURL(URL url, String str, int start, int end) { realHandlerService.parseURL(urlSetter, url, str, start, end); } @@ -127,6 +134,7 @@ public class URLStreamHandlerProxy extends URLStreamHandler implements ServiceTr /** * @see java.net.URLStreamHandler#sameFile(URL, URL) */ + @Override protected boolean sameFile(URL url1, URL url2) { return realHandlerService.sameFile(url1, url2); } @@ -134,6 +142,7 @@ public class URLStreamHandlerProxy extends URLStreamHandler implements ServiceTr /** * @see java.net.URLStreamHandler#toExternalForm(URL) */ + @Override protected String toExternalForm(URL url) { return realHandlerService.toExternalForm(url); } @@ -141,11 +150,13 @@ public class URLStreamHandlerProxy extends URLStreamHandler implements ServiceTr /** * @see java.net.URLStreamHandler#setURL(URL, String, String, int, String, String, String, String, String) */ + @Override public void setURL(URL u, String protocol, String host, int port, String authority, String userInfo, String file, String query, String ref) { super.setURL(u, protocol, host, port, authority, userInfo, file, query, ref); } @SuppressWarnings("deprecation") + @Override public void setURL(URL url, String protocol, String host, int port, String file, String ref) { //using non-deprecated URLStreamHandler.setURL method. @@ -156,6 +167,7 @@ public class URLStreamHandlerProxy extends URLStreamHandler implements ServiceTr /** * @see org.osgi.util.tracker.ServiceTrackerCustomizer#addingService(ServiceReference) */ + @Override public ServiceReference<URLStreamHandlerService> addingService(ServiceReference<URLStreamHandlerService> reference) { //check to see if our protocol is being registered by another service Object prop = reference.getProperty(URLConstants.URL_HANDLER_PROTOCOL); @@ -184,6 +196,7 @@ public class URLStreamHandlerProxy extends URLStreamHandler implements ServiceTr * @see org.osgi.util.tracker.ServiceTrackerCustomizer#modifiedService(ServiceReference, Object) */ // check to see if the ranking has changed. If so, re-select a new URLHandler + @Override public void modifiedService(ServiceReference<URLStreamHandlerService> reference, ServiceReference<URLStreamHandlerService> service) { int newRank = getRank(reference); if (reference == urlStreamServiceReference) { @@ -206,6 +219,7 @@ public class URLStreamHandlerProxy extends URLStreamHandler implements ServiceTr /** * @see org.osgi.util.tracker.ServiceTrackerCustomizer#removedService(ServiceReference, Object) */ + @Override public void removedService(ServiceReference<URLStreamHandlerService> reference, ServiceReference<URLStreamHandlerService> service) { // check to see if our URLStreamHandler was unregistered. if (reference != urlStreamServiceReference) @@ -224,6 +238,7 @@ public class URLStreamHandlerProxy extends URLStreamHandler implements ServiceTr return (property instanceof Integer) ? ((Integer) property).intValue() : 0; } + @Override protected URLConnection openConnection(URL u, Proxy p) throws IOException { try { Method openConn = realHandlerService.getClass().getMethod("openConnection", new Class[] {URL.class, Proxy.class}); //$NON-NLS-1$ diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/URLStreamHandlerSetter.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/URLStreamHandlerSetter.java index 792f004f3..263a39c49 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/URLStreamHandlerSetter.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/URLStreamHandlerSetter.java @@ -28,6 +28,7 @@ public class URLStreamHandlerSetter implements org.osgi.service.url.URLStreamHan * @see org.osgi.service.url.URLStreamHandlerSetter#setURL(URL, String, String, int, String, String) * @deprecated */ + @Override public void setURL(URL url, String protocol, String host, int port, String file, String ref) { handlerProxy.setURL(url, protocol, host, port, file, ref); } @@ -35,6 +36,7 @@ public class URLStreamHandlerSetter implements org.osgi.service.url.URLStreamHan /** * @see org.osgi.service.url.URLStreamHandlerSetter#setURL(URL, String, String, int, String, String, String, String, String) */ + @Override public void setURL(URL url, String protocol, String host, int port, String authority, String userInfo, String path, String query, String ref) { handlerProxy.setURL(url, protocol, host, port, authority, userInfo, path, query, ref); } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/weaving/WeavingHookConfigurator.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/weaving/WeavingHookConfigurator.java index eee15dae6..24acd3b27 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/weaving/WeavingHookConfigurator.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/weaving/WeavingHookConfigurator.java @@ -45,6 +45,7 @@ public class WeavingHookConfigurator extends ClassLoaderHook { return container.getServiceRegistry(); } + @Override public byte[] processClass(String name, byte[] classbytes, ClasspathEntry classpathEntry, BundleEntry entry, ClasspathManager manager) { ServiceRegistry registry = getRegistry(); if (registry == null) @@ -83,6 +84,7 @@ public class WeavingHookConfigurator extends ClassLoaderHook { return null; } + @Override public void recordClassDefine(String name, Class<?> clazz, byte[] classbytes, ClasspathEntry classpathEntry, BundleEntry entry, ClasspathManager manager) { // here we assume the stack contans a woven class with the same name as the class we are defining. WovenClassContext context = wovenClassContext.get(); diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/weaving/WovenClassImpl.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/weaving/WovenClassImpl.java index ce79e1188..e6bec24c6 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/weaving/WovenClassImpl.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/weaving/WovenClassImpl.java @@ -66,6 +66,7 @@ public final class WovenClassImpl implements WovenClass, HookContext { setState(TRANSFORMING); } + @Override public byte[] getBytes() { if ((hookFlags & FLAG_HOOKSCOMPLETE) == 0) { checkPermission(); @@ -79,6 +80,7 @@ public final class WovenClassImpl implements WovenClass, HookContext { return results; } + @Override public void setBytes(byte[] newBytes) { checkPermission(); if (newBytes == null) @@ -95,6 +97,7 @@ public final class WovenClassImpl implements WovenClass, HookContext { sm.checkPermission(new AdminPermission(loader.getWiring().getBundle(), AdminPermission.WEAVE)); } + @Override public List<String> getDynamicImports() { if ((hookFlags & FLAG_HOOKSCOMPLETE) == 0) return dynamicImports; @@ -102,6 +105,7 @@ public final class WovenClassImpl implements WovenClass, HookContext { return Collections.unmodifiableList(dynamicImports); } + @Override public boolean isWeavingComplete() { return (hookFlags & FLAG_WEAVINGCOMPLETE) != 0; } @@ -130,22 +134,27 @@ public final class WovenClassImpl implements WovenClass, HookContext { notifyWovenClassListeners(); } + @Override public String getClassName() { return className; } + @Override public ProtectionDomain getProtectionDomain() { return classpathEntry.getDomain(); } + @Override public Class<?> getDefinedClass() { return clazz; } + @Override public BundleWiring getBundleWiring() { return loader.getWiring(); } + @Override public void call(final Object hook, ServiceRegistration<?> hookRegistration) throws Exception { if (error != null) return; // do not call any other hooks once an error has occurred. @@ -196,10 +205,12 @@ public final class WovenClassImpl implements WovenClass, HookContext { return true; } + @Override public String getHookMethodName() { return "weave"; //$NON-NLS-1$ } + @Override public String getHookClassName() { return weavingHookName; } @@ -237,6 +248,7 @@ public final class WovenClassImpl implements WovenClass, HookContext { else { try { AccessController.doPrivileged(new PrivilegedExceptionAction<Void>() { + @Override public Void run() { registry.notifyHooksPrivileged(context); return null; @@ -259,6 +271,7 @@ public final class WovenClassImpl implements WovenClass, HookContext { } else { try { AccessController.doPrivileged(new PrivilegedExceptionAction<Void>() { + @Override public Void run() { registry.notifyHooksPrivileged(WovenClassImpl.this); return null; @@ -320,6 +333,7 @@ public final class WovenClassImpl implements WovenClass, HookContext { } } + @Override public String toString() { return className; } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/launch/Equinox.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/launch/Equinox.java index 37f284112..40d7bad54 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/launch/Equinox.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/launch/Equinox.java @@ -110,58 +110,72 @@ public class Equinox implements Framework { return systemBundle.compareTo(o); } + @Override public void start(int options) throws BundleException { systemBundle.start(options); } + @Override public void start() throws BundleException { systemBundle.start(); } + @Override public void stop(int options) throws BundleException { systemBundle.stop(options); } + @Override public void stop() throws BundleException { systemBundle.stop(); } + @Override public void update(InputStream input) throws BundleException { systemBundle.update(input); } + @Override public void update() throws BundleException { systemBundle.update(); } + @Override public void uninstall() throws BundleException { systemBundle.uninstall(); } + @Override public long getBundleId() { return systemBundle.getBundleId(); } + @Override public String getLocation() { return systemBundle.getLocation(); } + @Override public String getSymbolicName() { return systemBundle.getSymbolicName(); } + @Override public Enumeration<String> getEntryPaths(String path) { return systemBundle.getEntryPaths(path); } + @Override public URL getEntry(String path) { return systemBundle.getEntry(path); } + @Override public Enumeration<URL> findEntries(String path, String filePattern, boolean recurse) { return systemBundle.findEntries(path, filePattern, recurse); } + @Override public <A> A adapt(Class<A> type) { return systemBundle.adapt(type); } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/launch/EquinoxFactory.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/launch/EquinoxFactory.java index 98dc014f4..c836951ab 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/launch/EquinoxFactory.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/launch/EquinoxFactory.java @@ -23,6 +23,7 @@ import org.osgi.framework.launch.FrameworkFactory; */ public class EquinoxFactory implements FrameworkFactory { + @Override public Framework newFramework(Map<String, String> configuration) { return new Equinox(configuration); } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/service/pluginconversion/PluginConversionException.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/service/pluginconversion/PluginConversionException.java index 0012daf1c..474242bd9 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/service/pluginconversion/PluginConversionException.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/service/pluginconversion/PluginConversionException.java @@ -68,6 +68,7 @@ public class PluginConversionException extends Exception { * * @return the nested exception or <code>null</code> */ + @Override public Throwable getCause() { return cause; } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/service/resolver/BundleDelta.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/service/resolver/BundleDelta.java index 49f8bfeae..72e8967be 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/service/resolver/BundleDelta.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/service/resolver/BundleDelta.java @@ -125,5 +125,6 @@ public interface BundleDelta extends Comparable<BundleDelta> { * comparable with the receiver. * @since 3.7 */ + @Override public int compareTo(BundleDelta obj); } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/service/resolver/BundleDescription.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/service/resolver/BundleDescription.java index 6207b37e6..f96b546df 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/service/resolver/BundleDescription.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/service/resolver/BundleDescription.java @@ -33,6 +33,7 @@ public interface BundleDescription extends BaseDescription, BundleRevision { * @return The bundle symbolic name or null if the bundle * does not have a symbolic name. */ + @Override public String getSymbolicName(); /** @@ -168,6 +169,7 @@ public interface BundleDescription extends BaseDescription, BundleRevision { * * @return String representation of this bundle. */ + @Override public String toString(); /** diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/service/resolver/DisabledInfo.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/service/resolver/DisabledInfo.java index 604e6cb6a..7fcb76641 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/service/resolver/DisabledInfo.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/service/resolver/DisabledInfo.java @@ -70,6 +70,7 @@ public final class DisabledInfo { return bundle; } + @Override public boolean equals(Object obj) { if (obj == this) return true; @@ -83,6 +84,7 @@ public final class DisabledInfo { return false; } + @Override public int hashCode() { final int prime = 31; int result = 1; diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/service/resolver/GenericDescription.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/service/resolver/GenericDescription.java index 05a1a93ef..c18431ab5 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/service/resolver/GenericDescription.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/service/resolver/GenericDescription.java @@ -50,6 +50,7 @@ public interface GenericDescription extends BaseDescription { * @deprecated matching should only be done against a capability's * attributes. */ + @Override public String getName(); /** @@ -63,5 +64,6 @@ public interface GenericDescription extends BaseDescription { * @deprecated matching should only be done against a capability's * attributes. */ + @Override public Version getVersion(); } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/service/resolver/NativeCodeDescription.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/service/resolver/NativeCodeDescription.java index 09f087b99..43f5a2674 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/service/resolver/NativeCodeDescription.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/service/resolver/NativeCodeDescription.java @@ -76,6 +76,7 @@ public interface NativeCodeDescription extends BaseDescription, Comparable<Nativ * code description is less than, equal to, or greater than the specified object. * @since 3.7 */ + @Override public int compareTo(NativeCodeDescription other); /** diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/signedcontent/InvalidContentException.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/signedcontent/InvalidContentException.java index ea8a0222b..a01b67a3c 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/signedcontent/InvalidContentException.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/signedcontent/InvalidContentException.java @@ -43,6 +43,7 @@ public class InvalidContentException extends IOException { * * @return The cause of this exception or <code>null</code> if no cause was created. */ + @Override public Throwable getCause() { return cause; } @@ -56,6 +57,7 @@ public class InvalidContentException extends IOException { * <code>IllegalStateException</code> since the cause of this * exception can only be set when constructed. */ + @Override public Throwable initCause(Throwable t) { throw new IllegalStateException(); } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/BundleLocalizationImpl.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/BundleLocalizationImpl.java index 77155fdcc..28950e758 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/BundleLocalizationImpl.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/BundleLocalizationImpl.java @@ -36,6 +36,7 @@ public class BundleLocalizationImpl implements BundleLocalization { * @return A <code>ResourceBundle</code> object for the given bundle and locale. * If null is passed for the locale parameter, the default locale is used. */ + @Override public ResourceBundle getLocalization(Bundle bundle, String locale) { Module m = ((EquinoxBundle) bundle).getModule(); ModuleRevision r = m.getCurrentRevision(); diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/ManifestLocalization.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/ManifestLocalization.java index 324fc43fa..cf49f7e95 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/ManifestLocalization.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/ManifestLocalization.java @@ -230,14 +230,17 @@ public class ManifestLocalization { super(in); } + @Override public void setParent(ResourceBundle parent) { super.setParent(parent); } + @Override public boolean isEmpty() { return false; } + @Override public boolean isStemEmpty() { return parent == null; } @@ -252,24 +255,29 @@ public class ManifestLocalization { } @SuppressWarnings("unchecked") + @Override public Enumeration<String> getKeys() { return Collections.enumeration(Collections.EMPTY_LIST); } + @Override protected Object handleGetObject(String arg0) throws MissingResourceException { return null; } + @Override public void setParent(ResourceBundle parent) { super.setParent(parent); } + @Override public boolean isEmpty() { if (parent == null) return true; return ((BundleResourceBundle) parent).isEmpty(); } + @Override public boolean isStemEmpty() { if (defaultRoot.equals(localeString)) return false; diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java index ddea8b6f5..9f30acd13 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java @@ -555,6 +555,7 @@ public class Storage { /** * @throws IOException */ + @Override public void connect() throws IOException { connected = true; } @@ -562,6 +563,7 @@ public class Storage { /** * @throws IOException */ + @Override public InputStream getInputStream() throws IOException { return (in); } @@ -580,6 +582,7 @@ public class Storage { if (System.getSecurityManager() == null) return getUpdateLocation0(module); return AccessController.doPrivileged(new PrivilegedAction<String>() { + @Override public String run() { return getUpdateLocation0(module); } @@ -922,6 +925,7 @@ public class Storage { return getContentFile0(staged, isReference, bundleID, generationID); try { return AccessController.doPrivileged(new PrivilegedExceptionAction<File>() { + @Override public File run() throws BundleException { return getContentFile0(staged, isReference, bundleID, generationID); } @@ -1030,6 +1034,7 @@ public class Storage { return stageContent0(in, sourceURL); try { return AccessController.doPrivileged(new PrivilegedExceptionAction<File>() { + @Override public File run() throws BundleException { return stageContent0(in, sourceURL); } @@ -1186,6 +1191,7 @@ public class Storage { } else { try { AccessController.doPrivileged(new PrivilegedExceptionAction<Void>() { + @Override public Void run() throws IOException { delete0(delete); return null; @@ -1216,6 +1222,7 @@ public class Storage { } else { try { AccessController.doPrivileged(new PrivilegedExceptionAction<Void>() { + @Override public Void run() throws IOException { save0(); return null; @@ -1859,6 +1866,7 @@ public class Storage { private int curDataIndex = 0; private URL nextElement = null; + @Override public boolean hasMoreElements() { if (nextElement != null) return true; @@ -1866,6 +1874,7 @@ public class Storage { return nextElement != null; } + @Override public URL nextElement() { if (!hasMoreElements()) throw new NoSuchElementException(); diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/SystemBundleFile.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/SystemBundleFile.java index 312f6f6c2..c959047c9 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/SystemBundleFile.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/SystemBundleFile.java @@ -39,26 +39,32 @@ public class SystemBundleFile extends BundleFile { if (BundleInfo.OSGI_BUNDLE_MANIFEST.equals(path)) { return new BundleEntry() { + @Override public InputStream getInputStream() throws IOException { return getManifestURL().openStream(); } + @Override public long getSize() { return 0; } + @Override public String getName() { return BundleInfo.OSGI_BUNDLE_MANIFEST; } + @Override public long getTime() { return 0; } + @Override public URL getLocalURL() { return getManifestURL(); } + @Override public URL getFileURL() { return null; } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/BundleEntry.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/BundleEntry.java index 0fa694a40..81ccd3165 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/BundleEntry.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/BundleEntry.java @@ -79,6 +79,7 @@ public abstract class BundleEntry { * * @return String representation of this BundleEntry. */ + @Override public String toString() { return (getName()); } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/BundleFile.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/BundleFile.java index eb41c5588..6fba2d6c4 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/BundleFile.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/BundleFile.java @@ -177,6 +177,7 @@ abstract public class BundleFile { return mruIndex; } + @Override public String toString() { return String.valueOf(basefile); } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/DirBundleFile.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/DirBundleFile.java index cfa886448..366c82b47 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/DirBundleFile.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/DirBundleFile.java @@ -48,6 +48,7 @@ public class DirBundleFile extends BundleFile { return enableStrictBundleEntryPath ? secureAction.getCanonicalFile(basefile) : basefile; } + @Override public File getFile(String path, boolean nativeCode) { final boolean checkInBundle = path != null && path.indexOf(POINTER_UPPER_DIRECTORY) >= 0; File file = new File(this.basefile, path); @@ -105,6 +106,7 @@ public class DirBundleFile extends BundleFile { return file; } + @Override public BundleEntry getEntry(String path) { File filePath = getFile(path, false); if (filePath == null) @@ -112,11 +114,13 @@ public class DirBundleFile extends BundleFile { return new FileBundleEntry(filePath, path); } + @Override public boolean containsDir(String dir) { File dirPath = getFile(dir, false); return dirPath != null && BundleFile.secureAction.isDirectory(dirPath); } + @Override public Enumeration<String> getEntryPaths(String path, boolean recurse) { if (path.length() > 0 && path.charAt(0) == '/') path = path.substring(1); @@ -145,10 +149,12 @@ public class DirBundleFile extends BundleFile { return Collections.enumeration(entries); } + @Override public void close() { // nothing to do. } + @Override public void open() { // nothing to do. } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/DirZipBundleEntry.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/DirZipBundleEntry.java index b0d4e9872..8e6237967 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/DirZipBundleEntry.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/DirZipBundleEntry.java @@ -42,23 +42,28 @@ public class DirZipBundleEntry extends BundleEntry { /** * @throws IOException */ + @Override public InputStream getInputStream() throws IOException { return new ByteArrayInputStream(new byte[0]); } + @Override public long getSize() { return 0; } + @Override public String getName() { return name; } + @Override public long getTime() { return 0; } @SuppressWarnings("deprecation") + @Override public URL getLocalURL() { try { return new URL("jar:" + bundleFile.basefile.toURL() + "!/" + name); //$NON-NLS-1$ //$NON-NLS-2$ @@ -69,6 +74,7 @@ public class DirZipBundleEntry extends BundleEntry { } @SuppressWarnings("deprecation") + @Override public URL getFileURL() { try { return bundleFile.extractDirectory(name).toURL(); diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/FileBundleEntry.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/FileBundleEntry.java index f1a72623b..77d605bce 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/FileBundleEntry.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/FileBundleEntry.java @@ -54,6 +54,7 @@ public class FileBundleEntry extends BundleEntry { * @return InputStream for the entry * @exception java.io.IOException */ + @Override public InputStream getInputStream() throws IOException { return BundleFile.secureAction.getFileInputStream(file); } @@ -63,6 +64,7 @@ public class FileBundleEntry extends BundleEntry { * * @return size of entry */ + @Override public long getSize() { return BundleFile.secureAction.length(file); } @@ -72,6 +74,7 @@ public class FileBundleEntry extends BundleEntry { * * @return name of entry */ + @Override public String getName() { return (name); } @@ -83,15 +86,18 @@ public class FileBundleEntry extends BundleEntry { * * @return last modification time. */ + @Override public long getTime() { return BundleFile.secureAction.lastModified(file); } + @Override public URL getLocalURL() { return getFileURL(); } @SuppressWarnings("deprecation") + @Override public URL getFileURL() { try { return file.toURL(); diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/MRUBundleFileList.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/MRUBundleFileList.java index c8253481a..e6d8caf09 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/MRUBundleFileList.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/MRUBundleFileList.java @@ -181,6 +181,7 @@ public class MRUBundleFileList implements EventDispatcher<Object, Object, Bundle useStampList[index] = ++curUseStamp; } + @Override public final void dispatchEvent(Object eventListener, Object listenerObject, int eventAction, BundleFile eventObject) { if (firstDispatch) { // used to work around bug 275166; we don't want to leak the TCCL in this thread. diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/NestedDirBundleFile.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/NestedDirBundleFile.java index 67051edbf..4d8fc7c68 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/NestedDirBundleFile.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/NestedDirBundleFile.java @@ -61,6 +61,7 @@ public class NestedDirBundleFile extends BundleFile { this.filterPrefixes = filterPrefixes; } + @Override public void close() { // do nothing. } @@ -86,6 +87,7 @@ public class NestedDirBundleFile extends BundleFile { return filterPath(path); } + @Override public BundleEntry getEntry(String path) { if (filterPath(path)) { return null; @@ -93,6 +95,7 @@ public class NestedDirBundleFile extends BundleFile { return baseBundleFile.getEntry(prependNestedDir(path)); } + @Override public boolean containsDir(String dir) { if (dir == null) return false; @@ -108,6 +111,7 @@ public class NestedDirBundleFile extends BundleFile { return new StringBuffer(nestedDirName).append(path).toString(); } + @Override public Enumeration<String> getEntryPaths(String path, boolean recurse) { if (filterDir(path)) { return null; @@ -118,10 +122,12 @@ public class NestedDirBundleFile extends BundleFile { return null; return new Enumeration<String>() { + @Override public boolean hasMoreElements() { return basePaths.hasMoreElements(); } + @Override public String nextElement() { String next = basePaths.nextElement(); return next.substring(cpLength); @@ -129,6 +135,7 @@ public class NestedDirBundleFile extends BundleFile { }; } + @Override public File getFile(String entry, boolean nativeCode) { // getFile is only valid if this is a root bundle file. // TODO to catch bugs we probably should throw new UnsupportedOperationException() @@ -138,6 +145,7 @@ public class NestedDirBundleFile extends BundleFile { /** * @throws IOException */ + @Override public void open() throws IOException { // do nothing } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/ZipBundleEntry.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/ZipBundleEntry.java index 187874578..8dba5fdfc 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/ZipBundleEntry.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/ZipBundleEntry.java @@ -52,6 +52,7 @@ public class ZipBundleEntry extends BundleEntry { * @return InputStream for the entry * @exception java.io.IOException */ + @Override public InputStream getInputStream() throws IOException { return bundleFile.getInputStream(zipEntry); } @@ -61,6 +62,7 @@ public class ZipBundleEntry extends BundleEntry { * * @return size of entry */ + @Override public long getSize() { return zipEntry.getSize(); } @@ -70,6 +72,7 @@ public class ZipBundleEntry extends BundleEntry { * * @return name of entry */ + @Override public String getName() { return zipEntry.getName(); } @@ -81,11 +84,13 @@ public class ZipBundleEntry extends BundleEntry { * * @return last modification time. */ + @Override public long getTime() { return zipEntry.getTime(); } @SuppressWarnings("deprecation") + @Override public URL getLocalURL() { try { return new URL("jar:" + bundleFile.basefile.toURL() + "!/" + zipEntry.getName()); //$NON-NLS-1$//$NON-NLS-2$ @@ -96,6 +101,7 @@ public class ZipBundleEntry extends BundleEntry { } @SuppressWarnings("deprecation") + @Override public URL getFileURL() { try { File file = bundleFile.getFile(zipEntry.getName(), false); diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/ZipBundleFile.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/ZipBundleFile.java index b80ed90ef..c1cb4d84d 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/ZipBundleFile.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/bundlefile/ZipBundleFile.java @@ -197,6 +197,7 @@ public class ZipBundleFile extends BundleFile { return generation.getExtractFile(".cp", entryName); //$NON-NLS-1$ } + @Override public File getFile(String entry, boolean nativeCode) { if (!lockOpen()) { return null; @@ -246,6 +247,7 @@ public class ZipBundleFile extends BundleFile { return null; } + @Override public boolean containsDir(String dir) { if (!lockOpen()) { return false; @@ -282,6 +284,7 @@ public class ZipBundleFile extends BundleFile { return false; } + @Override public BundleEntry getEntry(String path) { if (!lockOpen()) { return null; @@ -356,6 +359,7 @@ public class ZipBundleFile extends BundleFile { } } + @Override public void close() throws IOException { openLock.lock(); try { @@ -418,6 +422,7 @@ public class ZipBundleFile extends BundleFile { return false; } + @Override public void open() throws IOException { getZipFile(false); } @@ -467,6 +472,7 @@ public class ZipBundleFile extends BundleFile { incrementReference(); } + @Override public int available() throws IOException { try { return super.available(); @@ -475,6 +481,7 @@ public class ZipBundleFile extends BundleFile { } } + @Override public void close() throws IOException { try { super.close(); @@ -490,6 +497,7 @@ public class ZipBundleFile extends BundleFile { } } + @Override public int read() throws IOException { try { return super.read(); @@ -498,6 +506,7 @@ public class ZipBundleFile extends BundleFile { } } + @Override public int read(byte[] var0, int var1, int var2) throws IOException { try { return super.read(var0, var1, var2); @@ -506,6 +515,7 @@ public class ZipBundleFile extends BundleFile { } } + @Override public int read(byte[] var0) throws IOException { try { return super.read(var0); @@ -514,6 +524,7 @@ public class ZipBundleFile extends BundleFile { } } + @Override public void reset() throws IOException { try { super.reset(); @@ -522,6 +533,7 @@ public class ZipBundleFile extends BundleFile { } } + @Override public long skip(long var0) throws IOException { try { return super.skip(var0); diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/BundleResourceHandler.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/BundleResourceHandler.java index f33a490a9..b0ada55f0 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/BundleResourceHandler.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/BundleResourceHandler.java @@ -48,6 +48,7 @@ public abstract class BundleResourceHandler extends URLStreamHandler { /** * Parse reference URL. */ + @Override protected void parseURL(URL url, String str, int start, int end) { if (end < start) return; @@ -145,6 +146,7 @@ public abstract class BundleResourceHandler extends URLStreamHandler { * * @exception IOException thrown if an IO error occurs during connection establishment */ + @Override protected URLConnection openConnection(URL url) throws IOException { if (bundleEntry != null) // if the bundleEntry is not null then return quick return (new BundleURLConnection(url, bundleEntry)); @@ -189,6 +191,7 @@ public abstract class BundleResourceHandler extends URLStreamHandler { * @param url the URL. * @return a string representation of the URL. */ + @Override protected String toExternalForm(URL url) { StringBuffer result = new StringBuffer(url.getProtocol()); result.append("://"); //$NON-NLS-1$ @@ -216,6 +219,7 @@ public abstract class BundleResourceHandler extends URLStreamHandler { return (result.toString()); } + @Override protected int hashCode(URL url) { int hash = 0; String protocol = url.getProtocol(); @@ -236,14 +240,17 @@ public abstract class BundleResourceHandler extends URLStreamHandler { return hash; } + @Override protected boolean equals(URL url1, URL url2) { return sameFile(url1, url2); } + @Override protected synchronized InetAddress getHostAddress(URL url) { return null; } + @Override protected boolean hostsEqual(URL url1, URL url2) { String host1 = url1.getHost(); String host2 = url2.getHost(); @@ -252,6 +259,7 @@ public abstract class BundleResourceHandler extends URLStreamHandler { return (host1 == null && host2 == null); } + @Override protected boolean sameFile(URL url1, URL url2) { // do a hashcode test to allow each handler to check the adaptor first if (url1.hashCode() != url2.hashCode()) diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/BundleURLConnection.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/BundleURLConnection.java index e79a6f8b8..4b92876b7 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/BundleURLConnection.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/BundleURLConnection.java @@ -50,6 +50,7 @@ public class BundleURLConnection extends URLConnection { this.contentType = null; } + @Override public synchronized void connect() throws IOException { if (!connected) { if (bundleEntry != null) { @@ -61,10 +62,12 @@ public class BundleURLConnection extends URLConnection { } } + @Override public int getContentLength() { return ((int) bundleEntry.getSize()); } + @Override public String getContentType() { if (contentType == null) { contentType = guessContentTypeFromName(bundleEntry.getName()); @@ -89,14 +92,17 @@ public class BundleURLConnection extends URLConnection { return (contentType); } + @Override public boolean getDoInput() { return (true); } + @Override public boolean getDoOutput() { return (false); } + @Override public InputStream getInputStream() throws IOException { if (!connected) { connect(); @@ -105,6 +111,7 @@ public class BundleURLConnection extends URLConnection { return (in); } + @Override public long getLastModified() { long lastModified = bundleEntry.getTime(); diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/BundleURLConverter.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/BundleURLConverter.java index 2313ecf92..2e4afbc11 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/BundleURLConverter.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/BundleURLConverter.java @@ -31,6 +31,7 @@ public class BundleURLConverter implements URLConverter { /* (non-Javadoc) * @see org.eclipse.osgi.service.urlconversion.URLConverter#toFileURL(java.net.URL) */ + @Override public URL toFileURL(URL url) throws IOException { URLConnection connection = url.openConnection(); if (connection instanceof BundleURLConnection) { @@ -49,6 +50,7 @@ public class BundleURLConverter implements URLConverter { /* (non-Javadoc) * @see org.eclipse.osgi.service.urlconversion.URLConverter#resolve(java.net.URL) */ + @Override public URL resolve(URL url) throws IOException { URLConnection connection = url.openConnection(); if (connection instanceof BundleURLConnection) diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/bundleentry/Handler.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/bundleentry/Handler.java index 328b7e397..3e9523290 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/bundleentry/Handler.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/bundleentry/Handler.java @@ -35,6 +35,7 @@ public class Handler extends BundleResourceHandler { super(container, bundleEntry); } + @Override protected BundleEntry findBundleEntry(URL url, Module module) throws IOException { ModuleRevision revision = module.getCurrentRevision(); BundleInfo.Generation revisionInfo = (BundleInfo.Generation) revision.getRevisionInfo(); diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/bundleresource/Handler.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/bundleresource/Handler.java index 0de5a821e..796d10fe1 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/bundleresource/Handler.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/bundleresource/Handler.java @@ -35,6 +35,7 @@ public class Handler extends BundleResourceHandler { super(container, bundleEntry); } + @Override protected BundleEntry findBundleEntry(URL url, Module module) throws IOException { ModuleRevision current = module.getCurrentRevision(); ModuleWiring wiring = current == null ? null : current.getWiring(); diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/reference/Handler.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/reference/Handler.java index de85c64c8..a6b1c4f66 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/reference/Handler.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/reference/Handler.java @@ -46,10 +46,12 @@ public class Handler extends URLStreamHandler { /** * @throws IOException */ + @Override protected URLConnection openConnection(URL url) throws IOException { return new ReferenceURLConnection(url, installPath); } + @Override protected void parseURL(URL url, String str, int start, int end) { if (end < start) { return; diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/reference/ReferenceInputStream.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/reference/ReferenceInputStream.java index 1e12a6106..b9ff45f04 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/reference/ReferenceInputStream.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/reference/ReferenceInputStream.java @@ -31,6 +31,7 @@ public class ReferenceInputStream extends InputStream { /* This method should not be called. */ + @Override public int read() throws IOException { throw new IOException(); } diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/reference/ReferenceURLConnection.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/reference/ReferenceURLConnection.java index d219c6017..80041aa15 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/reference/ReferenceURLConnection.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/url/reference/ReferenceURLConnection.java @@ -39,6 +39,7 @@ public class ReferenceURLConnection extends URLConnection { this.installPath = installPath; } + @Override public synchronized void connect() throws IOException { if (!connected) { // TODO assumes that reference URLs are always based on file: URLs. @@ -91,14 +92,17 @@ public class ReferenceURLConnection extends URLConnection { } } + @Override public boolean getDoInput() { return true; } + @Override public boolean getDoOutput() { return false; } + @Override public InputStream getInputStream() throws IOException { if (!connected) { connect(); |