Polish
This commit is contained in:
@@ -356,8 +356,8 @@ public class ConfigurationMetadataAnnotationProcessor extends AbstractProcessor
|
||||
catch (FileNotFoundException ex) {
|
||||
// No additional metadata
|
||||
}
|
||||
catch (InvalidConfigurationMetadataException e) {
|
||||
log(e.getKind(), e.getMessage());
|
||||
catch (InvalidConfigurationMetadataException ex) {
|
||||
log(ex.getKind(), ex.getMessage());
|
||||
}
|
||||
catch (Exception ex) {
|
||||
logWarning("Unable to merge additional metadata");
|
||||
|
||||
@@ -21,13 +21,13 @@ import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import javax.annotation.processing.ProcessingEnvironment;
|
||||
import javax.tools.Diagnostic;
|
||||
import javax.tools.FileObject;
|
||||
import javax.tools.StandardLocation;
|
||||
|
||||
import org.json.JSONException;
|
||||
|
||||
import org.springframework.boot.configurationprocessor.metadata.ConfigurationMetadata;
|
||||
import org.springframework.boot.configurationprocessor.metadata.InvalidConfigurationMetadataException;
|
||||
import org.springframework.boot.configurationprocessor.metadata.JsonMarshaller;
|
||||
@@ -87,8 +87,9 @@ public class MetadataStore {
|
||||
return null;
|
||||
}
|
||||
catch (JSONException ex) {
|
||||
throw new InvalidConfigurationMetadataException("Invalid additional meta-data in '" +
|
||||
METADATA_PATH + "': " + ex.getMessage(), Diagnostic.Kind.ERROR);
|
||||
throw new InvalidConfigurationMetadataException(
|
||||
"Invalid additional meta-data in '" + METADATA_PATH + "': "
|
||||
+ ex.getMessage(), Diagnostic.Kind.ERROR);
|
||||
}
|
||||
finally {
|
||||
in.close();
|
||||
|
||||
@@ -19,8 +19,8 @@ package org.springframework.boot.configurationprocessor.metadata;
|
||||
import javax.tools.Diagnostic;
|
||||
|
||||
/**
|
||||
* Thrown to indicate that some meta-data is invalid. Define the
|
||||
* severity to determine whether it has to fail the build.
|
||||
* Thrown to indicate that some meta-data is invalid. Define the severity to determine
|
||||
* whether it has to fail the build.
|
||||
*
|
||||
* @author Stephane Nicoll
|
||||
* @since 1.3.0
|
||||
@@ -36,7 +36,7 @@ public class InvalidConfigurationMetadataException extends RuntimeException {
|
||||
}
|
||||
|
||||
public Diagnostic.Kind getKind() {
|
||||
return kind;
|
||||
return this.kind;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -356,8 +356,8 @@ public class ConfigurationMetadataAnnotationProcessorTests {
|
||||
File additionalMetadataFile = createAdditionalMetadataFile();
|
||||
FileCopyUtils.copy("Hello World", new FileWriter(additionalMetadataFile));
|
||||
|
||||
thrown.expect(IllegalStateException.class);
|
||||
thrown.expectMessage("Compilation failed");
|
||||
this.thrown.expect(IllegalStateException.class);
|
||||
this.thrown.expectMessage("Compilation failed");
|
||||
compile(SimpleProperties.class);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user