mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 01:54:47 +02:00
8273157: Add convenience methods to Messager
Reviewed-by: jjg
This commit is contained in:
parent
9689f61520
commit
2f01a6f8b6
87 changed files with 359 additions and 354 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2006, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -45,7 +45,7 @@ import javax.lang.model.SourceVersion;
|
|||
import static javax.lang.model.SourceVersion.*;
|
||||
import javax.lang.model.element.*;
|
||||
import javax.lang.model.util.*;
|
||||
import static javax.tools.Diagnostic.Kind.*;
|
||||
|
||||
|
||||
/**
|
||||
* This processor returns the supported source level as indicated by
|
||||
|
@ -61,8 +61,7 @@ public class TestSourceVersionWarnings extends AbstractProcessor {
|
|||
public SourceVersion getSupportedSourceVersion() {
|
||||
String sourceVersion = processingEnv.getOptions().get("SourceVersion");
|
||||
if (sourceVersion == null) {
|
||||
processingEnv.getMessager().printMessage(WARNING,
|
||||
"No SourceVersion option given");
|
||||
processingEnv.getMessager().printWarning("No SourceVersion option given");
|
||||
return SourceVersion.RELEASE_8;
|
||||
} else {
|
||||
return SourceVersion.valueOf(sourceVersion);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue