Skip to content

raoulDoc/CodePatternPlugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Javac plugins (introduced in JDK8) let you inject new phases to javac without modifying the compiler itself.

This project shows an example of a Javac plugin that finds the following code pattern:

expr.get(key) == null // where expr is a subtype of java.util.Map

Requirements

  • JDK 8

Instructions

$ mvn compile
$ mvn jar:jar
$ javac -processorpath target/javac-compiler-plugin-example-1.0.jar -Xplugin:CodePatternPlugin samples/Test.java 
Running!
Found Match at line: 8 in samples/Test.java

Additional notes

About

Example of a javac Plugin

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages