GP-1806: Formatting

This commit is contained in:
Ryan Kurtz 2022-03-11 12:17:42 -05:00
parent c684fbb958
commit 61df70e6ec
2 changed files with 8 additions and 7 deletions

View File

@ -647,7 +647,7 @@ public class ResourceDataDirectory extends DataDirectory {
short menuItemOption = 0;
Stack<Short> parentItemOptions = new Stack<>();
parentItemOptions.push((short)0);
parentItemOptions.push((short) 0);
int numComponents = data.getNumComponents();
for (int i = 0; i < numComponents; i++) {
@ -679,7 +679,8 @@ public class ResourceDataDirectory extends DataDirectory {
int depth = parentItemOptions.size() - 1;
if (depth == 0) {
comment.append("\n");
} else {
}
else {
comment.append(" ".repeat(2 * depth));
}
@ -696,7 +697,8 @@ public class ResourceDataDirectory extends DataDirectory {
if ((menuItemOption & MF_POPUP) == MF_POPUP) {
// Increase the current depth
parentItemOptions.push(menuItemOption);
} else if ((menuItemOption & MF_END) == MF_END) {
}
else if ((menuItemOption & MF_END) == MF_END) {
// Decrease the current depth until we have found a parent menu item that isn't the last item in its parent
short parentOptions = parentItemOptions.pop();
while ((parentOptions & MF_END) == MF_END) {

View File

@ -15,9 +15,7 @@
*/
package ghidra.program.model.data;
import java.util.ArrayList;
import java.util.List;
import java.util.Stack;
import java.util.*;
import ghidra.docking.settings.Settings;
import ghidra.program.model.address.Address;
@ -92,7 +90,8 @@ public class MenuResourceDataType extends DynamicDataType {
if ((option & MF_POPUP) == MF_POPUP) {
// Increase the depth
parentItemOptions.push(option);
} else if ((option & MF_END) == MF_END) {
}
else if ((option & MF_END) == MF_END) {
// Decrease the depth until we have found a parent menu item that isn't also the last item
short parentOptions = parentItemOptions.pop();
while ((parentOptions & MF_END) == MF_END) {