Community
Participate
Working Groups
org.eclipse.osgi.framework.debug.Debug hard-codes debug to true and this is used in various places in Equinox in the pattern: if (Debug.debug && someothercond) ... The flag is apparently a throw-back to the embedded roots of Equinox when the codebase was sometimes built with the flag set to false. This is no longer a reasonable use case for Equinox as debug code is typically configured at runtime in the "someothercond" expressions. So the debug flag should be deleted to make the code more readable and avoid confusion.
I should have mentioned that I already discussed this with Tom Watson who asked me to raise the bug. :-)
Agreed, should do this early to make sure there is no unforeseen issues. The only potential issue I can foresee is if some framework extensions where using this flag. In that case they will get a compile error, but I think binaries should still work because the compiler should inline the final constant or even completely remove it from the bytecode as an optimization since it has no effect on the outcome of the condition "if (Debug.debug && someothercond) ...".
Created attachment 174158 [details] patch Here is a patch to remove the useless constant.
I released this to head and have kicked of a test eclipse/equinox build to make sure no one else is referencing the constant.
Test build succeeded. Fixed.
Thanks for addressing this so quickly Tom.