8303881: Mixed, minor cleanup in jdk.compiler

Reviewed-by: mcimadamore
This commit is contained in:
Pavel Rappo 2023-03-09 13:43:36 +00:00
parent 7e01534590
commit 1e9942aa11
8 changed files with 22 additions and 25 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -124,7 +124,7 @@ public class Preview {
* Returns true if {@code s} is deemed to participate in the preview of {@code previewSymbol}, and
* therefore no warnings or errors will be produced.
*
* @parem syms the symbol table
* @param syms the symbol table
* @param s the symbol depending on the preview symbol
* @param previewSymbol the preview symbol marked with @Preview
* @return true if {@code s} is participating in the preview of {@code previewSymbol}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -113,14 +113,14 @@ public abstract class Scope {
public abstract Iterable<Symbol> getSymbolsByName(final Name name, final Predicate<Symbol> sf,
final LookupKind lookupKind);
/** Return the first Symbol from this or outward scopes with the given name.
/** Returns the first Symbol from this or outward scopes with the given name.
* Returns null if none.
*/
public final Symbol findFirst(Name name) {
return findFirst(name, noFilter);
}
/** Return the first Symbol from this or outward scopes with the given name that matches the
/** Returns the first Symbol from this or outward scopes with the given name that matches the
* given filter. Returns null if none.
*/
public Symbol findFirst(Name name, Predicate<Symbol> sf) {
@ -128,7 +128,7 @@ public abstract class Scope {
return it.hasNext() ? it.next() : null;
}
/** Returns true iff there are is at least one Symbol in this scope matching the given filter.
/** Returns true iff there is at least one Symbol in this scope matching the given filter.
* Does not inspect outward scopes.
*/
public boolean anyMatch(Predicate<Symbol> filter) {
@ -153,7 +153,7 @@ public abstract class Scope {
return !getSymbols(NON_RECURSIVE).iterator().hasNext();
}
/** Returns the Scope from which the givins Symbol originates in this scope.
/** Returns the Scope from which the given Symbol originates in this scope.
*/
public abstract Scope getOrigin(Symbol byName);
@ -232,7 +232,7 @@ public abstract class Scope {
public abstract void remove(Symbol c);
/** Construct a fresh scope within this scope, with same owner. The new scope may
* shares internal structures with the this scope. Used in connection with
* share internal structures with this scope. Used in connection with
* method leave if scope access is stack-like in order to avoid allocation
* of fresh tables.
*/
@ -241,7 +241,7 @@ public abstract class Scope {
}
/** Construct a fresh scope within this scope, with new owner. The new scope may
* shares internal structures with the this scope. Used in connection with
* share internal structures with this scope. Used in connection with
* method leave if scope access is stack-like in order to avoid allocation
* of fresh tables.
*/
@ -276,7 +276,7 @@ public abstract class Scope {
*/
private boolean shared;
/** Next enclosing scope (with whom this scope may share a hashtable)
/** Next enclosing scope (with whom this scope may share a hash table)
*/
public ScopeImpl next;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -839,8 +839,8 @@ public abstract class Symbol extends AnnoConstruct implements PoolConstant, Elem
if (type.hasTag(CLASS)) {
return
types.rank(that.type) < types.rank(this.type) ||
types.rank(that.type) == types.rank(this.type) &&
that.getQualifiedName().compareTo(this.getQualifiedName()) < 0;
(types.rank(that.type) == types.rank(this.type) &&
that.getQualifiedName().compareTo(this.getQualifiedName()) < 0);
} else if (type.hasTag(TYPEVAR)) {
return types.isSubtype(this.type, that.type);
}

View File

@ -2863,7 +2863,7 @@ public class Types {
/**
* Merge multiple abstract methods. The preferred method is a method that is a subsignature
* of all the other signatures and whose return type is more specific {@link MostSpecificReturnCheck}.
* The resulting preferred method has a thrown clause that is the intersection of the merged
* The resulting preferred method has a throws clause that is the intersection of the merged
* methods' clauses.
*/
public Optional<Symbol> mergeAbstracts(List<Symbol> ambiguousInOrder, Type site, boolean sigCheck) {
@ -3692,7 +3692,7 @@ public class Types {
*
* <p>A closure is a list of all the supertypes and interfaces of
* a class or interface type, ordered by ClassSymbol.precedes
* (that is, subclasses come first, arbitrary but fixed
* (that is, subclasses come first, arbitrarily but fixed
* otherwise).
*/
private Map<Type,List<Type>> closureCache = new HashMap<>();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -1216,7 +1216,7 @@ public class Flow {
}
}
// add intersection of all thrown clauses of initial constructors
// add intersection of all throws clauses of initial constructors
// to set of caught exceptions, unless class is anonymous.
if (!anonymousClass) {
boolean firstConstructor = true;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -476,7 +476,7 @@ public class Resolve {
* and the selection takes place in given class?
* @param sym The symbol with protected access
* @param c The class where the access takes place
* @site The type of the qualifier
* @param site The type of the qualifier
*/
private
boolean isProtectedAccessible(Symbol sym, ClassSymbol c, Type site) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -239,13 +239,13 @@ public class ClassReader {
/**
* The prototype @Target Attribute.Compound if this class is an annotation annotated with
* @Target
* {@code @Target}
*/
CompoundAnnotationProxy target;
/**
* The prototype @Repeatable Attribute.Compound if this class is an annotation annotated with
* @Repeatable
* {@code @Repeatable}
*/
CompoundAnnotationProxy repeatable;

View File

@ -537,9 +537,6 @@ public class JavacElements implements Elements {
return valmap;
}
/**
* {@inheritDoc}
*/
@DefinedBy(Api.LANGUAGE_MODEL)
public FilteredMemberList getAllMembers(TypeElement element) {
Symbol sym = cast(Symbol.class, element);