Skip to content

Commit 3df95aa

Browse files
author
Pavel Rappo
committedJun 9, 2020
8247212: Use assistant markup in java.lang.module.ModuleDescriptor
Reviewed-by: alanb
1 parent 5b6f050 commit 3df95aa

File tree

3 files changed

+35
-34
lines changed

3 files changed

+35
-34
lines changed
 

‎src/java.base/share/classes/java/lang/module/ModuleDescriptor.java

+30-29
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2009, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -68,17 +68,17 @@
6868
* #read(InputStream,Supplier) read} methods defined here. </p>
6969
*
7070
* <p> A module descriptor describes a <em>normal</em>, open, or automatic
71-
* module. <em>Normal</em> modules and open modules describe their {@link
71+
* module. <em>Normal</em> modules and open modules describe their {@linkplain
7272
* #requires() dependences}, {@link #exports() exported-packages}, the services
73-
* that they {@link #uses() use} or {@link #provides() provide}, and other
74-
* components. <em>Normal</em> modules may {@link #opens() open} specific
75-
* packages. The module descriptor for an open modules does not declare any
73+
* that they {@linkplain #uses() use} or {@linkplain #provides() provide}, and other
74+
* components. <em>Normal</em> modules may {@linkplain #opens() open} specific
75+
* packages. The module descriptor for an open module does not declare any
7676
* open packages (its {@code opens} method returns an empty set) but when
7777
* instantiated in the Java virtual machine then it is treated as if all
7878
* packages are open. The module descriptor for an automatic module does not
7979
* declare any dependences (except for the mandatory dependency on {@code
8080
* java.base}), and does not declare any exported or open packages. Automatic
81-
* module receive special treatment during resolution so that they read all
81+
* modules receive special treatment during resolution so that they read all
8282
* other modules in the configuration. When an automatic module is instantiated
8383
* in the Java virtual machine then it reads every unnamed module and is
8484
* treated as if all packages are exported and open. </p>
@@ -131,7 +131,7 @@ public enum Modifier {
131131

132132

133133
/**
134-
* <p> A dependence upon a module </p>
134+
* <p> A dependence upon a module. </p>
135135
*
136136
* @see ModuleDescriptor#requires()
137137
* @since 9
@@ -607,7 +607,7 @@ public enum Modifier {
607607
private final Set<String> targets; // empty if unqualified export
608608

609609
/**
610-
* Constructs an Opens
610+
* Constructs an {@code Opens}.
611611
*/
612612
private Opens(Set<Modifier> ms, String source, Set<String> targets) {
613613
this.mods = Set.copyOf(ms);
@@ -634,9 +634,9 @@ public Set<Modifier> modifiers() {
634634
}
635635

636636
/**
637-
* Returns {@code true} if this is a qualified opens.
637+
* Returns {@code true} if this is a qualified {@code Opens}.
638638
*
639-
* @return {@code true} if this is a qualified opens
639+
* @return {@code true} if this is a qualified {@code Opens}
640640
*/
641641
public boolean isQualified() {
642642
return !targets.isEmpty();
@@ -652,19 +652,19 @@ public String source() {
652652
}
653653

654654
/**
655-
* For a qualified opens, returns the non-empty and immutable set
655+
* For a qualified {@code Opens}, returns the non-empty and immutable set
656656
* of the module names to which the package is open. For an
657-
* unqualified opens, returns an empty set.
657+
* unqualified {@code Opens}, returns an empty set.
658658
*
659659
* @return The set of target module names or for an unqualified
660-
* opens, an empty set
660+
* {@code Opens}, an empty set
661661
*/
662662
public Set<String> targets() {
663663
return targets;
664664
}
665665

666666
/**
667-
* Compares this module opens to another.
667+
* Compares this module {@code Opens} to another.
668668
*
669669
* <p> Two {@code Opens} objects are compared by comparing the package
670670
* names lexicographically. Where the packages names are equal then the
@@ -680,11 +680,11 @@ public Set<String> targets() {
680680
* set. </p>
681681
*
682682
* @param that
683-
* The module opens to compare
683+
* The module {@code Opens} to compare
684684
*
685685
* @return A negative integer, zero, or a positive integer if this module
686-
* opens is less than, equal to, or greater than the given
687-
* module opens
686+
* {@code Opens} is less than, equal to, or greater than the given
687+
* module {@code Opens}
688688
*/
689689
@Override
690690
public int compareTo(Opens that) {
@@ -710,14 +710,14 @@ public int compareTo(Opens that) {
710710
}
711711

712712
/**
713-
* Computes a hash code for this module opens.
713+
* Computes a hash code for this module {@code Opens}.
714714
*
715715
* <p> The hash code is based upon the modifiers, the package name,
716-
* and for a qualified opens, the set of modules names to which the
716+
* and for a qualified {@code Opens}, the set of modules names to which the
717717
* package is opened. It satisfies the general contract of the
718718
* {@link Object#hashCode Object.hashCode} method.
719719
*
720-
* @return The hash-code value for this module opens
720+
* @return The hash-code value for this module {@code Opens}
721721
*/
722722
@Override
723723
public int hashCode() {
@@ -727,7 +727,7 @@ public int hashCode() {
727727
}
728728

729729
/**
730-
* Tests this module opens for equality with the given object.
730+
* Tests this module {@code Opens} for equality with the given object.
731731
*
732732
* <p> If the given object is not an {@code Opens} then this method
733733
* returns {@code false}. Two {@code Opens} objects are equal if their
@@ -810,7 +810,7 @@ private Provides(String service, List<String> providers, boolean unused) {
810810
public List<String> providers() { return providers; }
811811

812812
/**
813-
* Compares this provides to another.
813+
* Compares this {@code Provides} to another.
814814
*
815815
* <p> Two {@code Provides} objects are compared by comparing the fully
816816
* qualified class name of the service type lexicographically. Where the
@@ -824,8 +824,9 @@ private Provides(String service, List<String> providers, boolean unused) {
824824
* @param that
825825
* The {@code Provides} to compare
826826
*
827-
* @return A negative integer, zero, or a positive integer if this provides
828-
* is less than, equal to, or greater than the given provides
827+
* @return A negative integer, zero, or a positive integer if this
828+
* {@code Provides} is less than, equal to, or greater than
829+
* the given {@code Provides}
829830
*/
830831
public int compareTo(Provides that) {
831832
if (this == that) return 0;
@@ -850,7 +851,7 @@ public int compareTo(Provides that) {
850851
}
851852

852853
/**
853-
* Computes a hash code for this provides.
854+
* Computes a hash code for this {@code Provides}.
854855
*
855856
* <p> The hash code is based upon the service type and the set of
856857
* providers. It satisfies the general contract of the {@link
@@ -864,7 +865,7 @@ public int hashCode() {
864865
}
865866

866867
/**
867-
* Tests this provides for equality with the given object.
868+
* Tests this {@code Provides} for equality with the given object.
868869
*
869870
* <p> If the given object is not a {@code Provides} then this method
870871
* returns {@code false}. Two {@code Provides} objects are equal if the
@@ -889,9 +890,9 @@ public boolean equals(Object ob) {
889890
}
890891

891892
/**
892-
* Returns a string describing this provides.
893+
* Returns a string describing this {@code Provides}.
893894
*
894-
* @return A string describing this provides
895+
* @return A string describing this {@code Provides}
895896
*/
896897
@Override
897898
public String toString() {
@@ -1416,7 +1417,7 @@ public Optional<Version> version() {
14161417

14171418
/**
14181419
* <p> Returns the string with the possibly-unparseable version of the
1419-
* module </p>
1420+
* module. </p>
14201421
*
14211422
* @return The string containing the version of the module or an empty
14221423
* {@code Optional} if the module does not have a version

‎src/java.base/share/classes/java/lang/module/ModuleReader.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -183,7 +183,7 @@ default Optional<ByteBuffer> read(String name) throws IOException {
183183
}
184184

185185
/**
186-
* Release a byte buffer. This method should be invoked after consuming
186+
* Releases a byte buffer. This method should be invoked after consuming
187187
* the contents of the buffer returned by the {@code read} method.
188188
* The behavior of this method when invoked to release a buffer that has
189189
* already been released, or the behavior when invoked to release a buffer

‎src/java.base/share/classes/jdk/internal/module/ServicesCatalog.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -94,7 +94,7 @@ public static ServicesCatalog create() {
9494
}
9595

9696
/**
97-
* Returns the list of service provides for the given service type
97+
* Returns the list of service providers for the given service type
9898
* name, creating it if needed.
9999
*/
100100
private List<ServiceProvider> providers(String service) {
@@ -132,7 +132,7 @@ public void register(Module module) {
132132
}
133133

134134
/**
135-
* Add a provider in the given module to this services catalog
135+
* Adds a provider in the given module to this services catalog.
136136
*
137137
* @apiNote This method is for use by java.lang.instrument
138138
*/

0 commit comments

Comments
 (0)
Please sign in to comment.