Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [wb-dev] Critical issue

Hi,

@Wim Jongman, the French department where I live is under quarantine (again), so I'm stuck at home for the week-end 😨

I'll work on this topic. I'm gonna try to use bytebuddy instead of CGLIB.

Cheers

Laurent

Le jeu. 25 mars 2021 à 20:44, Wim Jongman <wim.jongman@xxxxxxxxx> a écrit :
Hey Dave,

No problems. cglib can at runtime generate load and manipulate classes. Java16 and up don't allow certain kinds of class manipulations anymore.

CGLIB is deprecated by the author. The author of cglib is also the author of bytebuddy which deals with some of the issues that cglib has.

So we need to replace cglib and see what illegal reflections we still do that are not allowed anymore by java16 and up.

See the rest of this thread for links.

Cheers,

Wim






On Thu, Mar 25, 2021 at 8:27 PM David Garratt via wb-dev <wb-dev@xxxxxxxxxxx> wrote:
Can you explain. Is this a problem (bug) with Java 16 or a incompatibility with CGLIB. If the latter and it’s an open source lib could that not be fixed.

Apologies in advance for not understanding the nature of the problem.

Dave

On 25 Mar 2021, at 19:15, Wim Jongman <wim.jongman@xxxxxxxxx> wrote:

Hi Laurent,

Thank you for working on this. I looked at it as well and came to the same conclusion (not easy).

Yes it is relevant, I can imagine that WB has to instantiate a class, filter out error methods, visualizing user widgets, and more of that magic.

Cheers,

Wim


On Thu, Mar 25, 2021 at 8:10 PM Laurent Caron <laurent.caron@xxxxxxxxx> wrote:
Hi Wim,

I've started the analysis, and bad news, it is not easy. CGLIB is used for different cases :
a) Object creation (for example in BroadcastSupport)
b) Abstract class instantiation : an object that extends an abstract class can be instantiated: abstract methods are "empty" and returns the default value
c) Method interception (AOP), to override some behaviours (for example in SectionPartInfo)
d) Injection of classes in the classloader (for example in BindingContextClassLoaderInitializer)

IMHO, byte manipulation library is relevant in WindowBuilder, so I think we should investigate replacing CGLib by ByteBuddy or Javassist.

Regards,

Laurent


Le mer. 24 mars 2021 à 12:11, Wim Jongman <wim.jongman@xxxxxxxxx> a écrit :
Hi Laurent,

Yes, bytebuddy seems to be the alternative. But we first need to figure out what WB is trying to do.

There are 26 classes that use cglib:

AbstractParseFactory.java - org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/parser
AbstractVariableSupportTest.java - org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/core/model/variables (2 matches)
ActionContainerInfo.java - org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/model/jface/action (3 matches)
ActionFactoryCreationSupport.java - org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/model/rcp (3 matches)
ActionTest.java - org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/rcp/model/jface (3 matches)
ActivatorGetImagesByteCodeProcessor.java - org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/model/util
AstEvaluationEngine.java - org.eclipse.wb.core.java/src/org/eclipse/wb/core/eval
BindingContextClassLoaderInitializer.java - org.eclipse.wb.rcp.databinding/src/org/eclipse/wb/internal/rcp/databinding/parser
BroadcastSupport.java - org.eclipse.wb.core/src/org/eclipse/wb/core/model/broadcast (3 matches)
ContributionManagerInfo.java - org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/model/jface/action (2 matches)
DefaultMethodInterceptor.java - org.eclipse.wb.core.java/src/org/eclipse/wb/core/eval (2 matches)
DialogInfo.java - org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/model/widgets (4 matches)
ExecutionFlowUtils.java - org.eclipse.wb.core.java/src/org/eclipse/wb/core/eval (3 matches)
FormPageInfo.java - org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/model/forms (3 matches)
FrameViewInfo.java - org.eclipse.wb.swing.jsr296/src/org/eclipse/wb/internal/swing/jsr296/model (3 matches)
GroupMarkerInfo.java - org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/model/jface/action (2 matches)
InvocationEvaluator.java - org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/eval/evaluators (2 matches)
JavaInfoUtilsTest.java - org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/core/model/util (3 matches)
PageLayoutCreateFolderInfo.java - org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/model/rcp/perspective (3 matches)
PageLayoutCreationSupport.java - org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/model/rcp/perspective (3 matches)
ReflectionUtilsTest.java - org.eclipse.wb.tests/src/org/eclipse/wb/tests/designer/core/util/reflect (16 matches)
ResourceManagerClassLoaderInitializer.java - org.eclipse.wb.swt/src/org/eclipse/wb/internal/swt/utils (3 matches)
SectionPartInfo.java - org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/model/forms (3 matches)
ThisCreationSupport.java - org.eclipse.wb.core.java/src/org/eclipse/wb/internal/core/model/creation (7 matches)
ToolBarManagerInfo.java - org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/model/jface/action (2 matches)
WizardPageInfo.java - org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/model/jface (2 matches)

On Wed, Mar 24, 2021 at 8:19 AM Laurent Caron <laurent.caron@xxxxxxxxx> wrote:
Hi Wim,

Maybe adding " --illegal-access=permit" in the Eclipse Configuration can be a workaround.

The problem seems to be well known (look at [1],[2], [3]) since about 3 years.

Should be move to another library, like ByteBuddy ?

I have no idea of the impact (how many classes in WB rely on CGLib).

Regards

Laurent


Le mar. 23 mars 2021 à 20:57, Wim Jongman <wim.jongman@xxxxxxxxx> a écrit :
Hi All,

With Java 16, the usage of CGLIB stops working. We already had our first report [1]

CGLIB is a class manipulation tool that uses reflection to do some class/classloading/proxy magic.

If we don't get this fixed then we are in trouble. Is there someone on the list that wants to take a stab at this?

Cheers,

Wim


_______________________________________________
wb-dev mailing list
wb-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/wb-dev
_______________________________________________
wb-dev mailing list
wb-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/wb-dev
_______________________________________________
wb-dev mailing list
wb-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/wb-dev
_______________________________________________
wb-dev mailing list
wb-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/wb-dev
_______________________________________________
wb-dev mailing list
wb-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/wb-dev



David Garratt

www.commander4j.com

Please consider your environmental responsibility before printing emails.




_______________________________________________
wb-dev mailing list
wb-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/wb-dev
_______________________________________________
wb-dev mailing list
wb-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/wb-dev

Back to the top