Skip to content

Commit

Permalink
Mark certain types @Incubating in preparation for 2.0.0 GA
Browse files Browse the repository at this point in the history
  • Loading branch information
jkschneider committed Jun 16, 2020
1 parent 8fb72fb commit 597099f
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import static java.util.stream.Collectors.toList;

@Incubating(since = "2.0.0")
public interface ChangePublisher {
void publish(Collection<Change<?>> changes);

Expand Down
1 change: 1 addition & 0 deletions rewrite-core/src/main/java/org/openrewrite/Generate.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* for example, format (if some of the refactoring visitors are responsible for formatting) the new generated
* source in a manner that best suits the project being operated on.
*/
@Incubating(since = "2.0.0")
public interface Generate<S extends SourceFile> {
Collection<S> generate();
}
29 changes: 29 additions & 0 deletions rewrite-core/src/main/java/org/openrewrite/Incubating.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright 2020 the original author or authors.
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* https://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.openrewrite;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;

/**
* This is a feature that is experimental and may yield a breaking change in a minor release.
*/
@Documented
@Target({ElementType.METHOD, ElementType.TYPE, ElementType.CONSTRUCTOR})
public @interface Incubating {
String since();
}
1 change: 1 addition & 0 deletions rewrite-core/src/main/java/org/openrewrite/Metadata.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
*/
package org.openrewrite;

@Incubating(since = "2.0.0")
public interface Metadata {
}
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 @@ -28,6 +28,7 @@

import static java.util.stream.StreamSupport.stream;

@Incubating(since = "2.0.0")
public interface Validated extends Iterable<Validated> {
boolean isValid();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* Turns a set of {@link Validated.Invalid} into a throwable exception, which is used to throw an unchecked exception
* at runtime when one or more properties are invalid.
*/
@Incubating(since = "2.0.0")
public class ValidationException extends IllegalStateException {
private final Validated validation;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider;
import org.openrewrite.Change;
import org.openrewrite.ChangePublisher;
import org.openrewrite.Incubating;
import org.openrewrite.Metadata;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -30,6 +31,7 @@
import java.util.Collection;
import java.util.Map;

@Incubating(since = "2.0.0")
@RequiredArgsConstructor
public class GitChangePublisher implements ChangePublisher {
private static final Logger logger = LoggerFactory.getLogger(GitChangePublisher.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
*/
package org.openrewrite.git;

import org.openrewrite.Incubating;
import org.openrewrite.Metadata;

@Incubating(since = "2.0.0")
public enum GitMetadata implements Metadata {
HEAD_COMMIT_ID,
HEAD_TREE_ID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.kohsuke.github.GitHub;
import org.openrewrite.Change;
import org.openrewrite.ChangePublisher;
import org.openrewrite.Incubating;
import org.openrewrite.Metadata;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -38,6 +39,7 @@
* This publisher is best suited for changes to a single file per repository. Otherwise, multiple commits
* are generated, one for each changed file.
*/
@Incubating(since = "2.0.0")
public class GithubChangePublisher implements ChangePublisher {
private static final Logger logger = LoggerFactory.getLogger(GithubChangePublisher.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
*/
package org.openrewrite.git;

import org.openrewrite.Incubating;
import org.openrewrite.Metadata;

@Incubating(since = "2.0.0")
public enum GithubMetadata implements Metadata {
REPOSITORY,
ORGANIZATION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package org.openrewrite.refactor;

import org.openrewrite.Incubating;
import org.openrewrite.SourceVisitor;
import org.openrewrite.Tree;
import org.openrewrite.internal.StringUtils;
Expand All @@ -32,6 +33,7 @@
/**
* Discover the most common indentation level of a tree, and whether this indentation is built with spaces or tabs.
*/
@Incubating(since = "2.0.0")
public class FindIndent extends SourceVisitor<Void> {
private final SortedMap<Integer, Long> indentFrequencies = new TreeMap<>();
private final int enclosingIndent;
Expand Down

0 comments on commit 597099f

Please sign in to comment.