nus-yam/ex-repair huggingface dataset:
Program: 46857
Project: 46857
Buggy source:
/** 
 * Execute on key.
 * @param sessionId the session id
 * @param processor the processor
 * @return the object
 * @throws Exception the exception
 */
Object executeOnKey(String sessionId,EntryProcessor processor) throws Exception {
  try {
    ensureInstance();
    if (processor instanceof JvmIdAware) {
      ((JvmIdAware)processor).setJvmId(jvmId);
    }
    return clusterMap.executeOnKey(sessionId,processor);
  }
 catch (  Exception e) {
    failedConnection=true;
    throw e;
  }
}

Fixed version (ground truth):
/** 
 * Execute on key.
 * @param sessionId the session id
 * @param processor the processor
 * @return the object
 * @throws Exception
 */
Object executeOnKey(String sessionId,EntryProcessor processor) throws Exception {
  try {
    if (processor instanceof JvmIdAware) {
      ((JvmIdAware)processor).setJvmId(jvmId);
    }
    return clusterMap.executeOnKey(sessionId,processor);
  }
 catch (  Exception e) {
    LOGGER.finest("String_Node_Str",e);
    throw e;
  }
}
Program: 46858
Project: 46858
Buggy source:
public Object getAttribute(final String name){
  LocalCacheEntry cacheEntry=localCache.get(name);
  Object value=null;
  if (cacheEntry == null || cacheEntry.isReload()) {
    try {
      value=webFilter.getClusteredSessionService().getAttribute(id,name);
      cacheEntry=new LocalCacheEntry(false,value);
      cacheEntry.setReload(false);
      localCache.put(name,cacheEntry);
    }
 catch (    Exception e) {
      WebFilter.LOGGER.warning("String_Node_Str",e);
      if (cacheEntry == null) {
        return null;
      }
    }
  }
  if (cacheEntry.isRemoved()) {
    return null;
  }
  return cacheEntry.getValue();
}

Fixed version (ground truth):
public Object getAttribute(final String name){
  LocalCacheEntry cacheEntry=localCache.get(name);
  Object value=null;
  if (cacheEntry == null || cacheEntry.isReload()) {
    try {
      value=webFilter.getClusteredSessionService().getAttribute(id,name);
      cacheEntry=new LocalCacheEntry(false,value);
      cacheEntry.setReload(false);
      localCache.put(name,cacheEntry);
    }
 catch (    Exception e) {
      if (WebFilter.LOGGER.isFinestEnabled()) {
        WebFilter.LOGGER.finest("String_Node_Str",e);
      }
      if (cacheEntry == null) {
        return null;
      }
    }
  }
  if (cacheEntry.isRemoved()) {
    return null;
  }
  return cacheEntry.getValue();
}
Program: 46859
Project: 46859
Buggy source:
public static HazelcastInstance createInstance(final FilterConfig filterConfig,final Properties properties) throws ServletException {
  final String instanceName=properties.getProperty(INSTANCE_NAME);
  final String configLocation=properties.getProperty(CONFIG_LOCATION);
  final String useClientProp=properties.getProperty(USE_CLIENT);
  final String clientConfigLocation=properties.getProperty(CLIENT_CONFIG_LOCATION);
  final boolean useClient=!isEmpty(useClientProp) && Boolean.parseBoolean(useClientProp);
  URL configUrl=null;
  if (useClient && !isEmpty(clientConfigLocation)) {
    configUrl=getConfigURL(filterConfig,clientConfigLocation);
  }
 else   if (!isEmpty(configLocation)) {
    configUrl=getConfigURL(filterConfig,configLocation);
  }
  if (useClient) {
    return createClientInstance(configUrl);
  }
  Config config;
  if (configUrl == null) {
    config=new XmlConfigBuilder().build();
  }
 else {
    try {
      config=new UrlXmlConfig(configUrl);
    }
 catch (    IOException e) {
      throw new ServletException(e);
    }
  }
  return createHazelcastInstance(instanceName,config);
}

Fixed version (ground truth):
public static HazelcastInstance createInstance(final ClusteredSessionService sessionService,final FilterConfig filterConfig,final Properties properties) throws ServletException {
  final String instanceName=properties.getProperty(INSTANCE_NAME);
  final String configLocation=properties.getProperty(CONFIG_LOCATION);
  final String useClientProp=properties.getProperty(USE_CLIENT);
  final String clientConfigLocation=properties.getProperty(CLIENT_CONFIG_LOCATION);
  final boolean useClient=!isEmpty(useClientProp) && Boolean.parseBoolean(useClientProp);
  URL configUrl=null;
  if (useClient && !isEmpty(clientConfigLocation)) {
    configUrl=getConfigURL(filterConfig,clientConfigLocation);
  }
 else   if (!isEmpty(configLocation)) {
    configUrl=getConfigURL(filterConfig,configLocation);
  }
  if (useClient) {
    boolean isSticky=Boolean.valueOf(properties.getProperty(STICKY_SESSION_CONFIG));
    return createClientInstance(sessionService,configUrl,isSticky);
  }
  Config config;
  if (configUrl == null) {
    config=new XmlConfigBuilder().build();
  }
 else {
    try {
      config=new UrlXmlConfig(configUrl);
    }
 catch (    IOException e) {
      throw new ServletException(e);
    }
  }
  return createHazelcastInstance(sessionService,instanceName,config);
}
Program: 46860
Project: 46860
Buggy source:
private static HazelcastInstance createHazelcastInstance(String instanceName,Config config){
  if (!isEmpty(instanceName)) {
    if (LOGGER.isLoggable(Level.INFO)) {
      LOGGER.info(format("String_Node_Str",instanceName));
    }
    config.setInstanceName(instanceName);
    return Hazelcast.getOrCreateHazelcastInstance(config);
  }
 else {
    LOGGER.info("String_Node_Str");
    return Hazelcast.newHazelcastInstance(config);
  }
}

Fixed version (ground truth):
private static HazelcastInstance createHazelcastInstance(ClusteredSessionService sessionService,String instanceName,Config config){
  ListenerConfig listenerConfig=new ListenerConfig(new ServerLifecycleListener(sessionService));
  config.addListenerConfig(listenerConfig);
  if (!isEmpty(instanceName)) {
    if (LOGGER.isLoggable(Level.INFO)) {
      LOGGER.info(format("String_Node_Str",instanceName));
    }
    config.setInstanceName(instanceName);
    return Hazelcast.getOrCreateHazelcastInstance(config);
  }
 else {
    LOGGER.info("String_Node_Str");
    return Hazelcast.newHazelcastInstance(config);
  }
}
Program: 46861
Project: 46861
Buggy source:
private static HazelcastInstance createClientInstance(URL configUrl) throws ServletException {
  LOGGER.warning("String_Node_Str");
  LOGGER.warning("String_Node_Str");
  ClientConfig clientConfig;
  if (configUrl == null) {
    clientConfig=new ClientConfig();
  }
 else {
    try {
      clientConfig=new XmlClientConfigBuilder(configUrl).build();
    }
 catch (    IOException e) {
      throw new ServletException(e);
    }
  }
  clientConfig.getNetworkConfig().setConnectionAttemptLimit(1);
  return HazelcastClient.newHazelcastClient(clientConfig);
}

Fixed version (ground truth):
private static HazelcastInstance createClientInstance(ClusteredSessionService sessionService,URL configUrl,boolean isSticky) throws ServletException {
  LOGGER.warning("String_Node_Str");
  LOGGER.warning("String_Node_Str");
  ClientConfig clientConfig;
  if (configUrl == null) {
    clientConfig=new ClientConfig();
  }
 else {
    try {
      clientConfig=new XmlClientConfigBuilder(configUrl).build();
    }
 catch (    IOException e) {
      throw new ServletException(e);
    }
  }
  if (isSticky) {
    clientConfig.getNetworkConfig().setConnectionAttemptLimit(1);
  }
  ListenerConfig listenerConfig=new ListenerConfig(new ClientLifecycleListener(sessionService));
  clientConfig.addListenerConfig(listenerConfig);
  return HazelcastClient.newHazelcastClient(clientConfig);
}
Program: 46862
Project: 46862
Buggy source:
private static String generateSessionId(){
  final String id=UUID.randomUUID().toString();
  final StringBuilder sb=new StringBuilder("String_Node_Str");
  final char[] chars=id.toCharArray();
  for (  final char c : chars) {
    if (c != '-') {
      if (Character.isLetter(c)) {
        sb.append(Character.toUpperCase(c));
      }
 else {
        sb.append(c);
      }
    }
  }
  return sb.toString();
}

Fixed version (ground truth):
private static String generateSessionId(){
  String id=UUID.randomUUID().toString();
  StringBuilder sb=new StringBuilder("String_Node_Str");
  char[] chars=id.toCharArray();
  for (  final char c : chars) {
    if (c != '-') {
      if (Character.isLetter(c)) {
        sb.append(Character.toUpperCase(c));
      }
 else {
        sb.append(c);
      }
    }
  }
  return sb.toString();
}
Program: 46863
Project: 46863
Buggy source:
private void loadProperties() throws ServletException {
  if (properties == null) {
    properties=new Properties();
  }
  setProperty(HazelcastInstanceLoader.CONFIG_LOCATION);
  setProperty(HazelcastInstanceLoader.INSTANCE_NAME);
  setProperty(HazelcastInstanceLoader.USE_CLIENT);
  setProperty(HazelcastInstanceLoader.CLIENT_CONFIG_LOCATION);
}

Fixed version (ground truth):
private void loadProperties() throws ServletException {
  if (properties == null) {
    properties=new Properties();
  }
  setProperty(HazelcastInstanceLoader.CONFIG_LOCATION);
  setProperty(HazelcastInstanceLoader.INSTANCE_NAME);
  setProperty(HazelcastInstanceLoader.USE_CLIENT);
  setProperty(HazelcastInstanceLoader.CLIENT_CONFIG_LOCATION);
  setProperty(HazelcastInstanceLoader.STICKY_SESSION_CONFIG);
}
Program: 46864
Project: 46864
Buggy source:
public final void init(final FilterConfig config) throws ServletException {
  filterConfig=config;
  servletContext=config.getServletContext();
  servletContext.setAttribute(WEB_FILTER_ATTRIBUTE_KEY,this);
  loadProperties();
  initCookieParams();
  initParams();
  String mapName=getParam("String_Node_Str");
  if (mapName == null) {
    mapName="String_Node_Str" + servletContext.getServletContextName();
  }
  String sessionTTL=getParam("String_Node_Str");
  clusteredSessionService=new ClusteredSessionService(filterConfig,properties,mapName,sessionTTL);
  if (LOGGER.isLoggable(Level.FINEST)) {
    LOGGER.finest("String_Node_Str" + stickySession + "String_Node_Str"+ shutdownOnDestroy+ "String_Node_Str"+ mapName);
  }
}

Fixed version (ground truth):
public final void init(final FilterConfig config) throws ServletException {
  filterConfig=config;
  servletContext=config.getServletContext();
  servletContext.setAttribute(WEB_FILTER_ATTRIBUTE_KEY,this);
  loadProperties();
  initCookieParams();
  initParams();
  String mapName=getParam("String_Node_Str");
  if (mapName == null) {
    mapName="String_Node_Str" + servletContext.getServletContextName();
  }
  clusteredSessionService=new ClusteredSessionService(filterConfig,properties,mapName);
  if (LOGGER.isLoggable(Level.FINEST)) {
    LOGGER.finest("String_Node_Str" + stickySession + "String_Node_Str"+ shutdownOnDestroy+ "String_Node_Str"+ mapName);
  }
}
Program: 46865
Project: 46865
Buggy source:
public void invalidate(){
  webFilter.destroySession(this,true);
  originalSession.invalidate();
}

Fixed version (ground truth):
public void invalidate(){
  webFilter.destroySession(this,true);
  originalSession.invalidate();
  invalidatedOriginalSessionId=originalSession.getId();
}
Program: 46866
Project: 46866
Buggy source:
private HazelcastHttpSession readSessionFromLocal(){
  if (hazelcastSession != null && !hazelcastSession.isValid()) {
    LOGGER.finest("String_Node_Str");
    destroySession(hazelcastSession,true);
    hazelcastSession=null;
  }
 else   if (hazelcastSession != null) {
    return hazelcastSession;
  }
  HttpSession originalSession=getOriginalSession(false);
  if (originalSession != null) {
    String hazelcastSessionId=originalSessions.get(originalSession.getId());
    if (hazelcastSessionId != null) {
      hazelcastSession=sessions.get(hazelcastSessionId);
      if (hazelcastSession != null && !hazelcastSession.isStickySession()) {
        hazelcastSession.updateReloadFlag();
      }
      return hazelcastSession;
    }
    originalSessions.remove(originalSession.getId());
    originalSession.invalidate();
  }
  if (clusteredSessionId != null) {
    hazelcastSession=sessions.get(clusteredSessionId);
  }
  return readFromCookie();
}

Fixed version (ground truth):
private HazelcastHttpSession readSessionFromLocal(){
  String invalidatedOriginalSessionId=null;
  if (hazelcastSession != null && !hazelcastSession.isValid()) {
    LOGGER.finest("String_Node_Str");
    destroySession(hazelcastSession,true);
    invalidatedOriginalSessionId=hazelcastSession.invalidatedOriginalSessionId;
    hazelcastSession=null;
  }
 else   if (hazelcastSession != null) {
    return hazelcastSession;
  }
  HttpSession originalSession=getOriginalSession(false);
  if (originalSession != null) {
    String hazelcastSessionId=originalSessions.get(originalSession.getId());
    if (hazelcastSessionId != null) {
      hazelcastSession=sessions.get(hazelcastSessionId);
      if (hazelcastSession != null && !hazelcastSession.isStickySession()) {
        hazelcastSession.updateReloadFlag();
      }
      return hazelcastSession;
    }
    if (!originalSession.getId().equals(invalidatedOriginalSessionId)) {
      originalSession.invalidate();
    }
  }
  if (clusteredSessionId != null) {
    hazelcastSession=sessions.get(clusteredSessionId);
  }
  return readFromCookie();
}
Program: 46867
Project: 46867
Buggy source:
public void invalidate(){
  webFilter.destroySession(this,true);
  originalSession.invalidate();
}

Fixed version (ground truth):
public void invalidate(){
  webFilter.destroySession(this,true);
  originalSession.invalidate();
  invalidatedOriginalSessionId=originalSession.getId();
}
Program: 46868
Project: 46868
Buggy source:
private HazelcastHttpSession readSessionFromLocal(){
  if (hazelcastSession != null && !hazelcastSession.isValid()) {
    LOGGER.finest("String_Node_Str");
    destroySession(hazelcastSession,true);
    hazelcastSession=null;
  }
 else   if (hazelcastSession != null) {
    return hazelcastSession;
  }
  HttpSession originalSession=getOriginalSession(false);
  if (originalSession != null) {
    String hazelcastSessionId=originalSessions.get(originalSession.getId());
    if (hazelcastSessionId != null) {
      hazelcastSession=sessions.get(hazelcastSessionId);
      if (hazelcastSession != null && !hazelcastSession.isStickySession()) {
        hazelcastSession.updateReloadFlag();
      }
      return hazelcastSession;
    }
    originalSessions.remove(originalSession.getId());
    originalSession.invalidate();
  }
  if (clusteredSessionId != null) {
    hazelcastSession=sessions.get(clusteredSessionId);
  }
  return readFromCookie();
}

Fixed version (ground truth):
private HazelcastHttpSession readSessionFromLocal(){
  String invalidatedOriginalSessionId=null;
  if (hazelcastSession != null && !hazelcastSession.isValid()) {
    LOGGER.finest("String_Node_Str");
    destroySession(hazelcastSession,true);
    invalidatedOriginalSessionId=hazelcastSession.invalidatedOriginalSessionId;
    hazelcastSession=null;
  }
 else   if (hazelcastSession != null) {
    return hazelcastSession;
  }
  HttpSession originalSession=getOriginalSession(false);
  if (originalSession != null) {
    String hazelcastSessionId=originalSessions.get(originalSession.getId());
    if (hazelcastSessionId != null) {
      hazelcastSession=sessions.get(hazelcastSessionId);
      if (hazelcastSession != null && !hazelcastSession.isStickySession()) {
        hazelcastSession.updateReloadFlag();
      }
      return hazelcastSession;
    }
    if (!originalSession.getId().equals(invalidatedOriginalSessionId)) {
      originalSession.invalidate();
    }
  }
  if (clusteredSessionId != null) {
    hazelcastSession=sessions.get(clusteredSessionId);
  }
  return readFromCookie();
}
Program: 46869
Project: 46869
Buggy source:
static void remove(HazelcastInstanceImpl instance){
  OutOfMemoryErrorDispatcher.deregisterServer(instance);
  InstanceFuture future=INSTANCE_MAP.remove(instance.getName());
  if (future != null) {
    future.get().original=null;
  }
  if (INSTANCE_MAP.size() == 0) {
    ManagementService.shutdownAll();
  }
}

Fixed version (ground truth):
static void remove(HazelcastInstanceImpl instance){
  OutOfMemoryErrorDispatcher.deregisterServer(instance);
  InstanceFuture future=INSTANCE_MAP.remove(instance.getName());
  if (future != null && future.isSet()) {
    future.get().original=null;
  }
  if (INSTANCE_MAP.size() == 0) {
    ManagementService.shutdownAll();
  }
}
Program: 46871
Project: 46871
Buggy source:
private boolean hasOnGoingMigrationMaster(Level level){
  Address masterAddress=node.getMasterAddress();
  if (masterAddress == null) {
    return true;
  }
  Operation operation=new HasOngoingMigration();
  OperationService operationService=nodeEngine.getOperationService();
  InvocationBuilder invocationBuilder=operationService.createInvocationBuilder(SERVICE_NAME,operation,masterAddress);
  Future future=invocationBuilder.setTryCount(100).setTryPauseMillis(100).invoke();
  try {
    return (Boolean)future.get(1,TimeUnit.MINUTES);
  }
 catch (  InterruptedException ie) {
    Logger.getLogger(InternalPartitionServiceImpl.class).finest("String_Node_Str",ie);
  }
catch (  Exception e) {
    logger.log(level,"String_Node_Str" + e.toString());
  }
  return false;
}

Fixed version (ground truth):
private boolean hasOnGoingMigrationMaster(Level level){
  Address masterAddress=node.getMasterAddress();
  if (masterAddress == null) {
    return node.joined();
  }
  Operation operation=new HasOngoingMigration();
  OperationService operationService=nodeEngine.getOperationService();
  InvocationBuilder invocationBuilder=operationService.createInvocationBuilder(SERVICE_NAME,operation,masterAddress);
  Future future=invocationBuilder.setTryCount(100).setTryPauseMillis(100).invoke();
  try {
    return (Boolean)future.get(1,TimeUnit.MINUTES);
  }
 catch (  InterruptedException ie) {
    Logger.getLogger(InternalPartitionServiceImpl.class).finest("String_Node_Str",ie);
  }
catch (  Exception e) {
    logger.log(level,"String_Node_Str" + e.toString());
  }
  return false;
}
Program: 46872
Project: 46872
Buggy source:
@Override public NodeExtension createNodeExtension(Node node){
  return nodeExtension;
}

