nus-yam/ex-repair huggingface dataset:
Program: 49822
Project: 49822
Buggy source:
public void run(){
  try {
    Predicate predicate=null;
    if (request.value != null) {
      predicate=(Predicate)toObject(request.value);
    }
    QueryContext queryContext=new QueryContext(cmap.getName(),predicate,cmap.getMapIndexService());
    Set<MapEntry> results=cmap.getMapIndexService().doQuery(queryContext);
    boolean evaluateValues=(predicate != null && !queryContext.isStrong());
    createResultPairs(request,results,evaluateValues,predicate);
    enqueueAndReturn(new Processable(){
      public void process(){
        int callerPartitionHash=request.blockId;
        if (partitionManager.containsMigratingBlock() || callerPartitionHash != partitionManager.hashBlocks()) {
          request.response=OBJECT_REDO;
        }
        boolean sent=returnResponse(request);
        if (!sent) {
          Connection conn=node.connectionManager.getConnection(request.caller);
          logger.log(Level.WARNING,request + "String_Node_Str" + request.caller+ "String_Node_Str"+ conn);
        }
      }
    }
);
  }
 catch (  Throwable e) {
    logger.log(Level.SEVERE,request.toString(),e);
  }
}

Fixed version (ground truth):
public void run(){
  try {
    Predicate predicate=null;
    if (request.value != null) {
      predicate=(Predicate)toObject(request.value);
    }
    final QueryContext queryContext=new QueryContext(cmap.getName(),predicate,cmap.getMapIndexService());
    Set<MapEntry> results=cmap.getMapIndexService().doQuery(queryContext);
    boolean evaluateValues=(predicate != null && !queryContext.isStrong());
    createResultPairs(request,results,evaluateValues,predicate);
  }
 catch (  Throwable e) {
    logger.log(Level.SEVERE,request.toString(),e);
    request.response=e;
  }
  enqueueAndReturn(new Processable(){
    public void process(){
      int callerPartitionHash=request.blockId;
      if (partitionManager.containsMigratingBlock() || callerPartitionHash != partitionManager.hashBlocks()) {
        request.response=OBJECT_REDO;
      }
      boolean sent=returnResponse(request);
      if (!sent) {
        Connection conn=node.connectionManager.getConnection(request.caller);
        logger.log(Level.WARNING,request + "String_Node_Str" + request.caller+ "String_Node_Str"+ conn);
      }
    }
  }
);
}
Program: 49823
Project: 49823
Buggy source:
boolean onResponse(Object response){
  Pairs pairs=null;
  if (response instanceof Data) {
    pairs=(Pairs)toObject((Data)response);
  }
 else   if (response instanceof Pairs) {
    pairs=(Pairs)response;
  }
 else {
    return true;
  }
  entries.addEntries(pairs);
  return true;
}

Fixed version (ground truth):
boolean onResponse(Object response){
  Pairs pairs=null;
  if (response instanceof Data) {
    pairs=(Pairs)toObject((Data)response);
  }
 else   if (response instanceof Pairs) {
    pairs=(Pairs)response;
  }
 else   if (response instanceof Throwable) {
    Util.throwUncheckedException((Throwable)response);
  }
 else {
    return true;
  }
  entries.addEntries(pairs);
  return true;
}
Program: 49824
Project: 49824
Buggy source:
public void shutdown(){
  for (  CMap cmap : maps.values()) {
    try {
      flush(cmap.name);
      cmap.reset();
    }
 catch (    Throwable e) {
      if (node.isActive()) {
        logger.log(Level.SEVERE,e.getMessage(),e);
      }
    }
  }
}

Fixed version (ground truth):
public void shutdown(){
  for (  CMap cmap : maps.values()) {
    try {
      flush(cmap.name);
      cmap.destroy();
    }
 catch (    Throwable e) {
      if (node.isActive()) {
        logger.log(Level.SEVERE,e.getMessage(),e);
      }
    }
  }
}
Program: 49826
Project: 49826
Buggy source:
public UDPListener(DatagramSocket socket) throws SocketException {
  super("String_Node_Str");
  this.socket=socket;
  this.socket.setSoTimeout(1000);
}

Fixed version (ground truth):
public UDPListener(DatagramSocket socket,int timeout,boolean reuseAddress) throws SocketException {
  super("String_Node_Str");
  this.socket=socket;
  this.socket.setSoTimeout(timeout);
  this.socket.setReuseAddress(reuseAddress);
}
Program: 49828
Project: 49828
Buggy source:
public SocketReadyServerSocket(int port) throws IOException {
  super(port);
}

Fixed version (ground truth):
public SocketReadyServerSocket(int port,int timeout,boolean reuseAddress) throws IOException {
  super(port);
  setSoTimeout(timeout);
  setReuseAddress(reuseAddress);
}
Program: 49829
Project: 49829
Buggy source:
protected void customRun() throws InterruptedException {
  if (outRunnable.reconnection.get()) {
    Thread.sleep(10L);
    return;
  }
  Packet packet;
  try {
    Connection oldConnection=connection;
    connection=client.connectionManager.getConnection();
    if (oldConnection == null || restoredConnection(oldConnection,connection)) {
      if (outRunnable.sendReconnectCall(connection)) {
        logger.log(Level.FINEST,"String_Node_Str");
        if (oldConnection != null) {
          redoUnfinishedCalls(oldConnection);
        }
      }
      return;
    }
    if (connection == null) {
      outRunnable.clusterIsDown(oldConnection);
      Thread.sleep(10);
    }
 else {
      packet=reader.readPacket(connection);
      this.lastReceived=System.currentTimeMillis();
      Call call=callMap.remove(packet.getCallId());
      if (call != null) {
        call.received=System.nanoTime();
        call.setResponse(packet);
      }
 else {
        if (packet.getOperation().equals(ClusterOperation.EVENT)) {
          client.getListenerManager().enqueue(packet);
        }
        if (packet.getCallId() != -1) {
          logger.log(Level.SEVERE,"String_Node_Str" + packet.getOperation() + "String_Node_Str"+ packet.getCallId());
        }
      }
    }
  }
 catch (  Throwable e) {
    logger.log(Level.FINE,"String_Node_Str" + connection + "String_Node_Str"+ e.toString(),e);
    outRunnable.clusterIsDown(connection);
  }
}

Fixed version (ground truth):
protected void customRun() throws InterruptedException {
  if (outRunnable.reconnection.get()) {
    Thread.sleep(10L);
    return;
  }
  Packet packet;
  try {
    Connection oldConnection=connection;
    connection=client.connectionManager.getConnection();
    if (restoredConnection(oldConnection,connection)) {
      if (outRunnable.sendReconnectCall(connection)) {
        logger.log(Level.FINEST,"String_Node_Str");
        if (oldConnection != null) {
          redoUnfinishedCalls(oldConnection);
        }
      }
      return;
    }
    if (connection == null) {
      outRunnable.clusterIsDown(oldConnection);
      Thread.sleep(10);
    }
 else {
      packet=reader.readPacket(connection);
      this.lastReceived=System.currentTimeMillis();
      Call call=callMap.remove(packet.getCallId());
      if (call != null) {
        call.received=System.nanoTime();
        call.setResponse(packet);
      }
 else {
        if (packet.getOperation().equals(ClusterOperation.EVENT)) {
          client.getListenerManager().enqueue(packet);
        }
        if (packet.getCallId() != -1) {
          logger.log(Level.SEVERE,"String_Node_Str" + packet.getOperation() + "String_Node_Str"+ packet.getCallId());
        }
      }
    }
  }
 catch (  Throwable e) {
    logger.log(Level.FINEST,"String_Node_Str" + connection + "String_Node_Str"+ e.toString(),e);
    outRunnable.clusterIsDown(connection);
  }
}
Program: 49830
Project: 49830
Buggy source:
private void connect(String[] args){
  String groupName="String_Node_Str";
  String pass="String_Node_Str";
  if (args.length > 2) {
    groupName=args[2];
    pass=args[3];
  }
  String ip=args[1];
  System.out.println("String_Node_Str" + ip);
  String[] ips=null;
  if (ip.indexOf(':') == -1) {
    ips=new String[]{ip + "String_Node_Str",ip + "String_Node_Str",ip + "String_Node_Str"};
  }
 else {
    ips=new String[]{ip};
  }
  this.hz=HazelcastClient.newHazelcastClient(groupName,pass,ips);
  System.out.println(hz.getCluster().getMembers());
}

Fixed version (ground truth):
private void connect(String[] args){
  String ip="String_Node_Str";
  String groupName="String_Node_Str";
  String pass="String_Node_Str";
  if (args.length > 1) {
    ip=args[1];
  }
  if (args.length > 3) {
    groupName=args[2];
    pass=args[3];
  }
  System.out.println("String_Node_Str" + ip);
  String[] ips=null;
  if (ip.indexOf(':') == -1) {
    ips=new String[]{ip + "String_Node_Str",ip + "String_Node_Str",ip + "String_Node_Str"};
  }
 else {
    ips=new String[]{ip};
  }
  this.hz=HazelcastClient.newHazelcastClient(groupName,pass,ips);
  System.out.println(hz.getCluster().getMembers());
}
Program: 49831
Project: 49831
Buggy source:
@Test public void testProxySerialization(){
  IMap<Object,Object> mapProxy=getHazelcastClient().getMap("String_Node_Str");
  ILock mapLock=getHazelcastClient().getLock(mapProxy);
  assertNotNull(mapLock);
}

Fixed version (ground truth):
@Ignore public void testProxySerialization(){
  IMap<Object,Object> mapProxy=getHazelcastClient().getMap("String_Node_Str");
  ILock mapLock=getHazelcastClient().getLock(mapProxy);
  assertNotNull(mapLock);
}
Program: 49832
Project: 49832
Buggy source:
void markSessionDirty(String sessionId){
  System.out.println("String_Node_Str" + sessionId + "String_Node_Str");
  HazelcastHttpSession hazelSession=mapSessions.get(sessionId);
  if (hazelSession != null) {
    hazelSession.setDirty(true);
  }
}

Fixed version (ground truth):
void markSessionDirty(String sessionId){
  HazelcastHttpSession hazelSession=mapSessions.get(sessionId);
  if (hazelSession != null) {
    hazelSession.setDirty(true);
  }
}
Program: 49833
Project: 49833
Buggy source:
@Override public int hashCode(){
  if (buffer == null)   return Integer.MIN_VALUE;
  final int prime=0x01000193;
  int hash=0x811c9dc5;
  final byte[] data=buffer;
  for (int i=data.length - 1; i >= 0; i--) {
    hash=(hash ^ data[i]) * prime;
  }
  return hash;
}

Fixed version (ground truth):
@Override public int hashCode(){
  return Util.hashCode(buffer);
}
Program: 49834
Project: 49834
Buggy source:
public void enqueueFullPacket(final Packet p){
  p.flipBuffers();
  p.read();
  p.setFromConnection(connection);
  System.out.println("String_Node_Str" + p.client);
  if (p.client) {
    connection.setType(Connection.Type.JAVA_CLIENT);
    ioService.handleClientPacket(p);
  }
 else {
    connection.setType(Connection.Type.MEMBER);
    ioService.handleMemberPacket(p);
  }
}

Fixed version (ground truth):
public void enqueueFullPacket(final Packet p){
  p.flipBuffers();
  p.read();
  p.setFromConnection(connection);
  if (p.client) {
    connection.setType(Connection.Type.JAVA_CLIENT);
    ioService.handleClientPacket(p);
  }
 else {
    connection.setType(Connection.Type.MEMBER);
    ioService.handleMemberPacket(p);
  }
}
Program: 49835
Project: 49835
Buggy source:
private void overrideSession(HazelcastHttpSession session,Map mapSession){
  if (session == null || mapSession == null)   return;
  final Set<Map.Entry> entries=mapSession.entrySet();
  for (  final Map.Entry entry : entries) {
    session.setAttribute((String)entry.getKey(),entry.getValue());
  }
  session.setDirty(false);
}

Fixed version (ground truth):
private void overrideSession(HazelcastHttpSession session,Map mapSession){
  if (session == null || mapSession == null)   return;
  final Enumeration<String> atts=session.getAttributeNames();
  while (atts.hasMoreElements()) {
    session.removeAttribute(atts.nextElement());
  }
  Map mapData=null;
  final Set<Map.Entry> entries=mapSession.entrySet();
  for (  final Map.Entry entry : entries) {
    session.setAttribute((String)entry.getKey(),entry.getValue());
    if (mapData == null) {
      mapData=new HashMap<String,Object>();
    }
    mapData.put(entry.getKey(),entry.getValue());
  }
  session.sessionChanged(session.writeObject(mapData));
  session.setDirty(false);
}
Program: 49836
Project: 49836
Buggy source:
public void entryUpdated(EntryEvent entryEvent){
  markSessionDirty((String)entryEvent.getKey());
}

