GP-0: Fixing deprecated comment API warnings

This commit is contained in:
Ryan Kurtz 2025-06-02 09:54:19 -04:00
parent 5772ac2ab8
commit 684177702e
120 changed files with 1595 additions and 1641 deletions

View file

@ -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.
@ -64,7 +64,7 @@ public class ProgramProviderContext implements DataTypeProviderContext {
if (symbol != null && !symbol.isDynamic()) {
label = symbol.getName();
}
String comment = data.getComment(CodeUnit.EOL_COMMENT);
String comment = data.getComment(CommentType.EOL);
return new DataTypeComponentImpl(dt, null, length, 0, offset, label, comment);
}

View file

@ -84,7 +84,7 @@ class OldFunctionDataDB {
public synchronized String getComment() {
CodeUnit cu = program.getCodeManager().getCodeUnitContaining(entryPoint);
return cu.getComment(CodeUnit.PLATE_COMMENT);
return cu.getComment(CommentType.PLATE);
}
/**

View file

@ -16,6 +16,7 @@
package ghidra.program.util;
import ghidra.program.model.listing.CodeUnit;
import ghidra.program.model.listing.CommentType;
public class CommentTypeUtils {
@ -39,19 +40,19 @@ public class CommentTypeUtils {
return CodeUnit.REPEATABLE_COMMENT;
}
else if (cu != null) {
if (cu.getComment(CodeUnit.PRE_COMMENT) != null) {
if (cu.getComment(CommentType.PRE) != null) {
return CodeUnit.PRE_COMMENT;
}
if (cu.getComment(CodeUnit.POST_COMMENT) != null) {
if (cu.getComment(CommentType.POST) != null) {
return CodeUnit.POST_COMMENT;
}
if (cu.getComment(CodeUnit.EOL_COMMENT) != null) {
if (cu.getComment(CommentType.EOL) != null) {
return CodeUnit.EOL_COMMENT;
}
if (cu.getComment(CodeUnit.PLATE_COMMENT) != null) {
if (cu.getComment(CommentType.PLATE) != null) {
return CodeUnit.PLATE_COMMENT;
}
if (cu.getComment(CodeUnit.REPEATABLE_COMMENT) != null) {
if (cu.getComment(CommentType.REPEATABLE) != null) {
return CodeUnit.REPEATABLE_COMMENT;
}
}