Skip to content

Commit 7e31677

Browse files
committed
Merge master HEAD into openj9-staging
Signed-off-by: J9 Build <[email protected]>
2 parents 8c7b730 + 2db6732 commit 7e31677

File tree

31 files changed

+453
-148
lines changed

31 files changed

+453
-148
lines changed

make/InitSupport.gmk

+5-5
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,14 @@ ifeq ($(HAS_SPEC),)
6767

6868
# The variable MAKEOVERRIDES contains variable assignments from the command
6969
# line, but in reverse order to what the user entered.
70-
# The '\#' <=> '\ 'dance is needed to keep values with space in them connected.
71-
COMMAND_LINE_VARIABLES := $(subst \#,\ , $(call reverse, $(subst \ ,\#,$(MAKEOVERRIDES))))
70+
# The '§' <=> '\ 'dance is needed to keep values with space in them connected.
71+
COMMAND_LINE_VARIABLES := $(subst §,\ , $(call reverse, $(subst \ ,§,$(MAKEOVERRIDES))))
7272

7373
# A list like FOO="val1" BAR="val2" containing all user-supplied make
7474
# variables that we should propagate.
75-
# The '\#' <=> '\ 'dance is needed to keep values with space in them connected.
76-
USER_MAKE_VARS := $(subst \#,\ , $(filter-out $(addsuffix =%, $(INIT_CONTROL_VARIABLES)), \
77-
$(subst \ ,\#,$(MAKEOVERRIDES))))
75+
# The '§' <=> '\ 'dance is needed to keep values with space in them connected.
76+
USER_MAKE_VARS := $(subst §,\ , $(filter-out $(addsuffix =%, $(INIT_CONTROL_VARIABLES)), \
77+
$(subst \ ,§,$(MAKEOVERRIDES))))
7878

7979
# Setup information about available configurations, if any.
8080
ifneq ($(CUSTOM_ROOT), )

make/jdk/src/classes/build/tools/taglet/SealedGraph.java

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2022, 2024, 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
@@ -107,7 +107,7 @@ public String toString(List<? extends DocTree> tags, Element element) {
107107
throw new RuntimeException(e);
108108
}
109109

110-
String simpleTypeName = element.getSimpleName().toString();
110+
String simpleTypeName = packagelessCanonicalName(typeElement).replace('.', '/');
111111
String imageFile = simpleTypeName + "-sealed-graph.svg";
112112
int thumbnailHeight = 100; // also appears in the stylesheet
113113
String hoverImage = "<span>"
@@ -315,14 +315,14 @@ private static Optional<String> packageName(TypeElement element) {
315315
case MEMBER -> packageName((TypeElement) element.getEnclosingElement());
316316
};
317317
}
318+
}
318319

319-
private static String packagelessCanonicalName(TypeElement element) {
320-
String result = element.getSimpleName().toString();
321-
while (element.getNestingKind() == NestingKind.MEMBER) {
322-
element = (TypeElement) element.getEnclosingElement();
323-
result = element.getSimpleName().toString() + '.' + result;
324-
}
325-
return result;
320+
private static String packagelessCanonicalName(TypeElement element) {
321+
String result = element.getSimpleName().toString();
322+
while (element.getNestingKind() == NestingKind.MEMBER) {
323+
element = (TypeElement) element.getEnclosingElement();
324+
result = element.getSimpleName().toString() + '.' + result;
326325
}
326+
return result;
327327
}
328328
}

src/java.base/share/classes/java/lang/Process.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
* {@link #getInputStream()}, and
6565
* {@link #getErrorStream()}.
6666
* The I/O streams of characters and lines can be written and read using the methods
67-
* {@link #outputWriter()}, {@link #outputWriter(Charset)}},
67+
* {@link #outputWriter()}, {@link #outputWriter(Charset)},
6868
* {@link #inputReader()}, {@link #inputReader(Charset)},
6969
* {@link #errorReader()}, and {@link #errorReader(Charset)}.
7070
* The parent process uses these streams to feed input to and get output

src/java.base/share/classes/java/text/DecimalFormat.java

+9-5
Original file line numberDiff line numberDiff line change
@@ -2379,8 +2379,8 @@ private final boolean subparse(String text, ParsePosition parsePosition,
23792379
NumericPosition pos = subparseNumber(text, position, digits, true, isExponent, status);
23802380
position = pos.fullPos;
23812381

2382-
// First character after the prefix was un-parseable, should
2383-
// fail regardless if lenient or strict.
2382+
// First character after the prefix was un-parseable or parsing integer
2383+
// only with no integer portion. Should fail regardless if lenient or strict.
23842384
if (position == -1) {
23852385
parsePosition.index = oldStart;
23862386
parsePosition.errorIndex = oldStart;
@@ -2421,8 +2421,8 @@ private final boolean subparse(String text, ParsePosition parsePosition,
24212421
}
24222422

24232423
// When parsing integer only, index should be int pos
2424-
// If intPos is 0, the entire value was integer
2425-
if (isParseIntegerOnly() && pos.intPos > 0) {
2424+
// If intPos is -1, the entire value was integer and index should be full pos
2425+
if (isParseIntegerOnly() && pos.intPos != -1) {
24262426
parsePosition.index = pos.intPos;
24272427
} else {
24282428
// increment the index by the suffix
@@ -2474,7 +2474,7 @@ NumericPosition subparseNumber(String text, int position,
24742474
boolean isExponent, boolean[] status) {
24752475
// process digits or Inf, find decimal position
24762476
status[STATUS_INFINITE] = false;
2477-
int intIndex = 0;
2477+
int intIndex = -1;
24782478
if (!isExponent && text.regionMatches(position, symbols.getInfinity(), 0,
24792479
symbols.getInfinity().length())) {
24802480
position += symbols.getInfinity().length();
@@ -2570,6 +2570,10 @@ NumericPosition subparseNumber(String text, int position,
25702570
// Cancel out backup setting (see grouping handler below)
25712571
backup = -1;
25722572
} else if (!isExponent && ch == decimal) {
2573+
if (isParseIntegerOnly() && startPos == position) {
2574+
// Parsing int only with no integer portion, fail
2575+
return new NumericPosition(-1, intIndex);
2576+
}
25732577
// Check grouping size on decimal separator
25742578
if (parseStrict && isGroupingViolation(position, prevSeparatorIndex)) {
25752579
return new NumericPosition(

src/java.base/share/classes/jdk/internal/vm/TranslatedException.java

+16-28
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,13 @@
4242

4343
/**
4444
* Support for translating exceptions between the HotSpot heap and libjvmci heap.
45+
*
46+
* Successfully translated exceptions are wrapped in a TranslatedException instance.
47+
* This allows callers to distiguish between a translated exception and an error
48+
* that arose during translation.
4549
*/
4650
@SuppressWarnings("serial")
47-
final class TranslatedException extends Exception {
51+
public final class TranslatedException extends Exception {
4852

4953
/**
5054
* The value returned by {@link #encodeThrowable(Throwable)} when encoding
@@ -61,15 +65,18 @@ final class TranslatedException extends Exception {
6165
maybeFailClinit();
6266
try {
6367
FALLBACK_ENCODED_THROWABLE_BYTES =
64-
encodeThrowable(new TranslatedException("error during encoding",
65-
"<unknown>"), false);
68+
encodeThrowable(translationFailure("error during encoding"), false);
6669
FALLBACK_ENCODED_OUTOFMEMORYERROR_BYTES =
67-
encodeThrowable(new OutOfMemoryError(), false);
70+
encodeThrowable(translationFailure("OutOfMemoryError during encoding"), false);
6871
} catch (IOException e) {
6972
throw new InternalError(e);
7073
}
7174
}
7275

76+
private static InternalError translationFailure(String messageFormat, Object... messageArgs) {
77+
return new InternalError(messageFormat.formatted(messageArgs));
78+
}
79+
7380
/**
7481
* Helper to test exception translation.
7582
*/
@@ -86,14 +93,8 @@ private static void maybeFailClinit() {
8693
}
8794
}
8895

89-
/**
90-
* Class name of exception that could not be instantiated.
91-
*/
92-
private String originalExceptionClassName;
93-
94-
private TranslatedException(String message, String originalExceptionClassName) {
95-
super(message);
96-
this.originalExceptionClassName = originalExceptionClassName;
96+
TranslatedException(Throwable translated) {
97+
super(translated);
9798
}
9899

99100
/**
@@ -106,18 +107,6 @@ public Throwable fillInStackTrace() {
106107
return this;
107108
}
108109

109-
@Override
110-
public String toString() {
111-
String s;
112-
if (originalExceptionClassName.equals(TranslatedException.class.getName())) {
113-
s = getClass().getName();
114-
} else {
115-
s = getClass().getName() + "[" + originalExceptionClassName + "]";
116-
}
117-
String message = getMessage();
118-
return (message != null) ? (s + ": " + message) : s;
119-
}
120-
121110
/**
122111
* Prints a stack trace for {@code throwable} if the system property
123112
* {@code "jdk.internal.vm.TranslatedException.debug"} is true.
@@ -163,7 +152,7 @@ private static Throwable create(String className, String message, Throwable caus
163152
return initCause((Throwable) cons.newInstance(message), cause, debug);
164153
} catch (Throwable translationFailure) {
165154
debugPrintStackTrace(translationFailure, debug);
166-
return initCause(new TranslatedException(message, className), cause, debug);
155+
return initCause(translationFailure("%s [%s]", message, className), cause, debug);
167156
}
168157
}
169158

@@ -308,11 +297,10 @@ static Throwable decodeThrowable(byte[] encodedThrowable, boolean debug) {
308297
throwable.setStackTrace(stackTrace);
309298
cause = throwable;
310299
}
311-
return throwable;
300+
return new TranslatedException(throwable);
312301
} catch (Throwable translationFailure) {
313302
debugPrintStackTrace(translationFailure, debug);
314-
return new TranslatedException("Error decoding exception: " + encodedThrowable,
315-
translationFailure.getClass().getName());
303+
return translationFailure("error decoding exception: %s", encodedThrowable);
316304
}
317305
}
318306
}

src/java.base/share/classes/jdk/internal/vm/VMSupport.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -122,20 +122,25 @@ public static byte[] serializeAgentPropertiesToByteArray() throws IOException {
122122
* 2: an OutOfMemoryError was thrown while encoding the exception
123123
* 3: some other problem occured while encoding the exception. If {@code buffer != 0},
124124
* it contains a {@code struct { u4 len; char[len] desc}} where {@code desc} describes the problem
125+
* 4: an OutOfMemoryError thrown from within VM code on a
126+
* thread that cannot call Java (OOME has no stack trace)
125127
* </pre>
126128
* @param buffer encoded info about the exception to throw (depends on {@code format})
127129
* @param inJVMHeap [@code true} if executing in the JVM heap, {@code false} otherwise
128130
* @param debug specifies whether debug stack traces should be enabled in case of translation failure
129131
*/
130132
public static void decodeAndThrowThrowable(int format, long buffer, boolean inJVMHeap, boolean debug) throws Throwable {
131133
if (format != 0) {
134+
if (format == 4) {
135+
throw new TranslatedException(new OutOfMemoryError("in VM code and current thread cannot call Java"));
136+
}
132137
String context = String.format("while encoding an exception to translate it %s the JVM heap",
133138
inJVMHeap ? "to" : "from");
134139
if (format == 1) {
135140
throw new InternalError("native buffer could not be allocated " + context);
136141
}
137142
if (format == 2) {
138-
throw new OutOfMemoryError("OutOfMemoryError occurred " + context);
143+
throw new OutOfMemoryError(context);
139144
}
140145
if (format == 3 && buffer != 0L) {
141146
byte[] bytes = bufferToBytes(buffer);

src/java.xml/share/classes/org/w3c/dom/Attr.java

+21-23
Original file line numberDiff line numberDiff line change
@@ -124,65 +124,63 @@
124124
* </thead>
125125
* <tbody>
126126
* <tr>
127-
* <th scope="row" valign='top' rowspan='1' colspan='1'>
127+
* <th scope="row">
128128
* Character reference</th>
129-
* <td valign='top' rowspan='1' colspan='1'>
129+
* <td>
130130
* <pre>"x&amp;#178;=5"</pre>
131131
* </td>
132-
* <td valign='top' rowspan='1' colspan='1'>
132+
* <td>
133133
* <pre>"x&#178;=5"</pre>
134134
* </td>
135-
* <td valign='top' rowspan='1' colspan='1'>
135+
* <td>
136136
* <pre>"x&amp;#178;=5"</pre>
137137
* </td>
138138
* </tr>
139139
* <tr>
140-
* <th scope="row" valign='top' rowspan='1' colspan='1'>Built-in
141-
* character entity</th>
142-
* <td valign='top' rowspan='1' colspan='1'>
140+
* <th scope="row">Built-in character entity</th>
141+
* <td>
143142
* <pre>"y&amp;lt;6"</pre>
144143
* </td>
145-
* <td valign='top' rowspan='1' colspan='1'>
144+
* <td>
146145
* <pre>"y&lt;6"</pre>
147146
* </td>
148-
* <td valign='top' rowspan='1' colspan='1'>
147+
* <td>
149148
* <pre>"y&amp;lt;6"</pre>
150149
* </td>
151150
* </tr>
152151
* <tr>
153-
* <th scope="row" valign='top' rowspan='1' colspan='1'>Literal newline between</th>
154-
* <td valign='top' rowspan='1' colspan='1'>
155-
* <pre>
156-
* "x=5&amp;#10;y=6"</pre>
152+
* <th scope="row">Literal newline between</th>
153+
* <td>
154+
* <pre>"x=5&amp;#10;y=6"</pre>
157155
* </td>
158-
* <td valign='top' rowspan='1' colspan='1'>
156+
* <td>
159157
* <pre>"x=5 y=6"</pre>
160158
* </td>
161-
* <td valign='top' rowspan='1' colspan='1'>
159+
* <td>
162160
* <pre>"x=5&amp;#10;y=6"</pre>
163161
* </td>
164162
* </tr>
165163
* <tr>
166-
* <th scope="row" valign='top' rowspan='1' colspan='1'>Normalized newline between</th>
167-
* <td valign='top' rowspan='1' colspan='1'>
164+
* <th scope="row">Normalized newline between</th>
165+
* <td>
168166
* <pre>"x=5
169167
* y=6"</pre>
170168
* </td>
171-
* <td valign='top' rowspan='1' colspan='1'>
169+
* <td>
172170
* <pre>"x=5 y=6"</pre>
173171
* </td>
174-
* <td valign='top' rowspan='1' colspan='1'>
172+
* <td>
175173
* <pre>"x=5 y=6"</pre>
176174
* </td>
177175
* </tr>
178176
* <tr>
179-
* <th scope="row" valign='top' rowspan='1' colspan='1'>Entity <code>e</code> with literal newline</th>
180-
* <td valign='top' rowspan='1' colspan='1'>
177+
* <th scope="row">Entity <code>e</code> with literal newline</th>
178+
* <td>
181179
* <pre>
182180
* &lt;!ENTITY e '...&amp;#10;...'&gt; [...]&gt; "x=5&amp;e;y=6"</pre>
183181
* </td>
184-
* <td valign='top' rowspan='1' colspan='1'><em>Dependent on Implementation and Load Options</em></td>
185-
* <td valign='top' rowspan='1' colspan='1'><em>Dependent on Implementation and Load/Save Options</em></td>
182+
* <td><em>Dependent on Implementation and Load Options</em></td>
183+
* <td><em>Dependent on Implementation and Load/Save Options</em></td>
186184
* </tr>
187185
* </tbody>
188186
* </table>

src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java

+1-8
Original file line numberDiff line numberDiff line change
@@ -5241,14 +5241,7 @@ public void visitModifiers(JCModifiers tree) {
52415241

52425242
public void visitAnnotatedType(JCAnnotatedType tree) {
52435243
attribAnnotationTypes(tree.annotations, env);
5244-
Type underlyingType =
5245-
attribTree(tree.underlyingType, env, new ResultInfo(KindSelector.TYP_PCK, Type.noType));
5246-
if (underlyingType.hasTag(PACKAGE)) {
5247-
// Type annotations are not admissible on packages, but we handle packages here to
5248-
// report better diagnostics later in validateAnnotatedType.
5249-
result = tree.type = underlyingType;
5250-
return;
5251-
}
5244+
Type underlyingType = attribType(tree.underlyingType, env);
52525245
Type annotatedType = underlyingType.preannotatedType();
52535246

52545247
if (!env.info.isNewClass)

src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties

+4-2
Original file line numberDiff line numberDiff line change
@@ -319,10 +319,12 @@ doclet.record_equals_doc.fullbody.head=\
319319
doclet.record_equals_doc.fullbody.tail.both=\
320320
Reference components are compared with \
321321
{@link java.util.Objects#equals(Object,Object) Objects::equals(Object,Object)}; \
322-
primitive components are compared with '=='.
322+
primitive components are compared with the <code>compare</code> method from \
323+
their corresponding wrapper classes.
323324

324325
doclet.record_equals_doc.fullbody.tail.primitive=\
325-
All components in this record class are compared with '=='.
326+
All components in this record class are compared with the <code>compare</code> \
327+
method from their corresponding wrapper classes.
326328

327329
doclet.record_equals_doc.fullbody.tail.reference=\
328330
All components in this record class are compared with \

src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclint/HtmlTag.java

+1-21
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ public enum Attr {
507507
PROFILE,
508508
REV,
509509
REVERSED,
510-
ROLE,
510+
ROLE(true),
511511
ROWSPAN,
512512
RULES,
513513
SCHEME,
@@ -606,26 +606,6 @@ private static class AttrMap extends EnumMap<Attr,AttrKind> {
606606
this.attrs = new EnumMap<>(Attr.class);
607607
for (Map<Attr,AttrKind> m: attrMaps)
608608
this.attrs.putAll(m);
609-
attrs.put(Attr.CLASS, AttrKind.OK);
610-
attrs.put(Attr.ID, AttrKind.OK);
611-
attrs.put(Attr.STYLE, AttrKind.OK);
612-
attrs.put(Attr.ROLE, AttrKind.OK);
613-
// for now, assume that all ARIA attributes are allowed on all tags.
614-
attrs.put(Attr.ARIA_ACTIVEDESCENDANT, AttrKind.OK);
615-
attrs.put(Attr.ARIA_CONTROLS, AttrKind.OK);
616-
attrs.put(Attr.ARIA_DESCRIBEDBY, AttrKind.OK);
617-
attrs.put(Attr.ARIA_EXPANDED, AttrKind.OK);
618-
attrs.put(Attr.ARIA_LABEL, AttrKind.OK);
619-
attrs.put(Attr.ARIA_LABELLEDBY, AttrKind.OK);
620-
attrs.put(Attr.ARIA_LEVEL, AttrKind.OK);
621-
attrs.put(Attr.ARIA_MULTISELECTABLE, AttrKind.OK);
622-
attrs.put(Attr.ARIA_OWNS, AttrKind.OK);
623-
attrs.put(Attr.ARIA_POSINSET, AttrKind.OK);
624-
attrs.put(Attr.ARIA_READONLY, AttrKind.OK);
625-
attrs.put(Attr.ARIA_REQUIRED, AttrKind.OK);
626-
attrs.put(Attr.ARIA_SELECTED, AttrKind.OK);
627-
attrs.put(Attr.ARIA_SETSIZE, AttrKind.OK);
628-
attrs.put(Attr.ARIA_SORT, AttrKind.OK);
629609
}
630610

631611
public boolean accepts(HtmlTag t) {

0 commit comments

Comments
 (0)