mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-25 17:00:36 -09:00
GP-0: Fixing deprecated comment API warnings
This commit is contained in:
@@ -4,9 +4,9 @@
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@@ -19,8 +19,7 @@
|
||||
|
||||
import ghidra.app.script.GhidraScript;
|
||||
import ghidra.program.model.address.*;
|
||||
import ghidra.program.model.listing.CodeUnit;
|
||||
import ghidra.program.model.listing.Listing;
|
||||
import ghidra.program.model.listing.*;
|
||||
|
||||
public class DeleteEmptyPlateCommentsScript extends GhidraScript {
|
||||
|
||||
@@ -36,14 +35,14 @@ public class DeleteEmptyPlateCommentsScript extends GhidraScript {
|
||||
set = currentSelection;
|
||||
}
|
||||
int updateCount=0;
|
||||
AddressIterator iter = listing.getCommentAddressIterator(CodeUnit.PLATE_COMMENT, set, true);
|
||||
AddressIterator iter = listing.getCommentAddressIterator(CommentType.PLATE, set, true);
|
||||
while (iter.hasNext()) {
|
||||
Address addr = iter.next();
|
||||
CodeUnit cu = listing.getCodeUnitAt(addr);
|
||||
if (cu != null) {
|
||||
String[] comment = cu.getCommentAsArray(CodeUnit.PLATE_COMMENT);
|
||||
String[] comment = cu.getCommentAsArray(CommentType.PLATE);
|
||||
if (comment.length == 1 && comment[0].equals(EMPTY_PLATE)) {
|
||||
cu.setComment(CodeUnit.PLATE_COMMENT, null);
|
||||
cu.setComment(CommentType.PLATE, null);
|
||||
++updateCount;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user