-
Bug
-
Resolution: Fixed
-
P2
-
14
-
b28
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8247718 | 16 | Jonathan Gibbons | P2 | Resolved | Fixed | b02 |
JDK-8250050 | 15.0.2 | Jonathan Gibbons | P2 | Resolved | Fixed | b01 |
JDK-8250348 | 15.0.1 | Jonathan Gibbons | P2 | Resolved | Fixed | b03 |
From amber-dev:
Hello,
The javadoc tool in 14-ea+28-1366 doesn't resolve {@link} tags in
records unless the link target is qualified with its class name. This
seems like a bug because it's different than the behavior for
non-record classes.
Take this code for example:
package example;
public class JavadocTest {
/**
* {@link #foo()}
* {@link Bar}
*/
public static class Foo {
public void foo() {}
}
/**
* {@link #bar()}
* {@link Foo}
*/
public record Bar() {
public void bar() {}
}
}
The javadoc tool complains about both of the link tags in the "Bar"
record class. It's fine with the similar-looking link tags in the
"Foo" non-record class.
javadoc --enable-preview --release 14 -d jdoc
src/main/java/example/JavadocTest.java
src\main\java\example\JavadocTest.java:13: error: reference not found
* {@link #bar()}
^
src\main\java\example\JavadocTest.java:14: error: reference not found
* {@link Foo}
^
If I qualify the link tags in the record class, then javadoc is happy.
package example;
public class JavadocTest {
/**
* {@link #foo()}
* {@link Bar}
*/
public static class Foo {
public void foo() {}
}
/**
* {@link JavadocTest.Bar#bar()}
* {@link JavadocTest.Foo}
*/
public record Bar() {
public void bar() {}
}
}
-Michael
Hello,
The javadoc tool in 14-ea+28-1366 doesn't resolve {@link} tags in
records unless the link target is qualified with its class name. This
seems like a bug because it's different than the behavior for
non-record classes.
Take this code for example:
package example;
public class JavadocTest {
/**
* {@link #foo()}
* {@link Bar}
*/
public static class Foo {
public void foo() {}
}
/**
* {@link #bar()}
* {@link Foo}
*/
public record Bar() {
public void bar() {}
}
}
The javadoc tool complains about both of the link tags in the "Bar"
record class. It's fine with the similar-looking link tags in the
"Foo" non-record class.
javadoc --enable-preview --release 14 -d jdoc
src/main/java/example/JavadocTest.java
src\main\java\example\JavadocTest.java:13: error: reference not found
* {@link #bar()}
^
src\main\java\example\JavadocTest.java:14: error: reference not found
* {@link Foo}
^
If I qualify the link tags in the record class, then javadoc is happy.
package example;
public class JavadocTest {
/**
* {@link #foo()}
* {@link Bar}
*/
public static class Foo {
public void foo() {}
}
/**
* {@link JavadocTest.Bar#bar()}
* {@link JavadocTest.Foo}
*/
public record Bar() {
public void bar() {}
}
}
-Michael
- backported by
-
JDK-8247718 Relative link tags in record javadoc don't resolve
- Resolved
-
JDK-8250050 Relative link tags in record javadoc don't resolve
- Resolved
-
JDK-8250348 Relative link tags in record javadoc don't resolve
- Resolved
- links to