Community
Participate
Working Groups
Build Identifier: The Coordinator.join(long) method should throw an IllegalArgumentException if the provided timeout is negative. Reproducible: Always
I'll provide a patch as soon as I can figure out why my environment is creating patches that indicate every line of code within the Java file has changed. To fix this, the first three lines within the join() method simply need to be removed. // Treat negative arguments as if they were zero. if (timeInMillis < 0) timeInMillis = 0;
In addition to the IAE for the Coordination.join() method, the following changes need to be made. Type int has changed to long for all timeout related arguments. Support for the new Coordination.RELEASED exception. Within Coordination.extendTimeout(), simply returning 0 if the timer task could not be cancelled is against the spec. Needs to be changed to call Coordination.join() then throw the appropriate exception once it returns. New Coordination.getBundle() method added. New CoordinationException.WRONG_THREAD type in conjunction with new requirement on Coordination.end() which mandates that a coordination can only be ended by the same thread that pushed it onto the thread local stack. Coordination.fail() should not remove the coordination from the thread local stack. New requirement to unwind the thread local stack if a coordination that's not at the top of the stack is ended. New Coordination.getEnclosingCoordination() method.
This will also include updates for changes to CoordinationPermission.
We can try to get the weak references to coordinations on thread local stacks in here as well, but that may take longer than is desired in order to get these other changes in.
(In reply to comment #4) > We can try to get the weak references to coordinations on thread local stacks > in here as well, but that may take longer than is desired in order to get these > other changes in. This patch will include converting to using ThreadLocal, as opposed to Map<Thread, LinkedList<Coordination>>, now that failing a coordination from other threads no longer requires removal from the thread local stack. It will also include the use of WeakReference for coordinations on the stack.
We should try to get this in for M5.
Also included will be the new security exceptions that must be thrown from various methods.
Created attachment 187283 [details] Contains the changes discussed to date. I'm attaching a bloated patch containing the changes discussed so far in case of a catastrophic failure.
Created attachment 188437 [details] Condensed Patch Here's a patch showing only what really changed.
patch released.
This causes a compile warning in the official build: http://download.eclipse.org/eclipse/downloads/drops/N20110207-2000/compilelogs/plugins/org.eclipse.equinox.coordinator_1.0.0.N20110207-2000/@dot.html Please 1. set up your project(s) so that you see such warnings in the workspace 2. make sure to fix those warnings before committing to HEAD Thanks!
(In reply to comment #11) > This causes a compile warning in the official build: > http://download.eclipse.org/eclipse/downloads/drops/N20110207-2000/compilelogs/plugins/org.eclipse.equinox.coordinator_1.0.0.N20110207-2000/@dot.html > > Please > 1. set up your project(s) so that you see such warnings in the workspace > 2. make sure to fix those warnings before committing to HEAD > > Thanks! 1. WARNING in /src/org/osgi/service/coordinator/CoordinationPermission.java (at line 804) permissions = (HashMap<String, CoordinationPermission>) gfields.get( "permissions", null); Type safety: Unchecked cast from Object to HashMap<String,CoordinationPermission> This is OSGi API for which we will have to go back to OSGi to get a source code change. In the mean time it looks like we have to add the following to the build.properties. Not sure if OSGi can make a source code change to add an annotation since they want the source to be able to compile against J2SE-1.4 libraries with jsr14 option. javacWarnings..=-unchecked
I released an update to the build.properties for now.
(In reply to comment #12) > 1. WARNING in /src/org/osgi/service/coordinator/CoordinationPermission.java > (at line 804) > permissions = (HashMap<String, CoordinationPermission>) gfields.get( > "permissions", null); > Type safety: Unchecked cast from Object to > HashMap<String,CoordinationPermission> > > This is OSGi API for which we will have to go back to OSGi to get a source code > change. In the mean time it looks like we have to add the following to the > build.properties. Not sure if OSGi can make a source code change to add an > annotation since they want the source to be able to compile against J2SE-1.4 > libraries with jsr14 option. > > javacWarnings..=-unchecked All the OSGi permission classes have this "problem". OSGi can't use annotations since they are not in ee.minimum. So you will need to externally suppress the warning or live with it.
(In reply to comment #11) > This causes a compile warning in the official build: > http://download.eclipse.org/eclipse/downloads/drops/N20110207-2000/compilelogs/plugins/org.eclipse.equinox.coordinator_1.0.0.N20110207-2000/@dot.html Verified in N20110208-2000 that the warning is gone.