Skip to content

Commit

Permalink
refactor: Add a blank line around fields with annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
2 people authored and app committed Jun 12, 2024
1 parent d866025 commit 734c965
Show file tree
Hide file tree
Showing 41 changed files with 65 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rewrite-core/src/main/java/org/openrewrite/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,10 @@ default Charset getCharset(ExecutionContext ctx) {
class Input {
@Getter
private final boolean synthetic;

@Getter
private final Path path;

private final Supplier<InputStream> source;

@Getter
Expand Down
1 change: 1 addition & 0 deletions rewrite-core/src/main/java/org/openrewrite/Validated.java
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ public String toString() {
*/
class Valid<T> implements Validated<T> {
protected final String property;

@Nullable
private final T value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public void addPrecondition(Recipe recipe) {

@JsonIgnore
private Validated<Object> validation = Validated.none();

@JsonIgnore
private Validated<Object> initValidation = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public class YamlResourceLoader implements ResourceLoader {

@Nullable
private final ClassLoader classLoader;

private final Collection<? extends ResourceLoader> dependencyResourceLoaders;

@Nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
public class AlreadyReplaced implements Marker {
UUID id;
String find;

@Nullable
String replace;
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public class BuildToolFailure implements Marker {
* The name of the build tool that failed, possibly a wrapper.
*/
String type;

@Nullable
String version;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
public class DeserializationError implements Marker {
@EqualsAndHashCode.Include
UUID id;

String message;
String detail;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
public class OutdatedSerializer implements Marker {
@EqualsAndHashCode.Include
UUID id;

String language;
String minimumVersion;
String actualVersion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
public class BitbucketBuildEnvironment implements BuildEnvironment {
@With
UUID id;

String httpOrigin;
String branch;
String sha;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
public class CustomBuildEnvironment implements BuildEnvironment {
@With
UUID id;

String cloneURL;
String ref;
String sha;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
public class GithubActionsBuildEnvironment implements BuildEnvironment {
@With
UUID id;

String buildNumber;
String buildId;
String host;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
public class TeamcityBuildEnvironment implements BuildEnvironment {
@With
UUID id;

String projectName;
String buildNumber;
String buildUrl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
public class TravisBuildEnvironment implements BuildEnvironment {
@With
UUID id;

String buildNumber;
String buildId;
String buildUrl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,15 @@ public static class Row {
@Column(displayName = "Name",
description = "The name of the committer.")
String name;

@Column(displayName = "Email",
description = "The email of the committer.")
String email;

@Column(displayName = "Date",
description = "The date of the day.")
LocalDate day;

@Column(displayName = "Number of commits",
description = "The number of commits made by this committer on this day.")
int commits;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,15 @@ public static class Row {
@Column(displayName = "Name",
description = "The name of the committer.")
String name;

@Column(displayName = "Email",
description = "The email of the committer.")
String email;

@Column(displayName = "Last commit",
description = "The date of this committer's last commit.")
LocalDate lastCommit;

@Column(displayName = "Number of commits",
description = "The number of commits made by this committer.")
int commits;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ private static class CreateConstraintVisitor extends GroovyIsoVisitor<ExecutionC

String config;
GroupArtifactVersion gav;

@Nullable
String because;
@Override
Expand Down Expand Up @@ -437,6 +438,7 @@ public J.MethodInvocation visitMethodInvocation(J.MethodInvocation method, Execu
private static class UpdateConstraintVersionVisitor extends GroovyIsoVisitor<ExecutionContext> {
GroupArtifactVersion gav;
J.MethodInvocation existingConstraint;

@Nullable
String because;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class InsertDependencyComparator implements Comparator<Statement> {

@Getter
private Statement afterDependency;

@Getter
private Statement beforeDependency;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@
@Value
public class DistributionInfos {
String downloadUrl;

@Nullable
Checksum checksum;

@Nullable
Checksum wrapperJarChecksum;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ public static GroovyParser.Builder builder(Builder base) {
public static class Builder extends Parser.Builder {
@Nullable
private Collection<Path> classpath = Collections.emptyList();

@Nullable
protected Collection<String> artifactNames = Collections.emptyList();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@
*/
public class GroovyParserVisitor {
private final Path sourcePath;

@Nullable
private final FileAttributes fileAttributes;

private final String source;
private final Charset charset;
private final boolean charsetBomMarked;
Expand All @@ -75,6 +77,7 @@ public class GroovyParserVisitor {
private int cursor = 0;

private static final Pattern whitespacePrefixPattern = Pattern.compile("^\\s*");

@SuppressWarnings("RegExpSimplifiable")
private static final Pattern whitespaceSuffixPattern = Pattern.compile("\\s*[^\\s]+(\\s*)");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public class ReloadableJava11ParserVisitor extends TreePathScanner<J, Space> {

@Nullable
private final FileAttributes fileAttributes;

private final String source;
private final Charset charset;
private final boolean charsetBomMarked;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public class ReloadableJava17ParserVisitor extends TreePathScanner<J, Space> {

@Nullable
private final FileAttributes fileAttributes;

private final String source;
private final Charset charset;
private final boolean charsetBomMarked;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public class ReloadableJava21ParserVisitor extends TreePathScanner<J, Space> {

@Nullable
private final FileAttributes fileAttributes;

private final String source;
private final Charset charset;
private final boolean charsetBomMarked;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public class ReloadableJava8ParserVisitor extends TreePathScanner<J, Space> {

@Nullable
private final FileAttributes fileAttributes;

private final String source;
private final Charset charset;
private final boolean charsetBomMarked;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,10 @@ public J visit(@Nullable Tree tree, ExecutionContext ctx) {
private static class ChangeTypeVisitor extends JavaVisitor<ExecutionContext> {
private final JavaType.Class originalType;
private final JavaType targetType;

@Nullable
private J.Identifier importAlias;

@Nullable
private final Boolean ignoreDefinition;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public J.NewClass visitNewClass(J.NewClass newClass, P p) {
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
public static class MethodMatch implements Marker {
UUID id;

@EqualsAndHashCode.Include
String methodMatcher;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,13 +238,15 @@ public TreeVisitor<?, ExecutionContext> getVisitor(Accumulator acc) {
@Value
private static class GradleEnterpriseConfiguration {
ServerConfiguration server;

@Nullable
BuildScanConfiguration buildScan;
}

@Value
private static class ServerConfiguration {
String url;

@Nullable
Boolean allowUntrusted;
}
Expand All @@ -253,8 +255,10 @@ private static class ServerConfiguration {
private static class BuildScanConfiguration {
@Nullable
Boolean backgroundBuildScanUpload;

@Nullable
String publish;

@Nullable
Capture capture;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,13 @@ private static class InsertDependencyInOrder extends MavenIsoVisitor<ExecutionCo
private final String groupId;
private final String artifactId;
private final String version;

@Nullable
private final String type;

@Nullable
private final String scope;

@Nullable
private final String classifier;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
public class AddPropertyVisitor extends MavenIsoVisitor<ExecutionContext> {
String key;
String value;

@Nullable Boolean preserveExistingValue;

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ private MavenWrapper getMavenWrapper(ExecutionContext ctx) {

static class MavenWrapperState {
boolean needsWrapperUpdate = false;

@Nullable BuildTool updatedMarker;

boolean addMavenWrapperProperties = true;
boolean addMavenWrapperDownloader = true;
boolean addMavenWrapperJar = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public class MavenPomDownloader {

@Nullable
private MavenSettings mavenSettings;

private Collection<MavenRepositoryMirror> mirrors;

@Nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ public String toString() {
@Value
private static class Range {
boolean lowerClosed;

@Nullable
Version lower;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public class Plugin {
public static class Execution {

String id;

@Nullable
List<String> goals;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,25 @@ public static int getModelVersion() {

@Builder.Default
Map<String, String> properties = emptyMap();

@Builder.Default
List<ManagedDependency> dependencyManagement = emptyList();

@Builder.Default
List<Dependency> dependencies = emptyList();

@Builder.Default
List<MavenRepository> repositories = emptyList();

@Builder.Default
List<License> licenses = emptyList();

@Builder.Default
List<Profile> profiles = emptyList();

@Builder.Default
List<Plugin> plugins = emptyList();

@Builder.Default
List<Plugin> pluginManagement = emptyList();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,16 @@ class File implements Properties, SourceFile {

@With
String prefix;

@With
Markers markers;

@With
Path sourcePath;

@With
List<Content> content;

@With
String eof;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class ProtoParserVisitor extends Protobuf2ParserBaseVisitor<Proto> {

@Nullable
private final FileAttributes fileAttributes;

private final String source;
private final Charset charset;
private final boolean charsetBomMarked;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,7 @@ static boolean groupSourceSpecsByParser(List<Parser.Builder> parserBuilders, Map
class DelegateSourceFileForDiff implements SourceFile {
@Delegate(excludes = PrintAll.class)
private final SourceFile delegate;

private final String expected;

@Override
Expand Down
Loading

0 comments on commit 734c965

Please sign in to comment.