-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The PHP plugin accesses internals of the AdapterManager which have changed in 2021-12 / Eclipse Platform 4.22 #122
Comments
Signed-off-by: Dawid Pakuła <zulus@w3des.net>
Looks like author of this code, use PHPDebugElementAdapterFactory not only for PHPVariable, but also PHPLaunch, PHPMultiDebugTarget, DBGpMultiSessionTarget, IWatchExpression, DBGpVariable. I've checked code and looks, like this was workaround for problems similar to bug 576024. Wanted to be sure that PHP results will be first. As I see in bugzilla, bug 576024 already solves this (Adapter vs Context) but I haven't resources now to verify. For now I just run call "getFactories" as Map, this should solve invoke problems. |
@zulus Are you sure this change works in 2021-12? 921846f updates the target platform, but just to 2021-09. If I have understood properly, this still won't work with 2021-12 as the method called will continue to be HashMap return value so the NoSuchMethodError will still occur. Did you try installing the new build into a 2021-12 M2 build? You can give me the correct p2 URL and I can give it a try. At the moment the builds are broken on Jenkins (they pass on GH Actions because of no signing maybe??) |
This issues still exists in 2021-12 M3. Can you please reopen the issue. For example the user sees this error when trying to create a launch configuration: The 2021-12 M3 build can be downloaded from https://download.eclipse.org/technology/epp/downloads/release/2021-12/M3/_mirrors.php |
@zulus I have just realized that no new contribution was made for PDT to SimRel so the "Eclipse IDE for PHP Developers" is still using PDT 7.2 (from mid 2020). Will you be scheduling a release for 2021-12 timeframe? |
I just tried installing 7.2.1 into 2021-12 RC2 SDK from https://download.eclipse.org/eclipse/downloads/drops4/S-4.22RC2-202111241800/ and I get the same errors. AFAICT 7.2.1 is still building against 2021-09, that won't work because of the internal method signature change. The full build from EPP will be ready in a few hours, but I don't think the results can be different. |
Hi PDT devs,
This bit of code references the internal class for AdapterManager, but the signature changed of the method (getFactories). It now returns a Map instead of HashMap.
https://github.com/eclipse/pdt/blob/cbff9260efedf8063029339ae1ffc800f9f4ba65/plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/internal/debug/ui/PHPDebugUIPlugin.java#L110
This results in an exception like this in 2021-12 M2:
Note that AFAIU you won't be able to run the same version of PDT against 4.21 and 4.22 (unless you removed the access to internals or jump through hoops and use reflection). Also note that the reason the API changed is a side effect of behaviour changes of the Adapater Manager (See Bug 576024 - I don't think there is a N&N entry about this yet.
PS I would guess
manager.registerAdapters(propertiesFactory, IVariable.class);
can be replaced withmanager.registerAdapters(propertiesFactory, PHPVariable.class);
and then you can delete all the internals access. That would makePHPDebugElementAdapterFactory
preferred forPHPVariable
. (I haven't tested it, and you may need to also registerDBGpVariable
but I wasn't sure what that was for.)The text was updated successfully, but these errors were encountered: