Author: jonesde
Date: Wed Mar 5 23:40:48 2008 New Revision: 634183 URL: http://svn.apache.org/viewvc?rev=634183&view=rev Log: Fixed issue with java parsing; fixed caching for ArtifactInfoFactory; small cleanups Modified: ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilJavaParse.java ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaCondition.java ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ArtifactInfoFactory.java ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ServiceArtifactInfo.java Modified: ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilJavaParse.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilJavaParse.java?rev=634183&r1=634182&r2=634183&view=diff ============================================================================== --- ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilJavaParse.java (original) +++ ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilJavaParse.java Wed Mar 5 23:40:48 2008 @@ -138,14 +138,12 @@ // find the service name int openQuoteIndex = javaFile.indexOf("\"", openParenIndex); int closeQuoteIndex = javaFile.indexOf("\"", openQuoteIndex+1); - if (openQuoteIndex - openParenIndex > 3 || openQuoteIndex < 0 || closeQuoteIndex < 0) { + if (openQuoteIndex - openParenIndex <= 3 && openQuoteIndex >= 0 && closeQuoteIndex >= 0) { //more than two spaces/chars between quote and open paren... consider it something other than what we are looking for - continue; + String serviceName = javaFile.substring(openQuoteIndex+1, closeQuoteIndex).trim(); + //Debug.logInfo("In findServiceCallsInBlock found serviceName [" + serviceName + "]", module); + serviceNameSet.add(serviceName); } - String serviceName = javaFile.substring(openQuoteIndex+1, closeQuoteIndex).trim(); - //Debug.logInfo("In findServiceCallsInBlock found serviceName [" + serviceName + "]", module); - - serviceNameSet.add(serviceName); } dispatcherIndex = javaFile.indexOf("dispatcher.", openParenIndex); @@ -212,14 +210,12 @@ // find the entity name int openQuoteIndex = javaFile.indexOf("\"", openParenIndex); int closeQuoteIndex = javaFile.indexOf("\"", openQuoteIndex+1); - if (openQuoteIndex - openParenIndex > 3 || openQuoteIndex < 0 || closeQuoteIndex < 0) { + if (openQuoteIndex - openParenIndex <= 3 && openQuoteIndex >= 0 && closeQuoteIndex >= 0) { //more than two spaces/chars between quote and open paren... consider it something other than what we are looking for - continue; + String entityName = javaFile.substring(openQuoteIndex+1, closeQuoteIndex).trim(); + //Debug.logInfo("In findServiceCallsInBlock found valid entityName [" + entityName + "]", module); + entityNameSet.add(entityName); } - String entityName = javaFile.substring(openQuoteIndex+1, closeQuoteIndex).trim(); - //Debug.logInfo("In findServiceCallsInBlock found valid entityName [" + entityName + "]", module); - - entityNameSet.add(entityName); } delegatorIndex = javaFile.indexOf("delegator.", openParenIndex); Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaCondition.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaCondition.java?rev=634183&r1=634182&r2=634183&view=diff ============================================================================== --- ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaCondition.java (original) +++ ofbiz/trunk/framework/service/src/org/ofbiz/service/eca/ServiceEcaCondition.java Wed Mar 5 23:40:48 2008 @@ -96,8 +96,14 @@ buf.append(rhsValueName); if (moreDetail) { - if (UtilValidate.isNotEmpty(compareType)) buf.append(compareType); - if (UtilValidate.isNotEmpty(format)) buf.append(format); + if (UtilValidate.isNotEmpty(compareType)) { + buf.append("-"); + buf.append(compareType); + } + if (UtilValidate.isNotEmpty(format)) { + buf.append(";"); + buf.append(format); + } } buf.append("]"); Modified: ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java?rev=634183&r1=634182&r2=634183&view=diff ============================================================================== --- ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java (original) +++ ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/WebToolsServices.java Wed Mar 5 23:40:48 2008 @@ -1041,7 +1041,7 @@ } try { - ArtifactInfoFactory aif = ArtifactInfoFactory.makeArtifactInfoFactory("default"); + ArtifactInfoFactory aif = ArtifactInfoFactory.getArtifactInfoFactory("default"); ServiceArtifactInfo serviceInfo = aif.getServiceArtifactInfo(serviceName); serviceInfo.writeServiceCallGraphEoModel(eomodeldFullPath); } catch (GeneralException e) { Modified: ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ArtifactInfoFactory.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ArtifactInfoFactory.java?rev=634183&r1=634182&r2=634183&view=diff ============================================================================== --- ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ArtifactInfoFactory.java (original) +++ ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ArtifactInfoFactory.java Wed Mar 5 23:40:48 2008 @@ -77,7 +77,7 @@ public Map<ServiceEcaRule, Set<ServiceArtifactInfo>> allServiceInfosReferringToServiceEcaRule = FastMap.newInstance(); - public static ArtifactInfoFactory makeArtifactInfoFactory(String delegatorName) throws GeneralException { + public static ArtifactInfoFactory getArtifactInfoFactory(String delegatorName) throws GeneralException { if (UtilValidate.isEmpty(delegatorName)) { delegatorName = "default"; } @@ -85,6 +85,7 @@ ArtifactInfoFactory aif = artifactInfoFactoryCache.get(delegatorName); if (aif == null) { aif = new ArtifactInfoFactory(delegatorName); + artifactInfoFactoryCache.put(delegatorName, aif); } return aif; } Modified: ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ServiceArtifactInfo.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ServiceArtifactInfo.java?rev=634183&r1=634182&r2=634183&view=diff ============================================================================== --- ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ServiceArtifactInfo.java (original) +++ ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ServiceArtifactInfo.java Wed Mar 5 23:40:48 2008 @@ -304,7 +304,7 @@ if (callingServiceSet != null) { // set the prefix and add to the all list for (ServiceArtifactInfo callingService: callingServiceSet) { - callingService.setDisplayPrefix("Calling_"); + callingService.setDisplayPrefix("Calling:"); allDiagramEntitiesWithPrefixes.add(callingService.getDisplayPrefixedName()); allServiceList.add(callingService); } @@ -314,7 +314,7 @@ Set<ServiceArtifactInfo> calledServiceSet = this.getServicesCalledByService(); for (ServiceArtifactInfo calledService: calledServiceSet) { - calledService.setDisplayPrefix("Called_"); + calledService.setDisplayPrefix("Called:"); allDiagramEntitiesWithPrefixes.add(calledService.getDisplayPrefixedName()); allServiceList.add(calledService); } @@ -323,7 +323,7 @@ Set<ServiceEcaArtifactInfo> callingServiceEcaSet = this.getServiceEcaRulesCallingService(); if (callingServiceEcaSet != null) { for (ServiceEcaArtifactInfo callingServiceEca: callingServiceEcaSet) { - callingServiceEca.setDisplayPrefix("Triggering_"); + callingServiceEca.setDisplayPrefix("Triggering:"); allDiagramEntitiesWithPrefixes.add(callingServiceEca.getDisplayPrefixedName()); allServiceEcaList.add(callingServiceEca); } @@ -333,7 +333,7 @@ Set<ServiceEcaArtifactInfo> calledServiceEcaSet = this.getServiceEcaRulesTriggeredByService(); for (ServiceEcaArtifactInfo calledServiceEca: calledServiceEcaSet) { - calledServiceEca.setDisplayPrefix("Called_"); + calledServiceEca.setDisplayPrefix("Called:"); allDiagramEntitiesWithPrefixes.add(calledServiceEca.getDisplayPrefixedName()); allServiceEcaList.add(calledServiceEca); } |
Free forum by Nabble | Edit this page |