Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix invalid scaladoc links which cannot be found (#353) #682

Merged
merged 1 commit into from
Sep 26, 2023
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 @@ -134,7 +134,7 @@ abstract class BehaviorTestKit[T] {

/**
* Returns the current behavior as it was returned from processing the previous message.
* For example if [[Behaviors.unhandled]] is returned it will be kept here, but not in
* For example if [[pekko.actor.typed.javadsl.Behaviors.unhandled]] is returned it will be kept here, but not in
* [[currentBehavior]].
*/
def returnedBehavior: Behavior[T]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ abstract class TestProbe[M] extends RecipientRef[M] { this: InternalRecipientRef

/**
* Obtain time remaining for execution of the innermost enclosing `within`
* block or throw an [[AssertionError]] if no `within` block surrounds this
* block or throw an [[java.lang.AssertionError]] if no `within` block surrounds this
* call.
*/
def getRemaining: Duration
Expand Down Expand Up @@ -143,7 +143,7 @@ abstract class TestProbe[M] extends RecipientRef[M] { this: InternalRecipientRef
/**
* Receive one message from the test actor and assert that it equals the
* given object. Wait time is bounded by the given duration, with an
* [[AssertionError]] being thrown in case of timeout.
* [[java.lang.AssertionError]] being thrown in case of timeout.
*
* @return the received object
*/
Expand All @@ -152,7 +152,7 @@ abstract class TestProbe[M] extends RecipientRef[M] { this: InternalRecipientRef
/**
* Receive one message from the test actor and assert that it equals the
* given object. Wait time is bounded by the given duration, with an
* [[AssertionError]] being thrown in case of timeout.
* [[java.lang.AssertionError]] being thrown in case of timeout.
*
* @return the received object
*/
Expand Down Expand Up @@ -190,7 +190,7 @@ abstract class TestProbe[M] extends RecipientRef[M] { this: InternalRecipientRef

/**
* Receive one message of type `M`. Wait time is bounded by the `max` duration,
* with an [[AssertionError]] raised in case of timeout.
* with an [[java.lang.AssertionError]] raised in case of timeout.
*/
def receiveMessage(max: Duration): M

Expand Down Expand Up @@ -235,7 +235,7 @@ abstract class TestProbe[M] extends RecipientRef[M] { this: InternalRecipientRef

/**
* Expect the given actor to be stopped or stop within the given timeout or
* throw an [[AssertionError]].
* throw an [[java.lang.AssertionError]].
*
* Note that the timeout is scaled using the configuration entry "pekko.actor.testkit.typed.timefactor".
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ trait BehaviorTestKit[T] {

/**
* Returns the current behavior as it was returned from processing the previous message.
* For example if [[Behaviors.unhandled]] is returned it will be kept here, but not in
* For example if [[pekko.actor.typed.scaladsl.Behaviors.unhandled]] is returned it will be kept here, but not in
* [[currentBehavior]].
*/
def returnedBehavior: Behavior[T]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ object TestProbe {

/**
* Obtain time remaining for execution of the innermost enclosing `within`
* block or throw an [[AssertionError]] if no `within` block surrounds this
* block or throw an [[java.lang.AssertionError]] if no `within` block surrounds this
* call.
*/
def remaining: FiniteDuration
Expand Down Expand Up @@ -128,7 +128,7 @@ object TestProbe {
/**
* Receive one message from the test actor and assert that it equals the
* given object. Wait time is bounded by the given duration, with an
* [[AssertionError]] being thrown in case of timeout.
* [[java.lang.AssertionError]] being thrown in case of timeout.
*
* @return the received object
*/
Expand All @@ -137,7 +137,7 @@ object TestProbe {
/**
* Receive one message from the test actor and assert that it equals the
* given object. Wait time is bounded by the given duration, with an
* [[AssertionError]] being thrown in case of timeout.
* [[java.lang.AssertionError]] being thrown in case of timeout.
*
* @return the received object
*/
Expand Down Expand Up @@ -172,7 +172,7 @@ object TestProbe {

/**
* Receive one message of type `M`. Wait time is bounded by the `max` duration,
* with an [[AssertionError]] raised in case of timeout.
* with an [[java.lang.AssertionError]] raised in case of timeout.
*/
def receiveMessage(max: FiniteDuration): M

Expand Down Expand Up @@ -225,7 +225,7 @@ object TestProbe {

/**
* Expect the given actor to be stopped or stop within the given timeout or
* throw an [[AssertionError]].
* throw an [[java.lang.AssertionError]].
*/
def expectTerminated[U](actorRef: ActorRef[U], max: FiniteDuration): Unit

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ trait ActorRef[-T] extends RecipientRef[T] with java.lang.Comparable[ActorRef[_]
/**
* Unsafe utility method for widening the type accepted by this ActorRef;
* provided to avoid having to use `asInstanceOf` on the full reference type,
* which would unfortunately also work on non-ActorRefs. Use it with caution,it may cause a [[ClassCastException]] when you send a message
* to the widened [[ActorRef[U]]].
* which would unfortunately also work on non-ActorRefs. Use it with caution,it may cause a [[java.lang.ClassCastException]] when you send a message
* to the widened [[ActorRef ActorRef[U]]].
He-Pin marked this conversation as resolved.
Show resolved Hide resolved
*/
def unsafeUpcast[U >: T @uncheckedVariance]: ActorRef[U]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ abstract class Behavior[T](private[pekko] val _tag: Int) { behavior =>
* provided as an alternative to the universally available `asInstanceOf`, which
* casts the entire type rather than just the type parameter.
* Typically used to upcast a type, for instance from `Nothing` to some type `U`.
* Use it with caution, it may lead to a [[ClassCastException]] when you send a message
* Use it with caution, it may lead to a [[java.lang.ClassCastException]] when you send a message
* to the resulting [[Behavior[U]]].
*/
@InternalApi private[pekko] final def unsafeCast[U]: Behavior[U] = this.asInstanceOf[Behavior[U]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ trait Scheduler {
* Scala API: Schedules a Runnable to be run once with a delay, i.e. a time period that
* has to pass before the runnable is executed.
*
* @throws IllegalArgumentException if the given delays exceed the maximum
* @throws java.lang.IllegalArgumentException if the given delays exceed the maximum
* reach (calculated as: `delay / tickNanos > Int.MaxValue`).
*
* Note: For scheduling within actors `Behaviors.withTimers` or `ActorContext.scheduleOnce` should be preferred.
Expand All @@ -45,7 +45,7 @@ trait Scheduler {
* Java API: Schedules a Runnable to be run once with a delay, i.e. a time period that
* has to pass before the runnable is executed.
*
* @throws IllegalArgumentException if the given delays exceed the maximum
* @throws java.lang.IllegalArgumentException if the given delays exceed the maximum
Copy link
Member

Choose a reason for hiding this comment

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

Maybe better just import it.

Copy link
Contributor

@pjfanning pjfanning Sep 25, 2023

Choose a reason for hiding this comment

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

java.lang is imported implicitly - same as the top level scala package. If scaladoc is not linking these java.lang classes unless you prefix them like this - then there seems to be a bug that we should report to scala team. I'll have to test out locally if this change actually improves the scaladoc or whether the issue is with links to Java classes generally.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, if it can't lik, then its a bug of scaladoc.

Copy link
Contributor Author

@ydash ydash Sep 26, 2023

Choose a reason for hiding this comment

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

In my environment, linking to classes under the top level scala package is also failed without those scala. prefix:

https://github.com/apache/incubator-pekko/pull/682/files#diff-d77b49e58aab175ed0d750b8b282f3ad01daab1ba88f38b3a310dc3c2e89e179L126

* reach (calculated as: `delay / tickNanos > Int.MaxValue`).
*
* Note: For scheduling within actors `Behaviors.withTimers` or `ActorContext.scheduleOnce` should be preferred.
Expand All @@ -67,7 +67,7 @@ trait Scheduler {
* If the `Runnable` throws an exception the repeated scheduling is aborted,
* i.e. the function will not be invoked any more.
*
* @throws IllegalArgumentException if the given delays exceed the maximum
* @throws java.lang.IllegalArgumentException if the given delays exceed the maximum
* reach (calculated as: `delay / tickNanos > Int.MaxValue`).
*
* Note: For scheduling within actors `Behaviors.withTimers` should be preferred.
Expand All @@ -91,7 +91,7 @@ trait Scheduler {
* If the `Runnable` throws an exception the repeated scheduling is aborted,
* i.e. the function will not be invoked any more.
*
* @throws IllegalArgumentException if the given delays exceed the maximum
* @throws java.lang.IllegalArgumentException if the given delays exceed the maximum
* reach (calculated as: `delay / tickNanos > Int.MaxValue`).
*
* Note: For scheduling in actors `Behaviors.withTimers` should be preferred.
Expand Down Expand Up @@ -128,7 +128,7 @@ trait Scheduler {
* If the `Runnable` throws an exception the repeated scheduling is aborted,
* i.e. the function will not be invoked any more.
*
* @throws IllegalArgumentException if the given delays exceed the maximum
* @throws java.lang.IllegalArgumentException if the given delays exceed the maximum
* reach (calculated as: `delay / tickNanos > Int.MaxValue`).
*
* Note: For scheduling within actors `Behaviors.withTimers` should be preferred.
Expand Down Expand Up @@ -162,7 +162,7 @@ trait Scheduler {
* If the `Runnable` throws an exception the repeated scheduling is aborted,
* i.e. the function will not be invoked any more.
*
* @throws IllegalArgumentException if the given delays exceed the maximum
* @throws java.lang.IllegalArgumentException if the given delays exceed the maximum
* reach (calculated as: `delay / tickNanos > Int.MaxValue`).
*
* Note: For scheduling in actors `Behaviors.withTimers` should be preferred.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import pekko.util.OptionConverters._
* messages may be routed to two different workers and processed independent of each other.
*
* A worker actor (consumer) and its `ConsumerController` is dynamically registered to the
* `WorkPullingProducerController` via a [[ServiceKey]]. It will register itself to the
* `WorkPullingProducerController` via a [[pekko.actor.typed.receptionist.ServiceKey]]. It will register itself to the
* * [[pekko.actor.typed.receptionist.Receptionist]], and the `WorkPullingProducerController`
* subscribes to the same key to find active workers. In this way workers can be dynamically
* added or removed from any node in the cluster.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ trait ActorContext[T] extends TypedActorContext[T] with ClassicActorContextProvi
* *Warning*: This method is not thread-safe and must not be accessed from threads other
* than the ordinary actor message processing thread, such as [[java.util.concurrent.CompletionStage]] callbacks.
*
* @throws IllegalArgumentException if the given actor ref is not a direct child of this actor
* @throws java.lang.IllegalArgumentException if the given actor ref is not a direct child of this actorc
*/
def stop[U](child: ActorRef[U]): Unit

Expand All @@ -184,7 +184,7 @@ trait ActorContext[T] extends TypedActorContext[T] with ClassicActorContextProvi
*
* `watch` is idempotent if it is not mixed with `watchWith`.
*
* It will fail with an [[IllegalStateException]] if the same subject was watched before using `watchWith`.
* It will fail with an [[java.lang.IllegalStateException]] if the same subject was watched before using `watchWith`.
* To clear the termination message, unwatch first.
*
* *Warning*: This method is not thread-safe and must not be accessed from threads other
Expand All @@ -199,7 +199,7 @@ trait ActorContext[T] extends TypedActorContext[T] with ClassicActorContextProvi
*
* `watchWith` is idempotent if it is called with the same `msg` and not mixed with `watch`.
*
* It will fail with an [[IllegalStateException]] if the same subject was watched before using `watch` or `watchWith` with
* It will fail with an [[java.lang.IllegalStateException]] if the same subject was watched before using `watch` or `watchWith` with
* another termination message. To change the termination message, unwatch first.
*
* *Warning*: This method is not thread-safe and must not be accessed from threads other
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ import java.util.function.{ Function => JFunction, Predicate }
* Return the first element of the message buffer without removing it.
*
* @return the first element or throws `NoSuchElementException` if the buffer is empty
* @throws `NoSuchElementException` if the buffer is empty
* @throws java.util.NoSuchElementException if the buffer is empty
*/
def head: T

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ trait ActorContext[T] extends TypedActorContext[T] with ClassicActorContextProvi
* *Warning*: This method is not thread-safe and must not be accessed from threads other
* than the ordinary actor message processing thread, such as [[scala.concurrent.Future]] callbacks.
*
* @throws IllegalArgumentException if the given actor ref is not a direct child of this actor
* @throws java.lang.IllegalArgumentException if the given actor ref is not a direct child of this actor
*/
def stop[U](child: ActorRef[U]): Unit

Expand All @@ -167,7 +167,7 @@ trait ActorContext[T] extends TypedActorContext[T] with ClassicActorContextProvi
*
* `watch` is idempotent if it is not mixed with `watchWith`.
*
* It will fail with an [[IllegalStateException]] if the same subject was watched before using `watchWith`.
* It will fail with an [[java.lang.IllegalStateException]] if the same subject was watched before using `watchWith`.
* To clear the termination message, unwatch first.
*
* *Warning*: This method is not thread-safe and must not be accessed from threads other
Expand All @@ -182,7 +182,7 @@ trait ActorContext[T] extends TypedActorContext[T] with ClassicActorContextProvi
*
* `watchWith` is idempotent if it is called with the same `msg` and not mixed with `watch`.
*
* It will fail with an [[IllegalStateException]] if the same subject was watched before using `watch` or `watchWith` with
* It will fail with an [[java.lang.IllegalStateException]] if the same subject was watched before using `watch` or `watchWith` with
* another termination message. To change the termination message, unwatch first.
*
* *Warning*: This method is not thread-safe and must not be accessed from threads other
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ import pekko.annotation.{ DoNotInherit, InternalApi }
* Return the first element of the message buffer without removing it.
*
* @return the first element or throws `NoSuchElementException` if the buffer is empty
* @throws `NoSuchElementException` if the buffer is empty
* @throws java.util.NoSuchElementException if the buffer is empty
*/
def head: T

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import static org.apache.pekko.actor.SupervisorStrategy.Directive;

/**
* Used for building a partial function for {@link org.apache.pekko.actor.Actor#supervisorStrategy()
* Used for building a partial function for {@link org.apache.pekko.actor.Actor#supervisorStrategy
* Actor.supervisorStrategy()}. * Inside an actor you can use it like this with Java 8 to define
* your supervisorStrategy.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class FSMStopBuilder<S, D> {
private UnitPFBuilder<FSM.StopEvent<S, D>> builder = new UnitPFBuilder<FSM.StopEvent<S, D>>();

/**
* Add a case statement that matches on an {@link FSM.Reason}.
* Add a case statement that matches on an {@link org.apache.pekko.actor.FSM.Reason}.
*
* @param reason the reason for the termination
* @param apply an action to apply to the event and state data if there is a match
Expand Down
2 changes: 1 addition & 1 deletion actor/src/main/java/org/apache/pekko/japi/pf/Match.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public static final <F, T> Match<F, T> create(PFBuilder<F, T> builder) {
*
* @param i the argument to apply the match to
* @return the result of the application
* @throws MatchError if there is no match
* @throws scala.MatchError if there is no match
*/
public R match(I i) throws MatchError {
return statements.apply(i);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

/**
* Used for building a partial function for {@link
* org.apache.pekko.actor.AbstractActor#createReceive() AbstractActor.createReceive()}.
* org.apache.pekko.actor.AbstractActor#createReceive AbstractActor.createReceive()}.
Copy link
Member

Choose a reason for hiding this comment

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

this seems wrong too.

*
* <p>There is both a match on type only, and a match on type and predicate.
*
Expand Down
12 changes: 6 additions & 6 deletions actor/src/main/scala/org/apache/pekko/actor/AbstractFSM.scala
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ abstract class AbstractFSM[S, D] extends FSM[S, D] {
}

/**
* Set initial state. Call this method from the constructor before the [[#initialize]] method.
* If different state is needed after a restart this method, followed by [[#initialize]], can
* Set initial state. Call this method from the constructor before the [[initialize]] method.
* If different state is needed after a restart this method, followed by [[initialize]], can
* be used in the actor life cycle hooks [[pekko.actor.Actor#preStart]] and [[pekko.actor.Actor#postRestart]].
*
* @param stateName initial state designator
Expand All @@ -138,8 +138,8 @@ abstract class AbstractFSM[S, D] extends FSM[S, D] {
startWith(stateName, stateData, null: FiniteDuration)

/**
* Set initial state. Call this method from the constructor before the [[#initialize]] method.
* If different state is needed after a restart this method, followed by [[#initialize]], can
* Set initial state. Call this method from the constructor before the [[initialize]] method.
* If different state is needed after a restart this method, followed by [[initialize]], can
* be used in the actor life cycle hooks [[pekko.actor.Actor#preStart]] and [[pekko.actor.Actor#postRestart]].
*
* @param stateName initial state designator
Expand All @@ -150,8 +150,8 @@ abstract class AbstractFSM[S, D] extends FSM[S, D] {
super.startWith(stateName, stateData, Option(timeout))

/**
* Set initial state. Call this method from the constructor before the [[#initialize]] method.
* If different state is needed after a restart this method, followed by [[#initialize]], can
* Set initial state. Call this method from the constructor before the [[initialize]] method.
* If different state is needed after a restart this method, followed by [[initialize]], can
* be used in the actor life cycle hooks [[pekko.actor.Actor#preStart]] and [[pekko.actor.Actor#postRestart]].
*
* @param stateName initial state designator
Expand Down
4 changes: 2 additions & 2 deletions actor/src/main/scala/org/apache/pekko/actor/ActorCell.scala
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ trait ActorContext extends ActorRefFactory with ClassicActorContextProvider {
*
* `watch` is idempotent if it is not mixed with `watchWith`.
*
* It will fail with an [[IllegalStateException]] if the same subject was watched before using `watchWith`.
* It will fail with an [[java.lang.IllegalStateException]] if the same subject was watched before using `watchWith`.
* To clear the termination message, unwatch first.
*
* *Warning*: This method is not thread-safe and must not be accessed from threads other
Expand All @@ -218,7 +218,7 @@ trait ActorContext extends ActorRefFactory with ClassicActorContextProvider {
*
* `watchWith` is idempotent if it is called with the same `msg` and not mixed with `watch`.
*
* It will fail with an [[IllegalStateException]] if the same subject was watched before using `watch` or `watchWith` with
* It will fail with an [[java.lang.IllegalStateException]] if the same subject was watched before using `watch` or `watchWith` with
* another termination message. To change the termination message, unwatch first.
*
* *Warning*: This method is not thread-safe and must not be accessed from threads other
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ trait ActorRefFactory {
*
* @throws pekko.ConfigurationException if deployment, dispatcher
* or mailbox configuration is wrong
* @throws UnsupportedOperationException if invoked on an ActorSystem that
* @throws java.lang.UnsupportedOperationException if invoked on an ActorSystem that
* uses a custom user guardian
*/
def actorOf(props: Props): ActorRef
Expand All @@ -240,7 +240,7 @@ trait ActorRefFactory {
* invalid or already in use
* @throws pekko.ConfigurationException if deployment, dispatcher
* or mailbox configuration is wrong
* @throws UnsupportedOperationException if invoked on an ActorSystem that
* @throws java.lang.UnsupportedOperationException if invoked on an ActorSystem that
* uses a custom user guardian
*/
def actorOf(props: Props, name: String): ActorRef
Expand Down
Loading