Remove unnecessary casts
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1044931 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -428,7 +428,7 @@ public class ConfigXMLReader {
|
||||
}
|
||||
|
||||
String cacheId = controllerPartialPath != null ? controllerPartialPath : "NOPARTIALPATH";
|
||||
List<ControllerConfig> controllerConfigs = (List<ControllerConfig>) controllerSearchResultsCache.get(cacheId);
|
||||
List<ControllerConfig> controllerConfigs = controllerSearchResultsCache.get(cacheId);
|
||||
|
||||
if (controllerConfigs == null) {
|
||||
try {
|
||||
|
||||
@@ -851,7 +851,7 @@ public class LoginWorker {
|
||||
|
||||
Map<String, String> x500Map = KeyStoreUtil.getCertX500Map(clientCerts[i]);
|
||||
if (i == 0) {
|
||||
String cn = (String) x500Map.get("CN");
|
||||
String cn = x500Map.get("CN");
|
||||
cn = cn.replaceAll("\\\\", "");
|
||||
Matcher m = pattern.matcher(cn);
|
||||
if (m.matches()) {
|
||||
@@ -933,7 +933,7 @@ public class LoginWorker {
|
||||
String externalKey = request.getParameter(LoginWorker.EXTERNAL_LOGIN_KEY_ATTR);
|
||||
if (externalKey == null) return "success";
|
||||
|
||||
GenericValue userLogin = (GenericValue) LoginWorker.externalLoginKeys.get(externalKey);
|
||||
GenericValue userLogin = LoginWorker.externalLoginKeys.get(externalKey);
|
||||
if (userLogin != null) {
|
||||
//to check it's the right tenant
|
||||
//in case username and password are the same in different tenants
|
||||
|
||||
@@ -87,13 +87,13 @@ public class ProtectViewWorker {
|
||||
}
|
||||
GenericValue protectedView = protectedViews.get(0);
|
||||
// 1st hit ?
|
||||
Long curMaxHits = (Long) hitsByViewAccessed.get(viewNameUserLoginId);
|
||||
Long curMaxHits = hitsByViewAccessed.get(viewNameUserLoginId);
|
||||
if (UtilValidate.isEmpty(curMaxHits)) {
|
||||
hitsByViewAccessed.put(viewNameUserLoginId, one);
|
||||
Long maxHitsDuration = (Long) protectedView.get("maxHitsDuration") * 1000;
|
||||
durationByViewAccessed.put(viewNameUserLoginId, now + maxHitsDuration);
|
||||
} else {
|
||||
Long maxDuration = (Long) durationByViewAccessed.get(viewNameUserLoginId);
|
||||
Long maxDuration = durationByViewAccessed.get(viewNameUserLoginId);
|
||||
Long newMaxHits = (Long) curMaxHits + one;
|
||||
hitsByViewAccessed.put(viewNameUserLoginId, newMaxHits);
|
||||
// Are we in a period of time where we need to check if there was too much hits ?
|
||||
|
||||
@@ -88,10 +88,10 @@ public class WfsEventHandler implements EventHandler {
|
||||
Element queryElem = null;
|
||||
|
||||
try {
|
||||
typeName = (String)request.getParameter("typename");
|
||||
typeName = request.getParameter("typename");
|
||||
//determine if "get" or "post" and get "filter" param accordingly
|
||||
if (UtilValidate.isNotEmpty(typeName)) {
|
||||
String queryFieldCoded = (String)request.getParameter("filter");
|
||||
String queryFieldCoded = request.getParameter("filter");
|
||||
String queryFieldDecoded = UtilFormatOut.decodeQueryValue(queryFieldCoded);
|
||||
Document doc = UtilXml.readXmlDocument(queryFieldDecoded);
|
||||
queryElem = doc.getDocumentElement();
|
||||
|
||||
@@ -300,7 +300,7 @@ public class XmlRpcEventHandler extends XmlRpcHttpServer implements EventHandler
|
||||
context = checkMap(param, String.class, Object.class);
|
||||
} else {
|
||||
if (model.getDefinedInCount() == 1) {
|
||||
String paramName = (String) model.getInParamNames().iterator().next();
|
||||
String paramName = model.getInParamNames().iterator().next();
|
||||
context.put(paramName, xmlRpcReq.getParameter(0));
|
||||
} else {
|
||||
throw new XmlRpcException("More than one parameter defined on service; cannot call via RPC with parameter list");
|
||||
|
||||
@@ -117,7 +117,7 @@ public class RegionManager {
|
||||
newRegion = new Region(idAttr, templateAttr, null);
|
||||
} else {
|
||||
if (UtilValidate.isNotEmpty(regionAttr)) {
|
||||
Region parentRegion = (Region) regions.get(regionAttr);
|
||||
Region parentRegion = regions.get(regionAttr);
|
||||
|
||||
if (parentRegion == null) {
|
||||
throw new IllegalArgumentException("can't find page definition attribute with this key: " + regionAttr);
|
||||
|
||||
@@ -247,23 +247,23 @@ public class ServerHitBin {
|
||||
// save in global, and try to get bin by id
|
||||
switch (type) {
|
||||
case REQUEST:
|
||||
bin = (ServerHitBin) requestSinceStarted.get(id);
|
||||
bin = requestSinceStarted.get(id);
|
||||
break;
|
||||
|
||||
case EVENT:
|
||||
bin = (ServerHitBin) eventSinceStarted.get(id);
|
||||
bin = eventSinceStarted.get(id);
|
||||
break;
|
||||
|
||||
case VIEW:
|
||||
bin = (ServerHitBin) viewSinceStarted.get(id);
|
||||
bin = viewSinceStarted.get(id);
|
||||
break;
|
||||
|
||||
case ENTITY:
|
||||
bin = (ServerHitBin) entitySinceStarted.get(id);
|
||||
bin = entitySinceStarted.get(id);
|
||||
break;
|
||||
|
||||
case SERVICE:
|
||||
bin = (ServerHitBin) serviceSinceStarted.get(id);
|
||||
bin = serviceSinceStarted.get(id);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -271,23 +271,23 @@ public class ServerHitBin {
|
||||
synchronized (ServerHitBin.class) {
|
||||
switch (type) {
|
||||
case REQUEST:
|
||||
bin = (ServerHitBin) requestSinceStarted.get(id);
|
||||
bin = requestSinceStarted.get(id);
|
||||
break;
|
||||
|
||||
case EVENT:
|
||||
bin = (ServerHitBin) eventSinceStarted.get(id);
|
||||
bin = eventSinceStarted.get(id);
|
||||
break;
|
||||
|
||||
case VIEW:
|
||||
bin = (ServerHitBin) viewSinceStarted.get(id);
|
||||
bin = viewSinceStarted.get(id);
|
||||
break;
|
||||
|
||||
case ENTITY:
|
||||
bin = (ServerHitBin) entitySinceStarted.get(id);
|
||||
bin = entitySinceStarted.get(id);
|
||||
break;
|
||||
|
||||
case SERVICE:
|
||||
bin = (ServerHitBin) serviceSinceStarted.get(id);
|
||||
bin = serviceSinceStarted.get(id);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -477,7 +477,7 @@ public class ServerHitBin {
|
||||
|
||||
/** returns (endTime - startTime)/60000 */
|
||||
public double getBinLengthMinutes() {
|
||||
return ((double) this.getBinLength()) / 60000.0;
|
||||
return (this.getBinLength()) / 60000.0;
|
||||
}
|
||||
|
||||
public long getNumberHits() {
|
||||
@@ -493,7 +493,7 @@ public class ServerHitBin {
|
||||
}
|
||||
|
||||
public double getMinTimeSeconds() {
|
||||
return ((double) this.minTime) / 1000.0;
|
||||
return (this.minTime) / 1000.0;
|
||||
}
|
||||
|
||||
public long getMaxTime() {
|
||||
@@ -501,7 +501,7 @@ public class ServerHitBin {
|
||||
}
|
||||
|
||||
public double getMaxTimeSeconds() {
|
||||
return ((double) this.maxTime) / 1000.0;
|
||||
return (this.maxTime) / 1000.0;
|
||||
}
|
||||
|
||||
public double getAvgTime() {
|
||||
@@ -514,7 +514,7 @@ public class ServerHitBin {
|
||||
|
||||
/** return the hits per minute using the entire length of the bin as returned by getBinLengthMinutes() */
|
||||
public double getHitsPerMinute() {
|
||||
return ((double) this.numberHits) / this.getBinLengthMinutes();
|
||||
return (this.numberHits) / this.getBinLengthMinutes();
|
||||
}
|
||||
|
||||
synchronized void addHit(long startTime, long runningTime) {
|
||||
|
||||
Reference in New Issue
Block a user