Skip to content
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

Using cal10n-api: fix SupportedSourceVersion compilation warning #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,31 @@
import java.util.Set;

@SupportedAnnotationTypes("ch.qos.cal10n.BaseName")
@SupportedSourceVersion(SourceVersion.RELEASE_5)
public class CAL10NAnnotationProcessor extends AbstractProcessor {

TypeElement baseNameTypeElement;
Filer filer;

@Override
public SourceVersion getSupportedSourceVersion() {

//Replacement of @SupportedSourceVersion(SourceVersion.RELEASE_5) because it generate compilation warning like:
//[WARNING] Supported source version 'RELEASE_5' from annotation processor 'ch.qos.cal10n.verifier.processor.CAL10NAnnotationProcessor' less than -source '1.7'
try {
return SourceVersion.valueOf("RELEASE_8");
} catch (IllegalArgumentException e) {}

try {
return SourceVersion.valueOf("RELEASE_7");
} catch (IllegalArgumentException e) {}

try {
return SourceVersion.valueOf("RELEASE_6");
} catch (IllegalArgumentException x) {}

return SourceVersion.RELEASE_5;
}

@Override
public void init(ProcessingEnvironment env) {
super.init(env);
Expand Down