简体   繁体   中英

Eclipse 4.5.1. (MARS.1) Method not found: setDefaultEditor

I have a plugin that used to work with Eclipse Indigo, Kepler,Luna and Mars (4.5). It supports the Frege programming language ( http://www.frege-lang.org/fregide/ ). It is based on the IMP framework, which is, unfortunately, not maintained anymore (and I don't have the source code).

Tonight I checked for updates, and it found Eclipse 4.5.1. After updating, eclipse had a fancy new splash screen that says "MARS.1".

Yet it can't initialize the plugin anymore!

In the Error Log, I get the message:

Plug-in "frege.ide" was unable to instantiate class "frege.imp.builders.FregeBuilder".

and the stack trace seems to indicate that some method has vanished from the Eclipse API:

java.lang.NoSuchMethodError: org.eclipse.ui.internal.registry.FileEditorMapping.setDefaultEditor(Lorg/eclipse/ui/internal/registry/EditorDescriptor;)V
    at org.eclipse.imp.language.LanguageRegistry.addUniversalEditorMappings(LanguageRegistry.java:393)
    at org.eclipse.imp.language.LanguageRegistry.initializeRegistryAsNeeded(LanguageRegistry.java:268)
    at org.eclipse.imp.language.LanguageRegistry.findLanguage(LanguageRegistry.java:206)
    at frege.imp.builders.FregeBuilderBase.<clinit> (FregeBuilderBase.java:53)
    ...

Here are my questions:

  1. Does anybody know why this method is gone?
  2. How can I restrict installation of my plugin to LUNA, KEPLER and INDIGO only?
  3. Would it be possible to supply a fake setDefaultEditor method that does whatever must be done now to register the Editor for the plugin?

The setDefaultEditor method does still exist in FileEditorMapping but it now takes an IEditorDescriptor argument instead of EditorDescriptor . This will cause the NoSuchMethodError . Since this class is an internal class and therefore not part of the API this is a valid change.

According to the IMP Wiki the IMP project has moved to a github project , you may be able to get up to date code from there (or at least get the source).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM