Skip to content

Commit

Permalink
Merge pull request apache#1792 from BradWalker/cleanup_hash_rawtypes
Browse files Browse the repository at this point in the history
[NETBEANS-3608] - cleanup hash raw types
  • Loading branch information
matthiasblaesing committed Dec 19, 2019
2 parents 98d0bc1 + 61eecf5 commit 1a23299
Show file tree
Hide file tree
Showing 49 changed files with 88 additions and 89 deletions.
2 changes: 1 addition & 1 deletion enterprise/glassfish.eecommon/nbproject/project.properties
Expand Up @@ -15,7 +15,7 @@
# specific language governing permissions and limitations
# under the License.
is.autoload=true
javac.source=1.6
javac.source=1.8
javac.compilerargs=-Xlint -Xlint:-serial
spec.version.base=1.44.0

Expand Down
Expand Up @@ -497,7 +497,7 @@ private HashMap<String,String> getPoolValues(HashMap cpMap, String poolName) {
NodeList propsNodeList = cpElement.getElementsByTagName(CONST_PROP);

//Cycle through each property element
HashMap map = new HashMap();
HashMap<String, String> map = new HashMap<>();
for (int j = 0; j < propsNodeList.getLength(); j++) {
Node propNode = propsNodeList.item(j);
NamedNodeMap propsMap = propNode.getAttributes();
Expand Down
Expand Up @@ -46,8 +46,7 @@ public class WebLogicDDWizardPanel implements WizardDescriptor.Panel {
* The visual component that displays this panel. If you need to access the
* component from this class, just use getComponent().
*/
// private final Set<ChangeListener> listeners = new HashSet<ChangeListener>(1);
private final Set listeners = new HashSet(1);
private final Set<ChangeListener> listeners = new HashSet<ChangeListener>(1);
private WebLogicDDVisualPanel component = new WebLogicDDVisualPanel();
private WizardDescriptor wizardDescriptor;
private Project project;
Expand Down Expand Up @@ -129,16 +128,13 @@ public final void removeChangeListener(ChangeListener l) {
}

protected final void fireChangeEvent() {
// Iterator<ChangeListener> it;
Iterator it;
Iterator<ChangeListener> it;
synchronized (listeners) {
// it = new HashSet<ChangeListener>(listeners).iterator();
it = new HashSet(listeners).iterator();
it = new HashSet<ChangeListener>(listeners).iterator();
}
ChangeEvent ev = new ChangeEvent(this);
while (it.hasNext()) {
// it.next().stateChanged(ev);
((ChangeListener)it.next()).stateChanged(ev);
it.next().stateChanged(ev);
}
}

Expand Down
Expand Up @@ -130,7 +130,7 @@ public enum TaskEvent {
* conversion.
*/
private static final Map<String, TaskEvent> stringValuesMap
= new HashMap(values().length);
= new HashMap<>(values().length);

// Initialize backward String conversion <code>Map</code>.
static {
Expand Down
Expand Up @@ -65,7 +65,7 @@ public enum TaskState {
* conversion.
*/
private static final Map<String, TaskState> stringValuesMap
= new HashMap(values().length);
= new HashMap<>(values().length);

// Initialize backward String conversion <code>Map</code>.
static {
Expand Down
Expand Up @@ -64,7 +64,7 @@ public enum GlassFishStatusCheck {
/** Stored <code>String</code> values for backward <code>String</code>
* conversion. */
private static final Map<String, GlassFishStatusCheck> stringValuesMap
= new HashMap(values().length);
= new HashMap<>(values().length);
static {
for (GlassFishStatusCheck state : GlassFishStatusCheck.values()) {
stringValuesMap.put(state.toString().toUpperCase(), state);
Expand Down
Expand Up @@ -492,7 +492,7 @@ private HashMap<String,String> getPoolValues(HashMap cpMap, String poolName) {
NodeList propsNodeList = cpElement.getElementsByTagName(CONST_PROP);

//Cycle through each property element
HashMap map = new HashMap();
Map<String, String> map = new HashMap<>();
for (int j = 0; j < propsNodeList.getLength(); j++) {
Node propNode = propsNodeList.item(j);
NamedNodeMap propsMap = propNode.getAttributes();
Expand Down
Expand Up @@ -41,7 +41,7 @@
*/
public class PayaraDDWizardPanel implements WizardDescriptor.Panel {

private final Set listeners = new HashSet(1);
private final Set<ChangeListener> listeners = new HashSet<>(1);
private final PayaraDDVisualPanel component = new PayaraDDVisualPanel();
private WizardDescriptor wizardDescriptor;
private Project project;
Expand Down Expand Up @@ -117,13 +117,13 @@ public final void removeChangeListener(ChangeListener l) {
}

protected final void fireChangeEvent() {
Iterator it;
Iterator<ChangeListener> it;
synchronized (listeners) {
it = new HashSet(listeners).iterator();
it = new HashSet<ChangeListener>(listeners).iterator();
}
ChangeEvent ev = new ChangeEvent(this);
while (it.hasNext()) {
((ChangeListener)it.next()).stateChanged(ev);
it.next().stateChanged(ev);
}
}

Expand Down
Expand Up @@ -503,7 +503,7 @@ private void distributeOnSave(File destDir, Iterable<Artifact> artifacts) throws

// create target FOs map keyed by relative paths
java.util.Enumeration destFiles = destRoot.getChildren(true);
Map destMap = new HashMap();
Map<String, FileObject> destMap = new HashMap<>();
int rootPathLen = destRoot.getPath().length();
for (; destFiles.hasMoreElements();) {
FileObject destFO = (FileObject) destFiles.nextElement();
Expand Down
Expand Up @@ -130,7 +130,7 @@ public enum TaskEvent {
* conversion.
*/
private static final Map<String, TaskEvent> stringValuesMap
= new HashMap(values().length);
= new HashMap<>(values().length);

// Initialize backward String conversion <code>Map</code>.
static {
Expand Down
Expand Up @@ -65,7 +65,7 @@ public enum TaskState {
* conversion.
*/
private static final Map<String, TaskState> stringValuesMap
= new HashMap(values().length);
= new HashMap<>(values().length);

// Initialize backward String conversion <code>Map</code>.
static {
Expand Down
Expand Up @@ -53,7 +53,7 @@ public enum PayaraAdminInterface {
* conversion.
*/
private static final Map<String, PayaraAdminInterface> stringValuesMap
= new HashMap(values().length);
= new HashMap<>(values().length);

// Initialize backward String conversion <code>Map</code>.
static {
Expand Down
Expand Up @@ -64,7 +64,7 @@ public enum PayaraStatusCheck {
/** Stored <code>String</code> values for backward <code>String</code>
* conversion. */
private static final Map<String, PayaraStatusCheck> stringValuesMap
= new HashMap(values().length);
= new HashMap<>(values().length);
static {
for (PayaraStatusCheck state : PayaraStatusCheck.values()) {
stringValuesMap.put(state.toString().toUpperCase(), state);
Expand Down
Expand Up @@ -199,7 +199,7 @@ public enum PayaraVersion {
* conversion.
*/
private static final Map<String, PayaraVersion> stringValuesMap
= new HashMap(2 * values().length);
= new HashMap<>(2 * values().length);

// Initialize backward String conversion Map.
static {
Expand Down
Expand Up @@ -45,7 +45,7 @@
@ProjectServiceProvider(service = ReplaceTokenProvider.class, projectType = NbGradleProject.GRADLE_PLUGIN_TYPE + "/java-base")
public class GradleJavaTokenProvider implements ReplaceTokenProvider {

private static final Set<String> SUPPORTED = Collections.unmodifiableSet(new HashSet(Arrays.asList(
private static final Set<String> SUPPORTED = Collections.unmodifiableSet(new HashSet<String>(Arrays.asList(
"selectedClass", //NOI18N
"selectedMethod", //NOI18N
"affectedBuildTasks" //NOI18N
Expand Down
Expand Up @@ -39,7 +39,7 @@
*/
public class GroovyBreakpointAnnotationListener extends DebuggerManagerAdapter {

private HashMap breakpointToAnnotation = new HashMap ();
private HashMap<LineBreakpoint, Object> breakpointToAnnotation = new HashMap<>();
private boolean listen = true;

@Override
Expand Down
Expand Up @@ -59,7 +59,7 @@ public class DbDriverManager {

private static final DbDriverManager DEFAULT = new DbDriverManager();

private Set registeredDrivers;
private Set<Driver> registeredDrivers;

/**
* Maps each connection to the driver used to create that connection.
Expand Down Expand Up @@ -165,7 +165,7 @@ public Connection getSameDriverConnection(Connection existingConn, String databa
*/
public synchronized void registerDriver(Driver driver) {
if (registeredDrivers == null) {
registeredDrivers = new HashSet();
registeredDrivers = new HashSet<>();
}
registeredDrivers.add(driver);
}
Expand Down
Expand Up @@ -15,6 +15,6 @@
# specific language governing permissions and limitations
# under the License.
is.autoload=true
javac.source=1.6
javac.source=1.8
javac.compilerargs=-Xlint -Xlint:-serial
spec.version.base=1.38.0
Expand Up @@ -85,7 +85,7 @@ public class ExtFormatter extends Formatter implements FormatLayer {
private static final Object NULL_VALUE = new Object();

/** Map that contains the requested [setting-name, setting-value] pairs */
private final HashMap settingsMap = new HashMap();
private final HashMap<String, Object> settingsMap = new HashMap<>();

private Acceptor indentHotCharsAcceptor;
private boolean reindentWithTextBefore;
Expand Down
Expand Up @@ -43,7 +43,7 @@ class FormatTokenPositionSupport {
private SaveSet lastSet;

/** Map holding the [token, token-position-list] pairs. */
private final HashMap tokens2positionLists = new HashMap();
private final HashMap<TokenItem, ArrayList> tokens2positionLists = new HashMap<>();

FormatTokenPositionSupport(FormatWriter formatWriter) {
this.formatWriter = formatWriter;
Expand Down
Expand Up @@ -66,7 +66,7 @@ public int compare(Object o1, Object o2) {
private JTableHeader tableHeader;
private MouseListener mouseListener;
private TableModelListener tableModelListener;
private Map columnComparators = new HashMap();
private Map<Class, Comparator> columnComparators = new HashMap<>();
private List sortingColumns = new ArrayList();

public TableSorter() {
Expand Down
Expand Up @@ -474,7 +474,7 @@ public void removePropertyChangeListener(PropertyChangeListener l) {
pcs.removePropertyChangeListener(l);
// Also remove the listener from all MIME types
synchronized (pcsByMIMEType) {
Set<String> MIMETypes = new HashSet(pcsByMIMEType.keySet());
Set<String> MIMETypes = new HashSet<>(pcsByMIMEType.keySet());
for (String MIMEType : MIMETypes) {
PropertyChangeSupport _pcs = pcsByMIMEType.get(MIMEType);
_pcs.removePropertyChangeListener(l);
Expand Down Expand Up @@ -567,7 +567,7 @@ private void firePropertyChange(PropertyChangeEvent evt, String preferredMIMETyp
Map<String, Reference<Object>> lastEvents;
synchronized (this) {
lastMIMEType = lastFiredMIMEType;
lastEvents = new HashMap(lastMIMETypeEvents);
lastEvents = new HashMap<>(lastMIMETypeEvents);
if (lastMIMEType != null && lastMIMEType.equals(oldMIMEType)) {
lastFiredMIMEType = null;
lastMIMETypeEvents.clear();
Expand Down
2 changes: 1 addition & 1 deletion ide/xml.catalog.ui/nbproject/project.properties
Expand Up @@ -14,6 +14,6 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
javac.source=1.6
javac.source=1.8
javac.compilerargs=-Xlint -Xlint:-serial
spec.version.base=2.10.0
Expand Up @@ -272,7 +272,7 @@ public Node[] createNodes(Object key) {
public void reload() {
//if ( Util.THIS.isLoggable() ) /* then */ Util.THIS.debug(" Reloading kids of " + peer + "..."); // NOI18N

Set previous = new HashSet(keys);
Set<String> previous = new HashSet<>(keys);
keys.clear();
Iterator it = peer.getPublicIDs();
if (it != null) {
Expand Down
Expand Up @@ -38,7 +38,7 @@ public abstract class SectionNodeView extends SectionView {

private final XmlMultiViewDataObject dataObject;
private SectionNode rootNode = null;
private HashMap nodes = new HashMap();
private HashMap<SectionNode, SectionNode> nodes = new HashMap<>();

private final RequestProcessor.Task refreshTask = RequestProcessor.getDefault().create(new Runnable() {
public void run() {
Expand Down
Expand Up @@ -21,6 +21,7 @@

import javax.swing.JPanel;
import java.awt.*;
import java.util.Hashtable;

import org.openide.nodes.Node;
import org.netbeans.modules.xml.multiview.cookies.SectionFocusCookie;
Expand All @@ -34,7 +35,7 @@
public class SectionView extends PanelView implements SectionFocusCookie, ContainerPanel {
private JPanel scrollPanel, filler;
javax.swing.JScrollPane scrollPane;
private java.util.Hashtable map;
private Hashtable<Node, NodeSectionPanel> map;
private int sectionCount=0;
private NodeSectionPanel activePanel;
private InnerPanelFactory factory = null;
Expand All @@ -59,7 +60,7 @@ public SectionView() {

public void initComponents() {
super.initComponents();
map = new java.util.Hashtable();
map = new Hashtable<>();
setLayout(new java.awt.BorderLayout());
scrollPanel = new JPanel();
scrollPanel.setLayout(new java.awt.GridBagLayout());
Expand Down
Expand Up @@ -21,6 +21,7 @@

import javax.swing.*;
import java.awt.*;
import java.util.HashMap;

/**
* TreePanelView.java
Expand All @@ -30,7 +31,7 @@
*/
public class TreePanelView extends PanelView {

java.util.HashMap map;
HashMap<String, TreePanel> map;
JPanel cardPanel;
CardLayout cardLayout;
public TreePanelView() {
Expand All @@ -41,7 +42,7 @@ public void initComponents() {
setLayout(new BorderLayout());
cardLayout = new CardLayout();
cardPanel = new JPanel(cardLayout);
map = new java.util.HashMap();
map = new HashMap<>();
JScrollPane scrollPane = new JScrollPane();
scrollPane.setViewportView(cardPanel);
add (scrollPane, BorderLayout.CENTER);
Expand Down
Expand Up @@ -44,7 +44,7 @@ public class TreeNodeFilterCustomEditor extends JPanel implements EnhancedCustom


/** */
private static final Map publicNodeTypeNamesMap = new HashMap();
private static final Map<Class<?>, String> publicNodeTypeNamesMap = new HashMap();


//
Expand Down
2 changes: 1 addition & 1 deletion ide/xsl/nbproject/project.properties
Expand Up @@ -16,6 +16,6 @@
# under the License.

javac.compilerargs=-Xlint -Xlint:-serial
javac.source=1.6
javac.source=1.8

test.config.stableBTD.includes=**/*Test.class
Expand Up @@ -55,13 +55,13 @@ public final class XSLGrammarQuery implements GrammarQuery{
* allowed XSL children. Neither the element name keys nor the names in the
* value set should contain the namespace prefix.
*/
private static Map elementDecls;
private static Map<String, Set> elementDecls;

/** Contains a mapping from XSL namespace element names to set of names of
* allowed XSL attributes for that element. The element name keys should
* not contain the namespace prefix.
*/
private static Map attrDecls;
private static Map<String, Set> attrDecls;

/** A Set of XSL attributes which should be allowd for result elements*/
private static Set resultElementAttr;
Expand Down Expand Up @@ -130,8 +130,8 @@ public XSLGrammarQuery(DataObject dataObject) {

private static Map getElementDecls() {
if (elementDecls == null) {
elementDecls = new HashMap();
attrDecls = new HashMap();
elementDecls = new HashMap<>();
attrDecls = new HashMap<>();

// Commonly used variables
Set emptySet = new TreeSet();
Expand Down

0 comments on commit 1a23299

Please sign in to comment.