[infinispan-issues] [JBoss JIRA] Commented: (ISPN-1210) TreeCache getData method returns null Map

Annadurai Narayanan (JIRA) jira-events at lists.jboss.org
Tue Jun 28 16:35:23 EDT 2011


    [ https://issues.jboss.org/browse/ISPN-1210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12611633#comment-12611633 ] 

Annadurai Narayanan commented on ISPN-1210:
-------------------------------------------

find the problem in TreeCacheImpl.java at line 338. 

public Map<K, V> getData(Fqn fqn) {
      startAtomic();
      try {
         Node<K, V> node = getNode(fqn);
         if (node != null) // node is not null then return the node.getData()
            return null; // this is wrong.
         else
            return node.getData();
      }
      finally {
         endAtomic();
      }
   }

> TreeCache getData method returns null Map
> -----------------------------------------
>
>                 Key: ISPN-1210
>                 URL: https://issues.jboss.org/browse/ISPN-1210
>             Project: Infinispan
>          Issue Type: Bug
>          Components: Tree API
>    Affects Versions: 5.0.0.CR6
>         Environment: Windows OS
>            Reporter: Annadurai Narayanan
>            Assignee: Manik Surtani
>            Priority: Blocker
>
> TreeCache getData() method returns null instead of mapped value from the node. Please see the unit test case written in junit.
> public class TreeCacheTest extends Assert {
> 	
> 	
> 	@Test
> 	public void testTreeCache() {
> 		Configuration c = new Configuration();
> 	    c.setInvocationBatchingEnabled(true);
> 		TreeCache<Object, Object> cache = new TreeCacheFactory().createTreeCache(new DefaultCacheManager(c).getCache());
> 		
> 		cache.put(Fqn.fromRelativeFqn(getBase(), Fqn.fromString("TRADE")),"key1","TRADE1");
> 		cache.put(Fqn.fromRelativeFqn(getBase(), Fqn.fromString("TRADE")),"key2","TRADE2");
> 		cache.put(Fqn.fromRelativeFqn(getBase(), Fqn.fromString("TRADE")),"key3","TRADE3");
> 		cache.put(Fqn.fromRelativeFqn(getBase(), Fqn.fromString("TRADE")),"key4","TRADE4");
> 		cache.put(Fqn.fromRelativeFqn(getBase(), Fqn.fromString("TRADE")),"key5","TRADE5");
> 		cache.put(Fqn.fromRelativeFqn(getBase(), Fqn.fromString("TRADE")),"key6","TRADE6");
> 		cache.put(Fqn.fromRelativeFqn(getBase(), Fqn.fromString("TRADE")),"key7","TRADE7");
> 		Object object = cache.get(Fqn.fromRelativeFqn(getBase(), Fqn.fromString("TRADE")),"key7");
> 		assertNotNull(object);
> 		Map<Object, Object> data = cache.getData(Fqn.fromRelativeFqn(getBase(), Fqn.fromString("TRADE")));
> 		assertNotNull(data);
> 	}
> 	
> 	private Fqn getBase() {
> 		return Fqn.fromString("SYSTEMSTATUS");
> 	}
> }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the infinispan-issues mailing list