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

Borked javadoc for JDK 9/10 packages #612

Closed
fbricon opened this issue Apr 3, 2018 · 5 comments
Closed

Borked javadoc for JDK 9/10 packages #612

fbricon opened this issue Apr 3, 2018 · 5 comments

Comments

@fbricon
Copy link
Contributor

fbricon commented Apr 3, 2018

Following #582, hovering over the util bit in import java.util.HashMap returns incorrect/wrongly formed javadoc:

screen shot 2018-04-03 at 3 47 34 pm

See output:

[Trace - 15:50:10] Received response 'textDocument/hover - (88)' in 142ms.
Result: {
    "contents": [
        {
            "language": "java",
            "value": "java.util"
        },
        "Contains the collections framework, some internationalization support classes, a service loader, properties, random number generation, string parsing and scanning classes, base64 encoding and decoding, a bit array, and several miscellaneous utility classes. This package also contains legacy collection classes and legacy date and time classes.\n\n## Java Collections Framework ##\n\nFor an overview, API outline, and design rationale, please see:\n\n *   **Collections Framework Documentation**\n\nFor a tutorial and programming guide with examples of use of the collections framework, please see:\n\n *  [ **Collections Framework Tutorial**](http://docs.oracle.com/javase/tutorial/collections/index.html)\n\nSince:\n\n1.0\n\n *      | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n        | Interface                                                                                         | Description                                                                                                                                                                          |\n        | Collection<E>                                                                                     | The root interface in the *collection hierarchy*.                                                                                                                                    |\n        | Comparator<T>                                                                                     | A comparison function, which imposes a *total ordering* on some collection of objects.                                                                                               |\n        | Deque<E>                                                                                          | A linear collection that supports element insertion and removal at both ends.                                                                                                        |\n        | Enumeration<E>                                                                                    | An object that implements the Enumeration interface generates a series of elements, one at a time.                                                                                   |\n        | EventListener                                                                                     | A tagging interface that all event listener interfaces must extend.                                                                                                                  |\n        | Formattable                                                                                       | The `Formattable` interface must be implemented by any class that needs to perform custom formatting using the `'s'` conversion specifier of `Formatter`.                            |\n        | Iterator<E>                                                                                       | An iterator over a collection.                                                                                                                                                       |\n        | List<E>                                                                                           | An ordered collection (also known as a *sequence*).                                                                                                                                  |\n        | ListIterator<E>                                                                                   | An iterator for lists that allows the programmer to traverse the list in either direction, modify the list during iteration, and obtain the iterator's current position in the list. |\n        | Map<K,V>                                                                                          | An object that maps keys to values.                                                                                                                                                  |\n        | Map.Entry<K,V>                                                                                    | A map entry (key-value pair).                                                                                                                                                        |\n        | NavigableMap<K,V>                                                                                 | A `SortedMap` extended with navigation methods returning the closest matches for given search targets.                                                                               |\n        | NavigableSet<E>                                                                                   | A `SortedSet` extended with navigation methods reporting closest matches for given search targets.                                                                                   |\n        | Observer                                                                                          | Deprecated.  This interface has been deprecated.                                                                                                                                     |\n        | PrimitiveIterator<T,T\\_CONS>                                                                      | A base type for primitive specializations of `Iterator`.                                                                                                                             |\n        | PrimitiveIterator.OfDouble                                                                        | An Iterator specialized for `double` values.                                                                                                                                         |\n        | PrimitiveIterator.OfInt                                                                           | An Iterator specialized for `int` values.                                                                                                                                            |\n        | PrimitiveIterator.OfLong                                                                          | An Iterator specialized for `long` values.                                                                                                                                           |\n        | Queue<E>                                                                                          | A collection designed for holding elements prior to processing.                                                                                                                      |\n        | RandomAccess                                                                                      | Marker interface used by `List` implementations to indicate that they support fast (generally constant time) random access.                                                          |\n        | ServiceLoader.Provider<S>                                                                         | Represents a service provider located by `ServiceLoader`.                                                                                                                            |\n        | Set<E>                                                                                            | A collection that contains no duplicate elements.                                                                                                                                    |\n        | SortedMap<K,V>                                                                                    | A `Map` that further provides a *total ordering* on its keys.                                                                                                                        |\n        | SortedSet<E>                                                                                      | A `Set` that further provides a *total ordering* on its elements.                                                                                                                    |\n        | Spliterator<T>                                                                                    | An object for traversing and partitioning elements of a source.                                                                                                                      |\n        | Spliterator.OfDouble                                                                              | A Spliterator specialized for `double` values.                                                                                                                                       |\n        | Spliterator.OfInt                                                                                 | A Spliterator specialized for `int` values.                                                                                                                                          |\n        | Spliterator.OfLong                                                                                | A Spliterator specialized for `long` values.                                                                                                                                         |\n        | Spliterator.OfPrimitive<T,T\\_CONS,T\\_SPLITR extends Spliterator.OfPrimitive<T,T\\_CONS,T\\_SPLITR>> | A Spliterator specialized for primitive values.                                                                                                                                      |\n *      | ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n        | Class                                       | Description                                                                                                                                                                                                                                                                                       |\n        | AbstractCollection<E>                       | This class provides a skeletal implementation of the `Collection` interface, to minimize the effort required to implement this interface.                                                                                                                                                         |\n        | AbstractList<E>                             | This class provides a skeletal implementation of the `List` interface to minimize the effort required to implement this interface backed by a \"random access\" data store (such as an array).                                                                                                      |\n        | AbstractMap<K,V>                            | This class provides a skeletal implementation of the `Map` interface, to minimize the effort required to implement this interface.                                                                                                                                                                |\n        | AbstractMap.SimpleEntry<K,V>                | An Entry maintaining a key and a value.                                                                                                                                                                                                                                                           |\n        | AbstractMap.SimpleImmutableEntry<K,V>       | An Entry maintaining an immutable key and value.                                                                                                                                                                                                                                                  |\n        | AbstractQueue<E>                            | This class provides skeletal implementations of some `Queue` operations.                                                                                                                                                                                                                          |\n        | AbstractSequentialList<E>                   | This class provides a skeletal implementation of the `List` interface to minimize the effort required to implement this interface backed by a \"sequential access\" data store (such as a linked list).                                                                                             |\n        | AbstractSet<E>                              | This class provides a skeletal implementation of the `Set` interface to minimize the effort required to implement this interface.                                                                                                                                                                 |\n        | ArrayDeque<E>                               | Resizable-array implementation of the `Deque` interface.                                                                                                                                                                                                                                          |\n        | ArrayList<E>                                | Resizable-array implementation of the `List` interface.                                                                                                                                                                                                                                           |\n        | Arrays                                      | This class contains various methods for manipulating arrays (such as sorting and searching).                                                                                                                                                                                                      |\n        | Base64                                      | This class consists exclusively of static methods for obtaining encoders and decoders for the Base64 encoding scheme.                                                                                                                                                                             |\n        | Base64.Decoder                              | This class implements a decoder for decoding byte data using the Base64 encoding scheme as specified in RFC 4648 and RFC 2045.                                                                                                                                                                    |\n        | Base64.Encoder                              | This class implements an encoder for encoding byte data using the Base64 encoding scheme as specified in RFC 4648 and RFC 2045.                                                                                                                                                                   |\n        | BitSet                                      | This class implements a vector of bits that grows as needed.                                                                                                                                                                                                                                      |\n        | Calendar                                    | The `Calendar` class is an abstract class that provides methods for converting between a specific instant in time and a set of `calendar fields` such as `YEAR`, `MONTH`, `DAY_OF_MONTH`, `HOUR`, and so on, and for manipulating the calendar fields, such as getting the date of the next week. |\n        | Calendar.Builder                            | `Calendar.Builder` is used for creating a `Calendar` from various date-time parameters.                                                                                                                                                                                                           |\n        | Collections                                 | This class consists exclusively of static methods that operate on or return collections.                                                                                                                                                                                                          |\n        | Currency                                    | Represents a currency.                                                                                                                                                                                                                                                                            |\n        | Date                                        | The class `Date` represents a specific instant in time, with millisecond precision.                                                                                                                                                                                                               |\n        | Dictionary<K,V>                             | The `Dictionary` class is the abstract parent of any class, such as `Hashtable`, which maps keys to values.                                                                                                                                                                                       |\n        | DoubleSummaryStatistics                     | A state object for collecting statistics such as count, min, max, sum, and average.                                                                                                                                                                                                               |\n        | EnumMap<K extends Enum<K>,V>                | A specialized `Map` implementation for use with enum type keys.                                                                                                                                                                                                                                   |\n        | EnumSet<E extends Enum<E>>                  | A specialized `Set` implementation for use with enum types.                                                                                                                                                                                                                                       |\n        | EventListenerProxy<T extends EventListener> | An abstract wrapper class for an `EventListener` class which associates a set of additional parameters with the listener.                                                                                                                                                                         |\n        | EventObject                                 | The root class from which all event state objects shall be derived.                                                                                                                                                                                                                               |\n        | FormattableFlags                            | FomattableFlags are passed to the `Formattable.formatTo()` method and modify the output format for Formattables.                                                                                                                                                                                  |\n        | Formatter                                   | An interpreter for printf-style format strings.                                                                                                                                                                                                                                                   |\n        | GregorianCalendar                           | `GregorianCalendar` is a concrete subclass of `Calendar` and provides the standard calendar system used by most of the world.                                                                                                                                                                     |\n        | HashMap<K,V>                                | Hash table based implementation of the `Map` interface.                                                                                                                                                                                                                                           |\n        | HashSet<E>                                  | This class implements the `Set` interface, backed by a hash table (actually a `HashMap` instance).                                                                                                                                                                                                |\n        | Hashtable<K,V>                              | This class implements a hash table, which maps keys to values.                                                                                                                                                                                                                                    |\n        | IdentityHashMap<K,V>                        | This class implements the `Map` interface with a hash table, using reference-equality in place of object-equality when comparing keys (and values).                                                                                                                                               |\n        | IntSummaryStatistics                        | A state object for collecting statistics such as count, min, max, sum, and average.                                                                                                                                                                                                               |\n        | LinkedHashMap<K,V>                          | Hash table and linked list implementation of the `Map` interface, with predictable iteration order.                                                                                                                                                                                               |\n        | LinkedHashSet<E>                            | Hash table and linked list implementation of the `Set` interface, with predictable iteration order.                                                                                                                                                                                               |\n        | LinkedList<E>                               | Doubly-linked list implementation of the `List` and `Deque` interfaces.                                                                                                                                                                                                                           |\n        | ListResourceBundle                          | `ListResourceBundle` is an abstract subclass of `ResourceBundle` that manages resources for a locale in a convenient and easy to use list.                                                                                                                                                        |\n        | Locale                                      | A `Locale` object represents a specific geographical, political, or cultural region.                                                                                                                                                                                                              |\n        | Locale.Builder                              | `Builder` is used to build instances of `Locale` from values configured by the setters.                                                                                                                                                                                                           |\n        | Locale.LanguageRange                        | This class expresses a *Language Range* defined in [RFC 4647 Matching of Language Tags](http://tools.ietf.org/html/rfc4647).                                                                                                                                                                      |\n        | LongSummaryStatistics                       | A state object for collecting statistics such as count, min, max, sum, and average.                                                                                                                                                                                                               |\n        | Objects                                     | This class consists of `static` utility methods for operating on objects, or checking certain conditions before operation.                                                                                                                                                                        |\n        | Observable                                  | Deprecated.  This class and the `Observer` interface have been deprecated.                                                                                                                                                                                                                        |\n        | Optional<T>                                 | A container object which may or may not contain a non-`null` value.                                                                                                                                                                                                                               |\n        | OptionalDouble                              | A container object which may or may not contain a `double` value.                                                                                                                                                                                                                                 |\n        | OptionalInt                                 | A container object which may or may not contain an `int` value.                                                                                                                                                                                                                                   |\n        | OptionalLong                                | A container object which may or may not contain a `long` value.                                                                                                                                                                                                                                   |\n        | PriorityQueue<E>                            | An unbounded priority queue based on a priority heap.                                                                                                                                                                                                                                             |\n        | Properties                                  | The `Properties` class represents a persistent set of properties.                                                                                                                                                                                                                                 |\n        | PropertyPermission                          | This class is for property permissions.                                                                                                                                                                                                                                                           |\n        | PropertyResourceBundle                      | `PropertyResourceBundle` is a concrete subclass of `ResourceBundle` that manages resources for a locale using a set of static strings from a property file.                                                                                                                                       |\n        | Random                                      | An instance of this class is used to generate a stream of pseudorandom numbers.                                                                                                                                                                                                                   |\n        | ResourceBundle                              | Resource bundles contain locale-specific objects.                                                                                                                                                                                                                                                 |\n        | ResourceBundle.Control                      | `ResourceBundle.Control` defines a set of callback methods that are invoked by the `ResourceBundle.getBundle` factory methods during the bundle loading process.                                                                                                                                  |\n        | Scanner                                     | A simple text scanner which can parse primitive types and strings using regular expressions.                                                                                                                                                                                                      |\n        | ServiceLoader<S>                            | A facility to load implementations of a service.                                                                                                                                                                                                                                                  |\n        | SimpleTimeZone                              | `SimpleTimeZone` is a concrete subclass of `TimeZone` that represents a time zone for use with a Gregorian calendar.                                                                                                                                                                              |\n        | Spliterators                                | Static classes and methods for operating on or creating instances of `Spliterator` and its primitive specializations `Spliterator.OfInt`, `Spliterator.OfLong`, and `Spliterator.OfDouble`.                                                                                                       |\n        | Spliterators.AbstractDoubleSpliterator      | An abstract `Spliterator.OfDouble` that implements `trySplit` to permit limited parallelism.                                                                                                                                                                                                      |\n        | Spliterators.AbstractIntSpliterator         | An abstract `Spliterator.OfInt` that implements `trySplit` to permit limited parallelism.                                                                                                                                                                                                         |\n        | Spliterators.AbstractLongSpliterator        | An abstract `Spliterator.OfLong` that implements `trySplit` to permit limited parallelism.                                                                                                                                                                                                        |\n        | Spliterators.AbstractSpliterator<T>         | An abstract `Spliterator` that implements `trySplit` to permit limited parallelism.                                                                                                                                                                                                               |\n        | SplittableRandom                            | A generator of uniform pseudorandom values applicable for use in (among other contexts) isolated parallel computations that may generate subtasks.                                                                                                                                                |\n        | Stack<E>                                    | The `Stack` class represents a last-in-first-out (LIFO) stack of objects.                                                                                                                                                                                                                         |\n        | StringJoiner                                | `StringJoiner` is used to construct a sequence of characters separated by a delimiter and optionally starting with a supplied prefix and ending with a supplied suffix.                                                                                                                           |\n        | StringTokenizer                             | The string tokenizer class allows an application to break a string into tokens.                                                                                                                                                                                                                   |\n        | Timer                                       | A facility for threads to schedule tasks for future execution in a background thread.                                                                                                                                                                                                             |\n        | TimerTask                                   | A task that can be scheduled for one-time or repeated execution by a `Timer`.                                                                                                                                                                                                                     |\n        | TimeZone                                    | `TimeZone` represents a time zone offset, and also figures out daylight savings.                                                                                                                                                                                                                  |\n        | TreeMap<K,V>                                | A Red-Black tree based `NavigableMap` implementation.                                                                                                                                                                                                                                             |\n        | TreeSet<E>                                  | A `NavigableSet` implementation based on a `TreeMap`.                                                                                                                                                                                                                                             |\n        | UUID                                        | A class that represents an immutable universally unique identifier (UUID).                                                                                                                                                                                                                        |\n        | Vector<E>                                   | The `Vector` class implements a growable array of objects.                                                                                                                                                                                                                                        |\n        | WeakHashMap<K,V>                            | Hash table based implementation of the `Map` interface, with *weak keys*.                                                                                                                                                                                                                         |\n *      | ------------------------------ | ---------------------------------------------------------------------------- |\n        | Enum                           | Description                                                                  |\n        | Formatter.BigDecimalLayoutForm | Enum for `BigDecimal` formatting.                                            |\n        | Locale.Category                | Enum for locale categories.                                                  |\n        | Locale.FilteringMode           | This enum provides constants to select a filtering mode for locale matching. |\n        | Locale.IsoCountryCode          | Enum for specifying the type defined in ISO 3166.                            |\n *      | -------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n        | Exception                              | Description                                                                                                                                                                                           |\n        | ConcurrentModificationException        | This exception may be thrown by methods that have detected concurrent modification of an object when such modification is not permissible.                                                            |\n        | DuplicateFormatFlagsException          | Unchecked exception thrown when duplicate flags are provided in the format specifier.                                                                                                                 |\n        | EmptyStackException                    | Thrown by methods in the `Stack` class to indicate that the stack is empty.                                                                                                                           |\n        | FormatFlagsConversionMismatchException | Unchecked exception thrown when a conversion and flag are incompatible.                                                                                                                               |\n        | FormatterClosedException               | Unchecked exception thrown when the formatter has been closed.                                                                                                                                        |\n        | IllegalFormatCodePointException        | Unchecked exception thrown when a character with an invalid Unicode code point as defined by `Character.isValidCodePoint(int)` is passed to the `Formatter`.                                          |\n        | IllegalFormatConversionException       | Unchecked exception thrown when the argument corresponding to the format specifier is of an incompatible type.                                                                                        |\n        | IllegalFormatException                 | Unchecked exception thrown when a format string contains an illegal syntax or a format specifier that is incompatible with the given arguments.                                                       |\n        | IllegalFormatFlagsException            | Unchecked exception thrown when an illegal combination flags is given.                                                                                                                                |\n        | IllegalFormatPrecisionException        | Unchecked exception thrown when the precision is a negative value other than `-1`, the conversion does not support a precision, or the value is otherwise unsupported.                                |\n        | IllegalFormatWidthException            | Unchecked exception thrown when the format width is a negative value other than `-1` or is otherwise unsupported.                                                                                     |\n        | IllformedLocaleException               | Thrown by methods in `Locale` and `Locale.Builder` to indicate that an argument is not a well-formed BCP 47 tag.                                                                                      |\n        | InputMismatchException                 | Thrown by a `Scanner` to indicate that the token retrieved does not match the pattern for the expected type, or that the token is out of range for the expected type.                                 |\n        | InvalidPropertiesFormatException       | Thrown to indicate that an operation could not complete because the input did not conform to the appropriate XML document type for a collection of properties, as per the `Properties` specification. |\n        | MissingFormatArgumentException         | Unchecked exception thrown when there is a format specifier which does not have a corresponding argument or if an argument index refers to an argument that does not exist.                           |\n        | MissingFormatWidthException            | Unchecked exception thrown when the format width is required.                                                                                                                                         |\n        | MissingResourceException               | Signals that a resource is missing.                                                                                                                                                                   |\n        | NoSuchElementException                 | Thrown by various accessor methods to indicate that the element being requested does not exist.                                                                                                       |\n        | TooManyListenersException              | The `TooManyListenersException` Exception is used as part of the Java Event model to annotate and implement a unicast special case of a multicast Event Source.                                       |\n        | UnknownFormatConversionException       | Unchecked exception thrown when an unknown conversion is given.                                                                                                                                       |\n        | UnknownFormatFlagsException            | Unchecked exception thrown when an unknown flag is given.                                                                                                                                             |\n *      | ------------------------- | ---------------------------------------------------------------------------------------------------- |\n        | Error                     | Description                                                                                          |\n        | ServiceConfigurationError | Error thrown when something goes wrong while locating, loading, or instantiating a service provider. |"
    ]
}

