diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/cmd/comments/SetCommentCmd.java b/Ghidra/Features/Base/src/main/java/ghidra/app/cmd/comments/SetCommentCmd.java index f153b021ac..ace2b4a441 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/cmd/comments/SetCommentCmd.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/cmd/comments/SetCommentCmd.java @@ -75,7 +75,7 @@ public class SetCommentCmd implements Command { " Is this address valid?"; return false; } - String updatedComment = CommentUtils.fixupAnnoations(comment, program); + String updatedComment = CommentUtils.fixupAnnotations(comment, program); updatedComment = CommentUtils.sanitize(updatedComment); if (commentChanged(cu.getComment(commentType), updatedComment)) { cu.setComment(commentType, updatedComment); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/cmd/comments/SetCommentsCmd.java b/Ghidra/Features/Base/src/main/java/ghidra/app/cmd/comments/SetCommentsCmd.java index f4f7c316f5..1ea8dd2fc6 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/cmd/comments/SetCommentsCmd.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/cmd/comments/SetCommentsCmd.java @@ -90,28 +90,28 @@ public class SetCommentsCmd implements Command { if (cu != null) { if (commentChanged(cu.getComment(CodeUnit.PRE_COMMENT), preComment)) { - String updatedPreComment = CommentUtils.fixupAnnoations(preComment, program); + String updatedPreComment = CommentUtils.fixupAnnotations(preComment, program); updatedPreComment = CommentUtils.sanitize(updatedPreComment); cu.setComment(CodeUnit.PRE_COMMENT, updatedPreComment); } if (commentChanged(cu.getComment(CodeUnit.POST_COMMENT), postComment)) { - String updatedPostComment = CommentUtils.fixupAnnoations(postComment, program); + String updatedPostComment = CommentUtils.fixupAnnotations(postComment, program); updatedPostComment = CommentUtils.sanitize(updatedPostComment); cu.setComment(CodeUnit.POST_COMMENT, updatedPostComment); } if (commentChanged(cu.getComment(CodeUnit.EOL_COMMENT), eolComment)) { - String updatedEOLComment = CommentUtils.fixupAnnoations(eolComment, program); + String updatedEOLComment = CommentUtils.fixupAnnotations(eolComment, program); updatedEOLComment = CommentUtils.sanitize(updatedEOLComment); cu.setComment(CodeUnit.EOL_COMMENT, updatedEOLComment); } if (commentChanged(cu.getComment(CodeUnit.PLATE_COMMENT), plateComment)) { - String updatedPlateComment = CommentUtils.fixupAnnoations(plateComment, program); + String updatedPlateComment = CommentUtils.fixupAnnotations(plateComment, program); updatedPlateComment = CommentUtils.sanitize(updatedPlateComment); cu.setComment(CodeUnit.PLATE_COMMENT, updatedPlateComment); } if (commentChanged(cu.getComment(CodeUnit.REPEATABLE_COMMENT), repeatableComment)) { String updatedRepeatableComment = - CommentUtils.fixupAnnoations(repeatableComment, program); + CommentUtils.fixupAnnotations(repeatableComment, program); updatedRepeatableComment = CommentUtils.sanitize(updatedRepeatableComment); cu.setComment(CodeUnit.REPEATABLE_COMMENT, updatedRepeatableComment); } diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/bookmark/BookmarkTableModel.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/bookmark/BookmarkTableModel.java index b4c438c602..4dfe3c188b 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/bookmark/BookmarkTableModel.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/bookmark/BookmarkTableModel.java @@ -112,8 +112,8 @@ class BookmarkTableModel extends AddressBasedTableModel { } BookmarkType[] programTypes = bookmarkMgr.getBookmarkTypes(); - int allKnowTypesSize = programTypes.length; - return !types.isEmpty() && types.size() != allKnowTypesSize; + int allKnownTypesSize = programTypes.length; + return !types.isEmpty() && types.size() != allKnownTypesSize; } FilterState getFilterState() { diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/CommentUtils.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/CommentUtils.java index 4b5876d8fd..2c47061664 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/CommentUtils.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/CommentUtils.java @@ -46,7 +46,7 @@ public class CommentUtils { * @param program the program associated with the comment * @return the updated string */ - public static String fixupAnnoations(String rawCommentText, Program program) { + public static String fixupAnnotations(String rawCommentText, Program program) { if (rawCommentText == null) { return null; diff --git a/Ghidra/Features/Base/src/test.slow/java/ghidra/app/util/viewer/field/AnnotationTest.java b/Ghidra/Features/Base/src/test.slow/java/ghidra/app/util/viewer/field/AnnotationTest.java index b1d488d6bc..35506562de 100644 --- a/Ghidra/Features/Base/src/test.slow/java/ghidra/app/util/viewer/field/AnnotationTest.java +++ b/Ghidra/Features/Base/src/test.slow/java/ghidra/app/util/viewer/field/AnnotationTest.java @@ -89,45 +89,45 @@ public class AnnotationTest extends AbstractGhidraHeadedIntegrationTest { @Test public void testSymbolAnnotationWithAddress() { String rawComment = "This is a symbol {@sym 01001014} annotation."; - String fixed = CommentUtils.fixupAnnoations(rawComment, program); + String fixed = CommentUtils.fixupAnnotations(rawComment, program); assertEquals(rawComment, fixed); // with display string rawComment = "This is a symbol {@sym 01001014 bob} annotation."; - fixed = CommentUtils.fixupAnnoations(rawComment, program); + fixed = CommentUtils.fixupAnnotations(rawComment, program); assertEquals(rawComment, fixed); } @Test public void testSymbolAnnotationWithInvalidAddress() { String rawComment = "This is a symbol {@sym 999999} annotation."; - String fixed = CommentUtils.fixupAnnoations(rawComment, program); + String fixed = CommentUtils.fixupAnnotations(rawComment, program); assertEquals(rawComment, fixed); } @Test public void testSymbolAnnotationWithSymbol() { String rawComment = "This is a symbol {@sym LAB_01003d2c} annotation."; - String fixed = CommentUtils.fixupAnnoations(rawComment, program); + String fixed = CommentUtils.fixupAnnotations(rawComment, program); assertEquals("This is a symbol {@sym 01003d2c} annotation.", fixed); // with display string rawComment = "This is a symbol {@sym LAB_01003d2c displayText} annotation."; - fixed = CommentUtils.fixupAnnoations(rawComment, program); + fixed = CommentUtils.fixupAnnotations(rawComment, program); assertEquals("This is a symbol {@sym 01003d2c displayText} annotation.", fixed); } @Test public void testSymbolAnnotationWithInvalidSymbol() { String rawComment = "This is a symbol {@sym CocoPebbles} annotation."; - String fixed = CommentUtils.fixupAnnoations(rawComment, program); + String fixed = CommentUtils.fixupAnnotations(rawComment, program); assertEquals("This is a symbol {@sym CocoPebbles} annotation.", fixed); } @Test public void testNoAnnotation() { String rawComment = "This is no symbol annotation."; - String fixed = CommentUtils.fixupAnnoations(rawComment, program); + String fixed = CommentUtils.fixupAnnotations(rawComment, program); assertEquals(rawComment, fixed); } @@ -135,7 +135,7 @@ public class AnnotationTest extends AbstractGhidraHeadedIntegrationTest { public void testMixedAnnotationNoSymbolAnnotation() { String rawComment = "This is a symbol {@url www.noplace.com} annotation " + "with a {@program notepad} annotation."; - String fixed = CommentUtils.fixupAnnoations(rawComment, program); + String fixed = CommentUtils.fixupAnnotations(rawComment, program); assertEquals(rawComment, fixed); } @@ -143,7 +143,7 @@ public class AnnotationTest extends AbstractGhidraHeadedIntegrationTest { public void testMixedAnnotationWithSymbolAnnotation() { String rawComment = "This is a symbol {@sym LAB_01003d2c} annotation " + "with a {@program notepad} annotation."; - String fixed = CommentUtils.fixupAnnoations(rawComment, program); + String fixed = CommentUtils.fixupAnnotations(rawComment, program); assertEquals("This is a symbol {@sym 01003d2c} annotation " + "with a {@program notepad} annotation.", fixed); } @@ -151,21 +151,21 @@ public class AnnotationTest extends AbstractGhidraHeadedIntegrationTest { @Test public void testSymbolAnnotationAtBeginningOfComment() { String rawComment = "{@sym LAB_01003d2c} annotation at the beginning."; - String fixed = CommentUtils.fixupAnnoations(rawComment, program); + String fixed = CommentUtils.fixupAnnotations(rawComment, program); assertEquals("{@sym 01003d2c} annotation at the beginning.", fixed); } @Test public void testSymbolAnnotation_BackToBack() { String rawComment = "Test {@sym LAB_01003d2c}{@sym LAB_01003d2c} end."; - String fixed = CommentUtils.fixupAnnoations(rawComment, program); + String fixed = CommentUtils.fixupAnnotations(rawComment, program); assertEquals("Test {@sym 01003d2c}{@sym 01003d2c} end.", fixed); } @Test public void testSymbolAnnotationAtEndOfComment() { String rawComment = "Annotation at the end {@sym LAB_01003d2c}"; - String fixed = CommentUtils.fixupAnnoations(rawComment, program); + String fixed = CommentUtils.fixupAnnotations(rawComment, program); assertEquals("Annotation at the end {@sym 01003d2c}", fixed); } @@ -173,7 +173,7 @@ public class AnnotationTest extends AbstractGhidraHeadedIntegrationTest { public void testSymbolAnnotationAtBeginningAndEndOfComment() { String rawComment = "{@sym LAB_01003d2c} annotation at the beginning and end {@sym LAB_01003d5b}"; - String fixed = CommentUtils.fixupAnnoations(rawComment, program); + String fixed = CommentUtils.fixupAnnotations(rawComment, program); assertEquals("{@sym 01003d2c} annotation at the " + "beginning and end {@sym 01003d5b}", fixed); } @@ -183,7 +183,7 @@ public class AnnotationTest extends AbstractGhidraHeadedIntegrationTest { String rawComment = "{@sym LAB_01003d2c} annotation at the beginning, middle {@sym LAB_01003d28} and " + "end {@sym LAB_01003d5b}"; - String fixed = CommentUtils.fixupAnnoations(rawComment, program); + String fixed = CommentUtils.fixupAnnotations(rawComment, program); assertEquals("{@sym 01003d2c} annotation at the beginning, middle {@sym 01003d28} and " + "end {@sym 01003d5b}", fixed); } @@ -192,7 +192,7 @@ public class AnnotationTest extends AbstractGhidraHeadedIntegrationTest { public void testSymbolAnnotationWithValidAndInvalidSymbol() { String rawComment = "This is a symbol {@sym LAB_01003d2c} annotation " + "with a {@sym FruityPebbles} annotation."; - String fixed = CommentUtils.fixupAnnoations(rawComment, program); + String fixed = CommentUtils.fixupAnnotations(rawComment, program); assertEquals("This is a symbol {@sym 01003d2c} annotation " + "with a {@sym FruityPebbles} annotation.", fixed); } diff --git a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/AlgorithmFilter.java b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/AlgorithmFilter.java index ee3c6ba0da..f6289f1d55 100644 --- a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/AlgorithmFilter.java +++ b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/AlgorithmFilter.java @@ -75,7 +75,7 @@ public class AlgorithmFilter extends CheckBoxBasedAncillaryFilter { @Override protected void createCheckBoxInfos() { - List algorithmNames = getKnowAlgorithms(); + List algorithmNames = getKnownAlgorithms(); ItemListener listener = new ItemListener() { @Override @@ -92,7 +92,7 @@ public class AlgorithmFilter extends CheckBoxBasedAncillaryFilter { } } - private List getKnowAlgorithms() { + private List getKnownAlgorithms() { List list = new ArrayList<>(); // add the manual match correlator, which doesn't have a factory, since it is only through an action. diff --git a/Ghidra/Framework/Help/src/main/java/help/validator/model/HelpTopic.java b/Ghidra/Framework/Help/src/main/java/help/validator/model/HelpTopic.java index d3ee986e1e..4c474a2c7a 100644 --- a/Ghidra/Framework/Help/src/main/java/help/validator/model/HelpTopic.java +++ b/Ghidra/Framework/Help/src/main/java/help/validator/model/HelpTopic.java @@ -1,6 +1,5 @@ /* ### * IP: GHIDRA - * REVIEWED: YES * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,21 +15,21 @@ */ package help.validator.model; -import help.HelpBuildUtils; -import help.validator.location.DirectoryHelpModuleLocation; -import help.validator.location.HelpModuleLocation; - import java.io.IOException; import java.nio.file.*; import java.nio.file.attribute.BasicFileAttributes; import java.util.*; +import help.HelpBuildUtils; +import help.validator.location.DirectoryHelpModuleLocation; +import help.validator.location.HelpModuleLocation; + public class HelpTopic implements Comparable { private final HelpModuleLocation help; private final Path topicFile; private final Path relativePath; - private Map helpFiles = new LinkedHashMap(); + private Map helpFiles = new LinkedHashMap<>(); public static HelpTopic fromHTMLFile(Path topicFile) { @@ -51,8 +50,8 @@ public class HelpTopic implements Comparable { Path helpDir = help.getHelpLocation(); - Path unknowFSRelativePath = helpDir.relativize(topicFile); // may or may not be jar paths - this.relativePath = HelpBuildUtils.toDefaultFS(unknowFSRelativePath); + Path unknownFSRelativePath = helpDir.relativize(topicFile); // may or may not be jar paths + this.relativePath = HelpBuildUtils.toDefaultFS(unknownFSRelativePath); loadHelpFiles(topicFile); } @@ -104,7 +103,7 @@ public class HelpTopic implements Comparable { if (topicFile.getFileSystem() != FileSystems.getDefault()) { return Collections.emptyList(); } - List list = new ArrayList(); + List list = new ArrayList<>(); for (HelpFile helpFile : helpFiles.values()) { list.addAll(helpFile.getAllHREFs()); } @@ -116,7 +115,7 @@ public class HelpTopic implements Comparable { if (topicFile.getFileSystem() != FileSystems.getDefault()) { return Collections.emptyList(); } - List list = new ArrayList(); + List list = new ArrayList<>(); for (HelpFile helpFile : helpFiles.values()) { list.addAll(helpFile.getAllIMGs()); } @@ -125,7 +124,7 @@ public class HelpTopic implements Comparable { public Collection getAllAnchorDefinitions() { // The current module may refer to anchors in pre-built modules. - List list = new ArrayList(); + List list = new ArrayList<>(); for (HelpFile helpFile : helpFiles.values()) { list.addAll(helpFile.getAllAnchorDefinitions()); }