Fixed version (ground truth):
public void entryUpdated(EntryEvent entryEvent){
  if (!entryEvent.getMember().localMember()) {
    markSessionDirty((String)entryEvent.getKey());
  }
}
Program: 49837
Project: 49837
Buggy source:
public void init(final FilterConfig config) throws ServletException {
  String debugParam=config.getInitParameter("String_Node_Str");
  if (debugParam != null) {
    DEBUG=Boolean.valueOf(debugParam);
  }
  servletContext=config.getServletContext();
  String mapName=config.getInitParameter("String_Node_Str");
  if (mapName != null) {
    clusterMapName=mapName;
  }
 else {
    clusterMapName="String_Node_Str" + servletContext.getServletContextName();
  }
  String stickySessionParam=config.getInitParameter("String_Node_Str");
  if (stickySessionParam != null) {
    stickySession=Boolean.valueOf(stickySessionParam);
  }
  if (!stickySession) {
    getClusterMap().addEntryListener(new EntryListener(){
      public void entryAdded(      EntryEvent entryEvent){
      }
      public void entryRemoved(      EntryEvent entryEvent){
        removeSessionLocally((String)entryEvent.getKey());
      }
      public void entryUpdated(      EntryEvent entryEvent){
        markSessionDirty((String)entryEvent.getKey());
      }
      public void entryEvicted(      EntryEvent entryEvent){
      }
    }
,false);
  }
  log("String_Node_Str" + stickySession + "String_Node_Str"+ DEBUG+ "String_Node_Str"+ clusterMapName);
}

Fixed version (ground truth):
public void init(final FilterConfig config) throws ServletException {
  String debugParam=config.getInitParameter("String_Node_Str");
  if (debugParam != null) {
    debug=Boolean.valueOf(debugParam);
  }
  servletContext=config.getServletContext();
  String mapName=config.getInitParameter("String_Node_Str");
  if (mapName != null) {
    clusterMapName=mapName;
  }
 else {
    clusterMapName="String_Node_Str" + servletContext.getServletContextName();
  }
  String stickySessionParam=config.getInitParameter("String_Node_Str");
  if (stickySessionParam != null) {
    stickySession=Boolean.valueOf(stickySessionParam);
  }
  if (!stickySession) {
    getClusterMap().addEntryListener(new EntryListener(){
      public void entryAdded(      EntryEvent entryEvent){
      }
      public void entryRemoved(      EntryEvent entryEvent){
        if (!entryEvent.getMember().localMember()) {
          removeSessionLocally((String)entryEvent.getKey());
        }
      }
      public void entryUpdated(      EntryEvent entryEvent){
        if (!entryEvent.getMember().localMember()) {
          markSessionDirty((String)entryEvent.getKey());
        }
      }
      public void entryEvicted(      EntryEvent entryEvent){
      }
    }
,false);
  }
  log("String_Node_Str" + stickySession + "String_Node_Str"+ debug+ "String_Node_Str"+ clusterMapName);
}
Program: 49838
Project: 49838
Buggy source:
void destroySession(final HazelcastHttpSession session){
  log("String_Node_Str" + session.getId());
  mapSessions.remove(session.getId());
  mapOriginalSessions.remove(session.originalSession.getId());
  session.destroy();
  getClusterMap().remove(session.getId());
}

Fixed version (ground truth):
void destroySession(final HazelcastHttpSession session){
  log("String_Node_Str" + session.getId());
  mapSessions.remove(session.getId());
  mapOriginalSessions.remove(session.originalSession.getId());
  session.destroy();
  final long maxInactive=session.originalSession.getMaxInactiveInterval() * 1000;
  final long clusterLastAccess=session.timestamp.get();
  final long now=System.currentTimeMillis();
  if ((now - clusterLastAccess) >= maxInactive) {
    log("String_Node_Str" + session.getId() + "String_Node_Str"+ maxInactive+ "String_Node_Str"+ session.originalSession.getLastAccessedTime()+ "String_Node_Str"+ clusterLastAccess+ "String_Node_Str"+ now);
    getClusterMap().remove(session.getId());
    session.timestamp.destroy();
  }
}
Program: 49839
Project: 49839
Buggy source:
@Override public RequestDispatcher getRequestDispatcher(final String path){
  final ServletRequest original=getRequest();
  return new RequestDispatcher(){
    public void forward(    ServletRequest servletRequest,    ServletResponse servletResponse) throws ServletException, IOException {
      original.getRequestDispatcher(path).forward(original,servletResponse);
    }
    public void include(    ServletRequest servletRequest,    ServletResponse servletResponse) throws ServletException, IOException {
      original.getRequestDispatcher(path).include(original,servletResponse);
    }
  }
;
}

Fixed version (ground truth):
@Override public RequestDispatcher getRequestDispatcher(final String path){
  final ServletRequest original=getRequest();
  return new RequestDispatcher(){
    public void forward(    ServletRequest servletRequest,    ServletResponse servletResponse) throws ServletException, IOException {
      original.getRequestDispatcher(path).forward(RequestWrapper.this,servletResponse);
    }
    public void include(    ServletRequest servletRequest,    ServletResponse servletResponse) throws ServletException, IOException {
      original.getRequestDispatcher(path).include(RequestWrapper.this,servletResponse);
    }
  }
;
}
Program: 49840
Project: 49840
Buggy source:
public void putValue(final String name,final Object value){
  originalSession.setAttribute(name,value);
}

Fixed version (ground truth):
public void putValue(final String name,final Object value){
  setAttribute(name,value);
}
Program: 49841
Project: 49841
Buggy source:
void log(final Object obj){
  if (DEBUG) {
    logger.log(Level.FINEST,obj.toString());
    System.out.println(obj.toString());
  }
}

Fixed version (ground truth):
void log(final Object obj){
  Level level=Level.FINEST;
  if (debug) {
    level=Level.INFO;
  }
  logger.log(level,obj.toString());
}
Program: 49842
Project: 49842
Buggy source:
public HazelcastHttpSession(WebFilter webFilter,final String sessionId,HttpSession originalSession){
  this.webFilter=webFilter;
  this.id=sessionId;
  this.originalSession=originalSession;
}

Fixed version (ground truth):
public HazelcastHttpSession(WebFilter webFilter,final String sessionId,HttpSession originalSession){
  this.webFilter=webFilter;
  this.id=sessionId;
  this.originalSession=originalSession;
  timestamp=Hazelcast.getAtomicNumber(clusterMapName + "String_Node_Str" + id);
}
Program: 49843
Project: 49843
Buggy source:
public void setAttribute(final String name,final Object value){
  originalSession.setAttribute(name,value);
}

