src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options.processor/src/org/graalvm/compiler/options/processor/OptionProcessor.java
branchdatagramsocketimpl-branch
changeset 58678 9cf78a70fa4f
parent 54084 84f10bbf993f
child 58679 9c3209ff7550
equal deleted inserted replaced
58677:13588c901957 58678:9cf78a70fa4f
     1 /*
     1 /*
     2  * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   222                 processingEnv.getMessager().printMessage(Kind.ERROR, "Option help text must start with an upper case letter", element);
   222                 processingEnv.getMessager().printMessage(Kind.ERROR, "Option help text must start with an upper case letter", element);
   223                 return;
   223                 return;
   224             }
   224             }
   225         }
   225         }
   226 
   226 
       
   227         String optionStabilityName = getAnnotationValue(annotation, "stability", VariableElement.class).getSimpleName().toString();
       
   228         if (optionStabilityName.equals("STABLE")) {
       
   229             if (help.length() == 0) {
       
   230                 processingEnv.getMessager().printMessage(Kind.ERROR, "A stable option must have non-empty help text", element);
       
   231                 return;
       
   232             }
       
   233         }
       
   234 
   227         String optionTypeName = getAnnotationValue(annotation, "type", VariableElement.class).getSimpleName().toString();
   235         String optionTypeName = getAnnotationValue(annotation, "type", VariableElement.class).getSimpleName().toString();
   228         info.options.add(new OptionInfo(optionName, optionTypeName, help, extraHelp, optionType, declaringClass, field.getSimpleName().toString()));
   236         info.options.add(new OptionInfo(optionName, optionTypeName, help, extraHelp, optionType, declaringClass, field.getSimpleName().toString()));
   229     }
   237     }
   230 
   238 
   231     public static void createOptionsDescriptorsFile(ProcessingEnvironment processingEnv, OptionsInfo info) {
   239     public static void createOptionsDescriptorsFile(ProcessingEnvironment processingEnv, OptionsInfo info) {