Skip to content

Commit

Permalink
Hides internals from Javadoc (OpenJDK 17) (#1556)
Browse files Browse the repository at this point in the history
Signed-off-by: Yauheni Khnykin <[email protected]>
  • Loading branch information
Hsilgos authored Oct 25, 2023
1 parent c63b1ae commit 011f8ff
Show file tree
Hide file tree
Showing 41 changed files with 1,367 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"}}{{/set}}
{{/if}}

/**
* @hidden
*/
{{resolveName "visibility"}}final int value;

{{resolveName}}(final int value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,17 @@
{{>java/JavaDocComment}}{{>java/JavaAttributes}}
{{resolveName "visibility"}}{{#if forceStatic}}static {{/if}}{{!!
}}final class {{resolveName}} extends Exception {
/**
* @hidden
* @param error The error.
*/
{{resolveName "visibility"}}{{resolveName}}(final {{resolveName errorType}} error) {
super(error.toString());
this.error = error;
}

/**
* @hidden
*/
{{resolveName "visibility"}}final {{resolveName errorType}} error;
}
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ public abstract class NativeBase {
}
}

/**
* @hidden
* @param nativeHandle The native handle
* @param disposer The disposer
*/
protected NativeBase(final long nativeHandle, final Disposer disposer) {
this.nativeHandle = nativeHandle;
REFERENCES.add(new DisposableReference(this, nativeHandle, disposer));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
/*
*
*/

package com.example.smoke;


@OnException
public final class AttributesCrashException extends Exception {
/**
* @hidden
* @param error The error.
*/
public AttributesCrashException(final String error) {
super(error.toString());
this.error = error;
}

/**
* @hidden
*/
public final String error;
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
/*
*
*/

package com.example.smoke;


@OnEnumeration
public enum AttributesEnum {
@OnEnumerator
NOPE(0);
/**
* @hidden
*/
public final int value;

AttributesEnum(final int value) {
this.value = value;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
/*
*
*/

package com.example.smoke;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import com.example.NativeBase;

/**
* <p>This is some very useful interface.
*/
Expand All @@ -25,7 +29,11 @@ public enum SomeEnum {
* <p>Somewhat useful
*/
USEFUL(1);
/**
* @hidden
*/
public final int value;

SomeEnum(final int value) {
this.value = value;
}
Expand All @@ -34,10 +42,18 @@ public enum SomeEnum {
* <p>This is some very useful exception.
*/
public static final class SomethingWrongException extends Exception {
/**
* @hidden
* @param error The error.
*/
public SomethingWrongException(final Comments.SomeEnum error) {
super(error.toString());
this.error = error;
}

/**
* @hidden
*/
public final Comments.SomeEnum error;
}
/**
Expand All @@ -54,6 +70,7 @@ public static final class SomeStruct {
*/
@Nullable
public String nullableField;

/**
* <p>This is how easy it is to construct.
* @param someField <p>How useful this struct is
Expand All @@ -63,15 +80,26 @@ public SomeStruct(final boolean someField) {
this.someField = someField;
this.nullableField = null;
}

/**
* <p>This is some struct method that does nothing.
*/



public native void someStructMethod();

/**
* <p>This is some static struct method that does nothing.
*/



public static native void someStaticStructMethod();


}

/**
* @hidden
*/
Expand All @@ -84,15 +112,24 @@ public void disposeNative(long handle) {
}
});
}

private static native void disposeNativeHandle(long nativeHandle);


/**
* <p>This is some very useful lambda that does it.
* @param p0 <p>Very useful input parameter
* @param index <p>Slightly less useful input parameter
* @return <p>Usefulness of the input
*/



public native double doIt(@NonNull final String p0, final int index);


}

/**
* <p>This is some very useful lambda that does it.
*/
Expand All @@ -104,8 +141,13 @@ public interface SomeLambda {
* @param index <p>Slightly less useful input parameter
* @return <p>Usefulness of the input
*/



double doIt(@NonNull final String p0, final int index);
}


/**
* For internal use only.
* @hidden
Expand All @@ -120,80 +162,141 @@ public void disposeNative(long handle) {
}
});
}

private static native void disposeNativeHandle(long nativeHandle);


/**
* <p>This is some very useful method that measures the usefulness of its input.
* @param inputParameter <p>Very useful input parameter
* @return <p>Usefulness of the input
* @throws Comments.SomethingWrongException <p>Sometimes it happens.
*/



public native boolean someMethodWithAllComments(@NonNull final String inputParameter) throws Comments.SomethingWrongException;

/**
* <p>This is some very useful method that measures the usefulness of its input.
* @param input <p>Very useful input parameter
* @return
*/



public native boolean someMethodWithInputComments(@NonNull final String input);

/**
* <p>This is some very useful method that measures the usefulness of its input.
* @param input
* @return <p>Usefulness of the input
*/



public native boolean someMethodWithOutputComments(@NonNull final String input);

/**
* <p>This is some very useful method that measures the usefulness of its input.
* @param input
* @return
*/



public native boolean someMethodWithNoComments(@NonNull final String input);

/**
* <p>This is some very useful method that does not measure the usefulness of its input.
* @param input <p>Very useful input parameter
*/



public native void someMethodWithoutReturnTypeWithAllComments(@NonNull final String input);

/**
* <p>This is some very useful method that does not measure the usefulness of its input.
* @param input
*/



public native void someMethodWithoutReturnTypeWithNoComments(@NonNull final String input);

/**
* <p>This is some very useful method that measures the usefulness of something.
* @return <p>Usefulness of the input
*/



public native boolean someMethodWithoutInputParametersWithAllComments();

/**
* <p>This is some very useful method that measures the usefulness of something.
* @return
*/



public native boolean someMethodWithoutInputParametersWithNoComments();



public native void someMethodWithNothing();

/**
* <p>This is some very useful method that does nothing.
*/



public native void someMethodWithoutReturnTypeOrInputParameters();

/**
*
* @param undocumented
* @param documented <p>nicely documented
* @return
*/



@NonNull
public native String oneParameterCommentOnly(@NonNull final String undocumented, @NonNull final String documented);

/**
*
* @param undocumented
* @return <p>nicely documented
*/



@NonNull
public native String returnCommentOnly(@NonNull final String undocumented);

/**
* <p>Gets some very useful property.
* @return <p>Some very useful property.
*/



public native boolean isSomeProperty();

/**
* <p>Sets some very useful property.
* @param value <p>Some very useful property.
*/



public native void setSomeProperty(final boolean value);



}

Loading

0 comments on commit 011f8ff

Please sign in to comment.