cc @JPinkney

@JPinkney
Copy link
Contributor

JPinkney commented Apr 3, 2018

For mine the results are fine. I don't know why theres a difference. I get

"contents": [
        {
            "language": "java",
            "value": "java.util"
        },
        "Contains the collections framework, legacy collection classes, event model, date and time facilities, internationalization, and miscellaneous utility classes (a string tokenizer, a random-number generator, and a bit array).\n\n## Package Specification ##\n\n *  **Collections Framework Overview**\n *   **Collections Framework Annotated Outline**\n\n## Related Documentation ##\n\nFor overviews, tutorials, examples, guides, and tool documentation, please see:\n\n *  [ **Collections Framework Tutorial**](http://www.java.sun.com/docs/books/tutorial/collections/)\n *  **Collections Framework Design FAQ**\n\nSince:\n\nJDK1.0"
    ]

@fbricon
Copy link
Contributor Author

fbricon commented Apr 3, 2018

Seems caused by using Java 9. With Java 8, I get better results:

screen shot 2018-04-03 at 4 17 57 pm

Although 3 links out of 4 are missing O_o

Looking at the jdk8 sources, the javadoc is provided by a package.html page: http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/file/f940e7a48b72/src/share/classes/java/util/package.html

Given those 3 missing links are relative URLs, they're not rendered:

