[jboss-cvs] JBossAS SVN: r70727 - in projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/joinpoint/graph/tree/search: match and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Mar 11 01:14:38 EDT 2008
Author: flavia.rainone at jboss.com
Date: 2008-03-11 01:14:37 -0400 (Tue, 11 Mar 2008)
New Revision: 70727
Modified:
projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/joinpoint/graph/tree/search/element/ComparableElementFactory.java
projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/joinpoint/graph/tree/search/match/MatcherFactory.java
Log:
[JBAOP-503] Added support for .. in the middle of a search key.
Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/joinpoint/graph/tree/search/element/ComparableElementFactory.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/joinpoint/graph/tree/search/element/ComparableElementFactory.java 2008-03-11 04:51:15 UTC (rev 70726)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/joinpoint/graph/tree/search/element/ComparableElementFactory.java 2008-03-11 05:14:37 UTC (rev 70727)
@@ -79,11 +79,11 @@
// sequence for prefix part
this.profiles[MatcherProfile.PREFIX.getId()] = new MatcherSequenceProfile(
MatcherProfile.SIMPLE, MatcherProfile.SIMPLE,
- MatcherProfile.PREFIX, null, MatcherProfile.PREFIX);
+ MatcherProfile.PREFIX, MatcherProfile.SUFFIX, MatcherProfile.PREFIX);
// sequence for pattern part
this.profiles[MatcherProfile.PATTERN.getId()] = new MatcherSequenceProfile(
MatcherProfile.SUFFIX, MatcherProfile.SIMPLE,
- MatcherProfile.PREFIX, null, MatcherProfile.PATTERN);
+ MatcherProfile.PREFIX, MatcherProfile.SUFFIX, MatcherProfile.PATTERN);
// sequence for suffix part
this.profiles[MatcherProfile.SUFFIX.getId()] = new MatcherSequenceProfile(
MatcherProfile.SUFFIX, MatcherProfile.SIMPLE,
Modified: projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/joinpoint/graph/tree/search/match/MatcherFactory.java
===================================================================
--- projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/joinpoint/graph/tree/search/match/MatcherFactory.java 2008-03-11 04:51:15 UTC (rev 70726)
+++ projects/aop/branches/joinpoint_graph/aop/src/main/org/jboss/aop/joinpoint/graph/tree/search/match/MatcherFactory.java 2008-03-11 05:14:37 UTC (rev 70727)
@@ -99,13 +99,25 @@
matchers.add(new Matcher(profile.firstMatcherProfile, comparable));
begin = end + 1;
end = matchableExpression.indexOf(separator, begin);
+ MatcherProfile currentProfile = null;
// create middle matchers
while (end > 0)
{
- expression = matchableExpression.substring(begin, end);
- comparable = comparableFactory.create(expression,
- profile.middleMatchersProfile);
- matchers.add(new Matcher(profile.middleMatchersProfile, comparable));
+ if (begin == end)
+ {
+ begin = end + 1;
+ end = matchableExpression.indexOf(separator, begin);
+ expression = matchableExpression.substring(begin, end);
+ currentProfile = profile.doubleSeparatorMatcherProfile;
+ comparable = comparableFactory.create(expression, currentProfile);
+ }
+ else
+ {
+ expression = matchableExpression.substring(begin, end);
+ currentProfile = profile.middleMatchersProfile;
+ comparable = comparableFactory.create(expression, currentProfile);
+ }
+ matchers.add(new Matcher(currentProfile, comparable));
begin = end + 1;
end = matchableExpression.indexOf(separator, begin);
}
More information about the jboss-cvs-commits
mailing list