Fixed version (ground truth):
public void setAttribute(final String name,final Object value){
  if (value != null && !(value instanceof Serializable)) {
    throw new IllegalArgumentException(new NotSerializableException(value.getClass().getName()));
  }
  originalSession.setAttribute(name,value);
}
Program: 49845
Project: 49845
Buggy source:
private void addSessionCookie(final RequestWrapper req,final String sessionId){
  final Cookie sessionCookie=new Cookie(HAZELCAST_SESSION_COOKIE_NAME,sessionId);
  String path=req.getContextPath();
  if ("String_Node_Str".equals(path)) {
    path="String_Node_Str";
  }
  sessionCookie.setPath(path);
  sessionCookie.setMaxAge(-1);
  req.res.addCookie(sessionCookie);
}

Fixed version (ground truth):
private static void addSessionCookie(final RequestWrapper req,final String sessionId){
  final Cookie sessionCookie=new Cookie(HAZELCAST_SESSION_COOKIE_NAME,sessionId);
  String path=req.getContextPath();
  if ("String_Node_Str".equals(path)) {
    path="String_Node_Str";
  }
  sessionCookie.setPath(path);
  sessionCookie.setMaxAge(-1);
  req.res.addCookie(sessionCookie);
}
Program: 49846
Project: 49846
Buggy source:
public void entryRemoved(EntryEvent entryEvent){
  removeSessionLocally((String)entryEvent.getKey());
}

Fixed version (ground truth):
public void entryRemoved(EntryEvent entryEvent){
  if (!entryEvent.getMember().localMember()) {
    removeSessionLocally((String)entryEvent.getKey());
  }
}
Program: 49847
Project: 49847
Buggy source:
void markSessionDirty(String sessionId){
  HazelcastHttpSession hazelSession=mapSessions.get(sessionId);
  if (hazelSession != null) {
    hazelSession.setDirty(true);
  }
}

Fixed version (ground truth):
void markSessionDirty(String sessionId){
  System.out.println("String_Node_Str" + sessionId + "String_Node_Str");
  HazelcastHttpSession hazelSession=mapSessions.get(sessionId);
  if (hazelSession != null) {
    hazelSession.setDirty(true);
  }
}
Program: 49848
Project: 49848
Buggy source:
public void include(ServletRequest servletRequest,ServletResponse servletResponse) throws ServletException, IOException {
  original.getRequestDispatcher(path).include(original,servletResponse);
}

Fixed version (ground truth):
public void include(ServletRequest servletRequest,ServletResponse servletResponse) throws ServletException, IOException {
  original.getRequestDispatcher(path).include(RequestWrapper.this,servletResponse);
}
Program: 49849
Project: 49849
Buggy source:
public void forward(ServletRequest servletRequest,ServletResponse servletResponse) throws ServletException, IOException {
  original.getRequestDispatcher(path).forward(original,servletResponse);
}

Fixed version (ground truth):
public void forward(ServletRequest servletRequest,ServletResponse servletResponse) throws ServletException, IOException {
  original.getRequestDispatcher(path).forward(RequestWrapper.this,servletResponse);
}
Program: 49850
Project: 49850
Buggy source:
public Object getValue(final String name){
  return originalSession.getValue(name);
}

Fixed version (ground truth):
public Object getValue(final String name){
  return getAttribute(name);
}
Program: 49852
Project: 49852
Buggy source:
Record ensureRecord(Request req,Data defaultValue){
  checkServiceThread();
  CMap cmap=getOrCreateMap(req.name);
  Record record=cmap.getRecord(req);
  if (record == null) {
    record=cmap.createNewRecord(req.key,defaultValue);
    cmap.mapRecords.put(req.key,record);
  }
  return record;
}

Fixed version (ground truth):
Record ensureRecord(Request req,Data defaultValue){
  checkServiceThread();
  CMap cmap=getOrCreateMap(req.name);
  Record record=cmap.getRecord(req);
  if (record == null || !record.isActive() || !record.isValid()) {
    record=cmap.createNewRecord(req.key,defaultValue);
    cmap.mapRecords.put(req.key,record);
  }
  return record;
}
Program: 49853
Project: 49853
Buggy source:
/** 
 * Test for Issue 710
 */
@Test public void testEvictedEntryNotNullAfterLockAndGet() throws Exception {
  String mapName="String_Node_Str";
  Config config=new XmlConfigBuilder().build();
  MapConfig mapConfig=new MapConfig();
  mapConfig.setName(mapName);
  mapConfig.setTimeToLiveSeconds(3);
  config.addMapConfig(mapConfig);
  HazelcastInstance h1=Hazelcast.newHazelcastInstance(config);
  IMap<Object,Object> m1=h1.getMap(mapName);
  m1.put(1,1);
  assertEquals(1,m1.get(1));
  Thread.sleep(3000);
  assertEquals(null,m1.get(1));
  m1.lock(1);
  assertEquals(null,m1.get(1));
  m1.put(1,1);
  assertEquals(1,m1.get(1));
}

Fixed version (ground truth):
/** 
 * Test for Issue 710
 */
@Test public void testEvictedEntryNotNullAfterLockAndGet() throws Exception {
  String mapName="String_Node_Str";
  Config config=new XmlConfigBuilder().build();
  MapConfig mapConfig=new MapConfig();
  mapConfig.setName(mapName);
  mapConfig.setTimeToLiveSeconds(3);
  config.addMapConfig(mapConfig);
  HazelcastInstance h1=Hazelcast.newHazelcastInstance(config);
  IMap<Object,Object> m1=h1.getMap(mapName);
  m1.put(1,1);
  assertEquals(1,m1.get(1));
  Thread.sleep(5000);
  assertEquals(null,m1.get(1));
  m1.lock(1);
  assertEquals(null,m1.get(1));
  m1.put(1,1);
  assertEquals(1,m1.get(1));
}
Program: 49854
Project: 49854
Buggy source:
private void addSessionCookie(final RequestWrapper req,final String sessionId){
  final Cookie sessionCookie=new Cookie(HAZELCAST_SESSION_COOKIE_NAME,sessionId);
  sessionCookie.setPath(req.getContextPath());
  sessionCookie.setMaxAge(-1);
  req.res.addCookie(sessionCookie);
}