Fixed version (ground truth):
@Override public NodeExtension createNodeExtension(Node node){
  when(nodeExtension.createService(MapService.class)).thenReturn(mock(MapService.class));
  when(nodeExtension.createService(ICacheService.class)).thenReturn(mock(ICacheService.class));
  when(nodeExtension.createService(WanReplicationService.class)).thenReturn(mock(WanReplicationService.class));
  when(nodeExtension.createSerializationService()).thenReturn(new DefaultSerializationServiceBuilder().build());
  return nodeExtension;
}
Program: 46873
Project: 46873
Buggy source:
@Test public void verifyMethods() throws Exception {
  NodeExtension nodeExtension=prepareNodeExtension();
  hazelcastInstance=new HazelcastInstanceImpl(randomName(),getConfig(),new DummyNodeContext(nextAddress(),nodeExtension));
  InOrder inOrder=inOrder(nodeExtension);
  inOrder.verify(nodeExtension,times(1)).beforeStart();
  inOrder.verify(nodeExtension,times(1)).createSerializationService();
  inOrder.verify(nodeExtension,times(1)).printNodeInfo();
  inOrder.verify(nodeExtension,times(1)).createExtensionServices();
  inOrder.verify(nodeExtension,times(1)).beforeJoin();
  inOrder.verify(nodeExtension,times(1)).afterStart();
  hazelcastInstance.shutdown();
  inOrder.verify(nodeExtension,times(1)).beforeShutdown();
  inOrder.verify(nodeExtension,times(1)).shutdown();
}

Fixed version (ground truth):
@Test public void verifyMethods() throws Exception {
  DummyNodeContext nodeContext=new DummyNodeContext(new Address("String_Node_Str",5000));
  NodeExtension nodeExtension=nodeContext.getNodeExtension();
  hazelcastInstance=new HazelcastInstanceImpl(randomName(),getConfig(),nodeContext);
  InOrder inOrder=inOrder(nodeExtension);
  inOrder.verify(nodeExtension,times(1)).beforeStart();
  inOrder.verify(nodeExtension,times(1)).createSerializationService();
  inOrder.verify(nodeExtension,times(1)).printNodeInfo();
  inOrder.verify(nodeExtension,times(1)).createExtensionServices();
  inOrder.verify(nodeExtension,times(1)).beforeJoin();
  inOrder.verify(nodeExtension,times(1)).afterStart();
  hazelcastInstance.shutdown();
  inOrder.verify(nodeExtension,times(1)).beforeShutdown();
  inOrder.verify(nodeExtension,times(1)).shutdown();
}
Program: 46874
Project: 46874
Buggy source:
private DummyNodeContext(Address address,NodeExtension nodeExtension){
  this.address=address;
  this.nodeExtension=nodeExtension;
}

Fixed version (ground truth):
public DummyNodeContext(Address address){
  this.address=address;
}
Program: 46875
Project: 46875
Buggy source:
public TestHazelcastInstanceFactory(String... addresses){
  this.count=addresses.length;
  if (mockNetwork) {
    this.addresses=new CopyOnWriteArrayList<Address>();
    this.addresses.addAll(createAddresses(-1,PORTS,addresses));
    this.registry=new TestNodeRegistry(this.addresses);
  }
}

Fixed version (ground truth):
public TestHazelcastInstanceFactory(Collection<Address> addresses){
  this.count=addresses.size();
  if (mockNetwork) {
    initFactory(addresses);
  }
}
Program: 46876
Project: 46876
Buggy source:
@Override public boolean shouldBackup(){
  return response != null;
}

Fixed version (ground truth):
@Override public boolean shouldBackup(){
  return response != null && backupRecord != null;
}
Program: 46877
Project: 46877
Buggy source:
public CachePutBackupOperation(String name,Data key,CacheRecord cacheRecord){
  super(name,key);
  this.cacheRecord=cacheRecord;
}

