-
Bug
-
Resolution: Unresolved
-
P4
-
18, 19, 20, 21
-
None
Steps:
1. Create Java class MyTest.java:
package com.example;
/**
* {@snippet class="Test" region=reg:
*
*
* void two() {}}
*/
public class MyTest {
}
2. Create the Test.java snippet in snippet-files:
class Test {
// @start region=reg
// @replace region substring="one" replacement="two"
void one() {}
// @end
// @end
}
3. Run javadoc tool
javadoc.exe --snippet-path=snippet-files MyTest.java
Expected result: either no errors, or an error message which clearly shows what should be fixed
Actual result: error message that says about content mismatch, while the rendered content shown in error message is byte-to-byte the same.
Here's the complete output:
Loading source file MyTest.java...
Constructing Javadoc information...
Building index for all the packages and classes...
Standard Doclet version 21-ea+12-971
Building tree for all the packages and classes...
Generating .\com\example\MyTest.html...
MyTest.java:4: error: contents mismatch:
* {@snippet class="Test" region=reg:
^
----------------- inline -------------------
void two() {}
----------------- external -----------------
void two() {}
MyTest.java:9: warning: use of default constructor, which does not provide a comment
public class MyTest {
^
Generating .\com\example\package-summary.html...
Generating .\com\example\package-tree.html...
Generating .\overview-tree.html...
Building index for all classes...
Generating .\allclasses-index.html...
Generating .\allpackages-index.html...
Generating .\index-all.html...
Generating .\search.html...
Generating .\index.html...
Generating .\help-doc.html...
1 error
1 warning
1. Create Java class MyTest.java:
package com.example;
/**
* {@snippet class="Test" region=reg:
*
*
* void two() {}}
*/
public class MyTest {
}
2. Create the Test.java snippet in snippet-files:
class Test {
// @start region=reg
// @replace region substring="one" replacement="two"
void one() {}
// @end
// @end
}
3. Run javadoc tool
javadoc.exe --snippet-path=snippet-files MyTest.java
Expected result: either no errors, or an error message which clearly shows what should be fixed
Actual result: error message that says about content mismatch, while the rendered content shown in error message is byte-to-byte the same.
Here's the complete output:
Loading source file MyTest.java...
Constructing Javadoc information...
Building index for all the packages and classes...
Standard Doclet version 21-ea+12-971
Building tree for all the packages and classes...
Generating .\com\example\MyTest.html...
MyTest.java:4: error: contents mismatch:
* {@snippet class="Test" region=reg:
^
----------------- inline -------------------
void two() {}
----------------- external -----------------
void two() {}
MyTest.java:9: warning: use of default constructor, which does not provide a comment
public class MyTest {
^
Generating .\com\example\package-summary.html...
Generating .\com\example\package-tree.html...
Generating .\overview-tree.html...
Building index for all classes...
Generating .\allclasses-index.html...
Generating .\allpackages-index.html...
Generating .\index-all.html...
Generating .\search.html...
Generating .\index.html...
Generating .\help-doc.html...
1 error
1 warning
- relates to
-
JDK-8276966 Improve diagnostic output for the mismatching parts of a hybrid snippet
- Open