Skip to content

Analyzer plugin framework #2660

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

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactoring lambdas to method reference
  • Loading branch information
tulinkry committed Feb 16, 2019
commit 6dd520c4161c01a52236406094da8b8c55622f39
Original file line number Diff line number Diff line change
Expand Up @@ -90,51 +90,51 @@ public class AnalyzerFramework extends PluginFramework<IAnalyzerPlugin, Analyzer

private static final IAnalyzerPlugin[] DEFAULT_PLUGINS = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this is a temporary measure until the framework is fully implemented and in the final state it will dynamically load all the plugins from a directory - no hard-coding needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this is for seamless transition from the old approach to the new approach.

That is a good point though. I'm affraid that with that approach we would need to distribute two jar files instead of one and more to force people to actually put the second one somewhere (plugins directory) and point the configuration directory there and I think this is a little bit more than what I'd expect to get opengrok working.

() -> DEFAULT_ANALYZER_FACTORY,
() -> new IgnorantAnalyzerFactory(),
() -> new BZip2AnalyzerFactory(),
() -> new XMLAnalyzerFactory(),
IgnorantAnalyzerFactory::new,
BZip2AnalyzerFactory::new,
XMLAnalyzerFactory::new,
() -> MandocAnalyzerFactory.DEFAULT_INSTANCE,
() -> TroffAnalyzerFactory.DEFAULT_INSTANCE,
() -> new ELFAnalyzerFactory(),
ELFAnalyzerFactory::new,
() -> JavaClassAnalyzerFactory.DEFAULT_INSTANCE,
() -> new ImageAnalyzerFactory(),
ImageAnalyzerFactory::new,
() -> JarAnalyzerFactory.DEFAULT_INSTANCE,
() -> ZipAnalyzerFactory.DEFAULT_INSTANCE,
() -> new TarAnalyzerFactory(),
() -> new CAnalyzerFactory(),
() -> new CSharpAnalyzerFactory(),
() -> new VBAnalyzerFactory(),
() -> new CxxAnalyzerFactory(),
() -> new ErlangAnalyzerFactory(),
() -> new ShAnalyzerFactory(),
() -> new PowershellAnalyzerFactory(),
TarAnalyzerFactory::new,
CAnalyzerFactory::new,
CSharpAnalyzerFactory::new,
VBAnalyzerFactory::new,
CxxAnalyzerFactory::new,
ErlangAnalyzerFactory::new,
ShAnalyzerFactory::new,
PowershellAnalyzerFactory::new,
() -> PlainAnalyzerFactory.DEFAULT_INSTANCE,
() -> new UuencodeAnalyzerFactory(),
() -> new GZIPAnalyzerFactory(),
() -> new JavaAnalyzerFactory(),
() -> new JavaScriptAnalyzerFactory(),
() -> new KotlinAnalyzerFactory(),
() -> new SwiftAnalyzerFactory(),
() -> new JsonAnalyzerFactory(),
() -> new PythonAnalyzerFactory(),
() -> new RustAnalyzerFactory(),
() -> new PerlAnalyzerFactory(),
() -> new PhpAnalyzerFactory(),
() -> new LispAnalyzerFactory(),
() -> new TclAnalyzerFactory(),
() -> new ScalaAnalyzerFactory(),
() -> new ClojureAnalyzerFactory(),
() -> new SQLAnalyzerFactory(),
() -> new PLSQLAnalyzerFactory(),
() -> new FortranAnalyzerFactory(),
() -> new HaskellAnalyzerFactory(),
() -> new GolangAnalyzerFactory(),
() -> new LuaAnalyzerFactory(),
() -> new PascalAnalyzerFactory(),
() -> new AdaAnalyzerFactory(),
() -> new RubyAnalyzerFactory(),
() -> new EiffelAnalyzerFactory(),
() -> new VerilogAnalyzerFactory()
UuencodeAnalyzerFactory::new,
GZIPAnalyzerFactory::new,
JavaAnalyzerFactory::new,
JavaScriptAnalyzerFactory::new,
KotlinAnalyzerFactory::new,
SwiftAnalyzerFactory::new,
JsonAnalyzerFactory::new,
PythonAnalyzerFactory::new,
RustAnalyzerFactory::new,
PerlAnalyzerFactory::new,
PhpAnalyzerFactory::new,
LispAnalyzerFactory::new,
TclAnalyzerFactory::new,
ScalaAnalyzerFactory::new,
ClojureAnalyzerFactory::new,
SQLAnalyzerFactory::new,
PLSQLAnalyzerFactory::new,
FortranAnalyzerFactory::new,
HaskellAnalyzerFactory::new,
GolangAnalyzerFactory::new,
LuaAnalyzerFactory::new,
PascalAnalyzerFactory::new,
AdaAnalyzerFactory::new,
RubyAnalyzerFactory::new,
EiffelAnalyzerFactory::new,
VerilogAnalyzerFactory::new
};

/**
Expand Down Expand Up @@ -372,7 +372,7 @@ public void returnAnalyzers() {
}

/**
* Decode about two factory instances if they are different.
* Decide if two factory instances are different.
*
* @param a the first instance
* @param b the second instance
Expand Down