Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -465,12 +465,12 @@ private String formatJvmOption(String jvmOption) {
static final String[] sysDatasources = {"jdbc/__TimerPool", "jdbc/__CallFlowPool"}; //NOI18N


public HashMap<String,Map> getSunDatasourcesFromXml(){
HashMap<String, Map> dSources = new HashMap<>();
public HashMap<String, Map<String, String>> getSunDatasourcesFromXml(){
HashMap<String, Map<String, String>> dSources = new HashMap<>();
Document domainDoc = getDomainDocument();
if (domainDoc != null) {
Map<String,NamedNodeMap> dsMap = getDataSourcesAttrMap(domainDoc);
HashMap<String,Node> cpMap = getConnPoolsNodeMap(domainDoc);
Map<String,Node> cpMap = getConnPoolsNodeMap(domainDoc);
dsMap.keySet().removeAll(Arrays.asList(sysDatasources));
String[] ds = dsMap.keySet().toArray(new String[dsMap.size()]);

Expand All @@ -485,7 +485,7 @@ public HashMap<String,Map> getSunDatasourcesFromXml(){
return dSources;
}

private Map<String,String> getPoolValues(Map<String, Node> cpMap, String poolName) {
private Map<String, String> getPoolValues(Map<String, Node> cpMap, String poolName) {
Map<String,String> pValues = new HashMap<>();
Node cpNode = cpMap.get(poolName);
NamedNodeMap cpAttrMap = cpNode.getAttributes();
Expand Down Expand Up @@ -532,8 +532,8 @@ private Map<String,String> getPoolValues(Map<String, Node> cpMap, String poolNam
return pValues;
}

public HashMap<String,Map> getConnPoolsFromXml(){
HashMap<String, Map> pools = new HashMap<>();
public HashMap<String, Map<String, String>> getConnPoolsFromXml(){
HashMap<String, Map<String, String>> pools = new HashMap<>();
Document domainDoc = getDomainDocument();
if (domainDoc != null) {
HashMap<String,Node> cpMap = getConnPoolsNodeMap(domainDoc);
Expand All @@ -547,8 +547,8 @@ public HashMap<String,Map> getConnPoolsFromXml(){
return pools;
}

private HashMap<String,NamedNodeMap> getDataSourcesAttrMap(Document domainDoc){
HashMap<String,NamedNodeMap> dataSourceMap = new HashMap<String,NamedNodeMap>();
private Map<String, NamedNodeMap> getDataSourcesAttrMap(Document domainDoc){
Map<String,NamedNodeMap> dataSourceMap = new HashMap<>();
updateWithSampleDataSource(domainDoc);
NodeList dataSourceNodeList = domainDoc.getElementsByTagName(CONST_JDBC);
for(int i=0; i<dataSourceNodeList.getLength(); i++){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public void setDescription(String description) {
}
}

public void setAllDescriptions(java.util.Map descriptions) throws VersionNotSupportedException {
public void setAllDescriptions(Map descriptions) throws VersionNotSupportedException {
removeAllDescriptions();
if (descriptions!=null) {
Iterator<String> keys = descriptions.keySet().iterator();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@

import java.beans.PropertyChangeListener;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.netbeans.modules.j2ee.dd.api.webservices.Webservices;


Expand Down Expand Up @@ -181,8 +183,8 @@ public void setId(java.lang.String value) {
}
}

public java.util.Map getAllDescriptions() {
return webSvc==null?new java.util.HashMap():webSvc.getAllDescriptions();
public Map getAllDescriptions() {
return webSvc == null ? new HashMap<>() : webSvc.getAllDescriptions();
}

public String getDescription(String locale) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
Expand All @@ -193,8 +195,8 @@ public String getDefaultDescription() {
return webSvc==null?null:webSvc.getDefaultDescription();
}

public java.util.Map getAllDisplayNames() {
return webSvc==null?new java.util.HashMap():webSvc.getAllDisplayNames();
public Map getAllDisplayNames() {
return webSvc==null?new HashMap<>():webSvc.getAllDisplayNames();
}

public String getDefaultDisplayName() {
Expand All @@ -209,8 +211,8 @@ public org.netbeans.modules.j2ee.dd.api.common.Icon getDefaultIcon() {
return webSvc==null?null:webSvc.getDefaultIcon();
}

public java.util.Map getAllIcons() {
return webSvc==null?new java.util.HashMap():webSvc.getAllIcons();
public Map getAllIcons() {
return webSvc == null ? new HashMap<>() : webSvc.getAllIcons();
}

public String getLargeIcon() {
Expand Down Expand Up @@ -281,7 +283,7 @@ public void removeSmallIcon(String locale) throws org.netbeans.modules.j2ee.dd.a
if (webSvc!=null) webSvc.removeSmallIcon(locale);
}

public void setAllDescriptions(java.util.Map descriptions) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
public void setAllDescriptions(Map descriptions) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
if (webSvc!=null) webSvc.setAllDescriptions(descriptions);
}

Expand All @@ -293,7 +295,7 @@ public void setDescription(String locale, String description) throws org.netbean
if (webSvc!=null) webSvc.setDescription(locale, description);
}

public void setAllDisplayNames(java.util.Map displayNames) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
public void setAllDisplayNames(Map displayNames) throws org.netbeans.modules.j2ee.dd.api.common.VersionNotSupportedException {
if (webSvc!=null) webSvc.setAllDisplayNames(displayNames);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
*/

package org.netbeans.modules.j2ee.dd.api.common;

import java.util.Map;

/**
* Super interface for all DD elements having the description property/properties.
*
Expand Down Expand Up @@ -50,7 +53,7 @@ public interface DescriptionInterface {
*
* @param descriptions Map of descriptions in the form of [locale,description]
*/
public void setAllDescriptions(java.util.Map descriptions) throws VersionNotSupportedException;
public void setAllDescriptions(Map descriptions) throws VersionNotSupportedException;

/**
* Returns the description element value for particular locale.<br>
Expand All @@ -73,7 +76,7 @@ public interface DescriptionInterface {
*
* @return map of all descriptions in the form of [locale:description]
*/
public java.util.Map getAllDescriptions();
public Map getAllDescriptions();

/**
* Removes the description element for particular locale.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
*/

package org.netbeans.modules.j2ee.dd.api.common;

import java.util.Map;

/**
* Super interface for all DD elements having the display-name property/properties.
*
Expand Down Expand Up @@ -50,7 +53,7 @@ public interface DisplayNameInterface {
*
* @param displayNames Map of display names in the form of [locale,display-name]
*/
public void setAllDisplayNames(java.util.Map displayNames) throws VersionNotSupportedException;
public void setAllDisplayNames(Map displayNames) throws VersionNotSupportedException;

/**
* Returns the display-name element value for particular locale.<br>
Expand All @@ -73,7 +76,7 @@ public interface DisplayNameInterface {
*
* @return map of all display-names in the form of [locale:display-name]
*/
public java.util.Map getAllDisplayNames();
public Map getAllDisplayNames();

/**
* Removes the display-name element for particular locale.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
public class CmpRelationshipsTableModel extends InnerTableModel {

private EjbJar ejbJar;
private final Map relationshipsHelperMap = new HashMap();
private final Map<EjbRelation, RelationshipHelper> relationshipsHelperMap = new HashMap<>();
private static final String[] COLUMN_NAMES = {Utils.getBundleMessage("LBL_RelationshipName"),
Utils.getBundleMessage("LBL_Cardinality"),
Utils.getBundleMessage("LBL_EntityBean"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ private synchronized boolean setChecking(boolean value) {
}

private void check() {
Map nodeMap = new HashMap();
Map<Object, Node> nodeMap = new HashMap<>();
Children children = getChildren();
Node[] nodes = children.getNodes();
for (int i = 0; i < nodes.length; i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ public class EarActionProvider implements ActionProvider {
private final UpdateHelper updateHelper;

/** Map from commands to ant targets */
Map<String,String[]> commands;
Map<String, String[]> commands;

public EarActionProvider(EarProject project, UpdateHelper updateHelper) {
commands = new HashMap<String, String[]>();
commands = new HashMap<>();
commands.put(COMMAND_BUILD, new String[] {"dist"}); // NOI18N
commands.put(COMMAND_CLEAN, new String[] {"clean"}); // NOI18N
commands.put(COMMAND_REBUILD, new String[] {"clean", "dist"}); // NOI18N
Expand Down Expand Up @@ -407,7 +407,7 @@ private boolean isCosEnabled() {
return Boolean.parseBoolean(project.evaluator().getProperty(EarProjectProperties.J2EE_COMPILE_ON_SAVE));
}

private void collectStartupExtenderArgs(Map p, String command) {
private void collectStartupExtenderArgs(Map<Object, Object> p, String command) {
StringBuilder b = new StringBuilder();
for (String arg : runJvmargsIde(command)) {
b.append(' ').append(arg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ public final class ConfigSupportImpl implements J2eeModuleProvider.ConfigSupport
private static final String GENERIC_EXTENSION = ".dpf"; // NOI18N

private String configurationPrimaryFileName = null;
private Map relativePaths = null;
private Map allRelativePaths = null;
private Map<String, String> relativePaths = null;
private Map<String, String> allRelativePaths = null;

private final J2eeModuleProvider provider;
private final J2eeModule j2eeModule;
Expand Down Expand Up @@ -944,11 +944,11 @@ private J2eeModuleProvider getProvider () {
return provider;
}

private Map getRelativePaths() {
private Map<String, String> getRelativePaths() {
if (relativePaths != null)
return relativePaths;

relativePaths = new HashMap();
relativePaths = new HashMap<>();
if (hasCustomSupport()) {
String [] paths = server.getDeploymentPlanFiles(getModuleType());
configurationPrimaryFileName = paths[0].substring(paths[0].lastIndexOf("/")+1);
Expand All @@ -959,23 +959,23 @@ private Map getRelativePaths() {
return relativePaths;
}

private void collectData(Server server, Map map) {
private void collectData(Server server, Map<String, String> map) {
if (!hasCustomSupport(server, getModuleType()))
return;

String [] paths = server.getDeploymentPlanFiles(getModuleType());
String[] paths = server.getDeploymentPlanFiles(getModuleType());
paths = (paths == null) ? new String[0] : paths;
for (int i=0; i<paths.length; i++) {
String name = paths[i].substring(paths[i].lastIndexOf("/")+1);
map.put(name, paths[i]);
}
}

private Map getAllRelativePaths() {
private Map<String, String> getAllRelativePaths() {
if (allRelativePaths != null)
return allRelativePaths;

allRelativePaths = new HashMap();
allRelativePaths = new HashMap<>();
Collection servers = ServerRegistry.getInstance().getServers();
for (Iterator i=servers.iterator(); i.hasNext();) {
Server server = (Server) i.next();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -497,15 +497,15 @@ public ServerTarget[] getTargets() {
}

public Collection getTargetList() {
Map targets = getTargetMap();
Map<String, ServerTarget> targets = getTargetMap();
synchronized (this) {
return targets.values();
}
}

// PENDING use targets final variable?
private Map getTargetMap() {
Map tmpTargets = null;
private Map<String, ServerTarget> getTargetMap() {
Map<String, ServerTarget> tmpTargets = null;
synchronized (this) {
tmpTargets = targets;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,12 +459,12 @@ private String formatJvmOption(String jvmOption) {
static final String[] sysDatasources = {"jdbc/__TimerPool", "jdbc/__CallFlowPool"}; //NOI18N


public HashMap<String,Map> getSunDatasourcesFromXml(){
HashMap<String,Map> dSources = new HashMap<>();
public HashMap<String, Map<String, String>> getSunDatasourcesFromXml(){
HashMap<String,Map<String, String>> dSources = new HashMap<>();
Document domainDoc = getDomainDocument();
if (domainDoc != null) {
HashMap<String,NamedNodeMap> dsMap = getDataSourcesAttrMap(domainDoc);
HashMap<String,Node> cpMap = getConnPoolsNodeMap(domainDoc);
Map<String,NamedNodeMap> dsMap = getDataSourcesAttrMap(domainDoc);
Map<String,Node> cpMap = getConnPoolsNodeMap(domainDoc);
dsMap.keySet().removeAll(Arrays.asList(sysDatasources));
String[] ds = dsMap.keySet().toArray(new String[dsMap.size()]);

Expand All @@ -479,9 +479,9 @@ public HashMap<String,Map> getSunDatasourcesFromXml(){
return dSources;
}

private Map<String,String> getPoolValues(Map<String, Node> cpMap, String poolName) {
Map<String,String> pValues = new HashMap<>();
Node cpNode = cpMap.get(poolName);
private Map<String, String> getPoolValues(Map<String, Node> cpMap, String poolName) {
Map<String, String> pValues = new HashMap<>();
Node cpNode = (Node) cpMap.get(poolName);
NamedNodeMap cpAttrMap = cpNode.getAttributes();
Node dsClassName = cpAttrMap.getNamedItem(CONST_DS_CLASS);
Node resType = cpAttrMap.getNamedItem(CONST_RES_TYPE);
Expand Down Expand Up @@ -525,8 +525,8 @@ private Map<String,String> getPoolValues(Map<String, Node> cpMap, String poolNam
return pValues;
}

public HashMap<String,Map> getConnPoolsFromXml(){
HashMap<String,Map> pools = new HashMap<>();
public HashMap<String, Map<String, String>> getConnPoolsFromXml(){
HashMap<String, Map<String, String>> pools = new HashMap<>();
Document domainDoc = getDomainDocument();
if (domainDoc != null) {
HashMap<String,Node> cpMap = getConnPoolsNodeMap(domainDoc);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,9 @@ private void createOrReplace(
FileObject targetFO,
FileObject destRoot,
String relativePath,
Map destMap, boolean checkTimeStamps) throws IOException {
Map<String, FileObject> destMap,
boolean checkTimeStamps
) throws IOException {

FileObject destFolder;
OutputStream destStream = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public final class StartTomcat extends StartServer implements ProgressObject {
private ProgressEventSupport pes;
private int currentServerPort; // current server port Tomcat is running on

private static Map isDebugModeUri = Collections.synchronizedMap((Map)new HashMap(2,1));
private static Map<String, Object> isDebugModeUri = Collections.synchronizedMap(new HashMap<>(2,1));

public StartTomcat (DeploymentManager manager) {
assert manager instanceof TomcatManager :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public FreePlaceNodesLayouter( PageFlowScene scene, Rectangle visibleRectangle )
}


private final Map<String,Point> positions = new HashMap<String,Point> ();
private final Map<String, Point> positions = new HashMap<>();
public void layoutNodesLocations( PageFlowScene scene, Collection<Page> nodes) {
final Collection<Page> allNodes = scene.getNodes();
for( Page node : nodes ) {
Expand Down Expand Up @@ -115,7 +115,7 @@ public void addNode( Page node ) {

private final int SEP_X = 250;
private final int SEP_Y = 150;
private Point getNewComponentLocation(PageFlowScene scene, Map positions, Collection<Page> nodes) {
private Point getNewComponentLocation(PageFlowScene scene, Map<String, Point> positions, Collection<Page> nodes) {
for (int a = 0; ; a++) {
for (int b = 0; b <= a; b++) {
final int x = SEP_Y + SEP_X * (a - b);
Expand All @@ -127,7 +127,7 @@ private Point getNewComponentLocation(PageFlowScene scene, Map positions, Collec
}
}

private boolean isThereEmptyPlace(PageFlowScene scene, Map positions, Collection<Page> nodes, int x, int y) {
private boolean isThereEmptyPlace(PageFlowScene scene, Map<String, Point> positions, Collection<Page> nodes, int x, int y) {
final Rectangle rectangle = new Rectangle(x, y, 100, 150);
if (nodes != null) {
for( Page node : nodes) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ protected void addServletElement(Project project, String wsName, String serviceI
boolean addServletEntry = false;
JAXWSSupport wss = JAXWSSupport.getJAXWSSupport(project.getProjectDirectory());
if (wss != null) {
Map properties = wss.getAntProjectHelper().getStandardPropertyEvaluator().getProperties();
Map<String, String> properties = wss.getAntProjectHelper().getStandardPropertyEvaluator().getProperties();
if (properties != null) {
String serverInstance = (String)properties.get("j2ee.server.instance"); //NOI18N
if (serverInstance != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public static FileObject getFolderForPackage(SourceGroup sourceGroup, String pgk
return null;
}

private static Map createFoldersToSourceGroupsMap(final SourceGroup[] sourceGroups) {
private static Map<FileObject, SourceGroup> createFoldersToSourceGroupsMap(final SourceGroup[] sourceGroups) {
Map<FileObject, SourceGroup> result;
if (sourceGroups.length == 0) {
result = Collections.<FileObject, SourceGroup>emptyMap();
Expand All @@ -189,7 +189,7 @@ private static Set<SourceGroup> getTestSourceGroups(SourceGroup[] sourceGroups)
return testGroups;
}

private static List<SourceGroup> getTestTargets(SourceGroup sourceGroup, Map foldersToSourceGroupsMap) {
private static List<SourceGroup> getTestTargets(SourceGroup sourceGroup, Map<FileObject, SourceGroup> foldersToSourceGroupsMap) {
final URL[] rootURLs = UnitTestForSourceQuery.findUnitTests(sourceGroup.getRootFolder());
if (rootURLs.length == 0) {
return new ArrayList<SourceGroup>();
Expand Down
Loading