diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/rust/RustDemanglerAnalyzer.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/rust/RustDemanglerAnalyzer.java index 490ac106ee..3255dd2369 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/rust/RustDemanglerAnalyzer.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/rust/RustDemanglerAnalyzer.java @@ -27,9 +27,7 @@ import ghidra.app.util.demangler.*; import ghidra.app.util.importer.MessageLog; import ghidra.framework.options.*; import ghidra.program.model.address.Address; -import ghidra.program.model.listing.Function; import ghidra.program.model.listing.Program; -import ghidra.program.model.symbol.SourceType; import ghidra.util.HelpLocation; import ghidra.util.SystemUtilities; import ghidra.util.task.TaskMonitor; diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/calltree/CallTreeProvider.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/calltree/CallTreeProvider.java index d89f30d1da..b9cee58d72 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/calltree/CallTreeProvider.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/calltree/CallTreeProvider.java @@ -45,7 +45,6 @@ import ghidra.program.model.listing.Function; import ghidra.program.model.listing.Program; import ghidra.program.model.symbol.Symbol; import ghidra.program.util.*; -import ghidra.util.HTMLUtilities; import ghidra.util.HelpLocation; import ghidra.util.exception.CancelledException; import ghidra.util.task.SwingUpdateManager; @@ -443,10 +442,10 @@ public class CallTreeProvider extends ComponentProviderAdapter implements Domain navigateIncomingToggleAction.setSelected(isPrimary); navigateIncomingToggleAction.setToolBarData(new ToolBarData( Icons.NAVIGATE_ON_INCOMING_EVENT_ICON, navigationOptionsToolbarGroup, "2")); - navigateIncomingToggleAction.setDescription(HTMLUtilities.toHTML("Incoming Navigation" + + navigateIncomingToggleAction.setDescription("Incoming Navigation" + "

Toggle On - change the displayed " + "function on Listing navigation events" + - "
Toggled Off - don't change the displayed function on Listing navigation events")); + "
Toggled Off - don't change the displayed function on Listing navigation events"); navigateIncomingToggleAction.setHelpLocation( new HelpLocation(plugin.getName(), "Call_Tree_Action_Incoming_Navigation")); tool.addLocalAction(this, navigateIncomingToggleAction); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/clear/ClearDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/clear/ClearDialog.java index 09c61c7481..62df84aef2 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/clear/ClearDialog.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/clear/ClearDialog.java @@ -124,7 +124,7 @@ public class ClearDialog extends DialogComponentProvider { symbolsCb = new GCheckBox("Symbols"); commentsCb = new GHtmlCheckBox( - "Comments (does not affect automatic comments)"); + "Comments (does not affect automatic comments)"); commentsCb.setVerticalTextPosition(SwingConstants.TOP); propertiesCb = new GCheckBox("Properties"); codeCb = new GCheckBox("Code"); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/codebrowser/hover/DataTypeListingHover.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/codebrowser/hover/DataTypeListingHover.java index de0659147e..22e78635b2 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/codebrowser/hover/DataTypeListingHover.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/codebrowser/hover/DataTypeListingHover.java @@ -103,17 +103,17 @@ public class DataTypeListingHover extends AbstractConfigurableHover implements L toolTipText = toolTipText.replace("Unsized", Integer.toString(dataLen)); } if (dataInstance != null) { - toolTipText = toolTipText.replace("", - getLocationSupplimentalToolTipText(dt, dataInstance) + ""); + toolTipText = toolTipText.replace("", + getLocationSupplimentalToolTipText(dt, dataInstance) + ""); } String warningMsg = ""; if (hasInvalidStorage) { warningMsg += "WARNING! Invalid Storage"; } if (warningMsg.length() != 0) { - String errorText = "
" + warningMsg + "!

"; - toolTipText = toolTipText.replace("", errorText); + toolTipText = toolTipText.replace("", errorText); } return createTooltipComponent(toolTipText); } diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/codebrowser/hover/ProgramAddressRelationshipListingHover.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/codebrowser/hover/ProgramAddressRelationshipListingHover.java index 78139cbc5d..0cd848f18e 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/codebrowser/hover/ProgramAddressRelationshipListingHover.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/codebrowser/hover/ProgramAddressRelationshipListingHover.java @@ -39,7 +39,7 @@ import ghidra.util.StringUtilities; * The tool tip text shows relationships to key topological elements of the program relative to * the address -- offset from image base, offset from current memory block; if the address is * within the bounds of a function, the offset from function entry point; if the address is within - * the bounds of defined data, the offset from the start of the data. + * the bounds of defined data, the offset from the start of the data. */ public class ProgramAddressRelationshipListingHover extends AbstractConfigurableHover implements ListingHoverService { @@ -84,7 +84,7 @@ public class ProgramAddressRelationshipListingHover extends AbstractConfigurable return null; } - StringBuilder sb = new StringBuilder(""); + StringBuilder sb = new StringBuilder("
"); Address loc = programLocation.getAddress(); if (isInDefaultSpace(program, loc)) { diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/BitFieldPlacementComponent.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/BitFieldPlacementComponent.java index 992e34bbb4..3d3ac48491 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/BitFieldPlacementComponent.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/BitFieldPlacementComponent.java @@ -130,7 +130,7 @@ public class BitFieldPlacementComponent extends JPanel implements Scrollable { * Construct a bit field viewer/editor component. Non-edit use limits bit * attribute computation to visible range only which facilitate use within * scroll pane for very large structures. Edit use will determine bit attributes - * for full allocation size. + * for full allocation size. * @param composite composite data type to be viewed/modified. * @param editUseEnabled if true use of editing bitfield editing/placement is * supported, else viewing only. @@ -311,7 +311,7 @@ public class BitFieldPlacementComponent extends JPanel implements Scrollable { * When {@link #editMode} is not {@link EditMode#NONE} the specified * bitSize and bitOffset specify the active edit bitfield. * @param bitSize component bitsize - * @param bitOffset component lsb bit offset from lsb of allocation unit + * @param bitOffset component lsb bit offset from lsb of allocation unit * (allocation unit size is determine by current {@link #allocationByteSize}). */ void refresh(int bitSize, int bitOffset) { @@ -339,7 +339,7 @@ public class BitFieldPlacementComponent extends JPanel implements Scrollable { } /** - * Update the size and offset of the allocation unit. Since this can + * Update the size and offset of the allocation unit. Since this can * affect the size of this component, its bounds will be updated the component * repainted. * @param byteSize allocation byte size @@ -413,9 +413,9 @@ public class BitFieldPlacementComponent extends JPanel implements Scrollable { } return bitFieldAllocation.hasConflict; - // TODO: Improve conflict detection with zero-length components. - // Zero-length components can share common offset, although - // zero-length components should have a lower ordinal than a + // TODO: Improve conflict detection with zero-length components. + // Zero-length components can share common offset, although + // zero-length components should have a lower ordinal than a // sized component at the same offset. } @@ -544,7 +544,7 @@ public class BitFieldPlacementComponent extends JPanel implements Scrollable { /** * Get the bit attributes object which corresponds to the specified point p within the - * bounds of this component. NOTE: use of non-visible bitAttributes within the + * bounds of this component. NOTE: use of non-visible bitAttributes within the * allocation range requires edit use enablement (see {@link #editUseEnabled}). * @param p point within the bounds of this component * @return bit attributes object or null @@ -562,7 +562,7 @@ public class BitFieldPlacementComponent extends JPanel implements Scrollable { } /** - * Get the bit attributes index which corresponds to the specified horizontal x position + * Get the bit attributes index which corresponds to the specified horizontal x position * within the bounds of this component. * @param x horizontal x position within the bounds of this component * @return bit attributes index or -1 if not found @@ -623,9 +623,9 @@ public class BitFieldPlacementComponent extends JPanel implements Scrollable { conflictMsg += "
overlaps " + HTMLUtilities.escapeHTML(conflictTip) + "
"; } - return "
" + HTMLUtilities.escapeHTML(tip) + + return "
" + HTMLUtilities.escapeHTML(tip) + conflictMsg + - "
(Shift-wheel to zoom)
"; + "
(Shift-wheel to zoom)
"; } @Override @@ -729,7 +729,7 @@ public class BitFieldPlacementComponent extends JPanel implements Scrollable { int x = BYTE_SEPARATOR_THICKNESS; if (bitAttributes[0] != null && bitAttributes[0].leftEndType == EndBitType.TRUNCATED_END) { - // adjust left-most line to reflect truncated component + // adjust left-most line to reflect truncated component x -= BIT_SEPARATOR_THICKNESS; // backup to left line location drawTruncationLine(g, x, y, CELL_HEIGHT); x += BIT_SEPARATOR_THICKNESS; @@ -740,7 +740,7 @@ public class BitFieldPlacementComponent extends JPanel implements Scrollable { BitAttributes prevAttrs = null; // Limit rendered bits to those contained within the visible view port - // of this scrolled component. + // of this scrolled component. JViewport viewPort = (JViewport) getParent(); Rectangle bounds = viewPort.getViewRect(); @@ -850,9 +850,9 @@ public class BitFieldPlacementComponent extends JPanel implements Scrollable { } /** - * BitFieldPlacement provides the ability to translate a + * BitFieldPlacement provides the ability to translate a * composite component to a bit-level placement within the allocation - * range including the notion of clipped edges when one or both sides + * range including the notion of clipped edges when one or both sides * extend beyond the allocation range. */ private class BitFieldPlacement { @@ -883,7 +883,7 @@ public class BitFieldPlacementComponent extends JPanel implements Scrollable { BitFieldDataType bitfield = (BitFieldDataType) component.getDataType(); int storageSize = 8 * bitfield.getStorageSize(); rightBit = leftAdj + storageSize - bitfield.getBitOffset() - 1; - // Use effective bit-size since non-packed uses are only concerned with actual + // Use effective bit-size since non-packed uses are only concerned with actual // bits stored (NOTE: this may cause a transition from declared to effective // bit-size when editing a bitfield where the these bit-sizes differ). int bitSize = bitfield.getBitSize(); @@ -913,7 +913,7 @@ public class BitFieldPlacementComponent extends JPanel implements Scrollable { /** * BitFieldAllocation provides the bit-level details within the * allocation range including the optional overlay of an edit component - * with confict detection. The bit-level details are defined via + * with confict detection. The bit-level details are defined via * {@link BitAttributes}. */ class BitFieldAllocation { @@ -937,10 +937,10 @@ public class BitFieldPlacementComponent extends JPanel implements Scrollable { private int leftChopBytes; /** - * Bit attributes array reflects bit layout normalized to big-endian - * layout where left-most allocation bit has array index of 0. In edit - * mode this array covers the full span of {@link #allocationByteSize}, while in - * non-edit mode the array size is reduced based upon visibility as + * Bit attributes array reflects bit layout normalized to big-endian + * layout where left-most allocation bit has array index of 0. In edit + * mode this array covers the full span of {@link #allocationByteSize}, while in + * non-edit mode the array size is reduced based upon visibility as * indicated by {@link #leftChopBytes} and {@link #rightChopBytes}. */ private BitAttributes[] bitAttributes; @@ -1003,7 +1003,7 @@ public class BitFieldPlacementComponent extends JPanel implements Scrollable { } /** - * Refresh the computed bitAttributes. When editUseEnabled is false + * Refresh the computed bitAttributes. When editUseEnabled is false * the computed bitAttributes will correspond to the visible portion * of the component. This method does not handle changes to * {@link #allocationByteSize} which require a new {@link BitFieldAllocation} @@ -1090,7 +1090,7 @@ public class BitFieldPlacementComponent extends JPanel implements Scrollable { /** * Allocate {@link #bitAttributes} for all structure members which reside * within the byte range covered by {@link #allocationBytes}. - * @param struct structure whose component bit attributes should be + * @param struct structure whose component bit attributes should be * computed. */ private void allocateStructureMembers(Structure struct) { @@ -1126,7 +1126,7 @@ public class BitFieldPlacementComponent extends JPanel implements Scrollable { /** * Allocate {@link #bitAttributes} for the specified component within - * the byte range covered by {@link #allocationBytes}. + * the byte range covered by {@link #allocationBytes}. * @param dtc composite component * @param leftBit left bit index within the full {@link #allocationByteSize} * where 0 is the left-most bit index. @@ -1200,7 +1200,7 @@ public class BitFieldPlacementComponent extends JPanel implements Scrollable { } /** - * BitAttributes provide bit attributes which identify the + * BitAttributes provide bit attributes which identify the * associated component, a conflict component and left/right line * types to be displayed. */ diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/CompEditorPanel.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/CompEditorPanel.java index 89640b4614..9b2f264aa3 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/CompEditorPanel.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/CompEditorPanel.java @@ -394,10 +394,10 @@ public class CompEditorPanel extends CompositeEditorPanel { new HelpLocation(provider.getHelpTopic(), provider.getHelpName() + "_" + "Align")); } String alignmentToolTip = - "The align control allows the overall minimum alignment of this
" + + "The align control allows the overall minimum alignment of this
" + "data type to be specified. The actual computed alignment
" + "may be any multiple of this value. " + "(<F1> for help)"; + Palette.BLUE.toHexString() + "\" size=\"-2\">(<F1> for help)"; alignPanel.setToolTipText(alignmentToolTip); addMinimumAlignmentComponents(); @@ -449,10 +449,10 @@ public class CompEditorPanel extends CompositeEditorPanel { private void setupDefaultMinAlignButton() { defaultAlignButton.setName("Default Alignment"); - String alignmentToolTip = "Sets this data type to use default alignment.
" + + String alignmentToolTip = "Sets this data type to use default alignment.
" + "If packing is disabled, the default will be 1 byte. If packing
" + "is enabled, the alignment is computed based upon the pack
" + - "setting and the alignment of each component data type."; + "setting and the alignment of each component data type."; defaultAlignButton.addActionListener(e -> { ((CompEditorModel) model).setAlignmentType(AlignmentType.DEFAULT, -1); @@ -468,10 +468,10 @@ public class CompEditorPanel extends CompositeEditorPanel { private void setupMachineMinAlignButton() { machineAlignButton.setName("Machine Alignment"); String alignmentToolTip = - "Sets this data type to use the machine alignment
" + + "Sets this data type to use the machine alignment
" + "as specified by the compiler specification. If packing is
" + "enabled, the computed alignment of this composite should be
" + - "the machine alignment value."; + "the machine alignment value."; machineAlignButton.setToolTipText(alignmentToolTip); machineAlignButton.addActionListener(e -> { @@ -487,9 +487,9 @@ public class CompEditorPanel extends CompositeEditorPanel { private void setupExplicitAlignButton() { explicitAlignButton.setName("Explicit Alignment"); String alignmentToolTip = - "Sets this data type to use the explicit alignment value
" + + "Sets this data type to use the explicit alignment value
" + "specified. If packing is enabled, the computed alignment of
" + - "this composite may be any multiple of this value."; + "this composite may be any multiple of this value."; explicitAlignButton.setToolTipText(alignmentToolTip); explicitAlignButton.addActionListener(e -> { @@ -555,10 +555,10 @@ public class CompEditorPanel extends CompositeEditorPanel { private void setupActualAlignment() { GridBagConstraints gridBagConstraints = new GridBagConstraints(); String actualAlignmentToolTip = - "The actual alignment to be used for this data type.
" + + "The actual alignment to be used for this data type.
" + "A combination of the pack and alignment settings made to this datatype
" + "combined with alignments of the individual components are used to
" + - "to compute the actual alignment of this datatype."; + "to compute the actual alignment of this datatype."; JPanel actualAlignmentPanel = new JPanel(new BorderLayout()); actualAlignmentLabel = new GDLabel("Alignment:"); @@ -672,10 +672,10 @@ public class CompEditorPanel extends CompositeEditorPanel { private void setupPackingEnablementButton() { packingEnablementButton.setName("Packing Enablement"); String packingToolTipText = - "Enable packing when details of all components are known (including sizing and" + + "Enable packing when details of all components are known (including sizing and" + " alignment).
" + "Disable packing when Reverse Engineering composite. " + "(<F1> for help)"; + "\" size=\"-2\">(<F1> for help)
"; packingEnablementButton.addActionListener(e -> { ((CompEditorModel) model).setPackingType( packingEnablementButton.isSelected() ? PackingType.DEFAULT : PackingType.DISABLED, @@ -692,7 +692,7 @@ public class CompEditorPanel extends CompositeEditorPanel { private void setupDefaultPackingButton() { defaultPackingButton.setName("Default Packing"); String packingToolTipText = - "Indicates default compiler packing rules should be applied."; + "Indicates default compiler packing rules should be applied."; defaultPackingButton.addActionListener(e -> { ((CompEditorModel) model).setPackingType(PackingType.DEFAULT, -1); @@ -708,7 +708,7 @@ public class CompEditorPanel extends CompositeEditorPanel { private void setupExplicitPackingButton() { explicitPackingButton.setName("Explicit Packing"); String packingToolTipText = - "Indicates an explicit pack size should be applied."; + "Indicates an explicit pack size should be applied."; explicitPackingButton.addActionListener(e -> chooseByValuePacking()); explicitPackingButton.setToolTipText(packingToolTipText); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/DataTypeCellRenderer.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/DataTypeCellRenderer.java index 358c42b509..9527c82ac0 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/DataTypeCellRenderer.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/DataTypeCellRenderer.java @@ -94,8 +94,8 @@ public class DataTypeCellRenderer extends GTableCellRenderer { displayName = HTMLUtilities.friendlyEncodeHTML(displayName); String toolTipText = ToolTipUtils.getToolTipText(dataType); - String headerText = "" + displayName + "
"; - toolTipText = toolTipText.replace("", headerText); + String headerText = "" + displayName + "
"; + toolTipText = toolTipText.replace("", headerText); return toolTipText; } } diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/data/CreateStructureDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/data/CreateStructureDialog.java index c5fbd55f24..df187b5a10 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/data/CreateStructureDialog.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/data/CreateStructureDialog.java @@ -273,8 +273,8 @@ public class CreateStructureDialog extends ReusableDialogComponentProvider { return matchingStylePanel; } - // toggles whether the structure being created is new, based upon the name field, or a current - // structure, based upon a structure in the table. This method updates the GUI to reflect the + // toggles whether the structure being created is new, based upon the name field, or a current + // structure, based upon a structure in the table. This method updates the GUI to reflect the // current creation state. private void setCreateStructureByName(boolean createStructureByName) { if (createStructureByName) { @@ -572,7 +572,7 @@ public class CreateStructureDialog extends ReusableDialogComponentProvider { message = EXISITING_STRUCTURE_STATUS_PREFIX; } - setStatusText("" + message + "
\"" + HTMLUtilities.escapeHTML(name) + "\""); + setStatusText("" + message + "
\"" + HTMLUtilities.escapeHTML(name) + "\""); } // this class is used instead of a cell renderer so that sorting will diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/DataTypeSynchronizer.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/DataTypeSynchronizer.java index e513dfc3d9..2e73c24d28 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/DataTypeSynchronizer.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/DataTypeSynchronizer.java @@ -117,7 +117,7 @@ public class DataTypeSynchronizer { public static void commitAssumingTransactionsOpen(DataTypeManager sourceDTM, DataType refDT) { - // Must refresh associations of refDt and its dependencies to ensure that any + // Must refresh associations of refDt and its dependencies to ensure that any // non-sourced datatype is properly associated to the sourceDTM DataTypeManager refDTM = refDT.getDataTypeManager(); SourceArchive sourceArchive = refDTM.getSourceArchive(sourceDTM.getUniversalID()); @@ -359,7 +359,7 @@ public class DataTypeSynchronizer { // aesthetically pleasing String spacerString = createHTMLSpacerString(htmlContent, otherContent); StringBuilder buffy = new StringBuilder(); - buffy.append(""); + buffy.append(""); // -we use CELLPADDING here to allow us to create a narrow column within the table // -the CELLSPACING gives us some space around the narrow column @@ -412,8 +412,8 @@ public class DataTypeSynchronizer { private static String createHTMLSpacerString(String htmlContent, String otherHTMLContent) { // unfortunately, to get the displayed widths, we have to have rendered content, which // is what the JLabels below are doing for us - JLabel label1 = new GDHtmlLabel("" + htmlContent); - JLabel label2 = new GDHtmlLabel("" + otherHTMLContent); + JLabel label1 = new GDHtmlLabel("" + htmlContent); + JLabel label2 = new GDHtmlLabel("" + otherHTMLContent); int maxPixelWidth = Math.max(label1.getPreferredSize().width, label2.getPreferredSize().width); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/disassembler/DisassembledViewPlugin.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/disassembler/DisassembledViewPlugin.java index 003142b2df..9b5f74faec 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/disassembler/DisassembledViewPlugin.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/disassembler/DisassembledViewPlugin.java @@ -48,13 +48,13 @@ import ghidra.util.*; import ghidra.util.exception.UsrException; /** - * A plugin to disassemble the address at the current ProgramLocation and to + * A plugin to disassemble the address at the current ProgramLocation and to * display the Instruction. This work of this plugin is temporary in that it * will not change the state of the program. * * * - * TODO Change the PseudoCodeUnit's getComment(int) method or change its + * TODO Change the PseudoCodeUnit's getComment(int) method or change its * getPreview(int) method not to call getComment(int) and then change * this class to not handle the UnsupportedOperationException. * TODO are the category and names correct? @@ -82,7 +82,7 @@ public class DisassembledViewPlugin extends ProgramPlugin implements DomainObjec new GColor("color.fg.plugin.disassembledview.address"); /** - * The number of addresses that should be disassembled, including the + * The number of addresses that should be disassembled, including the * address of the current {@link ProgramLocation}. */ private static final int LOOK_AHEAD_COUNT = 5; @@ -94,7 +94,7 @@ public class DisassembledViewPlugin extends ProgramPlugin implements DomainObjec new DisassembledViewComponentProvider(); /** - * The last program location received from the + * The last program location received from the * {@link #locationChanged(ProgramLocation)} method. */ private ProgramLocation lastUpdatedLocation; @@ -113,7 +113,7 @@ public class DisassembledViewPlugin extends ProgramPlugin implements DomainObjec public DisassembledViewPlugin(PluginTool plugintool) { // We want to know about program activated events, location changed // events and selection changed events. The first type we get from - // our parent, the other two we get by passing true to our parent's + // our parent, the other two we get by passing true to our parent's // constructor super(plugintool); } @@ -153,8 +153,8 @@ public class DisassembledViewPlugin extends ProgramPlugin implements DomainObjec } /** - * We want to make sure that we no longer have any contents when the - * program is deactivated so that we do not make any more calls to the + * We want to make sure that we no longer have any contents when the + * program is deactivated so that we do not make any more calls to the * program or its plugins. * * @param program The program being deactivated. @@ -189,7 +189,7 @@ public class DisassembledViewPlugin extends ProgramPlugin implements DomainObjec // we only want to update if: // 1) we have a valid location, // 2) the location is different than the last location we processed, and - // TODO: **Note: this step is believed to be a bug--we should only be + // TODO: **Note: this step is believed to be a bug--we should only be // getting one location change at a time, not two // 3) the display is visible. if (loc == null || loc.equals(lastUpdatedLocation) || !displayComponent.isVisible()) { @@ -211,7 +211,7 @@ public class DisassembledViewPlugin extends ProgramPlugin implements DomainObjec /** * Called when we receive program selection events. * - * @param selection The ProgramSelection object that is the current + * @param selection The ProgramSelection object that is the current * selection. * @see ProgramPlugin#selectionChanged(ProgramSelection) */ @@ -222,19 +222,19 @@ public class DisassembledViewPlugin extends ProgramPlugin implements DomainObjec } // TODO: - // if there are multiple lines selected then we need to update the + // if there are multiple lines selected then we need to update the // display. Should we: - // 1) Show each line selected with some sort of visual delimiter + // 1) Show each line selected with some sort of visual delimiter // between each value? // 2) Clear the display when there are multiple values selected? // 3) Do nothing and allow selections, while showing only the current // location as determined by the cursor? - // - // Currently solution 3) is used + // + // Currently solution 3) is used if (selection != null) { if (containsMultipleSelection()) { disassembleLocation(currentLocation); -// changed in SCR 6875 +// changed in SCR 6875 // displayComponent.clearContents(); } else if (selection.isEmpty()) { @@ -250,7 +250,7 @@ public class DisassembledViewPlugin extends ProgramPlugin implements DomainObjec /** * Gets the pseudo disassembler used by this class. This method will lazy - * load the disassembler to prevent wasting of resources. If the + * load the disassembler to prevent wasting of resources. If the * program location changes, then the disassembler will be recreated. * * @return the pseudo disassembler used by this class. @@ -263,8 +263,8 @@ public class DisassembledViewPlugin extends ProgramPlugin implements DomainObjec } /** - * Gets the {@link DisassembledAddressInfo}s for the given address. - * This method will disassamble {@link #LOOK_AHEAD_COUNT a few} addresses + * Gets the {@link DisassembledAddressInfo}s for the given address. + * This method will disassamble {@link #LOOK_AHEAD_COUNT a few} addresses * after the one that is passed in. * * @param address The address for which an info object will be obtained. @@ -278,7 +278,7 @@ public class DisassembledViewPlugin extends ProgramPlugin implements DomainObjec try { DisassembledAddressInfo addressInfo = new DisassembledAddressInfo(address); - // Now get some follow-on addresses to provide a small level of + // Now get some follow-on addresses to provide a small level of // context. This loop will stop if we cannot find an Address // or a CodeUnit for a given address. for (int i = 0; (i < LOOK_AHEAD_COUNT) && (address != null) && @@ -304,7 +304,7 @@ public class DisassembledViewPlugin extends ProgramPlugin implements DomainObjec } /** - * Takes the provided program location object and locates a + * Takes the provided program location object and locates a * {@link CodeUnit} for it's address that is used to display a disassembled * preview of the location. * @@ -317,7 +317,7 @@ public class DisassembledViewPlugin extends ProgramPlugin implements DomainObjec DisassembledAddressInfo[] addressInfos = getAddressInformation(newLocation.getAddress()); - // add our preview content to our display (this will be empty if we + // add our preview content to our display (this will be empty if we // did not get a valid address or any valid code unit previews) displayComponent.setContents(addressInfos); } @@ -329,14 +329,14 @@ public class DisassembledViewPlugin extends ProgramPlugin implements DomainObjec private class DisassembledViewComponentProvider extends ComponentProviderAdapter { /** * The constant part of the tooltip text for the list cells. This - * string is prepended to the currently selected address in the + * string is prepended to the currently selected address in the * program. *

* Note: This value was just set on the list, but when that was done * the help key triggers (Ctrl-F1) did not work correctly. */ private static final String TOOLTIP_TEXT_PREPEND = - "Currently selected
Code Browser program location
" + "address: "; + "Currently selected
Code Browser program location
address: "; /** * The component that will house our view. @@ -481,10 +481,10 @@ public class DisassembledViewPlugin extends ProgramPlugin implements DomainObjec } /** - * Notifies the provider that the user pressed the "close" button. - * The provider should take appropriate action. Usually the - * appropriate action is to hide the component or remove the - * component. If the provider does nothing in this method, + * Notifies the provider that the user pressed the "close" button. + * The provider should take appropriate action. Usually the + * appropriate action is to hide the component or remove the + * component. If the provider does nothing in this method, * then the close button will appear broken. */ @Override @@ -521,7 +521,7 @@ public class DisassembledViewPlugin extends ProgramPlugin implements DomainObjec } /** - * An object that provides information about the address that it wraps. The info knows how to + * An object that provides information about the address that it wraps. The info knows how to * locate an info object for the address and can generate a string preview of the address. */ private class DisassembledAddressInfo { @@ -531,7 +531,7 @@ public class DisassembledViewPlugin extends ProgramPlugin implements DomainObjec private Address wrappedAddress; /** - * The code unit for the address of this info. This will be null + * The code unit for the address of this info. This will be null * after construction if not code unit exists for the address. */ private CodeUnit addressCodeUnit; @@ -558,7 +558,7 @@ public class DisassembledViewPlugin extends ProgramPlugin implements DomainObjec /** * Returns the address described by this info. * - * @return Returns the address described by this info. + * @return Returns the address described by this info. */ private Address getAddress() { @@ -566,10 +566,10 @@ public class DisassembledViewPlugin extends ProgramPlugin implements DomainObjec } /** - * Returns true if there is a {@link CodeUnit} for the address + * Returns true if there is a {@link CodeUnit} for the address * wrapped by this info. If not, then we do not have a valid addreess. * - * @return true if there is a {@link CodeUnit} for the address + * @return true if there is a {@link CodeUnit} for the address * wrapped by this info. */ public boolean isValidAddress() { @@ -577,14 +577,14 @@ public class DisassembledViewPlugin extends ProgramPlugin implements DomainObjec } /** - * Gets the length of the {@link CodeUnit} for the address wrapped - * by this info. + * Gets the length of the {@link CodeUnit} for the address wrapped + * by this info. *

* Note: If {@link #isValidAddress()} returns false, then this method * will return -1. * - * @return the length of the code unit for the address wrapped by this - * info. + * @return the length of the code unit for the address wrapped by this + * info. */ public int getCodeUnitLength() { if (isValidAddress()) { @@ -607,7 +607,7 @@ public class DisassembledViewPlugin extends ProgramPlugin implements DomainObjec Listing listing = currentProgram.getListing(); codeUnit = listing.getCodeUnitAt(address); - // if the CodeUnit is Data and is not defined, then we need to try to virtually + // if the CodeUnit is Data and is not defined, then we need to try to virtually // disassemble it if (codeUnit instanceof Data) { if (!((Data) codeUnit).isDefined()) { @@ -624,8 +624,8 @@ public class DisassembledViewPlugin extends ProgramPlugin implements DomainObjec } /** - * Attempts to disassemble the provided address virtually - * (without changing the state of the program) by making use of the + * Attempts to disassemble the provided address virtually + * (without changing the state of the program) by making use of the * {@link PseudoDisassembler}. * * @param address The address that will be disassembled. @@ -641,8 +641,8 @@ public class DisassembledViewPlugin extends ProgramPlugin implements DomainObjec codeUnit = disassembler.disassemble(address); } catch (UsrException ue) { - // these exceptions happen if there is insufficient data from the program: - // InsufficientBytesException, UnknownInstructionException, + // these exceptions happen if there is insufficient data from the program: + // InsufficientBytesException, UnknownInstructionException, // UnknownContextException } } diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/editor/FunctionEditorDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/editor/FunctionEditorDialog.java index 0d5d275fd2..cc5f5973ec 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/editor/FunctionEditorDialog.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/function/editor/FunctionEditorDialog.java @@ -656,9 +656,9 @@ public class FunctionEditorDialog extends DialogComponentProvider implements Mod color = getErrorForegroundColor(isSelected); } String toolTipText = ToolTipUtils.getToolTipText(dataType); - String headerText = "" + + String headerText = "" + HTMLUtilities.friendlyEncodeHTML(dataType.getPathName()) + "
"; - toolTipText = toolTipText.replace("", headerText); + toolTipText = toolTipText.replace("", headerText); setToolTipText(toolTipText); } else { diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/help/ProcessorListPlugin.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/help/ProcessorListPlugin.java index 2f1f28cdb8..e39f4f972f 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/help/ProcessorListPlugin.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/help/ProcessorListPlugin.java @@ -125,7 +125,7 @@ public class ProcessorListPlugin extends Plugin implements ApplicationLevelPlugi private String getProcessorList(boolean asHtml) { StringBuilder strBuilder = new StringBuilder(); if (asHtml) { - strBuilder.append("\n"); + strBuilder.append("\n"); strBuilder.append("

\n"); } @@ -152,7 +152,7 @@ public class ProcessorListPlugin extends Plugin implements ApplicationLevelPlugi } if (asHtml) { strBuilder.append("\n\n
"); - strBuilder.append(""); + strBuilder.append(""); } return strBuilder.toString(); } diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/script/GhidraScriptComponentProvider.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/script/GhidraScriptComponentProvider.java index 5d42f116ce..a6d6a06c63 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/script/GhidraScriptComponentProvider.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/script/GhidraScriptComponentProvider.java @@ -93,12 +93,12 @@ public class GhidraScriptComponentProvider extends ComponentProviderAdapter { private TaskListener cleanupTaskSetListener = new TaskListener() { @Override public void taskCompleted(Task task) { - runningScriptTaskSet.remove((RunScriptTask) task); + runningScriptTaskSet.remove(task); } @Override public void taskCancelled(Task task) { - runningScriptTaskSet.remove((RunScriptTask) task); + runningScriptTaskSet.remove(task); } }; @@ -176,7 +176,7 @@ public class GhidraScriptComponentProvider extends ComponentProviderAdapter { }); scriptCategoryTree.getSelectionModel() - .setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); + .setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); } private void build() { @@ -475,11 +475,11 @@ public class GhidraScriptComponentProvider extends ComponentProviderAdapter { */ public List getScriptDirectories() { return bundleHost.getGhidraBundles() - .stream() - .filter(GhidraSourceBundle.class::isInstance) - .filter(GhidraBundle::isEnabled) - .map(GhidraBundle::getFile) - .collect(Collectors.toList()); + .stream() + .filter(GhidraSourceBundle.class::isInstance) + .filter(GhidraBundle::isEnabled) + .map(GhidraBundle::getFile) + .collect(Collectors.toList()); } /** @@ -487,12 +487,12 @@ public class GhidraScriptComponentProvider extends ComponentProviderAdapter { */ public List getWritableScriptDirectories() { return bundleHost.getGhidraBundles() - .stream() - .filter(GhidraSourceBundle.class::isInstance) - .filter(Predicate.not(GhidraBundle::isSystemBundle)) - .filter(GhidraBundle::isEnabled) - .map(GhidraBundle::getFile) - .collect(Collectors.toList()); + .stream() + .filter(GhidraSourceBundle.class::isInstance) + .filter(Predicate.not(GhidraBundle::isSystemBundle)) + .filter(GhidraBundle::isEnabled) + .map(GhidraBundle::getFile) + .collect(Collectors.toList()); } boolean isEditorOpen(ResourceFile script) { @@ -647,9 +647,9 @@ public class GhidraScriptComponentProvider extends ComponentProviderAdapter { AtomicReference ref = new AtomicReference<>(); TaskBuilder.withRunnable(monitor -> ref.set(scriptSupplier.get())) - .setTitle("Compiling Script Directory") - .setLaunchDelay(1000) - .launchModal(); + .setTitle("Compiling Script Directory") + .setLaunchDelay(1000) + .launchModal(); return ref.get(); } @@ -1012,7 +1012,7 @@ public class GhidraScriptComponentProvider extends ComponentProviderAdapter { return list; } }); - tableFilterPanel.setToolTipText("Include scripts with Names or " + + tableFilterPanel.setToolTipText("Include scripts with Names or " + "Descriptions containing this text."); tableFilterPanel.setFocusComponent(scriptCategoryTree); } diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/script/ScriptSelectionEditor.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/script/ScriptSelectionEditor.java index d31cf2ccf6..fa07c0bd55 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/script/ScriptSelectionEditor.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/script/ScriptSelectionEditor.java @@ -31,7 +31,7 @@ import ghidra.util.HTMLUtilities; import ghidra.util.UserSearchUtils; /** - * A widget that allows the user to choose an existing script by typing its name or picking it + * A widget that allows the user to choose an existing script by typing its name or picking it * from a list. */ public class ScriptSelectionEditor { @@ -102,7 +102,7 @@ public class ScriptSelectionEditor { /** * Adds a document listener to the text field editing component of this editor so that users - * can be notified when the text contents of the editor change. You may verify whether the + * can be notified when the text contents of the editor change. You may verify whether the * text changes represent a valid DataType by calling {@link #validateUserSelection()}. * @param listener the listener to add. * @see #validateUserSelection() @@ -176,7 +176,7 @@ public class ScriptSelectionEditor { } private boolean containsValidScript() { - // look for the case where the user made a selection from the matching window, but + // look for the case where the user made a selection from the matching window, but // then changed the text field text. ScriptInfo selectedInfo = selectionField.getSelectedValue(); if (selectedInfo != null && @@ -211,7 +211,7 @@ public class ScriptSelectionEditor { //================================================================================================= // Inner Classes -//================================================================================================= +//================================================================================================= private class ScriptTextFieldModel extends DefaultDropDownSelectionDataModel { @@ -252,7 +252,7 @@ public class ScriptSelectionEditor { protected boolean shouldReplaceTextFieldTextWithSelectedItem(String textFieldText, ScriptInfo selectedItem) { - // This is called when the user presses Enter with a list item selected. By + // This is called when the user presses Enter with a list item selected. By // default, the text field will not replace the text field text if the given item // does not match the text. This is to allow users to enter custom text. We do // not want custom text, as the user must pick an existing script. Thus, we always @@ -265,7 +265,7 @@ public class ScriptSelectionEditor { @Override public String getString(ScriptInfo info) { - StringBuilder buffy = new StringBuilder("

"); + StringBuilder buffy = new StringBuilder("

"); KeyStroke keyBinding = info.getKeyBinding(); if (keyBinding != null) { @@ -289,9 +289,9 @@ public class ScriptSelectionEditor { private String formatDescription(String description) { // // We are going to wrap lines at 50 columns so that they fit the tooltip window. We - // will also try to keep the original structure of manually separated lines by + // will also try to keep the original structure of manually separated lines by // preserving empty lines included in the original description. Removing all newlines - // except for the blank lines allows the line wrapping utility to create the best + // except for the blank lines allows the line wrapping utility to create the best // output. // @@ -309,7 +309,7 @@ public class ScriptSelectionEditor { } // Remove all newlines, except for consecutive newlines, which represent blank lines. - // Then, for any remaining newline, add back the extra blank line. + // Then, for any remaining newline, add back the extra blank line. String trimmed = bufffy.toString(); String stripped = trimmed.replaceAll("(?"); + writer.print(""); writer.println("

");
 		}
 		TemplateSimplifier simplifier = new TemplateSimplifier();
@@ -339,7 +339,7 @@ class ProgramTextWriter {
 		}
 
 		if (options.isHTML()) {
-			writer.println("
"); + writer.println(""); } writer.close(); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/html/HTMLDataTypeRepresentation.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/html/HTMLDataTypeRepresentation.java index f174ee915e..0e649c751a 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/html/HTMLDataTypeRepresentation.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/html/HTMLDataTypeRepresentation.java @@ -40,9 +40,10 @@ public abstract class HTMLDataTypeRepresentation { protected final static int MAX_CHARACTER_LENGTH = 80; protected final static int MAX_LINE_LENGTH = MAX_CHARACTER_LENGTH * 3; - // HTML Tag constants - protected static final String HTML_OPEN = ""; - protected static final String HTML_CLOSE = ""; + // HTML Tag constants. Intentionally lower-case to match external checks for isHtml(), some of + // which check case-sensitive for "" + protected static final String HTML_OPEN = ""; + protected static final String HTML_CLOSE = ""; // single HTML space protected static final String HTML_SPACE = " "; @@ -300,11 +301,11 @@ public abstract class HTMLDataTypeRepresentation { */ protected HTMLDataTypeRepresentation(String htmlText) { this.originalHTMLData = htmlText.trim(); - // NOTE: the text expected here should not have tags! + // NOTE: the text expected here should not have tags! boolean htmlStart = StringUtilities.startsWithIgnoreCase(htmlText, HTML_OPEN); boolean htmlEnd = StringUtilities.startsWithIgnoreCase(htmlText, HTML_CLOSE); if (htmlStart || htmlEnd) { - throw new AssertException("Invalid HTML format: text must not include HTML tag"); + throw new AssertException("Invalid HTML format: text must not include tag"); } } diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/EolExtraCommentsPropertyEditor.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/EolExtraCommentsPropertyEditor.java index 8bd4d3910b..ba7d3ec67d 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/EolExtraCommentsPropertyEditor.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/EolExtraCommentsPropertyEditor.java @@ -37,7 +37,7 @@ public class EolExtraCommentsPropertyEditor extends PropertyEditorSupport private static final String ABBREVIATED_LABEL = "Use Abbreviated Comments"; private static final String REPEATABLE_TOOLTIP = - "For repeatable comments:" + + "For repeatable comments:" + "
    " + "
  • ALWAYS - show even if an EOL comment exists
  • " + "
  • DEFAULT - show only when no EOL comment exists
  • " + @@ -45,7 +45,7 @@ public class EolExtraCommentsPropertyEditor extends PropertyEditorSupport "
"; private static final String REF_REPEATABLE_TOOLTIP = - "For referenced repeatable comments:" + + "For referenced repeatable comments:" + "
    " + "
  • ALWAYS - show even if a higher priority comment exists
  • " + "
  • DEFAULT - show only when no higher priority comment exists
  • " + @@ -53,7 +53,7 @@ public class EolExtraCommentsPropertyEditor extends PropertyEditorSupport "
"; private static final String AUTO_TOOLTIP = - "For automatic comments:" + + "For automatic comments:" + "
    " + "
  • ALWAYS - show even if a higher priority comment exists
  • " + "
  • DEFAULT - show only when no higher priority comment exists
  • " + diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/listingpanel/ListingCodeComparisonPanel.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/listingpanel/ListingCodeComparisonPanel.java index 54beae9885..f7350c454b 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/listingpanel/ListingCodeComparisonPanel.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/listingpanel/ListingCodeComparisonPanel.java @@ -522,7 +522,7 @@ public class ListingCodeComparisonPanel class ToggleOrientationAction extends ToggleDockingAction { ToggleOrientationAction() { super("Dual Listing Toggle Orientation", owner); - setDescription("Toggle the layout of the listings " + + setDescription("Toggle the layout of the listings " + "
    between side-by-side and one above the other."); setEnabled(true); setSelected(isSideBySide); @@ -1071,7 +1071,7 @@ public class ListingCodeComparisonPanel saveState.remove("_BYTE_ADDR"); Address desiredByteAddress = null; if (byteAddress != null) { - // Try to get the indicated side's byte address using one of the address + // Try to get the indicated side's byte address using one of the address // correlators or by inferring it. desiredByteAddress = inferDesiredByteAddress(address, desiredAddress, byteAddress, programLocation.getProgram(), programs[leftOrRight]); @@ -1852,7 +1852,7 @@ public class ListingCodeComparisonPanel titlePanels[LEFT] = new TitledPanel(leftProgramName, listingPanels[LEFT], 5); titlePanels[RIGHT] = new TitledPanel(rightProgramName, listingPanels[RIGHT], 5); - // Set the MINIMUM_PANEL_WIDTH for the left and right panel to prevent the split pane's + // Set the MINIMUM_PANEL_WIDTH for the left and right panel to prevent the split pane's // divider from becoming locked (can't be moved) due to extra long title names. titlePanels[LEFT].setMinimumSize( new Dimension(MINIMUM_PANEL_WIDTH, titlePanels[LEFT].getMinimumSize().height)); @@ -1871,7 +1871,7 @@ public class ListingCodeComparisonPanel if (!titlePrefix.isEmpty()) { titlePrefix += " "; // Add a space between prefix and title. } - String htmlPrefix = ""; + String htmlPrefix = ""; if (title.startsWith(htmlPrefix)) { titlePanel.setTitleName(htmlPrefix + HTMLUtilities.friendlyEncodeHTML(titlePrefix) + title.substring(htmlPrefix.length())); @@ -2187,7 +2187,7 @@ public class ListingCodeComparisonPanel * @return the matching address in the indicated program or null. */ private Address getFunctionAddress(int leftOrRight, Address otherSidesAddress) { - // Try to get the address using the correlator. + // Try to get the address using the correlator. // If the correlator couldn't determine it, then try to infer it. int otherSide = (leftOrRight == RIGHT) ? LEFT : RIGHT; // Finding desired side's address. @@ -2215,7 +2215,7 @@ public class ListingCodeComparisonPanel } private Address getDataAddress(int leftOrRight, Address otherSidesAddress) { - // Correlator doesn't handle data compare, so associate beginning of data and + // Correlator doesn't handle data compare, so associate beginning of data and // infer the others based on relative position. Address leftDataAddress = getLeftDataAddress(); Address rightDataAddress = getRightDataAddress(); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/framework/main/InfoPanel.java b/Ghidra/Features/Base/src/main/java/ghidra/framework/main/InfoPanel.java index df4f75472a..63356c6165 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/framework/main/InfoPanel.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/framework/main/InfoPanel.java @@ -193,7 +193,7 @@ class InfoPanel extends JPanel { private HyperlinkComponent buildJavaVersionComponent() { String anchorName = "java_version"; final HyperlinkComponent javaVersionComponent = - new HyperlinkComponent("
    Java Version " + "
    Java Version " + "" + System.getProperty("java.version") + "
    "); javaVersionComponent.addHyperlinkListener(anchorName, e -> { if (e.getEventType() != HyperlinkEvent.EventType.ACTIVATED) { diff --git a/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/disassembler/ClearTest.java b/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/disassembler/ClearTest.java index f271aca530..4a07d26553 100644 --- a/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/disassembler/ClearTest.java +++ b/Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/disassembler/ClearTest.java @@ -52,7 +52,7 @@ import ghidra.test.TestEnv; public class ClearTest extends AbstractGhidraHeadedIntegrationTest { private static final String COMMENTS_CHECK_BOX_TEXT = - "Comments (does not affect automatic comments)"; + "Comments (does not affect automatic comments)"; private TestEnv env; private PluginTool tool; diff --git a/Ghidra/Features/Base/src/test/java/ghidra/app/util/html/HTMLDataTypeRepresentationTest.java b/Ghidra/Features/Base/src/test/java/ghidra/app/util/html/HTMLDataTypeRepresentationTest.java index bca1b00dd5..1840d1cbbd 100644 --- a/Ghidra/Features/Base/src/test/java/ghidra/app/util/html/HTMLDataTypeRepresentationTest.java +++ b/Ghidra/Features/Base/src/test/java/ghidra/app/util/html/HTMLDataTypeRepresentationTest.java @@ -361,8 +361,8 @@ public class HTMLDataTypeRepresentationTest extends AbstractGenericTest { private String getParamText(String html) { - // function html format: - // void myFunction(
        byte )
    + // function html format: + // void myFunction(
        byte )
    Pattern p = Pattern.compile("\\((.*)\\)"); Matcher matcher = p.matcher(html); diff --git a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/component/DecompilerCodeComparisonPanel.java b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/component/DecompilerCodeComparisonPanel.java index 319a7f5735..f1ccbe7965 100644 --- a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/component/DecompilerCodeComparisonPanel.java +++ b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/component/DecompilerCodeComparisonPanel.java @@ -26,7 +26,6 @@ import docking.ComponentProvider; import docking.action.*; import docking.options.OptionsService; import docking.widgets.fieldpanel.FieldPanel; -import docking.widgets.fieldpanel.internal.FieldPanelCoordinator; import docking.widgets.fieldpanel.support.FieldLocation; import docking.widgets.label.GDHtmlLabel; import ghidra.GhidraOptions; @@ -40,7 +39,8 @@ import ghidra.program.model.address.AddressSetView; import ghidra.program.model.listing.*; import ghidra.program.util.FunctionUtility; import ghidra.program.util.ProgramLocation; -import ghidra.util.*; +import ghidra.util.HTMLUtilities; +import ghidra.util.HelpLocation; /** * Panel that displays two decompilers for comparison @@ -133,7 +133,7 @@ public abstract class DecompilerCodeComparisonPanel toRemove = new HashSet<>(); for (DualDecompileResultsListener l : dualDecompileResultsListenerList) { @@ -780,7 +780,7 @@ public abstract class DecompilerCodeComparisonPanelToggle the layout of the decompiler " + + setDescription("Toggle the layout of the decompiler " + "
    between side-by-side and one above the other."); setEnabled(true); setSelected(isSideBySide); diff --git a/Ghidra/Features/GraphFunctionCalls/src/main/java/functioncalls/plugin/FcgProvider.java b/Ghidra/Features/GraphFunctionCalls/src/main/java/functioncalls/plugin/FcgProvider.java index e85a47cf13..a6f71874ea 100644 --- a/Ghidra/Features/GraphFunctionCalls/src/main/java/functioncalls/plugin/FcgProvider.java +++ b/Ghidra/Features/GraphFunctionCalls/src/main/java/functioncalls/plugin/FcgProvider.java @@ -52,7 +52,8 @@ import ghidra.graph.viewer.vertex.VertexClickListener; import ghidra.program.model.address.Address; import ghidra.program.model.listing.*; import ghidra.program.util.ProgramLocation; -import ghidra.util.*; +import ghidra.util.HelpLocation; +import ghidra.util.SystemUtilities; import ghidra.util.exception.CancelledException; import ghidra.util.task.TaskMonitor; import resources.Icons; @@ -172,9 +173,9 @@ public class FcgProvider if (!graphData.hasResults()) { return; } - + // The graph component won't contain valid perspective information if it's not 'initialized' - // (i.e. rendered or displayed to the user). It may happen if the graph has been kept minimized + // (i.e. rendered or displayed to the user). It may happen if the graph has been kept minimized // in the separate tab. Related method: `GraphComponent::viewerInitialized` if (view.getGraphComponent().isUninitialized()) { return; @@ -425,10 +426,10 @@ public class FcgProvider navigateIncomingToggleAction.setSelected(true); navigateIncomingToggleAction.setToolBarData( new ToolBarData(Icons.NAVIGATE_ON_INCOMING_EVENT_ICON, TOOLBAR_GROUP_A)); - navigateIncomingToggleAction.setDescription(HTMLUtilities.toHTML( - "Incoming Navigation

    Toggle On - change the graphed " + + navigateIncomingToggleAction.setDescription( + "Incoming Navigation

    Toggle On - change the graphed " + "function on Listing navigation events" + - "
    Toggled Off - don't change the graph on Listing navigation events")); + "
    Toggled Off - don't change the graph on Listing navigation events"); navigateIncomingToggleAction.setHelpLocation( new HelpLocation(plugin.getName(), "Navigation_Incoming")); addLocalAction(navigateIncomingToggleAction); diff --git a/Ghidra/Features/GraphServices/src/main/java/ghidra/graph/visualization/AttributedToolTipInfo.java b/Ghidra/Features/GraphServices/src/main/java/ghidra/graph/visualization/AttributedToolTipInfo.java index 11bcd02a2f..dcc4a3daa7 100644 --- a/Ghidra/Features/GraphServices/src/main/java/ghidra/graph/visualization/AttributedToolTipInfo.java +++ b/Ghidra/Features/GraphServices/src/main/java/ghidra/graph/visualization/AttributedToolTipInfo.java @@ -33,7 +33,7 @@ import ghidra.service.graph.*; import ghidra.util.HTMLUtilities; /** - * Generates tool tips for an {@link AttributedVertex} or {@link AttributedEdge} in + * Generates tool tips for an {@link AttributedVertex} or {@link AttributedEdge} in * an {@link AttributedGraph} */ public class AttributedToolTipInfo extends ToolTipInfo { @@ -79,7 +79,7 @@ public class AttributedToolTipInfo extends ToolTipInfo { } StringBuilder buf = new StringBuilder(); - buf.append(""); + buf.append(""); if (graphObject instanceof AttributedVertex) { addToolTipTextForVertex(buf, (AttributedVertex) graphObject); diff --git a/Ghidra/Features/ProgramDiff/src/main/java/ghidra/app/plugin/core/diff/DiffApplySettingsProvider.java b/Ghidra/Features/ProgramDiff/src/main/java/ghidra/app/plugin/core/diff/DiffApplySettingsProvider.java index 510009c51d..3473c74320 100644 --- a/Ghidra/Features/ProgramDiff/src/main/java/ghidra/app/plugin/core/diff/DiffApplySettingsProvider.java +++ b/Ghidra/Features/ProgramDiff/src/main/java/ghidra/app/plugin/core/diff/DiffApplySettingsProvider.java @@ -36,8 +36,8 @@ import ghidra.program.util.ProgramMergeFilter; import ghidra.util.HelpLocation; /** - * The DiffSettingsDialog is used to change the types of differences currently - * highlighted. It also allows the user to change the types of differences being + * The DiffSettingsDialog is used to change the types of differences currently + * highlighted. It also allows the user to change the types of differences being * applied and whether labels and/or comments are being merged or replaced. */ public class DiffApplySettingsProvider extends ComponentProviderAdapter { @@ -262,7 +262,7 @@ public class DiffApplySettingsProvider extends ComponentProviderAdapter { createChoices(); VariableHeightPanel panel = new VariableHeightPanel(false, 10, 3); - panel.setToolTipText("" + + panel.setToolTipText("" + "For each difference type, select whether to ignore, replace, or merge." + "
      Ignore - don't apply this type of difference." + "
      Replace - replace the difference type with the one from program 2." + diff --git a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/ApplyMarkupPropertyEditor.java b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/ApplyMarkupPropertyEditor.java index dcb718eee9..adfc0bf7af 100644 --- a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/ApplyMarkupPropertyEditor.java +++ b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/ApplyMarkupPropertyEditor.java @@ -44,75 +44,75 @@ import ghidra.util.layout.*; import help.HelpService; /** - * The ApplyMarkupPropertyEditor provides a custom GUI layout for the options that are used when + * The ApplyMarkupPropertyEditor provides a custom GUI layout for the options that are used when * applying version tracking markup. */ public class ApplyMarkupPropertyEditor implements OptionsEditor { // help tooltips private static final String DATA_MATCH_DATA_TYPE_TOOLTIP = - "The apply action for the data type on a data match when performing bulk apply operations"; + "The apply action for the data type on a data match when performing bulk apply operations"; private static final String LABELS_TOOLTIP = - "The apply action for labels when performing bulk apply operations"; + "The apply action for labels when performing bulk apply operations"; private static final String FUNCTION_NAME_TOOLTIP = - "The apply action for function name when performing bulk apply operations"; + "The apply action for function name when performing bulk apply operations"; private static final String FUNCTION_SIGNATURE_TOOLTIP = - "The apply action for the function signature " + - "when performing bulk apply operations"; + "The apply action for the function signature " + + "when performing bulk apply operations"; private static final String PLATE_COMMENT_TOOLTIP = - "The apply action for plate comments when performing bulk apply operations"; + "The apply action for plate comments when performing bulk apply operations"; private static final String PRE_COMMENT_TOOLTIP = - "The apply action for pre comments when performing bulk apply operations"; + "The apply action for pre comments when performing bulk apply operations"; private static final String END_OF_LINE_COMMENT_TOOLTIP = - "The apply action for end of line comments when performing bulk apply operations"; + "The apply action for end of line comments when performing bulk apply operations"; private static final String REPEATABLE_COMMENT_TOOLTIP = - "The apply action for repeatable comments when performing bulk apply operations"; + "The apply action for repeatable comments when performing bulk apply operations"; private static final String POST_COMMENT_TOOLTIP = - "The apply action for post comments when performing bulk apply operations"; + "The apply action for post comments when performing bulk apply operations"; private static final String FUNCTION_RETURN_TYPE_TOOLTIP = - "The apply action for function return type when the function signature is applied"; + "The apply action for function return type when the function signature is applied"; private static final String INLINE_TOOLTIP = - "The apply action to use for the function inline flag " + - "when applying the function signature"; + "The apply action to use for the function inline flag " + + "when applying the function signature"; private static final String NO_RETURN_TOOLTIP = - "The apply action to use for the function no return flag " + - "when applying the function signature"; + "The apply action to use for the function no return flag " + + "when applying the function signature"; private static final String CALLING_CONVENTION_TOOLTIP = - "The apply action to use for the function calling convention " + - "when applying the function signature"; + "The apply action to use for the function calling convention " + + "when applying the function signature"; private static final String CALL_FIXUP_TOOLTIP = - "The apply action for whether or not to apply call fixup " + - "when applying the function signature"; + "The apply action for whether or not to apply call fixup " + + "when applying the function signature"; private static final String VAR_ARGS_TOOLTIP = - "The apply action to use for the var args flag " + - "when applying the function signature"; + "The apply action to use for the var args flag " + + "when applying the function signature"; private static final String PARAMETER_DATA_TYPES_TOOLTIP = - "The apply action for function parameter data types when applying the function signature"; + "The apply action for function parameter data types when applying the function signature"; private static final String PARAMETER_NAMES_TOOLTIP = - "The apply action for function parameter names when applying the function signature"; + "The apply action for function parameter names when applying the function signature"; private static final String PARAMETER_NAME_PRIORITY_TOOTIP = - "Choose whether a parameter name with a User source type or Import source type is highest " + - "priority when determining whether to replace the name or not when using the priority."; + "Choose whether a parameter name with a User source type or Import source type is highest " + + "priority when determining whether to replace the name or not when using the priority."; private static final String HIGHEST_NAME_PRIORITY_TOOLTIP = - "The apply action for which source type is the highest priority " + - "when applying parameter names using a priority replace"; + "The apply action for which source type is the highest priority " + + "when applying parameter names using a priority replace"; private static final String USER_PRIORITY_TOOLTIP = - "Parameter Name Source Type Priority
    from highest to lowest:
    " + - "
    User Defined
    Imported
    Analysis
    default (i.e. param_...)
    "; + "Parameter Name Source Type Priority
    from highest to lowest:
    " + + "
    User Defined
    Imported
    Analysis
    default (i.e. param_...)
    "; private static final String IMPORT_PRIORITY_TOOLTIP = - "Parameter Name Source Type Priority
    from highest to lowest:
    " + - "
    Imported
    User Defined
    Analysis
    default (i.e. param_...)
    "; + "Parameter Name Source Type Priority
    from highest to lowest:
    " + + "
    Imported
    User Defined
    Analysis
    default (i.e. param_...)
    "; private static final String PARAMETER_NAMES_REPLACE_IF_SAME_PRIORITY_TOOLTIP = - "When function signature parameter names are being replaced based on source type priority, " + - "replace the destination name with the source name if their source types are the same."; + "When function signature parameter names are being replaced based on source type priority, " + + "replace the destination name with the source name if their source types are the same."; private static final String PARAMETER_COMMENTS_TOOLTIP = - "The apply action for parameter comments when applying the function signature"; + "The apply action for parameter comments when applying the function signature"; private static final String IGNORE_EXCLUDED_TOOLTIP = - "Markup items whose \"apply option\" is set to Do Not Apply should be" + - " changed to a status of Ignored by applying a match."; + "Markup items whose \"apply option\" is set to Do Not Apply should be" + + " changed to a status of Ignored by applying a match."; private static final String IGNORE_INCOMPLETE_TOOLTIP = - "Markup items that are incomplete (for example, no destination address is specified) " + - "should be changed to a status of Ignored by applying a match."; + "Markup items that are incomplete (for example, no destination address is specified) " + + "should be changed to a status of Ignored by applying a match."; private JComponent editorComponent; diff --git a/Ghidra/Framework/Docking/src/main/java/docking/StatusBar.java b/Ghidra/Framework/Docking/src/main/java/docking/StatusBar.java index 9ed42d82cf..56e4eb45ac 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/StatusBar.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/StatusBar.java @@ -182,7 +182,7 @@ public class StatusBar extends JPanel { */ public void setStatusText(String text) { // Run this later in case we are in the midst of a Java focus transition, such as when a - // dialog is closing. If we don't let the focus transition finish, then we will not + // dialog is closing. If we don't let the focus transition finish, then we will not // correctly locate the active window. Swing.runLater(() -> doSetStatusText(text)); } @@ -278,7 +278,7 @@ public class StatusBar extends JPanel { @Override public String getToolTipText() { if (messageQueue.size() > 0) { - StringBuffer buffer = new StringBuffer(""); + StringBuffer buffer = new StringBuffer(""); Iterator iter = messageQueue.iterator(); for (int i = 0; iter.hasNext(); i++) { diff --git a/Ghidra/Framework/Docking/src/main/java/docking/menu/DockingToolBarUtils.java b/Ghidra/Framework/Docking/src/main/java/docking/menu/DockingToolBarUtils.java index f5601a1ae2..b7deb1f04d 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/menu/DockingToolBarUtils.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/menu/DockingToolBarUtils.java @@ -52,8 +52,8 @@ class DockingToolBarUtils { private static String combingToolTipTextWithKeyBinding(String toolTipText, String keyBindingText) { StringBuilder buffy = new StringBuilder(toolTipText); - if (StringUtilities.startsWithIgnoreCase(toolTipText, "")) { - String endHTMLTag = ""; + if (StringUtilities.startsWithIgnoreCase(toolTipText, "")) { + String endHTMLTag = ""; int closeTagIndex = StringUtils.indexOfIgnoreCase(toolTipText, endHTMLTag); if (closeTagIndex < 0) { // no closing tag, which is acceptable diff --git a/Ghidra/Framework/Docking/src/main/java/docking/menu/HorizontalRuleAction.java b/Ghidra/Framework/Docking/src/main/java/docking/menu/HorizontalRuleAction.java index bb944e9a4a..cec98ab329 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/menu/HorizontalRuleAction.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/menu/HorizontalRuleAction.java @@ -56,13 +56,13 @@ public class HorizontalRuleAction extends DockingAction { String topHtml = HTMLUtilities.escapeHTML(topName); String bottomHtml = HTMLUtilities.escapeHTML(bottomName); menuData.setMenuItemNamePlain(String.format(""" -
    %s
    %s
    +
    %s
    %s
    """, Palette.SILVER, topHtml, bottomHtml)); setMenuBarData(menuData); // the description is meant to be used for the tooltip and is larger setDescription(String.format(""" -
    %s
    %s
    +
    %s
    %s
    """, PADDING + topHtml + PADDING, PADDING + bottomHtml + PADDING)); } diff --git a/Ghidra/Framework/Docking/src/main/java/docking/options/editor/ColorEditor.java b/Ghidra/Framework/Docking/src/main/java/docking/options/editor/ColorEditor.java index 55a7648354..0c70cf1662 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/options/editor/ColorEditor.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/options/editor/ColorEditor.java @@ -91,7 +91,7 @@ public class ColorEditor extends PropertyEditorSupport { String colorString = WebColors.toString(ColorUtils.contrastForegroundColor(newColor), false); previewLabel.setText( - "
    click
    "); + "
    click
    "); previewLabel.setBackground(color); } diff --git a/Ghidra/Framework/Gui/src/main/java/ghidra/util/HTMLUtilities.java b/Ghidra/Framework/Gui/src/main/java/ghidra/util/HTMLUtilities.java index 0fddc97093..6b0623122b 100644 --- a/Ghidra/Framework/Gui/src/main/java/ghidra/util/HTMLUtilities.java +++ b/Ghidra/Framework/Gui/src/main/java/ghidra/util/HTMLUtilities.java @@ -123,11 +123,13 @@ public class HTMLUtilities { private static final int MAX_TOOLTIP_LENGTH = 2000; // arbitrary private static final int TAB_SIZE = 4; - public static final String HTML = ""; - public static final String HTML_CLOSE = ""; - public static final String BR = "
    "; - public static final String PRE = "
    ";
    -	public static final String PRE_CLOSE = "
    "; + // Intentionally lower-case to match external checks for isHtml(), some of which check + // case-sensitive for "" + public static final String HTML = ""; + public static final String HTML_CLOSE = ""; + public static final String BR = "
    "; + public static final String PRE = "
    ";
    +	public static final String PRE_CLOSE = "
    "; /** * A tag to mark code that could be made into a hyperlink. This allows you to mark @@ -171,35 +173,35 @@ public class HTMLUtilities { */ public static String colorString(Color color, String text) { String rgb = toHexString(color); - return "" + text + ""; + return "" + text + ""; } /** * Surrounds the indicated text with HTML font coloring tags so that the * text will display in color within HTML. - * @param rgbColor (eg. "#8c0000") a string indicating the RGB hexadecimal color + * @param rgbColor (e.g., "#8c0000") a string indicating the RGB hexadecimal color * @param text the original text * @return the string for HTML colored text */ public static String colorString(String rgbColor, String text) { - return "" + text + ""; + return "" + text + ""; } /** * Surrounds the indicated numeric value with HTML font coloring tags so that the * numeric value will display in color within HTML. - * @param rgbColor (eg. "#8c0000") a string indicating the RGB hexadecimal color + * @param rgbColor (e.g., "#8c0000") a string indicating the RGB hexadecimal color * @param value the numeric value to be converted to text and wrapped with color tags. * @return the string for the HTML colored number */ public static String colorString(String rgbColor, int value) { - return "" + value + ""; + return "" + value + ""; } /** * Creates a string with the indicated number of HTML space characters (&nbsp;). * @param num the number of HTML spaces - * @return the string o HTML spaces + * @return the string of HTML spaces */ public static String spaces(int num) { StringBuilder buf = new StringBuilder(HTML_SPACE.length() * num); @@ -289,7 +291,7 @@ public class HTMLUtilities { } /** - * Sets the font size of the given text by wrapping it in <font> tags. + * Sets the font size of the given text by wrapping it in <span> tags. * * @param text the text to size * @param ptSize the point size of the text @@ -303,19 +305,19 @@ public class HTMLUtilities { } StringBuilder buffy = new StringBuilder(text); - buffy.insert(start, ""); + buffy.insert(start, ""); int end = buffy.length(); if (StringUtilities.endsWithIgnoreCase(text, HTML_CLOSE)) { end = end - HTML_CLOSE.length(); } - buffy.insert(end, ""); + buffy.insert(end, ""); return buffy.toString(); } /** - * Sets the font size and color of the given text by wrapping it in <font> tags. + * Sets the font size and color of the given text by wrapping it in <span> tags. * * @param text the text to size * @param color the color of the text @@ -330,14 +332,14 @@ public class HTMLUtilities { } StringBuilder buffy = new StringBuilder(text); - buffy.insert(start, ""); + buffy.insert(start, ""); int end = buffy.length(); if (StringUtilities.endsWithIgnoreCase(text, HTML_CLOSE)) { end = end - HTML_CLOSE.length(); } - buffy.insert(end, ""); + buffy.insert(end, ""); return buffy.toString(); } @@ -363,8 +365,8 @@ public class HTMLUtilities { /** * Takes HTML text wrapped by {@link #wrapWithLinkPlaceholder(String, String)} and replaces - * the custom link comment tags with HTML anchor (A) tags, where the HREF - * value is the value that was in the CONTENT attribute. + * the custom link comment tags with HTML anchor (A) tags, where the + * HREF value is the value that was in the CONTENT attribute. * * @param text the text for which to replace the markup * @return the updated text @@ -378,14 +380,14 @@ public class HTMLUtilities { while (matcher.find()) { String content = matcher.group(1); String escaped = content.replace("$", "\\$"); - String updated = ""; + String updated = ""; matcher.appendReplacement(buffy, updated); } matcher.appendTail(buffy); String pass1 = buffy.toString(); - String pass2 = pass1.replaceAll(LINK_PLACEHOLDER_CLOSE, ""); + String pass2 = pass1.replaceAll(LINK_PLACEHOLDER_CLOSE, ""); return pass2; } @@ -398,8 +400,7 @@ public class HTMLUtilities { */ public static String toHTML(String text) { int noMax = 0; - String html = toWrappedHTML(text, noMax); - return html; + return toWrappedHTML(text, noMax); } /** @@ -593,7 +594,7 @@ public class HTMLUtilities { *

    * See also StringEscapeUtils#escapeHtml3(String) if you need quote-safe html encoding. *

    - * + * * @param text plain-text that might have some characters that should NOT be interpreted as HTML * @return string with any html characters replaced with equivalents */ @@ -628,8 +629,8 @@ public class HTMLUtilities { } /** - * Tests a unicode code point (i.e., 32 bit character) to see if it needs to be escaped before - * being added to a HTML document because it is non-printable or a non-standard control + * Tests a unicode code point (i.e., 32 bit character) to see if it needs to be escaped before + * being added to a HTML document because it is non-printable or a non-standard control * character * * @param codePoint character to test @@ -787,8 +788,8 @@ public class HTMLUtilities { // formatting tags (like , , etc). So, just normalize the text, not // preserving any of the line breaks. // - // Note: Calling this method here causes unwanted removal of newlines. If the original - // need for this call is found, this can be revisited. + // Note: Calling this method here causes unwanted removal of newlines. If the original + // need for this call is found, this can be revisited. // (see history for condense() code) // String condensed = condense(updated); return updated; diff --git a/Ghidra/Framework/Gui/src/test/java/ghidra/util/HTMLUtilitiesTest.java b/Ghidra/Framework/Gui/src/test/java/ghidra/util/HTMLUtilitiesTest.java index d9fda2ff81..81c2be8b3d 100644 --- a/Ghidra/Framework/Gui/src/test/java/ghidra/util/HTMLUtilitiesTest.java +++ b/Ghidra/Framework/Gui/src/test/java/ghidra/util/HTMLUtilitiesTest.java @@ -107,7 +107,7 @@ public class HTMLUtilitiesTest { @Test public void testToLiteralHTML_AlreadyStartingWithHTML() { - String s = "Wrap
    here"; + String s = "Wrap
    here"; String html = HTMLUtilities.toLiteralHTML(s, 4); assertEquals(HTML + "<HTM
    \nL>Wr
    \nap<B
    \nR>he
    \nre", html); } @@ -121,7 +121,7 @@ public class HTMLUtilitiesTest { @Test public void testFromHTML() { - String s = "Bold, italics, sized font!"; + String s = "Bold, italics, sized font!"; String text = Swing.runNow(() -> HTMLUtilities.fromHTML(s)); assertEquals("Bold, italics, sized font!", text); } diff --git a/Ghidra/Framework/Help/src/main/java/help/screenshot/HelpMissingScreenShotReportGenerator.java b/Ghidra/Framework/Help/src/main/java/help/screenshot/HelpMissingScreenShotReportGenerator.java index 5e055f784b..d0a1d1118c 100644 --- a/Ghidra/Framework/Help/src/main/java/help/screenshot/HelpMissingScreenShotReportGenerator.java +++ b/Ghidra/Framework/Help/src/main/java/help/screenshot/HelpMissingScreenShotReportGenerator.java @@ -15,14 +15,6 @@ */ package help.screenshot; -import help.GHelpBuilder; -import help.HelpBuildUtils; -import help.validator.UnusedHelpImageFileFinder; -import help.validator.location.DirectoryHelpModuleLocation; -import help.validator.location.HelpModuleLocation; -import help.validator.model.HelpTopic; -import help.validator.model.IMG; - import java.awt.image.BufferedImage; import java.io.*; import java.lang.reflect.Method; @@ -36,6 +28,14 @@ import java.util.Map.Entry; import javax.imageio.ImageIO; +import help.GHelpBuilder; +import help.HelpBuildUtils; +import help.validator.UnusedHelpImageFileFinder; +import help.validator.location.DirectoryHelpModuleLocation; +import help.validator.location.HelpModuleLocation; +import help.validator.model.HelpTopic; +import help.validator.model.IMG; + public class HelpMissingScreenShotReportGenerator { private static boolean debugEnabled; @@ -68,17 +68,17 @@ public class HelpMissingScreenShotReportGenerator { generator.generateReport(); } - private Set helpDirectories = new HashSet(); - private Map topicNameToTopic = new HashMap(); - private Set testCases = new HashSet(); - private Map imageNameToTestCase = new HashMap(); + private Set helpDirectories = new HashSet<>(); + private Map topicNameToTopic = new HashMap<>(); + private Set testCases = new HashSet<>(); + private Map imageNameToTestCase = new HashMap<>(); - private SortedSet badlyNamedTestFiles = new TreeSet(); - private SortedSet badlyNamedTestCases = new TreeSet(); + private SortedSet badlyNamedTestFiles = new TreeSet<>(); + private SortedSet badlyNamedTestCases = new TreeSet<>(); // private Map untestedImages = new TreeMap(); - private Map> untestedImages = new TreeMap>(); + private Map> untestedImages = new TreeMap<>(); - private Set examinedImageFiles = new HashSet(); + private Set examinedImageFiles = new HashSet<>(); private File outputFile; @@ -125,8 +125,8 @@ public class HelpMissingScreenShotReportGenerator { writer.write("

    \n"); // - // Total Image File Count - // + // Total Image File Count + // int untestedCount = 0; Collection> values = untestedImages.values(); for (Set set : values) { @@ -141,7 +141,7 @@ public class HelpMissingScreenShotReportGenerator { // // All Tested Images - // + // writer.write("

    \n"); writer.write("Total Tested Images: " + imageNameToTestCase.size() + "\n"); writer.write("

    \n"); @@ -432,7 +432,7 @@ public class HelpMissingScreenShotReportGenerator { Set set = untestedImages.get(topic); if (set == null) { - set = new TreeSet(); + set = new TreeSet<>(); untestedImages.put(topic, set); } @@ -619,7 +619,7 @@ public class HelpMissingScreenShotReportGenerator { } private void writeHeader(BufferedWriter writer) throws IOException { - writer.write("\n"); + writer.write("\n"); writer.write("\n"); createStyleSheet(writer); writer.write("\n"); @@ -635,7 +635,7 @@ public class HelpMissingScreenShotReportGenerator { writer.write("
    \n"); writer.write("\n"); - writer.write("\n"); + writer.write("\n"); } private void createStyleSheet(BufferedWriter writer) throws IOException { @@ -643,11 +643,16 @@ public class HelpMissingScreenShotReportGenerator { writer.write("\n\n" + + String TOCXML = "\n" + + "\n\n" + "\n" + "\n"; @@ -114,14 +114,14 @@ public abstract class AbstractHelpTest extends AbstractGenericTest { } //@formatter:off - String HTML = - "\n" + - "\n" + - "Configure Tool\n" + + String HTML = + "\n" + + "\n" + + "Configure Tool\n" + "\n" + "\n" + - "\n" + + "\n" + "

    Configure Tool

    \n" + " Some text with reference to shared image \n" + " \n" + @@ -140,19 +140,19 @@ public abstract class AbstractHelpTest extends AbstractGenericTest { assertNotNull("Must specify the A tag HREF attribute", HREF); //@formatter:off - String HTML = - "\n" + - "\n" + - "Configure Tool\n" + + String HTML = + "\n" + + "\n" + + "Configure Tool\n" + "\n" + "\n" + - "\n" + + "\n" + "

    Configure Tool

    \n" + - " And this is a link Click Me" + + " And this is a link Click Me" + " \n" + "\n" + - "\n"; + "\n"; //@formatter:on Files.write(file, HTML.getBytes(), StandardOpenOption.CREATE); @@ -167,19 +167,19 @@ public abstract class AbstractHelpTest extends AbstractGenericTest { assertNotNull("Must specify the A tag SRC attribute", SRC); //@formatter:off - String HTML = - "\n" + - "\n" + - "Configure Tool\n" + + String HTML = + "\n" + + "\n" + + "Configure Tool\n" + "\n" + "\n" + - "\n" + + "\n" + "

    Configure Tool

    \n" + - " Some text with reference to shared image \n" + + " Some text with reference to shared image \n" + " \n" + "\n" + - "\n"; + "\n"; //@formatter:on Files.write(file, HTML.getBytes(), StandardOpenOption.CREATE); diff --git a/Ghidra/Framework/Help/src/test/java/help/validator/model/HelpFileTest.java b/Ghidra/Framework/Help/src/test/java/help/validator/model/HelpFileTest.java index 393c478e66..dc359cc332 100644 --- a/Ghidra/Framework/Help/src/test/java/help/validator/model/HelpFileTest.java +++ b/Ghidra/Framework/Help/src/test/java/help/validator/model/HelpFileTest.java @@ -150,7 +150,7 @@ public class HelpFileTest extends AbstractHelpTest { assertTrue(hrefs.isEmpty()); } - // @Test + // @Test // for debugging a real help file public void test() throws Exception { @@ -183,18 +183,18 @@ public class HelpFileTest extends AbstractHelpTest { String badAttr = "bob=1"; //@formatter:off - String HTML = - "\n" + - "\n" + - "Configure Tool\n" + + String HTML = + "\n" + + "\n" + + "Configure Tool\n" + "\n" + "\n" + - "\n" + + "\n" + "

    Configure Tool

    \n" + "Some text with reference to shared image Click me\n" + "\n" + "\n" + - "\n"; + "\n"; //@formatter:on Files.write(file, HTML.getBytes(), StandardOpenOption.CREATE); @@ -208,18 +208,18 @@ public class HelpFileTest extends AbstractHelpTest { String badAttr = "bob=1"; //@formatter:off - String HTML = - "\n" + - "\n" + - "Configure Tool\n" + + String HTML = + "\n" + + "\n" + + "Configure Tool\n" + "\n" + "\n" + - "\n" + + "\n" + "

    Configure Tool

    \n" + "Some text with reference to shared image \n" + "\n" + "\n" + - "\n"; + "\n"; //@formatter:on Files.write(file, HTML.getBytes(), StandardOpenOption.CREATE); @@ -233,18 +233,18 @@ public class HelpFileTest extends AbstractHelpTest { String badURI = ":baduri"; // no scheme name on this URI //@formatter:off - String HTML = - "\n" + - "\n" + - "Configure Tool\n" + + String HTML = + "\n" + + "\n" + + "Configure Tool\n" + "\n" + "\n" + - "\n" + + "\n" + "

    Configure Tool

    \n" + "Some text with reference to shared image Click me\n" + "\n" + "\n" + - "\n"; + "\n"; //@formatter:on Files.write(file, HTML.getBytes(), StandardOpenOption.CREATE); @@ -258,18 +258,18 @@ public class HelpFileTest extends AbstractHelpTest { String badName = "bad_name"; //@formatter:off - String HTML = - "\n" + - "\n" + - "Configure Tool\n" + + String HTML = + "\n" + + "\n" + + "Configure Tool\n" + "\n" + "\n" + - "\n" + + "\n" + "

    Configure Tool

    \n" + "Some text with reference to shared image \n" + "\n" + "\n" + - "\n"; + "\n"; //@formatter:on Files.write(file, HTML.getBytes(), StandardOpenOption.CREATE); @@ -284,20 +284,20 @@ public class HelpFileTest extends AbstractHelpTest { String badURI = ":baduri"; // no scheme name on this URI //@formatter:off - String HTML = - "\n" + - "\n" + - "Configure Tool\n" + + String HTML = + "\n" + + "\n" + + "Configure Tool\n" + "\n" + "\n" + - "\n" + + "\n" + "

    Configure Tool

    \n" + " " + + " -->" + "\n" + "\n" + - "\n"; + "\n"; //@formatter:on Files.write(file, HTML.getBytes(), StandardOpenOption.CREATE); diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatable/ProjectDataTablePanel.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatable/ProjectDataTablePanel.java index 28d95d2eed..f82a8e966f 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatable/ProjectDataTablePanel.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatable/ProjectDataTablePanel.java @@ -54,9 +54,9 @@ public class ProjectDataTablePanel extends JPanel { public Set filesPendingSelection; private GHtmlLabel capacityExceededText = - new GHtmlLabel("
    Table view disabled for very large projects, or
    " + + new GHtmlLabel("
    Table view disabled for very large projects, or
    " + "if an older project/repository filesystem is in use.
    " + - "View will remain disabled until project is closed.
    "); + "View will remain disabled until project is closed.
    "); private GGlassPanePainter painter = new TableGlassPanePainter(); @@ -95,8 +95,9 @@ public class ProjectDataTablePanel extends JPanel { checkOpen(e); } }); - gTable.getSelectionModel().addListSelectionListener( - e -> plugin.getTool().contextChanged(null)); + gTable.getSelectionModel() + .addListSelectionListener( + e -> plugin.getTool().contextChanged(null)); gTable.setDefaultRenderer(Date.class, new DateCellRenderer()); gTable.setDefaultRenderer(DomainFileType.class, new TypeCellRenderer()); @@ -275,7 +276,7 @@ public class ProjectDataTablePanel extends JPanel { //================================================================================================== // Inner Classes -//================================================================================================== +//================================================================================================== private class ProjectDataTableDomainFolderChangeListener implements DomainFolderChangeListener { diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/ProjectDataDeleteAction.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/ProjectDataDeleteAction.java index 3988d92982..1ce8950fa1 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/ProjectDataDeleteAction.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/ProjectDataDeleteAction.java @@ -89,17 +89,17 @@ public class ProjectDataDeleteAction extends FrontendProjectTreeAction { if (fileCount == 1) { if (!selectedFiles.isEmpty()) { DomainFile file = CollectionUtils.any(selectedFiles); - return "Are you sure you want to permanently delete \"" + + return "Are you sure you want to permanently delete \"" + HTMLUtilities.escapeHTML(file.getName()) + "\"?"; } // only folders are selected, but they contain files - return "Are you sure you want to permanently delete the " + + return "Are you sure you want to permanently delete the " + " selected files and folders?"; } // multiple files selected - return "Are you sure you want to permanently delete the " + fileCount + + return "Are you sure you want to permanently delete the " + fileCount + " selected files?"; } diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/dialog/PluginDetailsPanel.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/dialog/PluginDetailsPanel.java index 4553b4fd68..22b56f039e 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/dialog/PluginDetailsPanel.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/dialog/PluginDetailsPanel.java @@ -68,7 +68,7 @@ class PluginDetailsPanel extends AbstractDetailsPanel { List dependencies = model.getDependencies(descriptor); Collections.sort(dependencies, (pd1, pd2) -> pd1.getName().compareTo(pd2.getName())); - StringBuilder buffer = new StringBuilder(""); + StringBuilder buffer = new StringBuilder(""); buffer.append(""); diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/project/extensions/ExtensionDetailsPanel.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/project/extensions/ExtensionDetailsPanel.java index 4bfa1af546..ae55a701e6 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/project/extensions/ExtensionDetailsPanel.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/project/extensions/ExtensionDetailsPanel.java @@ -57,7 +57,7 @@ class ExtensionDetailsPanel extends AbstractDetailsPanel { createFieldAttributes(); createMainPanel(); - // Any time the table is reloaded or a new selection is made, we want to reload this + // Any time the table is reloaded or a new selection is made, we want to reload this // panel. This ensures we are always viewing data for the currently-selected item. tablePanel.getTableModel().addThreadedTableModelListener(new ThreadedTableModelListener() { @@ -94,7 +94,7 @@ class ExtensionDetailsPanel extends AbstractDetailsPanel { return; } - StringBuilder buffer = new StringBuilder(""); + StringBuilder buffer = new StringBuilder(""); buffer.append("
    "); insertRowTitle(buffer, "Name"); diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/ProgramCompilerSpec.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/ProgramCompilerSpec.java index c7b011ab64..a086a0fd89 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/ProgramCompilerSpec.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/ProgramCompilerSpec.java @@ -244,7 +244,7 @@ public class ProgramCompilerSpec extends BasicCompilerSpec { return; } StringBuilder buffer = new StringBuilder(); - buffer.append("User-defined extensions failed to parse: "); + buffer.append("User-defined extensions failed to parse: "); buffer.append("
      "); for (String line : errorList) { buffer.append("
    • ").append(line).append("
    • "); diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/DataTypeArchiveTransformerPanel.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/DataTypeArchiveTransformerPanel.java index f39a68704b..a4d8435e93 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/DataTypeArchiveTransformerPanel.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/DataTypeArchiveTransformerPanel.java @@ -57,9 +57,9 @@ public class DataTypeArchiveTransformerPanel extends JPanel { private void setupDescription() { JLabel label = new GHtmlLabel( - "Specify the files for converting a new data type archive (.gdt)
      " + + "Specify the files for converting a new data type archive (.gdt)
      " + "to match the IDs of data types in an old data type archive.
      " + - "The result will be saved to the destination archive."); + "The result will be saved to the destination archive."); label.setBorder(BorderFactory.createEmptyBorder(0, 0, 8, 0)); label.setHorizontalAlignment(SwingConstants.CENTER); add(label, BorderLayout.NORTH);