Skip to content

Commit

Permalink
Fix #122 - Support new AdapterManager API (#123)
Browse files Browse the repository at this point in the history
Signed-off-by: Dawid Pakuła <zulus@w3des.net>
  • Loading branch information
zulus committed Dec 1, 2021
1 parent 84c0085 commit eb4dd9a
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -13,6 +13,7 @@
*******************************************************************************/
package org.eclipse.php.internal.debug.ui;

import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
Expand Down Expand Up @@ -108,7 +109,9 @@ public void start(BundleContext context) throws Exception {
// class, we insert the
// factory before any other factory.
AdapterManager manager = (AdapterManager) Platform.getAdapterManager();
Map<String, List<IAdapterFactory>> factories = manager.getFactories();
Method method = manager.getClass().getMethod("getFactories"); //$NON-NLS-1$

Map<String, List<IAdapterFactory>> factories = (Map<String, List<IAdapterFactory>>) method.invoke(manager);
List<IAdapterFactory> list = factories.get(IVariable.class.getName());
PHPDebugElementAdapterFactory propertiesFactory = new PHPDebugElementAdapterFactory();
manager.registerAdapters(propertiesFactory, IVariable.class);
Expand Down

0 comments on commit eb4dd9a

Please sign in to comment.