Supported source version 'RELEASE_11' from annotation processor 'org.eclipse.ice.tests.dev.annotations.processors.LoggingDataElementProcessor' less than -source '14'
I encounter this error - Supported source version 'RELEASE_11' from annotation processor 'org.eclipse.ice.tests.dev.annotations.processors.LoggingDataElementProcessor' less than -source '14' - when I try to build on win64 with Java 14.
It is caused by using @SupportedSourceVersion(SourceVersion.Release_11) on the annotation processors.
Do we actually need this? Is there any reason why we would want to limit the latest version of JDK that we could use? I would propose that we remove these.
@dbluhm What do you think? If you agree I'll push the changes.
Designs
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related or that one is blocking others.
Learn more.
Without it, a warning is emitted on my version at least:
No SupportedSourceVersion annotation found on org.eclipse.ice.tests.dev.annotations.processors.LoggingDataElementProcessor, returning RELEASE_6.Supported source version 'RELEASE_6' from annotation processor 'org.eclipse.ice.tests.dev.annotations.processors.LoggingDataElementProcessor' less than -source '11'
This seems problematic but I'm not sure how deeply it affects things. If it's just a warning that we can ignore, we could probably filter it out or ignore warnings altogether and just use assertThat(compilation).succeeds() in the tests that are failing but we do risk another warning that does actually need to be addressed getting missed.
Actually, thinking again, the solution in both cases (omitting it or keeping it in) would require those tests be loosened up a bit. Dropping the @SupportedSourceVersion from the main DataElementProcessor and running tests, there were no apparent negative side-effects but having it default to RELEASE_6 feels odd if nothing else.
#473 Should hopefully solve this issue. Warnings will pop up during testing but they will no longer cause the tests to fail. I left the supported source versions at 11 since that is our "official" development version at the moment but with those changes, it shouldn't matter when running from Java 14.
It fails for me. I'll have to look at this more later.
DataElementProcessorTest.testDocStringsPreserved:333valueof:compilation.generatedFile(/TestImplementation.java).contents()expectedtocontain:*ANDANOTHERONANEWLINE.butwas:importjava.io.Serializable;importorg.slf4j.Logger;importorg.slf4j.LoggerFactory;importcom.fasterxml.jackson.annotation.JsonAutoDetect;importcom.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;importcom.fasterxml.jackson.annotation.JsonCreator;importcom.fasterxml.jackson.annotation.JsonIgnoreProperties;importcom.fasterxml.jackson.annotation.JsonProperty;importcom.fasterxml.jackson.core.JsonProcessingException;importcom.fasterxml.jackson.databind.ObjectMapper;importlombok.AccessLevel;importlombok.Data;importlombok.Getter;importlombok.NoArgsConstructor;importlombok.NonNull;importlombok.Setter;importorg.eclipse.ice.data.JavascriptValidator;importjava.util.UUID;/** * This is an implementation of Test that satisfies the dependencies of * the @DataElement Annotation and was auto-generated by the ICE Framework. */@Data@NoArgsConstructor@JsonAutoDetect(fieldVisibility=Visibility.ANY,getterVisibility=Visibility.NONE,isGetterVisibility=Visibility.NONE,setterVisibility=Visibility.NONE)@JsonIgnoreProperties(ignoreUnknown=true)publicclassTestImplementationimplementsTest,Serializable{/** * Logging tool */privatestaticfinalLoggerlogger=LoggerFactory.getLogger(TestImplementation.class);/** * The private UUID of this element. This field is left out of matches(). */@NonNull@Getter(AccessLevel.NONE)@Setter(AccessLevel.NONE)protectedUUIDprivateId=UUID.randomUUID();/** * A unique identifier for this element. */protectedlongid=0L;/** * A simple name for the data. */@NonNullprotectedStringname="name";/** * A simple description of the data */@NonNullprotectedStringdescription="description";/** * A comment that annotates the data in a meaningful way. */@NonNullprotectedStringcomment="no comment";/** * The context (a tag) in which the data should be considered. */@NonNullprotectedStringcontext="default";/** * This value is true if the element should be regarded by the client as required. */protectedbooleanrequired=false;/** * This value is true if the element should be regarded as a secret by the client, such as for passwords. */protectedbooleansecret=false;/** * The validator used to check the correctness of the data. */protectedJavascriptValidator<Test>validator;/** * A UNIQUE STRING IN THE DOC STRING. AND ANOTHER ON A NEW LINE. */publicinttestInt;/** * Get privateId. * @return UUID */publicUUIDgetUUID(){returnprivateId;}/** * All args constructor for TestImplementation. * * Used in JSON Deserialization. * @param privateId {@code UUID} for field privateId * @param id {@code long} for field id * @param name {@code String} for field name * @param description {@code String} for field description * @param comment {@code String} for field comment * @param context {@code String} for field context * @param required {@code boolean} for field required * @param secret {@code boolean} for field secret * @param validator {@code JavascriptValidator<Test>} for field validator * @param testInt {@code int} for field testInt */@JsonCreatorpublicTestImplementation(@JsonProperty("privateId")@NonNullUUIDprivateId,@JsonProperty("id")longid,@JsonProperty("name")@NonNullStringname,@JsonProperty("description")@NonNullStringdescription,@JsonProperty("comment")@NonNullStringcomment,@JsonProperty("context")@NonNullStringcontext,@JsonProperty("required")booleanrequired,@JsonProperty("secret")booleansecret,@JsonProperty("validator")JavascriptValidator<Test>validator,@JsonProperty("testInt")inttestInt){this.privateId=privateId;this.id=id;this.name=name;this.description=description;this.comment=comment;this.context=context;this.required=required;this.secret=secret;this.validator=validator;this.testInt=testInt;}/** * Copy constructor for TestImplementation. * @param other Instance of TestImplementation to copy */publicTestImplementation(Testother){copy(other);}/** * This operation clones the object. Note that it differs from the base class * implementation in that it will return null if it cannot create the clone to * promote fast failure. See {@link java.lang.Object#clone()}; */@OverridepublicObjectclone(){try{// Call the copy constructor to create the clone.returnnewTestImplementation(this);}catch(Exceptione){logger.error("Unable to clone TestImplementation!",e);returnnull;}}/** * Copy the contents of another element into this element. * @param element the element to copy */@Overridepublicvoidcopy(@NonNullTestelement){this.privateId=element.getUUID();this.id=element.getId();this.name=element.getName();this.description=element.getDescription();this.comment=element.getComment();this.context=element.getContext();this.required=element.isRequired();this.secret=element.isSecret();this.validator=element.getValidator();this.testInt=element.getTestInt();}/** * This function checks deep equality of DataElements to see if all members are * equal ("match") with the exception of fields with match set to false (such * as an automatically generated UUID). This is important for checking if two * objects were generated separately but are otherwise equal. * * @param o the other element to compare * @return true if all members of the element except excluded fields match * this element. */@Overridepublicbooleanmatches(Objecto){booleanretval=false;// Outer check for null comparisonsif(o!=null){// Next check for shallow comparisonif(this!=o){if(oinstanceofTestImplementation){TestImplementationother=(TestImplementation)o;// Separate boolean checks used to enable better catching// by debuggers.// Matching idbooleanidMatch=this.id==other.id;// Matching namebooleannameMatch=this.name.equals(other.name);// Matching descriptionbooleandescriptionMatch=this.description.equals(other.description);// Matching commentbooleancommentMatch=this.comment.equals(other.comment);// Matching contextbooleancontextMatch=this.context.equals(other.context);// Matching requiredbooleanrequiredMatch=this.required==other.required;// Matching secretbooleansecretMatch=this.secret==other.secret;// Matching validatorbooleanvalidatorMatch=this.validator==null?this.validator==other.validator:this.validator.equals(other.validator);// Matching testIntbooleantestIntMatch=this.testInt==other.testInt;retval=idMatch&&nameMatch&&descriptionMatch&&commentMatch&&contextMatch&&requiredMatch&&secretMatch&&validatorMatch&&testIntMatch;}}else{// This should be true if they are the same because the deep comparison is// performed otherwise.retval=true;}}returnretval;}/** * This operation serializes the data element to a string in verified JSON. * * @return a JSON string describing the element */@OverridepublicStringtoJson(){Stringvalue=null;// Convert to json using JacksonObjectMappermapper=newObjectMapper();try{value=mapper.writerWithDefaultPrettyPrinter().writeValueAsString(this);}catch(JsonProcessingExceptione){logger.error("Unable to write DataElement to string!",e);}returnvalue;}/** * This operation deserializes a valid JSON string and tries to load it into the * object. * * @param jsonDataElement the contents of this data element as JSON */@OverridepublicTestfromJson(finalStringjsonDataElement){// Load the data from the string with Jackson.ObjectMappermapper=newObjectMapper();try{copy(mapper.readValue(jsonDataElement,TestImplementation.class));}catch(JsonProcessingExceptione){logger.error("Unable to read DataElement from string!",e);}returnthis;}}compilationwas:compilationof[/C:/Users/jayjaybillings/git/ice/org.eclipse.ice.dev/org.eclipse.ice.dev.annotations/target/test-classes/input/DataElement/Single.java]usingannotationprocessors[lombok.launch.AnnotationProcessorHider$AnnotationProcessor@2728e166,org.eclipse.ice.dev.annotations.processors.DataElementProcessor@1d81dece]
Looks like a different error... Interesting, the doc comment formatting appears to not be behaving the same on Java 11 + Fedora as it is for you on Java 14 + Windows. I'll see if running it on Java 14 on Fedora has the same effect.
Could not reproduce on Java 14 on Fedora. On closer inspection, I think it must be a newline issue. Java on windows will interpret "\n" as the platform specific newline separator. As a fix, I've added the velocity escape tool to our velocity usage that should hopefully take care of that. Pushed those changes to the PR/bug-fix branch.
So, do we want to go with removing the annotation or should we update the source version to 14? I guess the con would be that client devs would need Java 14. The pros would be that it wouldn't assume Java 6 and print that warning message.
Since we'll end up with warnings being emitted either way on 14 whether we remove it or leave it as 11, I just left it as 11. The main concern I have with changing it to 14 is that it will no longer work on 11 which is the release everything is currently set to target so we'd have to update all of those as well. And with that, everyone currently working on it would have to update their environments, too. So balancing the cost of updating everything right now with having warnings on 14, I'm leaning towards leaving it on 11 unless there are other more compelling reasons to update.