You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Bertrand Delacretaz <bd...@gmail.com> on 2009/09/22 17:02:16 UTC
Trunk broken, org/apache/jackrabbit/util/Text not found (was: svn
commit: r817554...)
Hi,
The launchpad app and webapp modules don't work in the current trunk,
http://localhost:8888/ says:
java.lang.NoClassDefFoundError: org/apache/jackrabbit/util/Text
at org.apache.jackrabbit.util.ISO9075.encodePath(ISO9075.java:118)
at org.apache.sling.jcr.resource.internal.JcrPropertyMap.read(JcrPropertyMap.java:221)
at org.apache.sling.jcr.resource.internal.JcrPropertyMap.get(JcrPropertyMap.java:97)
which is probably caused by the changes below - I haven't investigated yet.
-Bertrand
On Tue, Sep 22, 2009 at 11:00 AM, <cz...@apache.org> wrote:
> Author: cziegeler
> Date: Tue Sep 22 09:00:58 2009
> New Revision: 817554
>
> URL: http://svn.apache.org/viewvc?rev=817554&view=rev
> Log:
> SLING-1112 : ValueMap doesn't allow "deep property fetching" anymore
>
> Modified:
> sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrModifiablePropertyMap.java
> sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrPropertyMap.java
> sling/trunk/bundles/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/JcrPropertyMapTest.java
>
> Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrModifiablePropertyMap.java
> URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrModifiablePropertyMap.java?rev=817554&r1=817553&r2=817554&view=diff
> ==============================================================================
> --- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrModifiablePropertyMap.java (original)
> +++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrModifiablePropertyMap.java Tue Sep 22 09:00:58 2009
> @@ -46,19 +46,6 @@
> }
>
> // ---------- Map
> -
> - /**
> - * @see java.util.Map#get(java.lang.Object)
> - */
> - public Object get(Object key) {
> - CacheEntry entry = cache.get(key);
> - if (entry == null && !this.fullyRead ) {
> - entry = read((String) key);
> - }
> -
> - return entry == null ? null : entry.defaultValue;
> - }
> -
> /**
> * @see java.util.Map#clear()
> */
> @@ -77,6 +64,9 @@
> * @see java.util.Map#put(java.lang.Object, java.lang.Object)
> */
> public Object put(String key, Object value) {
> + if ( key == null || key.indexOf('/') != -1 ) {
> + throw new IllegalArgumentException("Invalud key: " + key);
> + }
> readFully();
> final Object oldValue = this.get(key);
> try {
> @@ -144,7 +134,7 @@
> try {
> final Node node = getNode();
> for(final String key : this.changedProperties) {
> - final String name = ISO9075.encode(key);
> + final String name = ISO9075.encodePath(key);
> if ( cache.containsKey(key) ) {
> final CacheEntry entry = cache.get(key);
> if ( entry.isMulti ) {
>
> Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrPropertyMap.java
> URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrPropertyMap.java?rev=817554&r1=817553&r2=817554&view=diff
> ==============================================================================
> --- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrPropertyMap.java (original)
> +++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrPropertyMap.java Tue Sep 22 09:00:58 2009
> @@ -212,12 +212,13 @@
> CacheEntry read(final String key) {
>
> // if the node has been completely read, we need not check
> - // again, as we certainly will not find the key
> - if (fullyRead) {
> + // again if the key does not point to a sub node
> + if (fullyRead && key.indexOf('/') == -1 ) {
> + // except if the key contains
> return null;
> }
>
> - final String name = ISO9075.encode(key);
> + final String name = ISO9075.encodePath(key);
> try {
> if (node.hasProperty(name)) {
> final Property prop = node.getProperty(name);
>
> Modified: sling/trunk/bundles/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/JcrPropertyMapTest.java
> URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/JcrPropertyMapTest.java?rev=817554&r1=817553&r2=817554&view=diff
> ==============================================================================
> --- sling/trunk/bundles/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/JcrPropertyMapTest.java (original)
> +++ sling/trunk/bundles/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/JcrPropertyMapTest.java Tue Sep 22 09:00:58 2009
> @@ -234,17 +234,19 @@
> return createPropertyMap(node);
> }
>
> + private static final String TEST_PATH = "a<a";
> +
> public void testNames() throws Exception {
> - this.rootNode.setProperty(ISO9075.encode("a/a"), "value");
> + this.rootNode.setProperty(ISO9075.encodePath(TEST_PATH), "value");
> final ValueMap vm = this.createPropertyMap(this.rootNode);
> - assertEquals("value", vm.get("a/a"));
> + assertEquals("value", vm.get(TEST_PATH));
> }
>
> public void testIerators() throws Exception {
> - this.rootNode.setProperty(ISO9075.encode("a/a"), "value");
> + this.rootNode.setProperty(ISO9075.encodePath(TEST_PATH), "value");
> final ValueMap vm = this.createPropertyMap(this.rootNode);
> - assertTrue(vm.containsKey("a/a"));
> - search(vm.keySet().iterator(), "a/a");
> + assertTrue(vm.containsKey(TEST_PATH));
> + search(vm.keySet().iterator(), TEST_PATH);
> search(vm.values().iterator(), "value");
> }
>
>
>
>
Re: Trunk broken, org/apache/jackrabbit/util/Text not found (was:
svn commit: r817554...)
Posted by Carsten Ziegeler <cz...@apache.org>.
Seems to be my fault - the include for the Text class was missing.
This should be fixed now.
Carsten
Bertrand Delacretaz wrote:
> Hi,
>
> The launchpad app and webapp modules don't work in the current trunk,
> http://localhost:8888/ says:
>
> java.lang.NoClassDefFoundError: org/apache/jackrabbit/util/Text
> at org.apache.jackrabbit.util.ISO9075.encodePath(ISO9075.java:118)
> at org.apache.sling.jcr.resource.internal.JcrPropertyMap.read(JcrPropertyMap.java:221)
> at org.apache.sling.jcr.resource.internal.JcrPropertyMap.get(JcrPropertyMap.java:97)
>
> which is probably caused by the changes below - I haven't investigated yet.
> -Bertrand
>
> On Tue, Sep 22, 2009 at 11:00 AM, <cz...@apache.org> wrote:
>> Author: cziegeler
>> Date: Tue Sep 22 09:00:58 2009
>> New Revision: 817554
>>
>> URL: http://svn.apache.org/viewvc?rev=817554&view=rev
>> Log:
>> SLING-1112 : ValueMap doesn't allow "deep property fetching" anymore
>>
>> Modified:
>> sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrModifiablePropertyMap.java
>> sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrPropertyMap.java
>> sling/trunk/bundles/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/JcrPropertyMapTest.java
>>
>> Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrModifiablePropertyMap.java
>> URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrModifiablePropertyMap.java?rev=817554&r1=817553&r2=817554&view=diff
>> ==============================================================================
>> --- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrModifiablePropertyMap.java (original)
>> +++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrModifiablePropertyMap.java Tue Sep 22 09:00:58 2009
>> @@ -46,19 +46,6 @@
>> }
>>
>> // ---------- Map
>> -
>> - /**
>> - * @see java.util.Map#get(java.lang.Object)
>> - */
>> - public Object get(Object key) {
>> - CacheEntry entry = cache.get(key);
>> - if (entry == null && !this.fullyRead ) {
>> - entry = read((String) key);
>> - }
>> -
>> - return entry == null ? null : entry.defaultValue;
>> - }
>> -
>> /**
>> * @see java.util.Map#clear()
>> */
>> @@ -77,6 +64,9 @@
>> * @see java.util.Map#put(java.lang.Object, java.lang.Object)
>> */
>> public Object put(String key, Object value) {
>> + if ( key == null || key.indexOf('/') != -1 ) {
>> + throw new IllegalArgumentException("Invalud key: " + key);
>> + }
>> readFully();
>> final Object oldValue = this.get(key);
>> try {
>> @@ -144,7 +134,7 @@
>> try {
>> final Node node = getNode();
>> for(final String key : this.changedProperties) {
>> - final String name = ISO9075.encode(key);
>> + final String name = ISO9075.encodePath(key);
>> if ( cache.containsKey(key) ) {
>> final CacheEntry entry = cache.get(key);
>> if ( entry.isMulti ) {
>>
>> Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrPropertyMap.java
>> URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrPropertyMap.java?rev=817554&r1=817553&r2=817554&view=diff
>> ==============================================================================
>> --- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrPropertyMap.java (original)
>> +++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrPropertyMap.java Tue Sep 22 09:00:58 2009
>> @@ -212,12 +212,13 @@
>> CacheEntry read(final String key) {
>>
>> // if the node has been completely read, we need not check
>> - // again, as we certainly will not find the key
>> - if (fullyRead) {
>> + // again if the key does not point to a sub node
>> + if (fullyRead && key.indexOf('/') == -1 ) {
>> + // except if the key contains
>> return null;
>> }
>>
>> - final String name = ISO9075.encode(key);
>> + final String name = ISO9075.encodePath(key);
>> try {
>> if (node.hasProperty(name)) {
>> final Property prop = node.getProperty(name);
>>
>> Modified: sling/trunk/bundles/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/JcrPropertyMapTest.java
>> URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/JcrPropertyMapTest.java?rev=817554&r1=817553&r2=817554&view=diff
>> ==============================================================================
>> --- sling/trunk/bundles/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/JcrPropertyMapTest.java (original)
>> +++ sling/trunk/bundles/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/JcrPropertyMapTest.java Tue Sep 22 09:00:58 2009
>> @@ -234,17 +234,19 @@
>> return createPropertyMap(node);
>> }
>>
>> + private static final String TEST_PATH = "a<a";
>> +
>> public void testNames() throws Exception {
>> - this.rootNode.setProperty(ISO9075.encode("a/a"), "value");
>> + this.rootNode.setProperty(ISO9075.encodePath(TEST_PATH), "value");
>> final ValueMap vm = this.createPropertyMap(this.rootNode);
>> - assertEquals("value", vm.get("a/a"));
>> + assertEquals("value", vm.get(TEST_PATH));
>> }
>>
>> public void testIerators() throws Exception {
>> - this.rootNode.setProperty(ISO9075.encode("a/a"), "value");
>> + this.rootNode.setProperty(ISO9075.encodePath(TEST_PATH), "value");
>> final ValueMap vm = this.createPropertyMap(this.rootNode);
>> - assertTrue(vm.containsKey("a/a"));
>> - search(vm.keySet().iterator(), "a/a");
>> + assertTrue(vm.containsKey(TEST_PATH));
>> + search(vm.keySet().iterator(), TEST_PATH);
>> search(vm.values().iterator(), "value");
>> }
>>
>>
>>
>>
>
--
Carsten Ziegeler
cziegeler@apache.org