Fixed version (ground truth):
private void addSessionCookie(final RequestWrapper req,final String sessionId){
  final Cookie sessionCookie=new Cookie(HAZELCAST_SESSION_COOKIE_NAME,sessionId);
  String path=req.getContextPath();
  if ("String_Node_Str".equals(path)) {
    path="String_Node_Str";
  }
  sessionCookie.setPath(path);
  sessionCookie.setMaxAge(-1);
  req.res.addCookie(sessionCookie);
}
Program: 49855
Project: 49855
Buggy source:
public CollectionRegion buildCollectionRegion(final String regionName,final Properties properties,final CacheDataDescription metadata) throws CacheException {
  return new HazelcastCollectionRegion(instance,regionName,metadata);
}

Fixed version (ground truth):
public CollectionRegion buildCollectionRegion(final String regionName,final Properties properties,final CacheDataDescription metadata) throws CacheException {
  return new HazelcastCollectionRegion(instance,regionName,properties,metadata);
}
Program: 49856
Project: 49856
Buggy source:
public EntityRegion buildEntityRegion(final String regionName,final Properties properties,final CacheDataDescription metadata) throws CacheException {
  return new HazelcastEntityRegion(instance,regionName,metadata);
}

Fixed version (ground truth):
public EntityRegion buildEntityRegion(final String regionName,final Properties properties,final CacheDataDescription metadata) throws CacheException {
  return new HazelcastEntityRegion(instance,regionName,properties,metadata);
}
Program: 49857
Project: 49857
Buggy source:
public TimestampsRegion buildTimestampsRegion(final String regionName,final Properties properties) throws CacheException {
  return new HazelcastTimestampsRegion(instance,regionName);
}

Fixed version (ground truth):
public TimestampsRegion buildTimestampsRegion(final String regionName,final Properties properties) throws CacheException {
  return new HazelcastTimestampsRegion(instance,regionName,properties);
}
Program: 49858
Project: 49858
Buggy source:
public void stop(){
  LOG.log(Level.INFO,"String_Node_Str");
  instance.getLifecycleService().shutdown();
}

Fixed version (ground truth):
public void stop(){
  if (instanceLoader != null) {
    LOG.log(Level.INFO,"String_Node_Str");
    instanceLoader.unloadInstance();
    instance=null;
    instanceLoader=null;
  }
}
Program: 49859
Project: 49859
Buggy source:
public void start(final Settings settings,final Properties properties) throws CacheException {
  LOG.log(Level.INFO,"String_Node_Str");
  if (instance == null || !instance.getLifecycleService().isRunning()) {
    instance=HazelcastInstanceFactory.createInstance(properties);
  }
}

Fixed version (ground truth):
public void start(final Settings settings,final Properties properties) throws CacheException {
  LOG.log(Level.INFO,"String_Node_Str");
  if (instance == null || !instance.getLifecycleService().isRunning()) {
    instanceLoader=HazelcastInstanceFactory.createInstanceLoader(properties);
    instance=instanceLoader.loadInstance();
  }
}
Program: 49860
Project: 49860
Buggy source:
public QueryResultsRegion buildQueryResultsRegion(final String regionName,final Properties properties) throws CacheException {
  return new HazelcastQueryResultsRegion(instance,regionName);
}

Fixed version (ground truth):
public QueryResultsRegion buildQueryResultsRegion(final String regionName,final Properties properties) throws CacheException {
  return new HazelcastQueryResultsRegion(instance,regionName,properties);
}
Program: 49861
Project: 49861
Buggy source:
public static int getTimeout(HazelcastInstance instance,String regionName){
  int ttl=DEFAULT_TIMEOUT;
  try {
    final MapConfig cfg=instance.getConfig().findMatchingMapConfig(regionName);
    if (cfg.getTimeToLiveSeconds() > 0) {
      ttl=cfg.getTimeToLiveSeconds() * 1000;
    }
  }
 catch (  UnsupportedOperationException ignore) {
  }
  return ttl;
}

Fixed version (ground truth):
public static int getTimeout(HazelcastInstance instance,String regionName){
  try {
    final MapConfig cfg=instance.getConfig().findMatchingMapConfig(regionName);
    if (cfg.getTimeToLiveSeconds() > 0) {
      return cfg.getTimeToLiveSeconds() * 1000;
    }
  }
 catch (  UnsupportedOperationException ignored) {
  }
  return CacheEnvironment.getDefaultCacheTimeoutInMillis();
}
Program: 49862
Project: 49862
Buggy source:
protected AbstractAccessDelegate(final T hazelcastRegion){
  this.hazelcastRegion=hazelcastRegion;
}

Fixed version (ground truth):
protected AbstractAccessDelegate(final T hazelcastRegion,final Properties props){
  this.hazelcastRegion=hazelcastRegion;
}
Program: 49863
Project: 49863
Buggy source:
public NonStrictReadWriteAccessDelegate(T hazelcastRegion){
  super(hazelcastRegion);
}

Fixed version (ground truth):
public NonStrictReadWriteAccessDelegate(T hazelcastRegion,final Properties props){
  super(hazelcastRegion,props);
}
Program: 49864
Project: 49864
Buggy source:
public ReadOnlyAccessDelegate(T hazelcastRegion){
  super(hazelcastRegion);
}

Fixed version (ground truth):
public ReadOnlyAccessDelegate(T hazelcastRegion,final Properties props){
  super(hazelcastRegion,props);
}
Program: 49865
Project: 49865
Buggy source:
public SoftLock lockItem(final Object key,final Object version) throws CacheException {
  getCache().lock(key);
  return new SoftLock(){
  }
;
}

Fixed version (ground truth):
public SoftLock lockItem(final Object key,final Object version) throws CacheException {
  if (lockTimeout > 0) {
    if (!getCache().tryLock(key,lockTimeout,TimeUnit.SECONDS)) {
      throw new CacheException("String_Node_Str" + lockTimeout + "String_Node_Str");
    }
  }
 else {
    getCache().lock(key);
  }
  return new SoftLock(){
  }
;
}
Program: 49866
Project: 49866
Buggy source:
public ReadWriteAccessDelegate(T hazelcastRegion){
  super(hazelcastRegion);
}

Fixed version (ground truth):
public ReadWriteAccessDelegate(T hazelcastRegion,final Properties props){
  super(hazelcastRegion,props);
  lockTimeout=CacheEnvironment.getLockTimeoutInSeconds(props);
}
Program: 49867
Project: 49867
Buggy source:
public CollectionRegionAccessStrategy buildAccessStrategy(final AccessType accessType) throws CacheException {
  if (null == accessType) {
    throw new CacheException("String_Node_Str");
  }
  if (AccessType.READ_ONLY.equals(accessType)) {
    return new ReadOnlyAccessStrategy(this);
  }
  if (AccessType.NONSTRICT_READ_WRITE.equals(accessType)) {
    return new NonStrictReadWriteAccessStrategy(this);
  }
  if (AccessType.READ_WRITE.equals(accessType)) {
    return new ReadWriteAccessStrategy(this);
  }
  if (AccessType.TRANSACTIONAL.equals(accessType)) {
    throw new CacheException("String_Node_Str");
  }
  throw new CacheException("String_Node_Str" + accessType + "String_Node_Str");
}

