Skip to content

Commit

Permalink
Merge latest openjdk
Browse files Browse the repository at this point in the history
  • Loading branch information
j9build committed Jun 7, 2022
2 parents 81dd13c + ab0bac3 commit ceeea96
Show file tree
Hide file tree
Showing 51 changed files with 1,562 additions and 243 deletions.
26 changes: 13 additions & 13 deletions src/demo/share/java2d/J2DBench/src/j2dbench/Result.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2022, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -40,11 +40,11 @@

package j2dbench;

import java.util.Vector;
import java.util.Hashtable;
import java.util.Enumeration;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Vector;

public class Result {
public static final int RATE_UNKNOWN = 0;
Expand Down Expand Up @@ -243,7 +243,7 @@ public static int parseUnit(String c) {
int repsPerRun;
int unitsPerRep;
Vector times;
Hashtable modifiers;
LinkedHashMap modifiers;
Throwable error;

public Result(Test test) {
Expand Down Expand Up @@ -277,7 +277,7 @@ public void setError(Throwable t) {
this.error = t;
}

public void setModifiers(Hashtable modifiers) {
public void setModifiers(LinkedHashMap modifiers) {
this.modifiers = modifiers;
}

Expand All @@ -297,7 +297,7 @@ public long getUnitsPerRun() {
return ((long) getRepsPerRun()) * ((long) getUnitsPerRep());
}

public Hashtable getModifiers() {
public LinkedHashMap getModifiers() {
return modifiers;
}

Expand Down Expand Up @@ -423,11 +423,11 @@ public void summarize() {
System.out.println(test+" averaged "+getAverageString());
}
if (true) {
Enumeration enum_ = modifiers.keys();
Iterator iter_ = modifiers.keySet().iterator();
System.out.print(" with");
String sep = " ";
while (enum_.hasMoreElements()) {
Modifier mod = (Modifier) enum_.nextElement();
while (iter_.hasNext()) {
Modifier mod = (Modifier) iter_.next();
Object v = modifiers.get(mod);
System.out.print(sep);
System.out.print(mod.getAbbreviatedModifierDescription(v));
Expand All @@ -442,9 +442,9 @@ public void write(PrintWriter pw) {
"num-reps=\""+getRepsPerRun()+"\" "+
"num-units=\""+getUnitsPerRep()+"\" "+
"name=\""+test.getTreeName()+"\">");
Enumeration enum_ = modifiers.keys();
while (enum_.hasMoreElements()) {
Modifier mod = (Modifier) enum_.nextElement();
Iterator iter_ = modifiers.keySet().iterator();
while (iter_.hasNext()) {
Modifier mod = (Modifier) iter_.next();
Object v = modifiers.get(mod);
String val = mod.getModifierValueName(v);
pw.println(" <option "+
Expand Down
20 changes: 10 additions & 10 deletions src/demo/share/java2d/J2DBench/src/j2dbench/TestEnvironment.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2022, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -40,15 +40,15 @@

package j2dbench;

import java.awt.AlphaComposite;
import java.awt.Canvas;
import java.awt.Image;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Dimension;
import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Image;
import java.awt.Toolkit;
import java.util.Hashtable;
import java.util.LinkedHashMap;

import j2dbench.tests.GraphicsTests;

Expand Down Expand Up @@ -105,12 +105,12 @@ public void runAllTests() {
Image srcImage;
boolean stopped;
ResultSet results;
Hashtable modifiers;
LinkedHashMap modifiers;
Timer timer;

public TestEnvironment() {
results = new ResultSet();
modifiers = new Hashtable();
modifiers = new LinkedHashMap();
timer = Timer.getImpl();
}

Expand Down Expand Up @@ -246,8 +246,8 @@ public void removeModifier(Modifier o) {
modifiers.remove(o);
}

public Hashtable getModifiers() {
return (Hashtable) modifiers.clone();
public LinkedHashMap getModifiers() {
return (LinkedHashMap) modifiers.clone();
}

public void record(Result result) {
Expand Down
11 changes: 6 additions & 5 deletions src/java.base/share/classes/java/lang/Double.java
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ public static String toHexString(double d) {
* a {@code NumberFormatException} be thrown, the regular
* expression below can be used to screen the input string:
*
* <pre>{@code
* {@snippet lang="java" :
* final String Digits = "(\\p{Digit}+)";
* final String HexDigits = "(\\p{XDigit}+)";
* // an exponent is 'e' or 'E' followed by an optionally
Expand Down Expand Up @@ -679,13 +679,14 @@ public static String toHexString(double d) {
* ")[pP][+-]?" + Digits + "))" +
* "[fFdD]?))" +
* "[\\x00-\\x20]*");// Optional trailing "whitespace"
*
* // @link region substring="Pattern.matches" target ="java.util.regex.Pattern#matches"
* if (Pattern.matches(fpRegex, myString))
* Double.valueOf(myString); // Will not throw NumberFormatException
* // @end
* else {
* // Perform suitable alternative action
* }
* }</pre>
* }
*
* @param s the string to be parsed.
* @return a {@code Double} object holding the value
Expand Down Expand Up @@ -1099,13 +1100,13 @@ public static long doubleToLongBits(double value) {
* <p>In all other cases, let <i>s</i>, <i>e</i>, and <i>m</i> be three
* values that can be computed from the argument:
*
* <blockquote><pre>{@code
* {@snippet lang="java" :
* int s = ((bits >> 63) == 0) ? 1 : -1;
* int e = (int)((bits >> 52) & 0x7ffL);
* long m = (e == 0) ?
* (bits & 0xfffffffffffffL) << 1 :
* (bits & 0xfffffffffffffL) | 0x10000000000000L;
* }</pre></blockquote>
* }
*
* Then the floating-point result equals the value of the mathematical
* expression <i>s</i>&middot;<i>m</i>&middot;2<sup><i>e</i>-1075</sup>.
Expand Down
4 changes: 2 additions & 2 deletions src/java.base/share/classes/java/lang/Float.java
Original file line number Diff line number Diff line change
Expand Up @@ -922,13 +922,13 @@ public static int floatToIntBits(float value) {
* <p>In all other cases, let <i>s</i>, <i>e</i>, and <i>m</i> be three
* values that can be computed from the argument:
*
* <blockquote><pre>{@code
* {@snippet lang="java" :
* int s = ((bits >> 31) == 0) ? 1 : -1;
* int e = ((bits >> 23) & 0xff);
* int m = (e == 0) ?
* (bits & 0x7fffff) << 1 :
* (bits & 0x7fffff) | 0x800000;
* }</pre></blockquote>
* }
*
* Then the floating-point result equals the value of the mathematical
* expression <i>s</i>&middot;<i>m</i>&middot;2<sup><i>e</i>-150</sup>.
Expand Down
4 changes: 2 additions & 2 deletions src/java.base/share/classes/java/lang/Integer.java
Original file line number Diff line number Diff line change
Expand Up @@ -1839,7 +1839,7 @@ public static int reverse(int i) {
* @see #expand
* @since 19
*/
// @IntrinsicCandidate
@IntrinsicCandidate
public static int compress(int i, int mask) {
// See Hacker's Delight (2nd ed) section 7.4 Compress, or Generalized Extract

Expand Down Expand Up @@ -1927,7 +1927,7 @@ public static int compress(int i, int mask) {
* @see #compress
* @since 19
*/
// @IntrinsicCandidate
@IntrinsicCandidate
public static int expand(int i, int mask) {
// Save original mask
int originalMask = mask;
Expand Down
4 changes: 2 additions & 2 deletions src/java.base/share/classes/java/lang/Long.java
Original file line number Diff line number Diff line change
Expand Up @@ -1978,7 +1978,7 @@ public static long reverse(long i) {
* @see #expand
* @since 19
*/
// @IntrinsicCandidate
@IntrinsicCandidate
public static long compress(long i, long mask) {
// See Hacker's Delight (2nd ed) section 7.4 Compress, or Generalized Extract

Expand Down Expand Up @@ -2066,7 +2066,7 @@ public static long compress(long i, long mask) {
* @see #compress
* @since 19
*/
// @IntrinsicCandidate
@IntrinsicCandidate
public static long expand(long i, long mask) {
// Save original mask
long originalMask = mask;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,7 @@ protected void setContentsNative(Transferable contents) {
translateTransferable(contents, flavor, format);
publishClipboardData(format, bytes);
} catch (IOException e) {
// Fix 4696186: don't print exception if data with
// javaJVMLocalObjectMimeType failed to serialize.
// May remove this if-check when 5078787 is fixed.
if (!(flavor.isMimeTypeEqual(DataFlavor.javaJVMLocalObjectMimeType) &&
e instanceof java.io.NotSerializableException)) {
e.printStackTrace();
}
// Cannot be translated in this format, skip
}
}
} finally {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
package com.sun.jndi.ldap;

import java.io.*;
import java.util.ArrayList;
import java.util.Locale;
import java.util.Vector;
import java.util.Hashtable;
Expand Down Expand Up @@ -1577,15 +1578,15 @@ void processUnsolicited(BerDecoder ber) {


private void notifyUnsolicited(Object e) {
Vector<LdapCtx> unsolicitedCopy;
ArrayList<LdapCtx> unsolicitedCopy;
synchronized (unsolicited) {
unsolicitedCopy = new Vector<>(unsolicited);
unsolicitedCopy = new ArrayList<>(unsolicited);
if (e instanceof NamingException) {
unsolicited.setSize(0); // no more listeners after exception
}
}
for (int i = 0; i < unsolicitedCopy.size(); i++) {
unsolicitedCopy.elementAt(i).fireUnsolicited(e);
unsolicitedCopy.get(i).fireUnsolicited(e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -498,9 +498,9 @@ private byte[] windowsAbsolutePath() {
* given security mask.
* @param securityMask Windows security mask.
* @return Windows registry key's handle.
* @see #openKey(byte[], int)
* @see #openKey(int, byte[], int)
* @see #closeKey(int)
* @see #openKey(byte[], int, int)
* @see #openKey(long, byte[], int, int)
* @see #closeKey(long)
*/
private long openKey(int securityMask) {
return openKey(securityMask, securityMask);
Expand All @@ -512,9 +512,9 @@ private long openKey(int securityMask) {
* @param mask1 Preferred Windows security mask.
* @param mask2 Alternate Windows security mask.
* @return Windows registry key's handle.
* @see #openKey(byte[], int)
* @see #openKey(int, byte[], int)
* @see #closeKey(int)
* @see #openKey(byte[], int, int)
* @see #openKey(long, byte[], int, int)
* @see #closeKey(long)
*/
private long openKey(int mask1, int mask2) {
return openKey(windowsAbsolutePath(), mask1, mask2);
Expand All @@ -529,8 +529,8 @@ private long openKey(int mask1, int mask2) {
* @param mask2 Alternate Windows security mask.
* @return Windows registry key's handle.
* @see #openKey(int)
* @see #openKey(int, byte[],int)
* @see #closeKey(int)
* @see #openKey(long, byte[], int, int)
* @see #closeKey(long)
*/
private long openKey(byte[] windowsAbsolutePath, int mask1, int mask2) {
/* Check if key's path is short enough be opened at once
Expand Down Expand Up @@ -568,15 +568,15 @@ private long openKey(byte[] windowsAbsolutePath, int mask1, int mask2) {
/**
* Opens Windows registry key at a given relative path
* with respect to a given Windows registry key.
* @param windowsAbsolutePath Windows relative path of the
* @param windowsRelativePath Windows relative path of the
* key as a byte-encoded string.
* @param nativeHandle handle to the base Windows key.
* @param mask1 Preferred Windows security mask.
* @param mask2 Alternate Windows security mask.
* @return Windows registry key's handle.
* @see #openKey(int)
* @see #openKey(byte[],int)
* @see #closeKey(int)
* @see #openKey(byte[], int, int)
* @see #closeKey(long)
*/
private long openKey(long nativeHandle, byte[] windowsRelativePath,
int mask1, int mask2) {
Expand Down Expand Up @@ -630,10 +630,10 @@ private long openKey(long nativeHandle, byte[] windowsRelativePath,
/**
* Closes Windows registry key.
* Logs a warning if Windows registry is unavailable.
* @param key's Windows registry handle.
* @param nativeHandle Windows registry handle.
* @see #openKey(int)
* @see #openKey(byte[],int)
* @see #openKey(int, byte[],int)
* @see #openKey(byte[], int, int)
* @see #openKey(long, byte[], int, int)
*/
private void closeKey(long nativeHandle) {
int result = WindowsRegCloseKey(nativeHandle);
Expand Down Expand Up @@ -807,7 +807,6 @@ protected String[] childrenNamesSpi() throws BackingStoreException {
closeKey(nativeHandle);
return new String[0];
}
String[] subkeys = new String[subKeysNumber];
String[] children = new String[subKeysNumber];
// Get children
for (int i = 0; i < subKeysNumber; i++) {
Expand Down Expand Up @@ -870,7 +869,7 @@ public void flush() throws BackingStoreException{
/**
* Implements {@code Preferences} {@code sync()} method.
* Flushes Windows registry changes to disk. Equivalent to flush().
* @see flush()
* @see #flush()
*/
public void sync() throws BackingStoreException{
if (isRemoved())
Expand Down Expand Up @@ -929,8 +928,7 @@ public void removeNodeSpi() throws BackingStoreException {
private static String toJavaName(byte[] windowsNameArray) {
String windowsName = byteArrayToString(windowsNameArray);
// check if Alt64
if ((windowsName.length() > 1) &&
(windowsName.substring(0, 2).equals("/!"))) {
if (windowsName.startsWith("/!")) {
return toJavaAlt64Name(windowsName);
}
StringBuilder javaName = new StringBuilder();
Expand Down
Loading

0 comments on commit ceeea96

Please sign in to comment.