Skip to content

Commit

Permalink
Cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
lahodaj committed Nov 20, 2024
1 parent 586a000 commit f687ea0
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 57 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Signature file v4.1
#Version 2.13.0
#Version 2.11.0

CLSS public abstract interface java.io.Serializable

Expand All @@ -8,10 +8,8 @@ meth public abstract int compareTo({java.lang.Comparable%0})

CLSS public abstract java.lang.Enum<%0 extends java.lang.Enum<{java.lang.Enum%0}>>
cons protected init(java.lang.String,int)
innr public final static EnumDesc
intf java.io.Serializable
intf java.lang.Comparable<{java.lang.Enum%0}>
intf java.lang.constant.Constable
meth protected final java.lang.Object clone() throws java.lang.CloneNotSupportedException
meth protected final void finalize()
meth public final boolean equals(java.lang.Object)
Expand All @@ -20,7 +18,6 @@ meth public final int hashCode()
meth public final int ordinal()
meth public final java.lang.Class<{java.lang.Enum%0}> getDeclaringClass()
meth public final java.lang.String name()
meth public final java.util.Optional<java.lang.Enum$EnumDesc<{java.lang.Enum%0}>> describeConstable()
meth public java.lang.String toString()
meth public static <%0 extends java.lang.Enum<{%%0}>> {%%0} valueOf(java.lang.Class<{%%0}>,java.lang.String)
supr java.lang.Object
Expand All @@ -35,7 +32,6 @@ CLSS public java.lang.Object
cons public init()
meth protected java.lang.Object clone() throws java.lang.CloneNotSupportedException
meth protected void finalize() throws java.lang.Throwable
anno 0 java.lang.Deprecated(boolean forRemoval=false, java.lang.String since="9")
meth public boolean equals(java.lang.Object)
meth public final java.lang.Class<?> getClass()
meth public final void notify()
Expand Down Expand Up @@ -72,9 +68,6 @@ CLSS public abstract interface !annotation java.lang.annotation.Target
intf java.lang.annotation.Annotation
meth public abstract java.lang.annotation.ElementType[] value()

CLSS public abstract interface java.lang.constant.Constable
meth public abstract java.util.Optional<? extends java.lang.constant.ConstantDesc> describeConstable()

CLSS public final org.netbeans.modules.java.completion.JavaCompletionTask<%0 extends java.lang.Object>
fld protected final int caretOffset
fld protected final java.util.concurrent.Callable<java.lang.Boolean> cancel
Expand All @@ -95,8 +88,7 @@ meth public static <%0 extends java.lang.Object> org.netbeans.modules.java.compl
anno 4 org.netbeans.api.annotations.common.NullAllowed()
meth public void run(org.netbeans.modules.parsing.api.ResultIterator) throws java.lang.Exception
supr org.netbeans.modules.parsing.api.UserTask
hfds ABSTRACT_KEYWORD,ASSERT_KEYWORD,BLOCK_KEYWORDS,BOOLEAN_KEYWORD,BREAK_KEYWORD,BYTE_KEYWORD,CASE_KEYWORD,CATCH_KEYWORD,CHAR_KEYWORD,CLASS_BODY_KEYWORDS,CLASS_KEYWORD,COLON,CONTINUE_KEYWORD,DEFAULT_KEYWORD,DOUBLE_KEYWORD,DO_KEYWORD,ELSE_KEYWORD,EMPTY,ENUM_KEYWORD,ERROR,EXPORTS_KEYWORD,EXTENDS_KEYWORD,FALSE_KEYWORD,FINALLY_KEYWORD,FINAL_KEYWORD,FLOAT_KEYWORD,FOR_KEYWORD,IF_KEYWORD,IMPLEMENTS_KEYWORD,IMPORT_KEYWORD,INIT,INSTANCEOF_KEYWORD,INTERFACE_KEYWORD,INT_KEYWORD,JAVA_LANG_CLASS,JAVA_LANG_ITERABLE,JAVA_LANG_OBJECT,JAVA_LANG_STRING,LONG_KEYWORD,MODULE_BODY_KEYWORDS,MODULE_KEYWORD,NATIVE_KEYWORD,NEW_KEYWORD,NON_SEALED_KEYWORD,NULL_KEYWORD,OPENS_KEYWORD,OPEN_KEYWORD,PACKAGE_KEYWORD,PERMITS_KEYWORD,PRIM_KEYWORDS,PRIVATE_KEYWORD,PROTECTED_KEYWORD,PROVIDES_KEYWORD,PUBLIC_KEYWORD,RECORD_KEYWORD,REQUIRES_KEYWORD,RETURN_KEYWORD,SEALED_KEYWORD,SEMI,SHORT_KEYWORD,SPACE,STATEMENT_KEYWORDS,STATEMENT_SPACE_KEYWORDS,STATIC_KEYWORD,STRICT_KEYWORD,SUPER_KEYWORD,SWITCH_KEYWORD,SYNCHRONIZED_KEYWORD,THIS_KEYWORD,THROWS_KEYWORD,THROW_KEYWORD,TO_KEYWORD,TRANSIENT_KEYWORD,TRANSITIVE_KEYWORD,TRUE_KEYWORD,TRY_KEYWORD,USES_KEYWORD,VAR_KEYWORD,VOID_KEYWORD,VOLATILE_KEYWORD,WHEN_KEYWORD,WHILE_KEYWORD,WITH_KEYWORD,YIELD_KEYWORD,anchorOffset,hasAdditionalClasses,hasAdditionalMembers,itemFactory,options,results
hcls AddTypeItem
hfds ABSTRACT_KEYWORD,ASSERT_KEYWORD,BLOCK_KEYWORDS,BOOLEAN_KEYWORD,BREAK_KEYWORD,BYTE_KEYWORD,CASE_KEYWORD,CATCH_KEYWORD,CHAR_KEYWORD,CLASS_BODY_KEYWORDS,CLASS_KEYWORD,COLON,CONTINUE_KEYWORD,DEFAULT_KEYWORD,DOUBLE_KEYWORD,DO_KEYWORD,ELSE_KEYWORD,EMPTY,ENUM_KEYWORD,ERROR,EXPORTS_KEYWORD,EXTENDS_KEYWORD,FALSE_KEYWORD,FINALLY_KEYWORD,FINAL_KEYWORD,FLOAT_KEYWORD,FOR_KEYWORD,IF_KEYWORD,IMPLEMENTS_KEYWORD,IMPORT_KEYWORD,INIT,INSTANCEOF_KEYWORD,INTERFACE_KEYWORD,INT_KEYWORD,JAVA_LANG_CLASS,JAVA_LANG_ITERABLE,JAVA_LANG_OBJECT,LONG_KEYWORD,MODULE_BODY_KEYWORDS,MODULE_KEYWORD,NATIVE_KEYWORD,NEW_KEYWORD,NON_SEALED_KEYWORD,NULL_KEYWORD,OPENS_KEYWORD,OPEN_KEYWORD,PACKAGE_KEYWORD,PERMITS_KEYWORD,PRIM_KEYWORDS,PRIVATE_KEYWORD,PROTECTED_KEYWORD,PROVIDES_KEYWORD,PUBLIC_KEYWORD,RECORD_KEYWORD,REQUIRES_KEYWORD,RETURN_KEYWORD,SEALED_KEYWORD,SEMI,SHORT_KEYWORD,SPACE,STATEMENT_KEYWORDS,STATEMENT_SPACE_KEYWORDS,STATIC_KEYWORD,STRICT_KEYWORD,SUPER_KEYWORD,SWITCH_KEYWORD,SYNCHRONIZED_KEYWORD,THIS_KEYWORD,THROWS_KEYWORD,THROW_KEYWORD,TO_KEYWORD,TRANSIENT_KEYWORD,TRANSITIVE_KEYWORD,TRUE_KEYWORD,TRY_KEYWORD,USES_KEYWORD,VAR_KEYWORD,VOID_KEYWORD,VOLATILE_KEYWORD,WHEN_KEYWORD,WHILE_KEYWORD,WITH_KEYWORD,YIELD_KEYWORD,anchorOffset,hasAdditionalClasses,hasAdditionalMembers,itemFactory,options,results

CLSS public abstract interface static org.netbeans.modules.java.completion.JavaCompletionTask$ItemFactory<%0 extends java.lang.Object>
outer org.netbeans.modules.java.completion.JavaCompletionTask
Expand All @@ -113,8 +105,8 @@ meth public abstract {org.netbeans.modules.java.completion.JavaCompletionTask$It
meth public abstract {org.netbeans.modules.java.completion.JavaCompletionTask$ItemFactory%0} createOverrideMethodItem(org.netbeans.api.java.source.CompilationInfo,javax.lang.model.element.ExecutableElement,javax.lang.model.type.ExecutableType,int,boolean)
meth public abstract {org.netbeans.modules.java.completion.JavaCompletionTask$ItemFactory%0} createPackageItem(java.lang.String,int,boolean)
meth public abstract {org.netbeans.modules.java.completion.JavaCompletionTask$ItemFactory%0} createParametersItem(org.netbeans.api.java.source.CompilationInfo,javax.lang.model.element.ExecutableElement,javax.lang.model.type.ExecutableType,int,boolean,int,java.lang.String)
meth public abstract {org.netbeans.modules.java.completion.JavaCompletionTask$ItemFactory%0} createStaticMemberItem(org.netbeans.api.java.source.CompilationInfo,javax.lang.model.type.DeclaredType,javax.lang.model.element.Element,javax.lang.model.type.TypeMirror,boolean,int,boolean,boolean,boolean)
meth public abstract {org.netbeans.modules.java.completion.JavaCompletionTask$ItemFactory%0} createStaticMemberItem(org.netbeans.api.java.source.ElementHandle<javax.lang.model.element.TypeElement>,java.lang.String,int,boolean,org.netbeans.api.java.source.support.ReferencesCount,org.netbeans.modules.parsing.api.Source,boolean)
meth public abstract {org.netbeans.modules.java.completion.JavaCompletionTask$ItemFactory%0} createStaticMemberItem(org.netbeans.api.java.source.CompilationInfo,javax.lang.model.type.DeclaredType,javax.lang.model.element.Element,javax.lang.model.type.TypeMirror,boolean,int,boolean,boolean)
meth public abstract {org.netbeans.modules.java.completion.JavaCompletionTask$ItemFactory%0} createStaticMemberItem(org.netbeans.api.java.source.ElementHandle<javax.lang.model.element.TypeElement>,java.lang.String,int,boolean,org.netbeans.api.java.source.support.ReferencesCount,org.netbeans.modules.parsing.api.Source)
meth public abstract {org.netbeans.modules.java.completion.JavaCompletionTask$ItemFactory%0} createThisOrSuperConstructorItem(org.netbeans.api.java.source.CompilationInfo,javax.lang.model.element.ExecutableElement,javax.lang.model.type.ExecutableType,int,boolean,java.lang.String)
meth public abstract {org.netbeans.modules.java.completion.JavaCompletionTask$ItemFactory%0} createTypeItem(org.netbeans.api.java.source.CompilationInfo,javax.lang.model.element.TypeElement,javax.lang.model.type.DeclaredType,int,org.netbeans.api.java.source.support.ReferencesCount,boolean,boolean,boolean,boolean,boolean,boolean)
meth public abstract {org.netbeans.modules.java.completion.JavaCompletionTask$ItemFactory%0} createTypeItem(org.netbeans.api.java.source.ElementHandle<javax.lang.model.element.TypeElement>,java.util.EnumSet<javax.lang.model.element.ElementKind>,int,org.netbeans.api.java.source.support.ReferencesCount,org.netbeans.modules.parsing.api.Source,boolean,boolean,boolean)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ public static interface ItemFactory<T> {

T createAttributeValueItem(CompilationInfo info, String value, String documentation, TypeElement element, int substitutionOffset, ReferencesCount referencesCount);

T createStaticMemberItem(CompilationInfo info, DeclaredType type, Element memberElem, TypeMirror memberType, boolean multipleVersions, int substitutionOffset, boolean isDeprecated, boolean addSemicolon, boolean smartType);
T createStaticMemberItem(CompilationInfo info, DeclaredType type, Element memberElem, TypeMirror memberType, boolean multipleVersions, int substitutionOffset, boolean isDeprecated, boolean addSemicolon);

T createStaticMemberItem(ElementHandle<TypeElement> handle, String name, int substitutionOffset, boolean addSemicolon, ReferencesCount referencesCount, Source source, boolean smartType);
T createStaticMemberItem(ElementHandle<TypeElement> handle, String name, int substitutionOffset, boolean addSemicolon, ReferencesCount referencesCount, Source source);

T createChainedMembersItem(CompilationInfo info, List<? extends Element> chainedElems, List<? extends TypeMirror> chainedTypes, int substitutionOffset, boolean isDeprecated, boolean addSemicolon);

Expand Down Expand Up @@ -2652,7 +2652,7 @@ public void addTypeItem(CompilationInfo info, TypeElement elem, DeclaredType typ
continue;
}
//not filtering deprecated, etc., as those may be needed for exhaustiveness:
results.add(itemFactory.createStaticMemberItem(info, type, enumConstant, enumConstant.asType(), false, anchorOffset, info.getElements().isDeprecated(enumConstant), false, true));
results.add(itemFactory.createStaticMemberItem(info, type, enumConstant, enumConstant.asType(), false, anchorOffset, info.getElements().isDeprecated(enumConstant), false));
}
}
}
Expand Down Expand Up @@ -3577,7 +3577,7 @@ public boolean accept(Element e, TypeMirror t) {
};
for (Element ee : controller.getElementUtilities().getMembers(type, acceptor)) {
if (Utilities.isShowDeprecatedMembers() || !elements.isDeprecated(ee)) {
results.add(itemFactory.createStaticMemberItem(env.getController(), type, ee, asMemberOf(ee, type, types), false, anchorOffset, elements.isDeprecated(ee), false, true));
results.add(itemFactory.createStaticMemberItem(env.getController(), type, ee, asMemberOf(ee, type, types), false, anchorOffset, elements.isDeprecated(ee), false));
}
}
}
Expand Down Expand Up @@ -3661,7 +3661,7 @@ public boolean accept(Element e, TypeMirror t) {
};
for (Element ee : controller.getElementUtilities().getMembers(type, acceptor)) {
if (Utilities.isShowDeprecatedMembers() || !elements.isDeprecated(ee)) {
results.add(itemFactory.createStaticMemberItem(env.getController(), type, ee, asMemberOf(ee, type, types), false, anchorOffset, elements.isDeprecated(ee), env.addSemicolon(), true));
results.add(itemFactory.createStaticMemberItem(env.getController(), type, ee, asMemberOf(ee, type, types), false, anchorOffset, elements.isDeprecated(ee), env.addSemicolon()));
}
}
}
Expand Down Expand Up @@ -3698,7 +3698,7 @@ public boolean accept(Element e, TypeMirror t) {
}
ExecutableType et = (ExecutableType) asMemberOf(e, enclClass != null ? enclClass.asType() : null, types);
if (e.getEnclosingElement() != enclClass && conflictsWithLocalMethods(e.getSimpleName(), enclClass, methodsIn)) {
results.add(itemFactory.createStaticMemberItem(env.getController(), (DeclaredType)e.getEnclosingElement().asType(), e, et, false, anchorOffset, elements.isDeprecated(e), env.addSemicolon(), true));
results.add(itemFactory.createStaticMemberItem(env.getController(), (DeclaredType)e.getEnclosingElement().asType(), e, et, false, anchorOffset, elements.isDeprecated(e), env.addSemicolon()));
} else {
results.add(itemFactory.createExecutableItem(env.getController(), (ExecutableElement) e, et, anchorOffset, null, env.getScope().getEnclosingClass() != e.getEnclosingElement(), elements.isDeprecated(e), false, env.addSemicolon(), isOfSmartType(env, getCorrectedReturnType(env, et, (ExecutableElement) e, enclClass != null ? enclClass.asType() : null), smartTypes), env.assignToVarPos(), false));
}
Expand Down Expand Up @@ -3870,7 +3870,7 @@ public boolean accept(Element e, TypeMirror t) {
for (DeclaredType dt : dts) {
if (startsWith(env, dt.asElement().getSimpleName().toString())) {
for (Element ee : controller.getElementUtilities().getMembers(dt, acceptor)) {
results.add(itemFactory.createStaticMemberItem(env.getController(), dt, ee, asMemberOf(ee, dt, types), false, anchorOffset, elements.isDeprecated(ee), env.addSemicolon(), true));
results.add(itemFactory.createStaticMemberItem(env.getController(), dt, ee, asMemberOf(ee, dt, types), false, anchorOffset, elements.isDeprecated(ee), env.addSemicolon()));
}
}
}
Expand Down Expand Up @@ -3967,7 +3967,7 @@ private void addAllStaticMemberNames(final Env env) {
}
for (String name : symbols.getSymbols()) {
if (!Utilities.isExcludeMethods() || !Utilities.isExcluded(symbols.getEnclosingType().getQualifiedName() + '.' + name)) {
results.add(itemFactory.createStaticMemberItem(symbols.getEnclosingType(), name, anchorOffset, env.addSemicolon(), env.getReferencesCount(), controller.getSnapshot().getSource(), true));
results.add(itemFactory.createStaticMemberItem(symbols.getEnclosingType(), name, anchorOffset, env.addSemicolon(), env.getReferencesCount(), controller.getSnapshot().getSource()));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Reader;
import java.io.Writer;
import java.nio.file.Files;
import java.util.*;

import javax.lang.model.element.*;
Expand All @@ -35,7 +33,6 @@
import javax.lang.model.type.TypeMirror;
import javax.lang.model.util.Elements;
import javax.swing.text.Document;
import junit.framework.AssertionFailedError;

import org.netbeans.api.java.lexer.JavaTokenId;
import org.netbeans.api.java.source.*;
Expand Down Expand Up @@ -111,18 +108,7 @@ protected void performTest(String source, int caretPos, String textToInsert, Str

File goldenFile = getGoldenFile(goldenFileName);
File diffFile = new File(getWorkDir(), getName() + ".diff");
try {
assertFile(output, goldenFile, diffFile);
} catch (AssertionFailedError err) {
try (Reader input = Files.newBufferedReader(diffFile.toPath())) {
int r;

while ((r = input.read()) != (-1)) {
System.err.print((char) r);
}
}
throw err;
}
assertFile(output, goldenFile, diffFile);

LifecycleManager.getDefault().saveAll();
}
Expand Down Expand Up @@ -539,7 +525,7 @@ public CI createAttributeValueItem(CompilationInfo info, String value, String do
}

@Override
public CI createStaticMemberItem(CompilationInfo info, DeclaredType type, Element memberElem, TypeMirror memberType, boolean multipleVersions, int substitutionOffset, boolean isDeprecated, boolean addSemicolon, boolean smartType) {
public CI createStaticMemberItem(CompilationInfo info, DeclaredType type, Element memberElem, TypeMirror memberType, boolean multipleVersions, int substitutionOffset, boolean isDeprecated, boolean addSemicolon) {
switch (memberElem.getKind()) {
case METHOD:
case ENUM_CONSTANT:
Expand Down Expand Up @@ -591,14 +577,14 @@ public CI createStaticMemberItem(CompilationInfo info, DeclaredType type, Elemen
sb.append(')');
sortParams.append(')');
}
return new CI(sb.toString(), (memberElem.getKind().isField() ? 720 : 750) - (smartType ? SMART_TYPE : 0), memberElem.getKind().isField() ? memberName + "#" + typeName : memberName + "#" + ((cnt < 10 ? "0" : "") + cnt) + "#" + sortParams.toString() + "#" + typeName); //NOI18N
return new CI(sb.toString(), (memberElem.getKind().isField() ? 720 : 750) - SMART_TYPE, memberElem.getKind().isField() ? memberName + "#" + typeName : memberName + "#" + ((cnt < 10 ? "0" : "") + cnt) + "#" + sortParams.toString() + "#" + typeName); //NOI18N
default:
throw new IllegalArgumentException("kind=" + memberElem.getKind());
}
}

@Override
public CI createStaticMemberItem(ElementHandle<TypeElement> handle, String name, int substitutionOffset, boolean addSemicolon, ReferencesCount referencesCount, Source source, boolean smartType) {
public CI createStaticMemberItem(ElementHandle<TypeElement> handle, String name, int substitutionOffset, boolean addSemicolon, ReferencesCount referencesCount, Source source) {
String fqn = handle.getQualifiedName();
int weight = 50;
if (fqn.startsWith("java.lang") || fqn.startsWith("java.util")) { // NOI18N
Expand Down
Loading

0 comments on commit f687ea0

Please sign in to comment.