Fixed version (ground truth):
public CollectionRegionAccessStrategy buildAccessStrategy(final AccessType accessType) throws CacheException {
  if (null == accessType) {
    throw new CacheException("String_Node_Str");
  }
  if (AccessType.READ_ONLY.equals(accessType)) {
    return new ReadOnlyAccessStrategy(this,props);
  }
  if (AccessType.NONSTRICT_READ_WRITE.equals(accessType)) {
    return new NonStrictReadWriteAccessStrategy(this,props);
  }
  if (AccessType.READ_WRITE.equals(accessType)) {
    return new ReadWriteAccessStrategy(this,props);
  }
  if (AccessType.TRANSACTIONAL.equals(accessType)) {
    throw new CacheException("String_Node_Str");
  }
  throw new CacheException("String_Node_Str" + accessType + "String_Node_Str");
}
Program: 49868
Project: 49868
Buggy source:
public HazelcastCollectionRegion(final HazelcastInstance instance,final String regionName,final CacheDataDescription metadata){
  super(instance,regionName,metadata);
}

Fixed version (ground truth):
public HazelcastCollectionRegion(final HazelcastInstance instance,final String regionName,final Properties props,final CacheDataDescription metadata){
  super(instance,regionName,props,metadata);
}
Program: 49869
Project: 49869
Buggy source:
@Override public void onExpire(){
  request.response=null;
  returnResponse(request);
  setValid(false);
}

Fixed version (ground truth):
@Override public void onExpire(){
  request.response=null;
  pollWaitList.remove(this);
  returnResponse(request);
  setValid(false);
}
Program: 49870
Project: 49870
Buggy source:
final void handleSocketException(Throwable e){
  if (e instanceof OutOfMemoryError) {
    node.onOutOfMemory((OutOfMemoryError)e);
  }
  if (sk != null) {
    sk.cancel();
  }
  connection.close();
  StringBuilder sb=new StringBuilder();
  sb.append(Thread.currentThread().getName());
  sb.append("String_Node_Str");
  sb.append(connection.getEndPoint());
  sb.append("String_Node_Str").append(e);
  if (e instanceof IOException) {
    logger.log(Level.WARNING,sb.toString());
  }
 else {
    logger.log(Level.WARNING,sb.toString(),e);
  }
}

Fixed version (ground truth):
final void handleSocketException(Throwable e){
  if (e instanceof OutOfMemoryError) {
    node.onOutOfMemory((OutOfMemoryError)e);
  }
  if (sk != null) {
    sk.cancel();
  }
  connection.close();
  if (connection.getType().isClient() && !connection.getType().isBinary()) {
    return;
  }
  StringBuilder sb=new StringBuilder();
  sb.append(Thread.currentThread().getName());
  sb.append("String_Node_Str");
  sb.append(connection.getEndPoint());
  sb.append("String_Node_Str").append(e);
  if (e instanceof IOException) {
    logger.log(Level.WARNING,sb.toString());
  }
 else {
    logger.log(Level.WARNING,sb.toString(),e);
  }
}
Program: 49872
Project: 49872
Buggy source:
/** 
 * See the general contract of the <code>readUTF</code> method of <code>DataInput</code>. <p/> Bytes for this operation are read from the contained input stream.
 * @return a Unicode string.
 * @throws EOFException           if this input stream reaches the end before reading allthe bytes.
 * @throws IOException            if an I/O error occurs.
 * @throws UTFDataFormatException if the bytes do not represent a valid modified UTF-8encoding of a string.
 * @see java.io.DataInputStream#readUTF(java.io.DataInput)
 */
public final String readUTF() throws IOException {
  StringBuilder result=new StringBuilder();
  int chunkSize=readInt();
  while (chunkSize > 0) {
    result.append(readShortUTF());
    chunkSize--;
  }
  return result.toString();
}

Fixed version (ground truth):
/** 
 * See the general contract of the <code>readUTF</code> method of <code>DataInput</code>. <p/> Bytes for this operation are read from the contained input stream.
 * @return a Unicode string.
 * @throws EOFException           if this input stream reaches the end before reading allthe bytes.
 * @throws IOException            if an I/O error occurs.
 * @throws UTFDataFormatException if the bytes do not represent a valid modified UTF-8encoding of a string.
 * @see java.io.DataInputStream#readUTF(java.io.DataInput)
 */
public final String readUTF() throws IOException {
  boolean isNull=readBoolean();
  if (isNull)   return null;
  int length=readInt();
  StringBuilder result=new StringBuilder(length);
  int chunkSize=length / FastByteArrayOutputStream.STRING_CHUNK_SIZE + 1;
  while (chunkSize > 0) {
    result.append(readShortUTF());
    chunkSize--;
  }
  return result.toString();
}
Program: 49873
Project: 49873
Buggy source:
public final void writeUTF(final String str) throws IOException {
  int length=str.length();
  int chunkSize=length / STRING_CHUNK_SIZE + 1;
  writeInt(chunkSize);
  for (int i=0; i < chunkSize; i++) {
    int beginIndex=Math.max(0,i * STRING_CHUNK_SIZE - 1);
    int endIndex=Math.min((i + 1) * STRING_CHUNK_SIZE - 1,length);
    writeShortUTF(str.substring(beginIndex,endIndex));
  }
}

