Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

@InterfaceAudience.Public
@InterfaceStability.Evolving
public class InterfaceAudience {
public final class InterfaceAudience {
/**
* Intended for use by any project or application.
*/
Expand All @@ -61,6 +61,10 @@ public class InterfaceAudience {
@Documented
@Retention(RetentionPolicy.RUNTIME)
public @interface LimitedPrivate {
/**
* The list of projects with access.
* @return project names
*/
String[] value();
}

Expand All @@ -71,5 +75,6 @@ public class InterfaceAudience {
@Retention(RetentionPolicy.RUNTIME)
public @interface Private { }

private InterfaceAudience() { } // Audience can't exist on its own
/** Audience can't exist on its own. */
private InterfaceAudience() { }
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,29 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

import org.apache.yetus.audience.InterfaceAudience.LimitedPrivate;
import org.apache.yetus.audience.InterfaceAudience.Private;
import org.apache.yetus.audience.InterfaceAudience.Public;

/**
* Annotation to inform users of how much to rely on a particular package,
* class or method not changing over time. Currently the stability can be
* {@link Stable}, {@link Evolving} or {@link Unstable}. <br>
*
* <ul><li>All classes that are annotated with {@link Public} or
* {@link LimitedPrivate} must have InterfaceStability annotation. </li>
* <li>Classes that are {@link Private} are to be considered unstable unless
* a different InterfaceStability annotation states otherwise.</li>
* <li>Incompatible changes must not be made to classes marked as stable.</li>
* <ul><li>All classes that are annotated with
* {@link InterfaceAudience.Public} or
* {@link InterfaceAudience.LimitedPrivate} must have InterfaceStability
* annotation. </li>
* <li>Classes that are {@link InterfaceAudience.Private} are to be
* considered unstable unless a different InterfaceStability annotation
* states otherwise.</li>
* <li>Incompatible changes must not be made to classes marked as
* stable.</li>
* </ul>
*/
@InterfaceAudience.Public
@InterfaceStability.Evolving
public class InterfaceStability {
/** Default constructor. */
public InterfaceStability() {
}

/**
* Can evolve while retaining compatibility for minor release boundaries.
* can break compatibility only at major release (ie. at m.0).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,34 +25,72 @@
import java.util.EnumSet;
import java.util.HashSet;
import java.util.Set;
import java.util.TreeSet;

/**
* A {@link jdk.javadoc.doclet.Doclet}
* for excluding elements that are annotated with
* {@link org.apache.yetus.audience.InterfaceAudience.Private} or
* {@link org.apache.yetus.audience.InterfaceAudience.LimitedPrivate}.
* It delegates to the Standard Doclet, and takes the same options.
* Subclasses may override {@link #getName()}, {@link #getSupportedOptions()},
* and {@link #run(DocletEnvironment)} to customize behavior.
*/
@InterfaceAudience.Public
@InterfaceStability.Evolving
public class ExcludePrivateAnnotationsStandardDoclet extends StandardDoclet {
protected DocletEnvironmentProcessor processor = new DocletEnvironmentProcessor();
/** Default constructor. */
public ExcludePrivateAnnotationsStandardDoclet() {
super();
}

/** The doclet environment processor. */
// CHECKSTYLE:OFF VisibilityModifier - protected for subclass API compatibility
protected DocletEnvironmentProcessor processor =
new DocletEnvironmentProcessor();
// CHECKSTYLE:ON VisibilityModifier

/**
* Returns the processor used to filter the doclet environment.
* @return the doclet environment processor
*/
protected DocletEnvironmentProcessor getProcessor() {
return processor;
}

/**
* {@inheritDoc}
* Returns the name of this doclet.
* Subclasses should override to return a distinct name.
* @return doclet name
*/
@Override
public String getName() {
return "ExcludePrivateAnnotationsStandard";
}

/**
* {@inheritDoc}
* Returns the supported options, including stability filter options.
* Subclasses may override to add or remove options.
* @return set of supported options
*/
@Override
public Set<Option> getSupportedOptions() {
Set<Option> options = new HashSet<>(super.getSupportedOptions());
Set<StabilityOption> stabilityOptions = EnumSet.allOf(StabilityOption.class);
Set<StabilityOption> stabilityOptions =
EnumSet.allOf(StabilityOption.class);
stabilityOptions.forEach(o -> o.setProcessor(processor));
options.addAll(stabilityOptions);
return options;
}

/**
* {@inheritDoc}
* Runs the doclet, wrapping the environment to filter private elements.
* Subclasses may override to apply additional filtering.
* @param environment the doclet environment
* @return true if successful
*/
@Override
public boolean run(final DocletEnvironment environment) {
return super.run(processor.wrap(environment));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,30 @@
@InterfaceStability.Evolving
public class IncludePublicAnnotationsStandardDoclet
extends ExcludePrivateAnnotationsStandardDoclet {
/** Default constructor. */
public IncludePublicAnnotationsStandardDoclet() {
super();
}

/**
* {@inheritDoc}
* Initializes the doclet, marking unannotated classes as private.
* Subclasses may override to apply additional initialization.
* @param locale the locale for messages
* @param reporter the reporter for messages
*/
@Override
public void init(final Locale locale, final Reporter reporter) {
processor.treatUnannotatedClassesAsPrivate();
getProcessor().treatUnannotatedClassesAsPrivate();
super.init(locale, reporter);
}

/**
* {@inheritDoc}
* Returns the name of this doclet.
* Subclasses should override to return a distinct name.
* @return doclet name
*/
@Override
public String getName() {
return "IncludePublicAnnotationsStandard";
Expand Down
9 changes: 8 additions & 1 deletion pom.xml
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the pom changes?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of this is fallout from upgrading the apache pom which sets a bunch of stuff that it didn't before.

Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,19 @@
<version>${maven-javadoc-plugin.version}</version>
<configuration>
<notimestamp>true</notimestamp><!-- avoid noise for svn/gitpubsub -->
<release combine.self="override"></release>
<additionalOptions>${jigsaw.avoidance}</additionalOptions>
<additionalJOption>-J${jigsaw.avoidance}</additionalJOption>
</configuration>
</plugin>

<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<configuration>
<exportAntProperties>false</exportAntProperties>
</configuration>
</plugin>

<plugin>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
Expand Down Expand Up @@ -308,7 +316,6 @@
<additionalOptions>
<additionalOption>${jigsaw.avoidance}</additionalOption>
</additionalOptions>

<additionalJOption>-J${jigsaw.avoidance}</additionalJOption>

<doclet>org.apache.yetus.audience.tools.ExcludePrivateAnnotationsStandardDoclet</doclet>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@
@InterfaceStability.Unstable
public final class CreateDirsMojo extends AbstractMojo {

/** Default constructor. */
public CreateDirsMojo() {
super();
}

/**
* Location of the dirName.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
@InterfaceStability.Unstable
public final class CreateSymLinkMojo extends AbstractMojo {

/** Default constructor. */
public CreateSymLinkMojo() {
super();
}

/**
* Location of the target.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@
@InterfaceStability.Unstable
public final class MakeBins4Libs extends AbstractMojo {

/** Default constructor. */
public MakeBins4Libs() {
super();
}

/**
* bin dir.
*/
Expand Down