Fixed version (ground truth):
public CachePutBackupOperation(String name,Data key,CacheRecord cacheRecord){
  super(name,key);
  if (cacheRecord == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.cacheRecord=cacheRecord;
}
Program: 46878
Project: 46878
Buggy source:
@Override public boolean shouldBackup(){
  return Boolean.TRUE.equals(response);
}

Fixed version (ground truth):
@Override public boolean shouldBackup(){
  return Boolean.TRUE.equals(response) && backupRecord != null;
}
Program: 46879
Project: 46879
Buggy source:
@Override public boolean shouldBackup(){
  return true;
}

Fixed version (ground truth):
@Override public boolean shouldBackup(){
  return backupRecord != null;
}
Program: 46880
Project: 46880
Buggy source:
@Override public boolean shouldBackup(){
  return Boolean.TRUE.equals(response);
}

Fixed version (ground truth):
@Override public boolean shouldBackup(){
  return Boolean.TRUE.equals(response) && backupRecord != null;
}
Program: 46881
Project: 46881
Buggy source:
@BeforeClass public static void init() throws Exception {
  final URL configUrl1=CacheCreationTest.class.getClassLoader().getResource("String_Node_Str");
  XmlConfigBuilder configBuilder=new XmlConfigBuilder(configUrl1.getFile());
  hzConfig=configBuilder.build();
}

Fixed version (ground truth):
@BeforeClass public static void init() throws Exception {
  final URL configUrl1=CacheCreationTest.class.getClassLoader().getResource("String_Node_Str");
  String decodedURL=URLDecoder.decode(configUrl1.getFile(),"String_Node_Str");
  XmlConfigBuilder configBuilder=new XmlConfigBuilder(decodedURL);
  hzConfig=configBuilder.build();
}
Program: 46882
Project: 46882
Buggy source:
@Test public void testConfigurationWithFile() throws Exception {
  URL url=getClass().getClassLoader().getResource("String_Node_Str");
  System.setProperty("String_Node_Str",url.getFile());
  Config config=new XmlConfigBuilder().build();
  assertEquals(url,config.getConfigurationUrl());
}

Fixed version (ground truth):
@Test public void testConfigurationWithFile() throws Exception {
  URL url=getClass().getClassLoader().getResource("String_Node_Str");
  assertNotNull(url);
  String decodedURL=URLDecoder.decode(url.getFile(),"String_Node_Str");
  System.setProperty("String_Node_Str",decodedURL);
  Config config=new XmlConfigBuilder().build();
  URL file=new URL("String_Node_Str");
  URL encodedURL=new URL(file,decodedURL);
  assertEquals(encodedURL,config.getConfigurationUrl());
}
Program: 46883
Project: 46883
Buggy source:
@Before public void setUp() throws Exception {
  startMS=System.currentTimeMillis();
  URL root=new URL(MancenterServlet.class.getResource("String_Node_Str"),"String_Node_Str");
  String baseDir=new File(root.getFile().replaceAll("String_Node_Str","String_Node_Str")).toString();
  String sourceDir=baseDir + "String_Node_Str";
  String sourceName="String_Node_Str";
  portNum=availablePort();
  jettyServer=new JettyServer(portNum,sourceDir,sourceName);
  hazelcastInstance=Hazelcast.newHazelcastInstance(makeConfig());
}

Fixed version (ground truth):
@Before public void setUp() throws Exception {
  startMS=System.currentTimeMillis();
  URL root=new URL(MancenterServlet.class.getResource("String_Node_Str"),"String_Node_Str");
  String baseDir=URLDecoder.decode(root.getFile(),"String_Node_Str");
  String sourceDir=baseDir + "String_Node_Str";
  String sourceName="String_Node_Str";
  portNum=availablePort();
  jettyServer=new JettyServer(portNum,sourceDir,sourceName);
  hazelcastInstance=Hazelcast.newHazelcastInstance(makeConfig());
}
Program: 46885
Project: 46885
Buggy source:
@Test public void all_nodes_should_have_the_same_cluster_start_time_and_cluster_id() throws Exception {
  HazelcastInstance h1=factory.newHazelcastInstance();
  HazelcastInstance h2=factory.newHazelcastInstance();
  HazelcastInstance h3=factory.newHazelcastInstance();
  assertSizeEventually(3,h1.getCluster().getMembers());
  assertSizeEventually(3,h2.getCluster().getMembers());
  assertSizeEventually(3,h3.getCluster().getMembers());
  Node node1=TestUtil.getNode(h1);
  Node node2=TestUtil.getNode(h2);
  Node node3=TestUtil.getNode(h3);
  final ClusterServiceImpl clusterService=node1.getClusterService();
  long node1ClusterStartTime=clusterService.getClusterClock().getClusterStartTime();
  long clusterUpTime=clusterService.getClusterClock().getClusterUpTime();
  String node1ClusterId=clusterService.getClusterId();
  assertTrue(clusterUpTime > 0);
  assertNotEquals(node1ClusterStartTime,Long.MIN_VALUE);
  assertEquals(node1ClusterStartTime,node2.getClusterService().getClusterClock().getClusterStartTime());
  assertEquals(node1ClusterStartTime,node3.getClusterService().getClusterClock().getClusterStartTime());
  assertNotNull(node1ClusterId);
  assertEquals(node1ClusterId,node2.getClusterService().getClusterId());
  assertEquals(node1ClusterId,node3.getClusterService().getClusterId());
}

Fixed version (ground truth):
@Test public void all_nodes_should_have_the_same_cluster_start_time_and_cluster_id() throws Exception {
  HazelcastInstance h1=factory.newHazelcastInstance();
  HazelcastInstance h2=factory.newHazelcastInstance();
  HazelcastInstance h3=factory.newHazelcastInstance();
  assertClusterSizeEventually(3,h1);
  assertClusterSizeEventually(3,h2);
  assertClusterSizeEventually(3,h3);
  Node node1=TestUtil.getNode(h1);
  Node node2=TestUtil.getNode(h2);
  Node node3=TestUtil.getNode(h3);
  final ClusterServiceImpl clusterService=node1.getClusterService();
  long node1ClusterStartTime=clusterService.getClusterClock().getClusterStartTime();
  long clusterUpTime=clusterService.getClusterClock().getClusterUpTime();
  String node1ClusterId=clusterService.getClusterId();
  assertTrue(clusterUpTime > 0);
  assertNotEquals(node1ClusterStartTime,Long.MIN_VALUE);
  assertEquals(node1ClusterStartTime,node2.getClusterService().getClusterClock().getClusterStartTime());
  assertEquals(node1ClusterStartTime,node3.getClusterService().getClusterClock().getClusterStartTime());
  assertNotNull(node1ClusterId);
  assertEquals(node1ClusterId,node2.getClusterService().getClusterId());
  assertEquals(node1ClusterId,node3.getClusterService().getClusterId());
}
Program: 46886
Project: 46886
Buggy source:
@Override public boolean shouldBackup(){
  return response != null;
}

Fixed version (ground truth):
@Override public boolean shouldBackup(){
  return response != null && backupRecord != null;
}
Program: 46887
Project: 46887
Buggy source:
public CachePutBackupOperation(String name,Data key,CacheRecord cacheRecord,boolean wanOriginated){
  this(name,key,cacheRecord);
  this.wanOriginated=wanOriginated;
}

Fixed version (ground truth):
public CachePutBackupOperation(String name,Data key,CacheRecord cacheRecord,boolean wanOriginated){
  this(name,key,cacheRecord);
  if (cacheRecord == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.wanOriginated=wanOriginated;
}
Program: 46888
Project: 46888
Buggy source:
@Override public boolean shouldBackup(){
  return Boolean.TRUE.equals(response);
}

Fixed version (ground truth):
@Override public boolean shouldBackup(){
  return Boolean.TRUE.equals(response) && backupRecord != null;
}
Program: 46889
Project: 46889
Buggy source:
@Override public boolean shouldBackup(){
  return true;
}

Fixed version (ground truth):
@Override public boolean shouldBackup(){
  return backupRecord != null;
}
Program: 46890
Project: 46890
Buggy source:
@Override public boolean shouldBackup(){
  return Boolean.TRUE.equals(response);
}

Fixed version (ground truth):
@Override public boolean shouldBackup(){
  return Boolean.TRUE.equals(response) && backupRecord != null;
}
Program: 46892
Project: 46892
Buggy source:
@Test public void all_nodes_should_have_the_same_cluster_start_time_and_cluster_id() throws Exception {
  HazelcastInstance h1=factory.newHazelcastInstance();
  HazelcastInstance h2=factory.newHazelcastInstance();
  HazelcastInstance h3=factory.newHazelcastInstance();
  assertSizeEventually(3,h1.getCluster().getMembers());
  assertSizeEventually(3,h2.getCluster().getMembers());
  assertSizeEventually(3,h3.getCluster().getMembers());
  Node node1=TestUtil.getNode(h1);
  Node node2=TestUtil.getNode(h2);
  Node node3=TestUtil.getNode(h3);
  final ClusterServiceImpl clusterService=node1.getClusterService();
  long node1ClusterStartTime=clusterService.getClusterClock().getClusterStartTime();
  long clusterUpTime=clusterService.getClusterClock().getClusterUpTime();
  String node1ClusterId=clusterService.getClusterId();
  assertTrue(clusterUpTime > 0);
  assertNotEquals(node1ClusterStartTime,Long.MIN_VALUE);
  assertEquals(node1ClusterStartTime,node2.getClusterService().getClusterClock().getClusterStartTime());
  assertEquals(node1ClusterStartTime,node3.getClusterService().getClusterClock().getClusterStartTime());
  assertNotNull(node1ClusterId);
  assertEquals(node1ClusterId,node2.getClusterService().getClusterId());
  assertEquals(node1ClusterId,node3.getClusterService().getClusterId());
}

Fixed version (ground truth):
@Test public void all_nodes_should_have_the_same_cluster_start_time_and_cluster_id() throws Exception {
  HazelcastInstance h1=factory.newHazelcastInstance();
  HazelcastInstance h2=factory.newHazelcastInstance();
  HazelcastInstance h3=factory.newHazelcastInstance();
  assertClusterSizeEventually(3,h1);
  assertClusterSizeEventually(3,h2);
  assertClusterSizeEventually(3,h3);
  Node node1=TestUtil.getNode(h1);
  Node node2=TestUtil.getNode(h2);
  Node node3=TestUtil.getNode(h3);
  final ClusterServiceImpl clusterService=node1.getClusterService();
  long node1ClusterStartTime=clusterService.getClusterClock().getClusterStartTime();
  long clusterUpTime=clusterService.getClusterClock().getClusterUpTime();
  String node1ClusterId=clusterService.getClusterId();
  assertTrue(clusterUpTime > 0);
  assertNotEquals(node1ClusterStartTime,Long.MIN_VALUE);
  assertEquals(node1ClusterStartTime,node2.getClusterService().getClusterClock().getClusterStartTime());
  assertEquals(node1ClusterStartTime,node3.getClusterService().getClusterClock().getClusterStartTime());
  assertNotNull(node1ClusterId);
  assertEquals(node1ClusterId,node2.getClusterService().getClusterId());
  assertEquals(node1ClusterId,node3.getClusterService().getClusterId());
}
Program: 46893
Project: 46893
Buggy source:
/** 
 * It may be useful to use this   {@code init} method in some cases that same instance of this class can be usedinstead of creating a new one for every iteration when scanning large data sets, for example: <pre> <code>Predicate predicate = ... QueryEntry entry = new QueryEntry() for(i == 0; i < HUGE_NUMBER; i++) { entry.init(...) boolean valid = predicate.apply(queryEntry); if(valid) { .... } } </code> </pre>
 */
public void init(SerializationService serializationService,Data key,Object value,Extractors extractors){
  if (key == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.serializationService=serializationService;
  this.key=key;
  this.value=value;
  this.extractors=extractors;
}

Fixed version (ground truth):
/** 
 * It may be useful to use this   {@code init} method in some cases that same instance of this class can be usedinstead of creating a new one for every iteration when scanning large data sets, for example: <pre> <code>Predicate predicate = ... QueryEntry entry = new QueryEntry() for (i == 0; i < HUGE_NUMBER; i++) { entry.init(...) boolean valid = predicate.apply(queryEntry); if (valid) { .... } } </code> </pre>
 */
public void init(SerializationService serializationService,Data key,Object value,Extractors extractors){
  if (key == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.serializationService=serializationService;
  this.key=key;
  this.value=value;
  this.extractors=extractors;
}
Program: 46894
Project: 46894
Buggy source:
@Before public void setup(){
  HazelcastInstance[] cluster=createHazelcastInstanceFactory(2).newInstances();
  local=cluster[0];
  remote=cluster[1];
  map=local.getMap(randomName());
  serializationService=getSerializationService(local);
  remoteKey1=generateKeyOwnedBy(remote);
  remoteKey2=generateKeyOwnedBy(remote);
  remoteKey3=generateKeyOwnedBy(remote);
  localKey1=generateKeyOwnedBy(local);
  localKey2=generateKeyOwnedBy(local);
  localKey3=generateKeyOwnedBy(local);
}

Fixed version (ground truth):
@Before public void setup(){
  HazelcastInstance[] cluster=createHazelcastInstanceFactory(2).newInstances();
  HazelcastInstance local=cluster[0];
  HazelcastInstance remote=cluster[1];
  map=local.getMap(randomName());
  serializationService=getSerializationService(local);
  localKey1=generateKeyOwnedBy(local);
  localKey2=generateKeyOwnedBy(local);
  localKey3=generateKeyOwnedBy(local);
  remoteKey1=generateKeyOwnedBy(remote);
  remoteKey2=generateKeyOwnedBy(remote);
  remoteKey3=generateKeyOwnedBy(remote);
}
Program: 46895
Project: 46895
Buggy source:
@Before public void setup(){
  hz=createHazelcastInstance();
  map=hz.getMap(randomName());
  serializationService=getSerializationService(hz);
}

Fixed version (ground truth):
@Before public void setup(){
  HazelcastInstance instance=createHazelcastInstance();
  map=instance.getMap(randomName());
  serializationService=getSerializationService(instance);
}
Program: 46896
Project: 46896
Buggy source:
private void assertResultContains(Set<Map.Entry<String,String>> result,String key,String value){
  assertTrue(result.contains(new SimpleEntry(key,value)));
}

Fixed version (ground truth):
private void assertResultContains(Set<Map.Entry<String,String>> result,String key,String value){
  assertTrue(result.contains(new SimpleEntry<String,String>(key,value)));
}
Program: 46897
Project: 46897
Buggy source:
@Before public void setup(){
  hz=createHazelcastInstance();
  map=hz.getMap(randomName());
  serializationService=getSerializationService(hz);
}

Fixed version (ground truth):
@Before public void setup(){
  HazelcastInstance instance=createHazelcastInstance();
  map=instance.getMap(randomName());
  serializationService=getSerializationService(instance);
}
Program: 46898
Project: 46898
Buggy source:
@Test(expected=QueryResultSizeExceededException.class) public void whenLimitExceeded() throws Exception {
  fillPartition(limit + 1);
  queryEngine.queryLocalPartition(map.getName(),TruePredicate.INSTANCE,PARTITION_ID,IterationType.ENTRY);
}

Fixed version (ground truth):
@Test(expected=QueryResultSizeExceededException.class) public void whenLimitExceeded() throws Exception {
  fillPartition(limit + 1);
  queryEngine.queryLocalPartition(map.getName(),TruePredicate.INSTANCE,PARTITION_ID,ENTRY);
}
Program: 46899
Project: 46899
Buggy source:
@Test public void whenLimitEquals() throws Exception {
  fillPartition(limit);
  QueryResult result=queryEngine.queryLocalPartition(map.getName(),TruePredicate.INSTANCE,PARTITION_ID,IterationType.ENTRY);
  assertEquals(limit,result.getRows().size());
}

Fixed version (ground truth):
@Test public void whenLimitEquals() throws Exception {
  fillPartition(limit);
  QueryResult result=queryEngine.queryLocalPartition(map.getName(),TruePredicate.INSTANCE,PARTITION_ID,ENTRY);
  assertEquals(limit,result.getRows().size());
}
Program: 46900
Project: 46900
Buggy source:
@Test public void whenLimitNotExceeded() throws Exception {
  fillPartition(limit - 1);
  QueryResult result=queryEngine.queryLocalPartition(map.getName(),TruePredicate.INSTANCE,PARTITION_ID,IterationType.ENTRY);
  assertEquals(limit - 1,result.getRows().size());
}

Fixed version (ground truth):
@Test public void whenLimitNotExceeded() throws Exception {
  fillPartition(limit - 1);
  QueryResult result=queryEngine.queryLocalPartition(map.getName(),TruePredicate.INSTANCE,PARTITION_ID,ENTRY);
  assertEquals(limit - 1,result.getRows().size());
}
Program: 46901
Project: 46901
Buggy source:
@Test public void whenResultSizeLimitEquals() throws Exception {
  fillMap(limit);
  QueryResult result=queryEngine.queryLocalPartitions(map.getName(),TruePredicate.INSTANCE,IterationType.ENTRY);
  assertEquals(limit,result.getRows().size());
}

Fixed version (ground truth):
@Test public void whenResultSizeLimitEquals() throws Exception {
  fillMap(limit);
  QueryResult result=queryEngine.queryLocalPartitions(map.getName(),TruePredicate.INSTANCE,ENTRY);
  assertEquals(limit,result.getRows().size());
}
Program: 46902
Project: 46902
Buggy source:
@Test public void whenResultSizeLimitNotExceeded() throws Exception {
  fillMap(limit - 1);
  QueryResult result=queryEngine.queryLocalPartitions(map.getName(),TruePredicate.INSTANCE,IterationType.ENTRY);
  assertEquals(limit - 1,result.getRows().size());
}

Fixed version (ground truth):
@Test public void whenResultSizeLimitNotExceeded() throws Exception {
  fillMap(limit - 1);
  QueryResult result=queryEngine.queryLocalPartitions(map.getName(),TruePredicate.INSTANCE,ENTRY);
  assertEquals(limit - 1,result.getRows().size());
}
Program: 46903
Project: 46903
Buggy source:
@Test public void checkResultLimit() throws Exception {
  QueryResult result=queryEngine.queryLocalPartitions(map.getName(),TruePredicate.INSTANCE,IterationType.ENTRY);
  assertEquals(limit,result.getResultLimit());
}

Fixed version (ground truth):
@Test public void checkResultLimit() throws Exception {
  QueryResult result=queryEngine.queryLocalPartitions(map.getName(),TruePredicate.INSTANCE,ENTRY);
  assertEquals(limit,result.getResultLimit());
}
Program: 46904
Project: 46904
Buggy source:
@Test(expected=QueryResultSizeExceededException.class) public void whenResultSizeLimitExceeded() throws Exception {
  fillMap(limit + 1);
  queryEngine.queryLocalPartitions(map.getName(),TruePredicate.INSTANCE,IterationType.ENTRY);
}

Fixed version (ground truth):
@Test(expected=QueryResultSizeExceededException.class) public void whenResultSizeLimitExceeded() throws Exception {
  fillMap(limit + 1);
  queryEngine.queryLocalPartitions(map.getName(),TruePredicate.INSTANCE,ENTRY);
}
Program: 46905
Project: 46905
Buggy source:
@Test public void checkResultLimit() throws Exception {
  QueryResult result=queryEngine.queryLocalPartitions(map.getName(),TruePredicate.INSTANCE,IterationType.ENTRY);
  assertEquals(Long.MAX_VALUE,result.getResultLimit());
}

Fixed version (ground truth):
@Test public void checkResultLimit() throws Exception {
  QueryResult result=queryEngine.queryLocalPartitions(map.getName(),TruePredicate.INSTANCE,ENTRY);
  assertEquals(Long.MAX_VALUE,result.getResultLimit());
}
Program: 46906
Project: 46906
Buggy source:
@Before public void setup(){
  hz=createHazelcastInstance();
  map=hz.getMap(randomName());
  serializationService=getSerializationService(hz);
}

Fixed version (ground truth):
@Before public void setup(){
  HazelcastInstance instance=createHazelcastInstance();
  map=instance.getMap(randomName());
  serializationService=getSerializationService(instance);
}
Program: 46907
Project: 46907
Buggy source:
protected void putAndGetFromCacheAndThenGetFromClientNearCache(InMemoryFormat inMemoryFormat){
  NearCacheConfig nearCacheConfig=createNearCacheConfig(inMemoryFormat);
  final NearCacheTestContext nearCacheTestContext=createNearCacheTestAndFillWithData(DEFAULT_CACHE_NAME,nearCacheConfig);
  for (int i=0; i < DEFAULT_RECORD_COUNT; i++) {
    assertNull(nearCacheTestContext.nearCache.get(nearCacheTestContext.serializationService.toData(i)));
  }
  for (int i=0; i < DEFAULT_RECORD_COUNT; i++) {
    nearCacheTestContext.cache.get(i);
  }
  for (int i=0; i < DEFAULT_RECORD_COUNT; i++) {
    String expectedValue=generateValueFromKey(i);
    Data keyData=nearCacheTestContext.serializationService.toData(i);
    assertEquals(expectedValue,nearCacheTestContext.nearCache.get(keyData));
  }
  nearCacheTestContext.close();
}

Fixed version (ground truth):
protected void putAndGetFromCacheAndThenGetFromClientNearCache(InMemoryFormat inMemoryFormat){
  NearCacheConfig nearCacheConfig=createNearCacheConfig(inMemoryFormat);
  final NearCacheTestContext nearCacheTestContext=createNearCacheTestAndFillWithData(DEFAULT_CACHE_NAME,nearCacheConfig);
  for (int i=0; i < DEFAULT_RECORD_COUNT; i++) {
    assertNull(nearCacheTestContext.nearCache.get(nearCacheTestContext.serializationService.toData(i)));
  }
  for (int i=0; i < DEFAULT_RECORD_COUNT; i++) {
    nearCacheTestContext.cache.get(i);
  }
  for (int i=0; i < DEFAULT_RECORD_COUNT; i++) {
    String expectedValue=generateValueFromKey(i);
    Data keyData=nearCacheTestContext.serializationService.toData(i);
    assertEquals(expectedValue,nearCacheTestContext.nearCache.get(keyData));
  }
}
Program: 46909
Project: 46909
Buggy source:
protected void putToCacheAndRemoveFromOtherNodeThenCantGetUpdatedFromClientNearCache(InMemoryFormat inMemoryFormat){
  NearCacheConfig nearCacheConfig=createNearCacheConfig(inMemoryFormat);
  nearCacheConfig.setInvalidateOnChange(true);
  NearCacheTestContext nearCacheTestContext1=createNearCacheTest(DEFAULT_CACHE_NAME,nearCacheConfig);
  final NearCacheTestContext nearCacheTestContext2=createNearCacheTest(DEFAULT_CACHE_NAME,nearCacheConfig);
  for (int i=0; i < DEFAULT_RECORD_COUNT; i++) {
    nearCacheTestContext1.cache.put(i,generateValueFromKey(i));
  }
  for (int i=0; i < DEFAULT_RECORD_COUNT; i++) {
    final Integer key=i;
    final String value=nearCacheTestContext2.cache.get(key);
    HazelcastTestSupport.assertTrueEventually(new AssertTask(){
      @Override public void run() throws Exception {
        assertEquals(value,nearCacheTestContext2.nearCache.get(nearCacheTestContext2.serializationService.toData(key)));
      }
    }
);
  }
  for (int i=0; i < DEFAULT_RECORD_COUNT; i++) {
    nearCacheTestContext1.cache.remove(i);
  }
  for (int i=0; i < DEFAULT_RECORD_COUNT; i++) {
    final int key=i;
    HazelcastTestSupport.assertTrueEventually(new AssertTask(){
      @Override public void run() throws Exception {
        assertNull(nearCacheTestContext2.nearCache.get(nearCacheTestContext2.serializationService.toData(key)));
      }
    }
);
  }
  nearCacheTestContext1.close();
  nearCacheTestContext2.close();
}

Fixed version (ground truth):
protected void putToCacheAndRemoveFromOtherNodeThenCantGetUpdatedFromClientNearCache(InMemoryFormat inMemoryFormat){
  NearCacheConfig nearCacheConfig=createNearCacheConfig(inMemoryFormat);
  nearCacheConfig.setInvalidateOnChange(true);
  NearCacheTestContext nearCacheTestContext1=createNearCacheTest(DEFAULT_CACHE_NAME,nearCacheConfig);
  final NearCacheTestContext nearCacheTestContext2=createNearCacheTest(DEFAULT_CACHE_NAME,nearCacheConfig);
  for (int i=0; i < DEFAULT_RECORD_COUNT; i++) {
    nearCacheTestContext1.cache.put(i,generateValueFromKey(i));
  }
  for (int i=0; i < DEFAULT_RECORD_COUNT; i++) {
    final Integer key=i;
    final String value=nearCacheTestContext2.cache.get(key);
    HazelcastTestSupport.assertTrueEventually(new AssertTask(){
      @Override public void run() throws Exception {
        assertEquals(value,nearCacheTestContext2.nearCache.get(nearCacheTestContext2.serializationService.toData(key)));
      }
    }
);
  }
  for (int i=0; i < DEFAULT_RECORD_COUNT; i++) {
    nearCacheTestContext1.cache.remove(i);
  }
  for (int i=0; i < DEFAULT_RECORD_COUNT; i++) {
    final int key=i;
    HazelcastTestSupport.assertTrueEventually(new AssertTask(){
      @Override public void run() throws Exception {
        assertNull(nearCacheTestContext2.nearCache.get(nearCacheTestContext2.serializationService.toData(key)));
      }
    }
);
  }
}
Program: 46910
Project: 46910
Buggy source:
@After public void tearDown(){
  if (serverInstance != null) {
    serverInstance.shutdown();
  }
}

Fixed version (ground truth):
@After public void tearDown(){
  hazelcastFactory.shutdownAll();
}
Program: 46911
Project: 46911
Buggy source:
NearCacheTestContext(HazelcastClientProxy client,HazelcastClientCacheManager cacheManager,NearCacheManager nearCacheManager,ICache<Integer,String> cache,NearCache<Data,String> nearCache){
  this.client=client;
  this.serializationService=client.getSerializationService();
  this.cacheManager=cacheManager;
  this.nearCacheManager=nearCacheManager;
  this.cache=cache;
  this.nearCache=nearCache;
}

Fixed version (ground truth):
NearCacheTestContext(HazelcastClientProxy client,HazelcastClientCacheManager cacheManager,NearCacheManager nearCacheManager,ICache<Object,String> cache,NearCache<Data,String> nearCache){
  this.client=client;
  this.serializationService=client.getSerializationService();
  this.cacheManager=cacheManager;
  this.nearCacheManager=nearCacheManager;
  this.cache=cache;
  this.nearCache=nearCache;
}
Program: 46912
Project: 46912
Buggy source:
protected void doTestGetAllReturnsFromNearCache(){
  NearCacheConfig nearCacheConfig=createNearCacheConfig(InMemoryFormat.OBJECT);
  final NearCacheTestContext nearCacheTestContext=createNearCacheTestAndFillWithData(DEFAULT_CACHE_NAME,nearCacheConfig);
  for (int i=0; i < DEFAULT_RECORD_COUNT; i++) {
    assertNull(nearCacheTestContext.nearCache.get(nearCacheTestContext.serializationService.toData(i)));
  }
  for (int i=0; i < DEFAULT_RECORD_COUNT; i++) {
    nearCacheTestContext.cache.get(i);
  }
  for (int i=0; i < DEFAULT_RECORD_COUNT; i++) {
    final Data keyData=nearCacheTestContext.serializationService.toData(i);
    assertTrue(nearCacheTestContext.cache.get(i) == nearCacheTestContext.nearCache.get(keyData));
  }
  nearCacheTestContext.close();
}

Fixed version (ground truth):
protected void doTestGetAllReturnsFromNearCache(){
  NearCacheConfig nearCacheConfig=createNearCacheConfig(InMemoryFormat.OBJECT);
  final NearCacheTestContext nearCacheTestContext=createNearCacheTestAndFillWithData(DEFAULT_CACHE_NAME,nearCacheConfig);
  for (int i=0; i < DEFAULT_RECORD_COUNT; i++) {
    assertNull(nearCacheTestContext.nearCache.get(nearCacheTestContext.serializationService.toData(i)));
  }
  for (int i=0; i < DEFAULT_RECORD_COUNT; i++) {
    nearCacheTestContext.cache.get(i);
  }
  for (int i=0; i < DEFAULT_RECORD_COUNT; i++) {
    final Data keyData=nearCacheTestContext.serializationService.toData(i);
    assertTrue(nearCacheTestContext.cache.get(i) == nearCacheTestContext.nearCache.get(keyData));
  }
}