<h2>Package Specification</h2>
<ul>
  <li><a href="../../../technotes/guides/collections/overview.html"><b>Collections Framework Overview</b></a>
  <li><a href="../../../technotes/guides/collections/reference.html"><b>
       Collections Framework Annotated Outline</b></a>
</ul>

<h2>Related Documentation</h2>
For overviews, tutorials, examples, guides, and tool documentation, please see:
<ul>
    <li><a href="http://www.java.sun.com/docs/books/tutorial/collections/">
       <b>Collections Framework Tutorial</b></a>
    <li><a
    href="../../../technotes/guides/collections/designfaq.html"><b>Collections
    Framework Design FAQ</b></a>
</ul>

@fbricon
Copy link
Contributor Author

fbricon commented Apr 3, 2018

In Eclipse, when using Java 9, hovering over util gives:

screen shot 2018-04-03 at 4 22 12 pm

@JPinkney
Copy link
Contributor

JPinkney commented Apr 3, 2018

I believe this is actually an issue with the remark library. Using Java 9 and hovering over util yields the same thing in current vscode-java. I've tested all of the table settings for Remark and none of them seem to provide a sensible output.

@fbricon fbricon changed the title Borked javadoc for packages Borked javadoc for JDK 9/10 packages Apr 3, 2018
@fbricon
Copy link
Contributor Author

fbricon commented Apr 3, 2018

So there are probably 2 issues:

  • as you mentioned, remark doesn't handle tables really well
  • JDT doesn't parse the newer Javadoc content (since Java 9), making it include the list of package classes in the javadoc when it should be ignored otherwise. That'd be a JDT issue.

fbricon added a commit to fbricon/eclipse.jdt.ls that referenced this issue Apr 4, 2018
fbricon added a commit to fbricon/eclipse.jdt.ls that referenced this issue Apr 4, 2018
@fbricon fbricon added this to the End March 2018 milestone Apr 4, 2018
@fbricon fbricon self-assigned this Apr 4, 2018
fbricon added a commit to fbricon/eclipse.jdt.ls that referenced this issue Apr 4, 2018
@fbricon fbricon closed this as completed in 1935320 Apr 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants