Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
*/
public class RhinoJavaScriptTypesFactory extends JSR223JavaScriptTypesFactory {

private LinkedHashSet<String> importClasses = new LinkedHashSet<>();
private LinkedHashSet<String> importPackages = new LinkedHashSet<>();
private Set<String> importClasses = new LinkedHashSet<>();
private Set<String> importPackages = new LinkedHashSet<>();

public RhinoJavaScriptTypesFactory(TypeDeclarationFactory typesFactory) {
super(typesFactory);
Expand All @@ -43,9 +43,9 @@ public void mergeImports(Set<String> packages, Set<String> classes) {
mergeImports(classes, importClasses, false);
}

private void mergeImports(Set<String> newImports, LinkedHashSet<String> oldImports, boolean packages) {
private void mergeImports(Set<String> newImports, Set<String> oldImports, boolean packages) {
//iterate through the old imports and check whether the import exists in new. If not then add to remove and remove all types for that package/class
HashSet<String> remove = new HashSet<>();
Set<String> remove = new HashSet<>();
for (String obj : oldImports) {
if (!newImports.contains(obj)) {
remove.add(obj);
Expand All @@ -55,7 +55,7 @@ private void mergeImports(Set<String> newImports, LinkedHashSet<String> oldImpor

//now iterate through the remove list and remove imports not needed
if (!remove.isEmpty()) {
HashSet<TypeDeclaration> removeTypes = new HashSet<>();
Set<TypeDeclaration> removeTypes = new HashSet<>();
for (String name : remove) {
for (TypeDeclaration dec : cachedTypes.keySet()) {
if ((packages && dec.getQualifiedName().startsWith(name)) || (!packages && dec.getQualifiedName().equals(name))) {
Expand Down Expand Up @@ -84,7 +84,7 @@ private void mergeImports(Set<String> newImports, LinkedHashSet<String> oldImpor
* @param oldImports
* @return
*/
private boolean canClearCache(Set<String> newImports, LinkedHashSet<String> oldImports) {
private boolean canClearCache(Set<String> newImports, Set<String> oldImports) {
if (newImports.size() != oldImports.size()) {
return true;
}
Expand All @@ -105,7 +105,7 @@ public void clearImportCache() {
}

private void clearAllImportTypes() {
HashSet<TypeDeclaration> removeTypes = new HashSet<>();
Set<TypeDeclaration> removeTypes = new HashSet<>();
//clear all non ECMA (JavaScript types) for importPackage and importClass to work properly
for (TypeDeclaration dec : cachedTypes.keySet()) {
if (!typesFactory.isJavaScriptType(dec) && !dec.equals(typesFactory.getDefaultTypeDeclaration())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public class RhinoJavaScriptAstParser extends JavaScriptAstParser {

public static final String PACKAGES = "Packages.";

private LinkedHashSet<String> importClasses = new LinkedHashSet<>();
private LinkedHashSet<String> importPackages = new LinkedHashSet<>();
private Set<String> importClasses = new LinkedHashSet<>();
private Set<String> importPackages = new LinkedHashSet<>();

public RhinoJavaScriptAstParser(SourceCompletionProvider provider, int dot,
TypeDeclarationOptions options) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public abstract class TypeDeclarations {

// reverse lookup for Java types to Javascript types
private final Map<String, String> javascriptReverseLookup = new HashMap<>();
private final HashSet<JavaScriptObject> ecmaObjects = new HashSet<>();
private final Set<JavaScriptObject> ecmaObjects = new HashSet<>();


public TypeDeclarations() {
Expand Down
2 changes: 1 addition & 1 deletion config/checkstyle/lsSuppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
For now we're ignoring several issues that will take some time to address.
TODO: Remove these issues one by one.
-->
<suppress files=".*src[\\/]main[\\/]java[\\/]org[\\/]fife[\\/]rsta[\\/]ac[\\/]js[\\/].*" checks="AvoidNestedBlocks|CommentsIndentation|ExplicitInitialization|IllegalType|JavadocTagContinuationIndentation|JavadocMethod|JavadocPackage|JavadocStyle|LineLength|MissingJavadocMethod|MissingJavadocType|NeedBraces|NonEmptyAtclauseDescription|OperatorWrap|StaticVariableName|VisibilityModifier"/>
<suppress files=".*src[\\/]main[\\/]java[\\/]org[\\/]fife[\\/]rsta[\\/]ac[\\/]js[\\/].*" checks="AvoidNestedBlocks|CommentsIndentation|ExplicitInitialization|JavadocTagContinuationIndentation|JavadocMethod|JavadocPackage|JavadocStyle|LineLength|MissingJavadocMethod|MissingJavadocType|NeedBraces|NonEmptyAtclauseDescription|OperatorWrap|StaticVariableName|VisibilityModifier"/>

<!-- Lots of blocks are empty with "TODO" comments describing future implementations -->
<suppress files=".*src[\\/]main[\\/]java[\\/]org[\\/]fife[\\/]rsta[\\/]ac[\\/].*" checks="EmptyBlock"/>
Expand Down