Fixed version (ground truth):
public final void writeUTF(final String str) throws IOException {
  boolean isNull=(str == null);
  writeBoolean(isNull);
  if (isNull)   return;
  int length=str.length();
  writeInt(length);
  int chunkSize=length / STRING_CHUNK_SIZE + 1;
  for (int i=0; i < chunkSize; i++) {
    int beginIndex=Math.max(0,i * STRING_CHUNK_SIZE - 1);
    int endIndex=Math.min((i + 1) * STRING_CHUNK_SIZE - 1,length);
    writeShortUTF(str.substring(beginIndex,endIndex));
  }
}
Program: 49874
Project: 49874
Buggy source:
public static Class<?> loadClass(final ClassLoader classLoader,final String className) throws ClassNotFoundException {
  if (className == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (className.startsWith("String_Node_Str")) {
    return AbstractSerializer.class.getClassLoader().loadClass(className);
  }
  ClassLoader theClassLoader=classLoader;
  if (theClassLoader == null) {
    theClassLoader=Thread.currentThread().getContextClassLoader();
  }
  if (theClassLoader != null) {
    return theClassLoader.loadClass(className);
  }
  return ClassLoader.getSystemClassLoader().loadClass(className);
}

Fixed version (ground truth):
public static Class<?> loadClass(final ClassLoader classLoader,final String className) throws ClassNotFoundException {
  if (className == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (className.startsWith("String_Node_Str")) {
    return AbstractSerializer.class.getClassLoader().loadClass(className);
  }
  ClassLoader theClassLoader=classLoader;
  if (theClassLoader == null) {
    theClassLoader=Thread.currentThread().getContextClassLoader();
  }
  if (className.startsWith("String_Node_Str")) {
    return Class.forName(className,true,theClassLoader);
  }
  if (theClassLoader != null) {
    return theClassLoader.loadClass(className);
  }
  return ClassLoader.getSystemClassLoader().loadClass(className);
}
Program: 49875
Project: 49875
Buggy source:
void markAsActive(Record record){
  long now=System.currentTimeMillis();
  if (!record.isActive() || !record.isValid(now)) {
    record.setActive();
    record.setCreationTime(now);
    record.setExpirationTime(ttl);
  }
}

Fixed version (ground truth):
void markAsActive(Record record){
  long now=System.currentTimeMillis();
  if (!record.isActive() || !record.isValid(now)) {
    record.setActive();
    record.setCreationTime(now);
    record.setLastUpdateTime(0L);
    record.setExpirationTime(ttl);
  }
}
Program: 49876
Project: 49876
Buggy source:
public void setLastUpdated(){
  if (expirationTime != Long.MAX_VALUE && expirationTime > 0) {
    long ttl=expirationTime - (lastUpdateTime > 0L ? lastUpdateTime : creationTime);
    setExpirationTime(ttl);
  }
  setLastUpdateTime(System.currentTimeMillis());
}

Fixed version (ground truth):
public void setLastUpdated(){
  if (expirationTime != Long.MAX_VALUE && expirationTime > 0) {
    long ttl=expirationTime - Math.max(lastUpdateTime,creationTime);
    setExpirationTime(ttl);
  }
  setLastUpdateTime(System.currentTimeMillis());
}
Program: 49877
Project: 49877
Buggy source:
public boolean isCancelled(){
  return false;
}

Fixed version (ground truth):
public boolean isCancelled(){
  return cancelled;
}
Program: 49878
Project: 49878
Buggy source:
public void setResult(Object obj){
  if (obj == null) {
    obj=NULL;
  }
  result=obj;
}

Fixed version (ground truth):
public void setResult(Object obj){
  result=(obj == null) ? NULL : obj;
}
Program: 49879
Project: 49879
Buggy source:
public V get(long timeout,TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
  if (result != null) {
    return getResult();
  }
  processResult(remoteCall.getResponse(timeout,unit));
  return getResult();
}

Fixed version (ground truth):
public V get(long timeout,TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
  if (isDone()) {
    return getResult();
  }
  Object response;
  try {
    response=remoteCall.getResponse(timeout,unit);
  }
 catch (  RuntimeException e) {
    response=e.getCause();
  }
  processResult(response);
  return getResult();
}
Program: 49880
Project: 49880
Buggy source:
public boolean isDone(){
  return false;
}

Fixed version (ground truth):
public boolean isDone(){
  return cancelled || result != null;
}
Program: 49881
Project: 49881
Buggy source:
public String getName(){
  return name.substring(Prefix.ATOMIC_NUMBER.length());
}

Fixed version (ground truth):
public String getName(){
  return name.substring(Prefix.ATOMIC_LONG.length());
}
Program: 49882
Project: 49882
Buggy source:
public InstanceType getInstanceType(){
  return InstanceType.ATOMIC_NUMBER;
}

Fixed version (ground truth):
public InstanceType getInstanceType(){
  return InstanceType.ATOMIC_LONG;
}
Program: 49884
Project: 49884
Buggy source:
public AtomicNumber getAtomicNumber(String name){
  return (AtomicNumber)getClientProxy(Prefix.ATOMIC_NUMBER + name);
}

Fixed version (ground truth):
public AtomicNumber getAtomicNumber(String name){
  return (AtomicNumber)getClientProxy(Prefix.ATOMIC_LONG + name);
}
Program: 49885
Project: 49885
Buggy source:
@Override public boolean equals(Object o){
  if (o instanceof ILock && o != null) {
    return getId().equals(((ILock)o).getId());
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean equals(Object o){
  if (o != null && o instanceof ILock) {
    return getId().equals(((ILock)o).getId());
  }
 else {
    return false;
  }
}
Program: 49886
Project: 49886
Buggy source:
public Object getId(){
  return lockObject;
}

Fixed version (ground truth):
public Object getId(){
  return new FactoryImpl.ProxyKey("String_Node_Str",lockObject);
}
Program: 49887
Project: 49887
Buggy source:
void clusterIsDown(Connection oldConnection){
  if (!running) {
    return;
  }
  client.getConnectionManager().destroyConnection(oldConnection);
  if (reconnection.compareAndSet(false,true)) {
    client.runAsyncAndWait(new Runnable(){
      public void run(){
        try {
          final Connection lookForAliveConnection=client.getConnectionManager().lookForAliveConnection();
          if (lookForAliveConnection == null) {
            logger.log(Level.WARNING,"String_Node_Str" + reconnection);
            if (reconnection.get()) {
              interruptWaitingCalls();
            }
          }
 else {
            if (running) {
              enQueue(RECONNECT_CALL);
            }
          }
        }
 catch (        IOException e) {
          logger.log(Level.WARNING,Thread.currentThread().getName() + "String_Node_Str" + e.getMessage(),e);
        }
 finally {
          reconnection.compareAndSet(true,false);
        }
      }
    }
);
  }
}

Fixed version (ground truth):
void clusterIsDown(Connection oldConnection){
  if (!running) {
    interruptWaitingCalls();
    return;
  }
  client.getConnectionManager().destroyConnection(oldConnection);
  if (reconnection.compareAndSet(false,true)) {
    client.runAsyncAndWait(new Runnable(){
      public void run(){
        try {
          final Connection lookForAliveConnection=client.getConnectionManager().lookForAliveConnection();
          if (lookForAliveConnection == null) {
            logger.log(Level.WARNING,"String_Node_Str" + reconnection);
            if (reconnection.get()) {
              interruptWaitingCalls();
            }
          }
 else {
            if (running) {
              enQueue(RECONNECT_CALL);
            }
          }
        }
 catch (        IOException e) {
          logger.log(Level.WARNING,Thread.currentThread().getName() + "String_Node_Str" + e.getMessage(),e);
        }
 finally {
          reconnection.compareAndSet(true,false);
        }
      }
    }
);
  }
}
Program: 49888
Project: 49888
Buggy source:
protected Packet prepareRequest(ClusterOperation operation,Object key,Object value){
  return prepareRequest(operation,key,value,0,null);
}

Fixed version (ground truth):
Packet prepareRequest(ClusterOperation operation,Object key,Object value){
  return prepareRequest(operation,key,value,0,null);
}
Program: 49889
Project: 49889
Buggy source:
@Test(expected=IllegalStateException.class,timeout=50000L) public void testNoClusterOnStart() throws Exception {
  final ClientProperties clientProperties=ClientProperties.crateBaseClientProperties(GroupConfig.DEFAULT_GROUP_NAME,GroupConfig.DEFAULT_GROUP_PASSWORD);
  clientProperties.setPropertyValue(ClientPropertyName.INIT_CONNECTION_ATTEMPTS_LIMIT,"String_Node_Str");
  clientProperties.setPropertyValue(ClientPropertyName.RECONNECTION_TIMEOUT,"String_Node_Str");
  HazelcastClient.newHazelcastClient(clientProperties,"String_Node_Str");
}

Fixed version (ground truth):
@Test(expected=IllegalStateException.class,timeout=50000L) public void testNoClusterOnStart() throws Exception {
  final ClientProperties clientProperties=ClientProperties.createBaseClientProperties(GroupConfig.DEFAULT_GROUP_NAME,GroupConfig.DEFAULT_GROUP_PASSWORD);
  clientProperties.setPropertyValue(ClientPropertyName.INIT_CONNECTION_ATTEMPTS_LIMIT,"String_Node_Str");
  clientProperties.setPropertyValue(ClientPropertyName.RECONNECTION_TIMEOUT,"String_Node_Str");
  HazelcastClient.newHazelcastClient(clientProperties,"String_Node_Str");
}
Program: 49890
Project: 49890
Buggy source:
@Test(expected=NoMemberAvailableException.class,timeout=50000L) public void testNoClusterAfterStart() throws Exception {
  HazelcastInstance h1=Hazelcast.newHazelcastInstance(new Config());
  final ClientProperties clientProperties=ClientProperties.crateBaseClientProperties(GroupConfig.DEFAULT_GROUP_NAME,GroupConfig.DEFAULT_GROUP_PASSWORD);
  clientProperties.setPropertyValue(ClientPropertyName.INIT_CONNECTION_ATTEMPTS_LIMIT,"String_Node_Str");
  clientProperties.setPropertyValue(ClientPropertyName.RECONNECTION_TIMEOUT,"String_Node_Str");
  HazelcastClient client=newHazelcastClient(clientProperties,h1);
  final IMap<Object,Object> map=client.getMap("String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  h1.getLifecycleService().shutdown();
  map.put("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test(expected=NoMemberAvailableException.class,timeout=50000L) public void testNoClusterAfterStart() throws Exception {
  HazelcastInstance h1=Hazelcast.newHazelcastInstance(new Config());
  final ClientProperties clientProperties=ClientProperties.createBaseClientProperties(GroupConfig.DEFAULT_GROUP_NAME,GroupConfig.DEFAULT_GROUP_PASSWORD);
  clientProperties.setPropertyValue(ClientPropertyName.INIT_CONNECTION_ATTEMPTS_LIMIT,"String_Node_Str");
  clientProperties.setPropertyValue(ClientPropertyName.RECONNECTION_TIMEOUT,"String_Node_Str");
  HazelcastClient client=newHazelcastClient(clientProperties,h1);
  final IMap<Object,Object> map=client.getMap("String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  h1.getLifecycleService().shutdown();
  map.put("String_Node_Str","String_Node_Str");
}
Program: 49893
Project: 49893
Buggy source:
@Test(expected=NoMemberAvailableException.class) public void testNoClusterAfterStartIssue328() throws Exception {
  HazelcastInstance h1=Hazelcast.newHazelcastInstance(new Config());
  final ClientProperties clientProperties=ClientProperties.crateBaseClientProperties(GroupConfig.DEFAULT_GROUP_NAME,GroupConfig.DEFAULT_GROUP_PASSWORD);
  clientProperties.setPropertyValue(ClientPropertyName.INIT_CONNECTION_ATTEMPTS_LIMIT,"String_Node_Str");
  clientProperties.setPropertyValue(ClientPropertyName.RECONNECTION_TIMEOUT,"String_Node_Str");
  HazelcastClient client=newHazelcastClient(clientProperties,h1);
  final IMap<Object,Object> map=client.getMap("String_Node_Str");
  h1.getLifecycleService().shutdown();
  map.put("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test(expected=NoMemberAvailableException.class) public void testNoClusterAfterStartIssue328() throws Exception {
  HazelcastInstance h1=Hazelcast.newHazelcastInstance(new Config());
  final ClientProperties clientProperties=ClientProperties.createBaseClientProperties(GroupConfig.DEFAULT_GROUP_NAME,GroupConfig.DEFAULT_GROUP_PASSWORD);
  clientProperties.setPropertyValue(ClientPropertyName.INIT_CONNECTION_ATTEMPTS_LIMIT,"String_Node_Str");
  clientProperties.setPropertyValue(ClientPropertyName.RECONNECTION_TIMEOUT,"String_Node_Str");
  HazelcastClient client=newHazelcastClient(clientProperties,h1);
  final IMap<Object,Object> map=client.getMap("String_Node_Str");
  h1.getLifecycleService().shutdown();
  map.put("String_Node_Str","String_Node_Str");
}
Program: 49894
Project: 49894
Buggy source:
@Test public void testMultiMapGetNameAndType(){
  HazelcastClient hClient=getHazelcastClient();
  MultiMap<String,String> map=hClient.getMultiMap("String_Node_Str");
  assertEquals("String_Node_Str",map.getName());
  Instance.InstanceType type=map.getInstanceType();
  assertEquals(Instance.InstanceType.MULTIMAP,type);
}

Fixed version (ground truth):
@Test public void testMultiMapGetNameAndType(){
  HazelcastClient hClient=getHazelcastClient();
  MultiMap<String,String> map=hClient.getMultiMap("String_Node_Str");
  assertEquals("String_Node_Str",map.getName());
  assertTrue(map.getInstanceType().isMultiMap());
}