This repository was archived by the owner on Aug 27, 2022. It is now read-only.
File tree 6 files changed +65
-5
lines changed
src/jdk.compiler/share/classes/com/sun/tools/javac/parser
test/langtools/tools/javac/doctree/dcapi
6 files changed +65
-5
lines changed Original file line number Diff line number Diff line change @@ -708,14 +708,14 @@ boolean isEndPreamble() {
708
708
case "body" :
709
709
// Check if also followed by <main>
710
710
// 1. skip rest of <body>
711
- while (ch != - 1 && ch != '>' ) {
711
+ while (bp < buflen && ch != '>' ) {
712
712
nextChar ();
713
713
}
714
714
if (ch == '>' ) {
715
715
nextChar ();
716
716
}
717
717
// 2. skip any whitespace
718
- while (ch != - 1 && Character . isWhitespace (ch )) {
718
+ while (bp < buflen && isWhitespace (ch )) {
719
719
nextChar ();
720
720
}
721
721
// 3. check if looking at "<main..."
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (c) 2015, 2019 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2015, 2020 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
23
23
24
24
/*
25
25
* @test
26
- * @bug 8132096 8157611 8190552
26
+ * @bug 8132096 8157611 8190552 8251357
27
27
* @summary test the APIs in the DocTree interface
28
28
* @modules jdk.compiler/com.sun.tools.javac.api
29
29
* jdk.compiler/com.sun.tools.javac.file
53
53
import javax .lang .model .util .Elements ;
54
54
import javax .tools .FileObject ;
55
55
import javax .tools .JavaFileObject ;
56
- import javax .tools .JavaFileObject .Kind ;
57
56
import javax .tools .StandardJavaFileManager ;
58
57
59
58
import com .sun .source .doctree .DocTree ;
Original file line number Diff line number Diff line change
1
+ <!-- /nodynamiccopyright/ -->
2
+ < HTML >
3
+ < HEAD >
4
+ </ HEAD >
5
+ < BODY lang ="en "
Original file line number Diff line number Diff line change
1
+ EXPECT_START
2
+ DocComment[DOC_COMMENT, pos:0
3
+ preamble: 5
4
+ Comment[COMMENT, pos:0, <!--_/nodynamiccopyright/_-->]
5
+ StartElement[START_ELEMENT, pos:30
6
+ name:HTML
7
+ attributes: empty
8
+ ]
9
+ StartElement[START_ELEMENT, pos:37
10
+ name:HEAD
11
+ attributes: empty
12
+ ]
13
+ EndElement[END_ELEMENT, pos:44, HEAD]
14
+ Erroneous[ERRONEOUS, pos:52
15
+ code: compiler.err.dc.malformed.html
16
+ body: <
17
+ ]
18
+ firstSentence: 1
19
+ Text[TEXT, pos:53, BODY_lang="en"]
20
+ body: empty
21
+ block tags: empty
22
+ ]
23
+ EXPECT_END
Original file line number Diff line number Diff line change
1
+ <!-- /nodynamiccopyright/ -->
2
+ < HTML >
3
+ < HEAD >
4
+ </ HEAD >
5
+ < BODY lang ="en ">
Original file line number Diff line number Diff line change
1
+ EXPECT_START
2
+ DocComment[DOC_COMMENT, pos:0
3
+ preamble: 5
4
+ Comment[COMMENT, pos:0, <!--_/nodynamiccopyright/_-->]
5
+ StartElement[START_ELEMENT, pos:30
6
+ name:HTML
7
+ attributes: empty
8
+ ]
9
+ StartElement[START_ELEMENT, pos:37
10
+ name:HEAD
11
+ attributes: empty
12
+ ]
13
+ EndElement[END_ELEMENT, pos:44, HEAD]
14
+ StartElement[START_ELEMENT, pos:52
15
+ name:BODY
16
+ attributes: 1
17
+ Attribute[ATTRIBUTE, pos:58
18
+ name: lang
19
+ vkind: DOUBLE
20
+ value: 1
21
+ Text[TEXT, pos:64, en]
22
+ ]
23
+ ]
24
+ firstSentence: empty
25
+ body: empty
26
+ block tags: empty
27
+ ]
28
+ EXPECT_END
You can’t perform that action at this time.
0 commit comments