Skip to content

Commit

Permalink
Revert files to OpenJDK head if they lack user-visible types.
Browse files Browse the repository at this point in the history
  • Loading branch information
cpovirk committed Dec 9, 2024
1 parent 2941b2e commit 300a39f
Show file tree
Hide file tree
Showing 38 changed files with 38 additions and 189 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@

package java.lang;

import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;

/**
* A collection of assertion status directives (such as "enable assertions
* in package p" or "disable assertions in class c"). This class is used by
Expand All @@ -38,7 +35,6 @@
* @since 1.4
* @author Josh Bloch
*/
@NullMarked
class AssertionStatusDirectives {
/**
* The classes for which assertions are to be enabled or disabled.
Expand Down
7 changes: 2 additions & 5 deletions src/java.base/share/classes/java/lang/Shutdown.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@

package java.lang;

import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;

import jdk.internal.misc.VM;

Expand All @@ -42,8 +40,7 @@
* @see java.io.DeleteOnExitHook
*/

@NullMarked
class Shutdown {
class Shutdown {

// The system shutdown hooks are registered with a predefined slot.
// The list of shutdown hooks is as follows:
Expand All @@ -52,7 +49,7 @@ class Shutdown {
// shutdown hooks and waits until they finish
// (2) DeleteOnExit hook
private static final int MAX_SYSTEM_HOOKS = 10;
private static final @Nullable Runnable[] hooks = new Runnable[MAX_SYSTEM_HOOKS];
private static final Runnable[] hooks = new Runnable[MAX_SYSTEM_HOOKS];

// the index of the currently running shutdown hook to the hooks array
private static int currentRunningHook = -1;
Expand Down
6 changes: 1 addition & 5 deletions src/java.base/share/classes/java/text/DigitList.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@

package java.text;

import org.jspecify.annotations.Nullable;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.RoundingMode;
Expand Down Expand Up @@ -690,9 +688,7 @@ final void set(boolean isNegative, BigInteger source, int maximumDigits) {
/**
* equality test between two digit lists.
*/


public boolean equals(@Nullable Object obj) {
public boolean equals(Object obj) {
if (this == obj) // quick check
return true;
if (!(obj instanceof DigitList other)) // (1) same object?
Expand Down
6 changes: 1 addition & 5 deletions src/java.base/share/classes/java/text/PatternEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@

package java.text;

import org.jspecify.annotations.Nullable;

import java.lang.Character;

/**
Expand Down Expand Up @@ -70,9 +68,7 @@ private void appendQuotedChars(StringBuilder toAddTo) {
* Because Vector.indexOf doesn't take a comparator,
* this method is ill-defined and ignores strength.
*/


public boolean equals(@Nullable Object obj) {
public boolean equals(Object obj) {
if (obj == null) return false;
PatternEntry other = (PatternEntry) obj;
boolean result = chars.equals(other.chars);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@

package java.text;

import org.jspecify.annotations.Nullable;

/**
* A RuleBasedCollationKey is a concrete implementation of CollationKey class.
* The RuleBasedCollationKey class is used by the RuleBasedCollator class.
Expand Down Expand Up @@ -74,9 +72,7 @@ else if (result >= Collator.GREATER)
* @param target the RuleBasedCollationKey to compare to.
* @return Returns true if two objects are equal, false otherwise.
*/


public boolean equals(@Nullable Object target) {
public boolean equals(Object target) {
if (this == target) return true;
if (target == null || !getClass().equals(target.getClass())) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@
*/
package java.time.chrono;

import org.jspecify.annotations.Nullable;

import static java.time.temporal.ChronoField.EPOCH_DAY;

import java.io.IOException;
Expand Down Expand Up @@ -435,9 +433,7 @@ static ChronoLocalDateTime<?> readExternal(ObjectInput in) throws IOException, C

//-----------------------------------------------------------------------
@Override


public boolean equals(@Nullable Object obj) {
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@
*/
package java.time.chrono;

import org.jspecify.annotations.Nullable;

import static java.time.temporal.ChronoField.MONTH_OF_YEAR;
import static java.time.temporal.ChronoUnit.DAYS;
import static java.time.temporal.ChronoUnit.MONTHS;
Expand Down Expand Up @@ -317,9 +315,7 @@ private void validateChrono(TemporalAccessor temporal) {

//-----------------------------------------------------------------------
@Override


public boolean equals(@Nullable Object obj) {
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@
*/
package java.time.chrono;

import org.jspecify.annotations.Nullable;

import static java.time.temporal.ChronoUnit.SECONDS;

import java.io.IOException;
Expand Down Expand Up @@ -367,9 +365,7 @@ static ChronoZonedDateTime<?> readExternal(ObjectInput in) throws IOException, C

//-------------------------------------------------------------------------
@Override


public boolean equals(@Nullable Object obj) {
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@

package java.util;

import org.jspecify.annotations.Nullable;

import java.io.IOException;
import java.io.ObjectInputStream;
import sun.util.locale.provider.CalendarDataUtility;
Expand Down Expand Up @@ -383,9 +381,7 @@ public String getCalendarType() {
* @see Calendar#compareTo(Calendar)
*/
@Override


public boolean equals(@Nullable Object obj) {
public boolean equals(Object obj) {
return obj instanceof JapaneseImperialCalendar &&
super.equals(obj);
}
Expand Down
6 changes: 1 addition & 5 deletions src/java.base/unix/classes/sun/nio/fs/UnixFileKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@

package sun.nio.fs;

import org.jspecify.annotations.Nullable;

/**
* Container for device/inode to uniquely identify file.
*/
Expand All @@ -47,9 +45,7 @@ public int hashCode() {
}

@Override


public boolean equals(@Nullable Object obj) {
public boolean equals(Object obj) {
if (obj == this)
return true;
return obj instanceof UnixFileKey other
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@

package java.awt.datatransfer;

import org.jspecify.annotations.Nullable;

import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Iterator;
Expand Down Expand Up @@ -76,9 +74,7 @@ public int hashCode() {
* set of parameter names and associated values. The order of the parameters
* is not considered.
*/


public boolean equals(@Nullable Object thatObject) {
public boolean equals(Object thatObject) {
//System.out.println("MimeTypeParameterList.equals("+this+","+thatObject+")");
if (!(thatObject instanceof MimeTypeParameterList)) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
*/
package com.sun.beans;

import org.jspecify.annotations.Nullable;

import java.lang.reflect.Type;
import java.lang.reflect.WildcardType;
import java.util.Arrays;
Expand Down Expand Up @@ -104,9 +102,7 @@ public Type[] getLowerBounds() {
* @see sun.reflect.generics.reflectiveObjects.WildcardTypeImpl#equals
*/
@Override


public boolean equals(@Nullable Object object) {
public boolean equals(Object object) {
if (object instanceof WildcardType) {
WildcardType type = (WildcardType) object;
return Arrays.equals(this.upperBounds, type.getUpperBounds())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
*/
package com.sun.beans.finder;

import org.jspecify.annotations.Nullable;

/**
* This class is designed to be a key of a cache
* of constructors or methods.
Expand Down Expand Up @@ -85,9 +83,7 @@ Class<?>[] getArgs() {
* @see #hashCode()
*/
@Override


public boolean equals(@Nullable Object object) {
public boolean equals(Object object) {
if (this == object) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
*/
package javax.swing.plaf.nimbus;

import org.jspecify.annotations.Nullable;

import javax.swing.UIManager;
import java.awt.Color;
import java.beans.PropertyChangeSupport;
Expand Down Expand Up @@ -115,9 +113,7 @@ public void rederiveColor() {
}

@Override


public boolean equals(@Nullable Object o) {
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof DerivedColor)) return false;
DerivedColor that = (DerivedColor) o;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@

package sun.awt.im;

import org.jspecify.annotations.Nullable;

import java.awt.AWTException;
import java.awt.im.spi.InputMethodDescriptor;
import java.util.Locale;
Expand Down Expand Up @@ -56,9 +54,7 @@ final class InputMethodLocator {
this.locale = locale;
}



public boolean equals(@Nullable Object other) {
public boolean equals(Object other) {
if (other == this) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
*/
package sun.awt.X11;

import org.jspecify.annotations.Nullable;

import java.awt.*;

class WindowDimensions {
Expand Down Expand Up @@ -166,9 +164,7 @@ public String toString() {
return "[" + loc + ", " + size + "(" +(isClientSizeSet?"client":"bounds") + ")+" + insets + "]";
}



public boolean equals(@Nullable Object o) {
public boolean equals(Object o) {
if (!(o instanceof WindowDimensions)) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@

package com.sun.jndi.ldap;

import org.jspecify.annotations.Nullable;

import java.util.Locale;
import java.util.Arrays; // JDK 1.2
import java.io.OutputStream;
Expand Down Expand Up @@ -117,9 +115,7 @@ class ClientId {
+ (ctlHash=hashCodeControls(bindCtls));
}



public boolean equals(@Nullable Object obj) {
public boolean equals(Object obj) {
if (!(obj instanceof ClientId)) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@

package com.sun.jndi.ldap;

import org.jspecify.annotations.Nullable;

import java.util.Arrays; // JDK 1.2
import java.util.Hashtable;

Expand Down Expand Up @@ -84,9 +82,7 @@ class DigestClientId extends SimpleClientId {
myHash = super.hashCode() ^ Arrays.hashCode(propvals);
}



public boolean equals(@Nullable Object obj) {
public boolean equals(Object obj) {
if (!(obj instanceof DigestClientId)) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@

package com.sun.jndi.ldap;

import org.jspecify.annotations.Nullable;

import javax.naming.directory.SearchControls;
import javax.naming.event.*;

Expand Down Expand Up @@ -80,9 +78,7 @@ final class NotifierArgs {
}

// checks name, filter, controls


public boolean equals(@Nullable Object obj) {
public boolean equals(Object obj) {
if (obj instanceof NotifierArgs) {
NotifierArgs target = (NotifierArgs)obj;
return mask == target.mask &&
Expand Down
Loading

0 comments on commit 300a39f

Please sign in to comment.