GP-6370: Upgrading to JDOM2

This commit is contained in:
Ryan Kurtz
2026-01-24 05:37:29 -05:00
parent 3dcb02018d
commit 2a06923b23
139 changed files with 363 additions and 365 deletions
@@ -18,7 +18,7 @@ package ghidra.debug.api.tracemgr;
import java.io.IOException;
import java.util.*;
import org.jdom.Element;
import org.jdom2.Element;
import ghidra.app.services.DebuggerTraceManagerService;
import ghidra.debug.api.target.Target;
@@ -22,7 +22,7 @@ import java.nio.channels.SocketChannel;
import java.util.*;
import java.util.concurrent.*;
import org.jdom.JDOMException;
import org.jdom2.JDOMException;
import com.google.protobuf.ByteString;
@@ -22,8 +22,8 @@ import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom2.Element;
import org.jdom2.JDOMException;
import db.Transaction;
import docking.ActionContext;
@@ -17,7 +17,7 @@ import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.*;
import org.jdom.JDOMException;
import org.jdom2.JDOMException;
import db.Transaction;
import ghidra.app.plugin.assembler.Assembler;
@@ -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.
@@ -18,7 +18,7 @@ package ghidra.app.plugin.core.debug.gui;
import java.util.List;
import java.util.function.BiConsumer;
import org.jdom.Element;
import org.jdom2.Element;
import ghidra.app.plugin.core.debug.gui.MultiProviderSaveBehavior.SaveableProvider;
import ghidra.framework.options.SaveState;
@@ -21,7 +21,7 @@ import java.util.List;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import org.jdom.Element;
import org.jdom2.Element;
import docking.ActionContext;
import docking.action.MenuData;
@@ -31,7 +31,7 @@ import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import org.apache.commons.lang3.StringUtils;
import org.jdom.Element;
import org.jdom2.Element;
import docking.*;
import docking.action.DockingAction;
@@ -19,7 +19,7 @@ import java.util.List;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import org.jdom.Element;
import org.jdom2.Element;
import docking.action.DockingAction;
import ghidra.app.plugin.PluginCategoryNames;
@@ -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,7 +19,7 @@ import java.util.*;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
import org.jdom.Element;
import org.jdom2.Element;
import ghidra.app.plugin.PluginCategoryNames;
import ghidra.app.plugin.core.debug.AbstractDebuggerPlugin;
@@ -29,7 +29,7 @@ import javax.swing.*;
import javax.swing.table.TableColumn;
import javax.swing.table.TableColumnModel;
import org.jdom.Element;
import org.jdom2.Element;
import db.Transaction;
import docking.ActionContext;
@@ -21,7 +21,7 @@ import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.jdom.JDOMException;
import org.jdom2.JDOMException;
import db.Transaction;
import ghidra.app.plugin.core.debug.service.modules.DebuggerStaticMappingUtils;
@@ -19,7 +19,7 @@ import static org.junit.Assert.assertEquals;
import java.util.List;
import org.jdom.JDOMException;
import org.jdom2.JDOMException;
import org.junit.Test;
import db.Transaction;
@@ -31,7 +31,7 @@ import java.util.function.Supplier;
import javax.swing.*;
import javax.swing.tree.TreePath;
import org.jdom.JDOMException;
import org.jdom2.JDOMException;
import org.junit.*;
import org.junit.rules.TestName;
@@ -21,7 +21,7 @@ import java.awt.event.MouseEvent;
import java.util.*;
import java.util.stream.*;
import org.jdom.JDOMException;
import org.jdom2.JDOMException;
import org.junit.*;
import db.Transaction;
@@ -23,7 +23,7 @@ import java.util.function.Predicate;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.jdom.JDOMException;
import org.jdom2.JDOMException;
import db.*;
import ghidra.framework.data.OpenMode;
@@ -18,8 +18,8 @@ package ghidra.trace.model.target.schema;
import java.io.*;
import java.util.*;
import org.jdom.*;
import org.jdom.input.SAXBuilder;
import org.jdom2.*;
import org.jdom2.input.SAXBuilder;
import ghidra.trace.model.target.TraceObject;
import ghidra.trace.model.target.iface.TraceObjectInterface;
@@ -20,7 +20,7 @@ import static org.junit.Assert.assertNotNull;
import java.io.IOException;
import org.jdom.JDOMException;
import org.jdom2.JDOMException;
import org.junit.Ignore;
import org.junit.Test;
@@ -28,7 +28,7 @@ import java.nio.file.Path;
import java.util.Collection;
import java.util.List;
import org.jdom.JDOMException;
import org.jdom2.JDOMException;
import db.DBHandle;
import db.Transaction;
@@ -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,8 @@ import java.io.*;
import java.util.*;
import org.apache.commons.lang3.StringUtils;
import org.jdom.*;
import org.jdom.input.SAXBuilder;
import org.jdom2.*;
import org.jdom2.input.SAXBuilder;
import generic.jar.ResourceFile;
import ghidra.app.util.bin.ByteProvider;
@@ -17,7 +17,7 @@ package ghidra.app.plugin.core.codebrowser;
import java.util.Iterator;
import org.jdom.Element;
import org.jdom2.Element;
import docking.widgets.fieldpanel.FieldPanel;
import docking.widgets.fieldpanel.support.FieldSelection;
@@ -21,7 +21,7 @@ import java.awt.Color;
import java.util.ArrayList;
import java.util.List;
import org.jdom.Element;
import org.jdom2.Element;
import docking.ActionContext;
import docking.action.DockingAction;
@@ -1,13 +1,12 @@
/* ###
* IP: GHIDRA
* REVIEWED: YES
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* 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.
@@ -24,7 +23,7 @@ import ghidra.program.util.ProgramLocation;
import java.util.*;
import org.jdom.Element;
import org.jdom2.Element;
import docking.ComponentProvider;
@@ -17,7 +17,7 @@ package ghidra.app.plugin.core.navigation;
import java.util.*;
import org.jdom.Element;
import org.jdom2.Element;
import docking.ComponentProvider;
import docking.DockingWindowManager;
@@ -18,8 +18,8 @@ package ghidra.app.plugin.core.navigation;
import java.io.IOException;
import java.util.*;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom2.Element;
import org.jdom2.JDOMException;
import docking.widgets.OptionDialog;
import ghidra.app.CorePluginPackage;
@@ -27,7 +27,7 @@ import javax.swing.*;
import javax.swing.border.LineBorder;
import javax.swing.table.AbstractTableModel;
import org.jdom.Element;
import org.jdom2.Element;
import docking.DropDownMenuIcon;
import docking.widgets.button.GButton;
@@ -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.
@@ -21,7 +21,7 @@ import javax.swing.*;
import javax.swing.border.*;
import javax.swing.event.ChangeListener;
import org.jdom.Element;
import org.jdom2.Element;
import docking.ReusableDialogComponentProvider;
import docking.widgets.button.GRadioButton;
@@ -22,7 +22,7 @@ import java.util.*;
import javax.swing.JComponent;
import org.jdom.Element;
import org.jdom2.Element;
import docking.ComponentProvider;
import docking.DockingUtils;
@@ -23,7 +23,7 @@ import java.util.Map;
import javax.swing.*;
import org.jdom.Element;
import org.jdom2.Element;
import docking.ComponentProvider;
import docking.ReusableDialogComponentProvider;
@@ -17,7 +17,7 @@ package ghidra.app.plugin.core.symtable;
import java.util.*;
import org.jdom.Element;
import org.jdom2.Element;
import ghidra.program.model.address.Address;
import ghidra.program.model.listing.*;
@@ -24,7 +24,7 @@ import javax.swing.event.TableModelListener;
import javax.swing.table.TableColumn;
import javax.swing.table.TableColumnModel;
import org.jdom.Element;
import org.jdom2.Element;
import docking.widgets.checkbox.GCheckBox;
import docking.widgets.table.DefaultRowFilterTransformer;
@@ -26,9 +26,9 @@ import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.output.XMLOutputter;
import org.jdom2.Document;
import org.jdom2.Element;
import org.jdom2.output.XMLOutputter;
import docking.ActionContext;
import docking.DialogComponentProvider;
@@ -390,7 +390,7 @@ public class GenerateOldLanguagePlugin extends Plugin implements ApplicationLeve
Document doc = new Document(root);
FileOutputStream out = new FileOutputStream(transFile);
XMLOutputter xml = new GenericXMLOutputter();
XMLOutputter xml = GenericXMLOutputter.getInstance();
xml.output(doc, out);
out.close();
@@ -21,8 +21,8 @@ import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.jdom.*;
import org.jdom.input.SAXBuilder;
import org.jdom2.*;
import org.jdom2.input.SAXBuilder;
import generic.jar.ResourceFile;
import ghidra.program.model.lang.*;
@@ -19,8 +19,8 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.*;
import org.jdom.*;
import org.jdom.input.SAXBuilder;
import org.jdom2.*;
import org.jdom2.input.SAXBuilder;
import generic.jar.ResourceFile;
import ghidra.app.util.bin.format.dwarf.DWARFUtil;
@@ -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.
@@ -18,8 +18,8 @@ package ghidra.app.util.bin.format.macho.prelink;
import java.io.*;
import java.util.*;
import org.jdom.*;
import org.jdom.input.SAXBuilder;
import org.jdom2.*;
import org.jdom2.input.SAXBuilder;
import ghidra.app.util.bin.ByteProvider;
import ghidra.app.util.bin.format.macho.MachHeader;
@@ -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.
@@ -18,8 +18,8 @@ package ghidra.app.util.opinion;
import java.io.*;
import java.util.*;
import org.jdom.*;
import org.jdom.input.SAXBuilder;
import org.jdom2.*;
import org.jdom2.input.SAXBuilder;
import org.xml.sax.SAXException;
import org.xml.sax.SAXNotRecognizedException;
@@ -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.
@@ -20,9 +20,9 @@ import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import org.jdom.*;
import org.jdom.input.SAXBuilder;
import org.jdom.output.XMLOutputter;
import org.jdom2.*;
import org.jdom2.input.SAXBuilder;
import org.jdom2.output.XMLOutputter;
import org.xml.sax.*;
import generic.jar.ResourceFile;
@@ -519,7 +519,7 @@ class LibrarySymbolTable {
try {
Document doc = new Document(root);
XMLOutputter xmlout = new GenericXMLOutputter();
XMLOutputter xmlout = GenericXMLOutputter.getInstance();
xmlout.output(doc, fos);
}
finally {
@@ -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.
@@ -20,7 +20,7 @@ import java.util.*;
import org.apache.commons.collections4.BidiMap;
import org.apache.commons.collections4.bidimap.DualHashBidiMap;
import org.jdom.JDOMException;
import org.jdom2.JDOMException;
import ghidra.app.util.bin.ByteProvider;
import ghidra.app.util.bin.ByteProviderWrapper;
@@ -17,7 +17,7 @@ package ghidra.app.util.viewer.format;
import java.util.*;
import org.jdom.Element;
import org.jdom2.Element;
import docking.widgets.fieldpanel.field.Field;
import docking.widgets.fieldpanel.support.RowLayout;
@@ -19,7 +19,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import org.jdom.Element;
import org.jdom2.Element;
import docking.widgets.fieldpanel.support.Highlight;
import ghidra.app.util.ListingHighlightProvider;
@@ -23,7 +23,7 @@ import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
import org.jdom.Element;
import org.jdom2.Element;
import docking.ComponentProvider;
import docking.DialogComponentProvider;
@@ -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.
@@ -20,10 +20,10 @@ import java.io.*;
import java.util.*;
import java.util.function.Predicate;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.input.SAXBuilder;
import org.jdom.output.XMLOutputter;
import org.jdom2.Document;
import org.jdom2.Element;
import org.jdom2.input.SAXBuilder;
import org.jdom2.output.XMLOutputter;
import generic.theme.GThemeDefaults.Colors.Palette;
import ghidra.test.processors.support.PCodeTestResults.TestResults;
@@ -108,7 +108,7 @@ public class PCodeTestCombinedTestResults {
combinedResults.put(jUnitName, testResults);
}
}
catch (org.jdom.JDOMException je) {
catch (org.jdom2.JDOMException je) {
throw new IOException("Invalid P-Code test results xml file: " + xmlFile, je);
}
finally {
@@ -148,7 +148,7 @@ public class PCodeTestCombinedTestResults {
try {
Document doc = new Document(root);
XMLOutputter xmlout = new GenericXMLOutputter();
XMLOutputter xmlout = GenericXMLOutputter.getInstance();
xmlout.output(doc, bos);
}
finally {
@@ -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.
@@ -20,8 +20,8 @@ import java.text.SimpleDateFormat;
import java.util.*;
import java.util.function.Predicate;
import org.jdom.Attribute;
import org.jdom.Element;
import org.jdom2.Attribute;
import org.jdom2.Element;
public class PCodeTestResults {
@@ -25,7 +25,7 @@ import java.util.concurrent.atomic.AtomicReference;
import javax.swing.JComponent;
import javax.swing.JLabel;
import org.jdom.Element;
import org.jdom2.Element;
import org.junit.Test;
import docking.test.AbstractDockingTest;
@@ -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.
@@ -25,7 +25,7 @@ import java.util.concurrent.atomic.AtomicReference;
import javax.swing.*;
import javax.swing.table.*;
import org.jdom.*;
import org.jdom2.*;
import org.junit.*;
import docking.DockingUtils;
@@ -23,7 +23,7 @@ import java.util.List;
import javax.swing.JComponent;
import javax.swing.JPanel;
import org.jdom.Element;
import org.jdom2.Element;
import org.junit.*;
import docking.*;
@@ -21,7 +21,7 @@ import java.util.List;
import javax.swing.tree.TreePath;
import org.jdom.Element;
import org.jdom2.Element;
import org.junit.*;
import docking.DockingWindowManager;
@@ -30,7 +30,7 @@ import javax.swing.event.ChangeEvent;
import javax.swing.table.TableModel;
import javax.swing.text.JTextComponent;
import org.jdom.Element;
import org.jdom2.Element;
import org.junit.*;
import docking.*;
@@ -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.
@@ -25,10 +25,10 @@ import java.util.Date;
import javax.swing.KeyStroke;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.input.SAXBuilder;
import org.jdom.output.XMLOutputter;
import org.jdom2.Document;
import org.jdom2.Element;
import org.jdom2.input.SAXBuilder;
import org.jdom2.output.XMLOutputter;
import org.junit.Before;
import org.junit.Test;
@@ -177,7 +177,7 @@ public class GPropertiesTest extends AbstractGenericTest {
try {
os = new FileOutputStream(saveFile);
Document doc = new Document(element);
XMLOutputter xmlout = new GenericXMLOutputter();
XMLOutputter xmlout = GenericXMLOutputter.getInstance();
xmlout.output(doc, os);
os.close();
}
@@ -30,7 +30,7 @@ import java.util.*;
import javax.swing.JComponent;
import javax.swing.KeyStroke;
import org.jdom.Element;
import org.jdom2.Element;
import org.junit.*;
import docking.DockingUtils;
@@ -17,7 +17,7 @@ package ghidra.framework.options;
import static org.junit.Assert.*;
import org.jdom.Element;
import org.jdom2.Element;
import org.junit.Test;
import generic.test.AbstractGTest;

Some files were not shown because too many files have changed in this diff Show More