abdera-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Josh Gordineer <joshg...@gmail.com>
Subject Re: Where did the 1.0-SNAPSHOT go for abdera-i18n ?!?
Date Thu, 17 Jun 2010 00:19:45 GMT
Thanks for the quick response, for the moment we'll just have a local
version of the 1.0-SNAPSHOT so we can apply our patch that was on a class
that ended up going away (Operation.java).

The original issue is in the message below, let me know if this looks like
something that can make it into 1.1.


----- Forwarded Message ----
*From:* Nagesh Susarla <*nagii5@yahoo.com*>
*To:* *user@abdera.apache.org
**Sent:* Thu, March 26, 2009 12:23:06 PM
*Subject:* i18n Template Neg operator impl


Firstly let me say that the URITemplate impl is great and works great for
Recently I came across an issue with the -neg operator which seems to
deviates from the spec. The spec states the following:

3.3.2.  The 'neg' operator

   If all of the variables are un-defined or empty then substitute the
   value of arg, otherwise substitute the empty string.

Template t = new Template("*http://cnn.com/{-neg|all|foo,bar}";*);
Map m = new HashMap();
m.put("foo", "value");
String out = t.expand(m);

out =>  *http://cnn.com/all
Note that the output returns "all" inspite of one of the variables being
declared. If I read correctly, it should return "*http://cnn.com*" instead
of "*http://cnn.com/all*"
Can you please confirm that this is a bug or point me to the correct spec?

After debugging this a bit, it looks like this can be fixed with the
following diff  (I'm looking at the sources from

--- ./org/apache/abdera/i18n/templates/Operation.java    2008-12-19
12:54:26.000000000 -0800
+++ ./patch/Operation.java    2009-03-25 17:39:18.000000000 -0700
@@ -528,9 +528,9 @@
     public String evaluate(String var, String arg, Context context) {
       String[] vardefs = var.split("\\s*,\\s*");
       for (String v : vardefs) {
-        if (!isdefined(v,context)) return arg;
+        if (isdefined(v,context)) return null;
-      return null;
+      return arg;
     public void explain(String var, String arg, Appendable buf) throws
IOException {
       buf.append("If [");

Let me know if you'd like me to file a bug.


------ End of Forwarded Message

On Wed, Jun 16, 2010 at 2:21 PM, ant elder <ant.elder@gmail.com> wrote:

> On Wed, Jun 16, 2010 at 9:55 PM, Josh Gordineer <joshgord@gmail.com>
> wrote:
> > Our project used to depend on the following location but I see that it
> has
> > been removed:
> >
> >
> http://repository.apache.org/snapshots/org/apache/abdera/abdera-i18n/1.0-SNAPSHOT/abdera-i18n-1.0-SNAPSHOT.pom
> >
> > We had a patch for a piece of functionality that was not working as
> defined
> > by the URI templates  (We've previously submitted a bug for this to be
> fixed
> > but doesn't look like it has been in 1.1 We had also asked for that to be
> > fixed in the next release which does not look like it is fixed either - I
> > can forward that info if you are interested).
> >
> > My question is why would the 1.0 snapshot be deleted which would force
> > people to upgrade to the latest (1.1) even though (such as in our case)
> > there are reasons why you would not want to upgrade.
> >
> > Thanks..
> > Josh
> >
> I don't know for sure what happened but i do know that "they" do
> delete old snapshots sometimes, otherwise the snapshot repo would
> become enormous. So perhaps that one was just deleted as 1.0 has been
> release and the snapshot repo now has 1.1 snapshots.
> We're about to do a 1.1 release, i'd be very happy to try to get
> whatever fix or patch you have into that so you can depend on a
> reliable non-snapshot release - what is the JIRA for the bug you have
> reported?
>   ...ant

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message