auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected Object decode( ChannelHandlerContext ctx, Channel channel, ChannelBuffer buf) throws Exception { if (buf.readableBytes() == 0) { return null; } byte[] bytes = new byte[buf.readableBytes()]; buf.getBytes(0, bytes); if (bytes[0] == HEADER_START_SIGN && bytes.length == HEADER_LENGTH && (bytes[1] == HEADER_VERSION_1 || bytes[1] == HEADER_VERSION_2)) { return buf.readBytes(HEADER_LENGTH); } int parcelNumber = bytes[1] & 0xFF; if (bytes[0] == PACKAGE_START_SIGN && bytes[bytes.length - 1] == PACKAGE_END_SIGN && parcelNumber >= PACKAGE_MIN_PARCEL_NUMBER && parcelNumber <= PACKAGE_MAX_PARCEL_NUMBER) { return buf.readBytes(bytes.length); } return null; }

Target:
protected Object decode( ChannelHandlerContext ctx, Channel channel, ChannelBuffer buf) throws Exception { if (buf.readableBytes() < MIN_LENGTH) { return null; } int length; if (firstPacket) { firstPacket = false; length = HEADER_LENGTH; } else { int index = buf.getUnsignedByte(1); if (index == COMMAND_ANSWER_PARCEL_NUMBER) { length = COMMAND_ANSWER_PACKET_LENGTH; } else { int pos = 2; while (pos + PACKET_WRAPPER_LENGTH < buf.readableBytes() && buf.getByte(pos) != PACKAGE_END_SIGN) { int dataLength = buf.getUnsignedShort(pos + 1); pos += PACKET_WRAPPER_LENGTH + dataLength; } if (buf.getByte(pos) != PACKAGE_END_SIGN) { return null; } length = pos + 1; } } if (buf.readableBytes() >= length) { return buf.readBytes(length); } return null; }
Source:
public List<Response> listAll() { List<Sample> listSample = findAll(); List<Response> listRetorno = new ArrayList<Response>(); for (Sample sample : listSample) { SampleResponse sr = new SampleResponse(); sr.setName(sample.getName()); listRetorno.add(sr); } return listRetorno; }

Target:
public List<Response> listAll() { List<Sample> listSample = findAll(); List<Response> listReturn = new ArrayList<Response>(); for (Sample sample : listSample) { SampleResponse sr = new SampleResponse(); sr.setName(sample.getName()); listReturn.add(sr); } return listReturn; }
Source:
public OpenTxnsResponse open_txns(OpenTxnRequest rqst) throws TException { OpenTxnsResponse response = getTxnHandler().openTxns(rqst); if (!listeners.isEmpty()) { List<Long> txnIds = response.getTxn_ids(); for (Long id : txnIds) { MetaStoreListenerNotifier.notifyEvent(transactionalListeners, EventType.OPEN_TXN, new OpenTxnEvent(id, true, this)); } } return response; }

Target:
public OpenTxnsResponse open_txns(OpenTxnRequest rqst) throws TException { OpenTxnsResponse response = getTxnHandler().openTxns(rqst); List<Long> txnIds = response.getTxn_ids(); if (!listeners.isEmpty()) { MetaStoreListenerNotifier.notifyEvent(listeners,EventType.OPEN_TXN, new OpenTxnEvent(txnIds.iterator(),this)); } if (!transactionalListeners.isEmpty()) { MetaStoreListenerNotifier.notifyEvent(transactionalListeners, EventType.OPEN_TXN, new OpenTxnEvent(txnIds.iterator(),this)); } return response; }
Source:
public boolean assignVMToBackupOffering(final VirtualMachine vm, final BackupOffering backupOffering) { final VeeamClient client = getClient(vm.getDataCenterId()); final Job parentJob = client.listJob(backupOffering.getExternalId()); final String clonedJobName = getGuestBackupName(vm.getInstanceName(), vm.getUuid()); if (client.cloneVeeamJob(parentJob, clonedJobName)) { for (BackupOffering job : client.listJobs()) { if (job.getName().equals(clonedJobName)) { final Job clonedJob = client.listJob(job.getExternalId()); if (clonedJob.getScheduleConfigured() && !clonedJob.getScheduleEnabled()) { client.toggleJobSchedule(clonedJob.getId()); } final VmwareDatacenter vmwareDC = findVmwareDatacenterForVM(vm); if (client.addVMToVeeamJob(job.getExternalId(), vm.getInstanceName(), vmwareDC.getVcenterHost())) { ((VMInstanceVO) vm).setBackupExternalId(job.getExternalId()); return true; } } } } else { LOG.error("Failed to clone pre-defined Veeam job (backup offering) for backup offering ID: " + backupOffering.getExternalId()); } return false; }

Target:
public boolean assignVMToBackupOffering(final VirtualMachine vm, final BackupOffering backupOffering) { final VeeamClient client = getClient(vm.getDataCenterId()); final Job parentJob = client.listJob(backupOffering.getExternalId()); final String clonedJobName = getGuestBackupName(vm.getInstanceName(), vm.getUuid()); if (!client.cloneVeeamJob(parentJob, clonedJobName)) { LOG.error("Failed to clone pre-defined Veeam job (backup offering) for backup offering ID: " + backupOffering.getExternalId() + " but will check the list of jobs again if it was eventually succeeded."); } for (final BackupOffering job : client.listJobs()) { if (job.getName().equals(clonedJobName)) { final Job clonedJob = client.listJob(job.getExternalId()); if (clonedJob.getScheduleConfigured() && !clonedJob.getScheduleEnabled()) { client.toggleJobSchedule(clonedJob.getId()); } LOG.debug("Veeam job (backup offering) for backup offering ID: " + backupOffering.getExternalId() + " found, now trying to assign the VM to the job."); final VmwareDatacenter vmwareDC = findVmwareDatacenterForVM(vm); if (client.addVMToVeeamJob(job.getExternalId(), vm.getInstanceName(), vmwareDC.getVcenterHost())) { ((VMInstanceVO) vm).setBackupExternalId(job.getExternalId()); return true; } } } return false; }
Source:
private WorkerCountResponse createResponse(){ WorkerCountResponse.Builder builder = WorkerCountResponse.newBuilder(); if (workerCountProvider == null) { return builder .setValue(1) .setCanSetWorkerCount(false) .build(); } return builder .setValue(workerCountProvider.get()) .setCanSetWorkerCount(true) .build(); }

Target:
private WorkerCountResponse createResponse(){ WorkerCountResponse.Builder builder = WorkerCountResponse.newBuilder(); if (workerCountProvider == null) { return builder .setValue(DEFAULT_WORKER_COUNT) .setCanSetWorkerCount(false) .build(); } return builder .setValue(workerCountProvider.get()) .setCanSetWorkerCount(true) .build(); }
Source:
private String executeDeleteRequest(String urlString, ParamsMap params) throws MalformedURLException, IOException, MambuApiException { String response = ""; Integer errorCode = null; if (params != null && params.size() > 0) { urlString = new String((urlHelper.createUrlWithParams(urlString, params))); } LOGGER.info("DELETE with URL with params=" + urlString); HttpParams httpParameters = new BasicHttpParams(); HttpClient httpClient = new DefaultHttpClient(httpParameters); HttpDelete httpDelete = new HttpDelete(urlString); httpDelete.setHeader("Authorization", "Basic " + encodedAuthorization); HttpResponse httpResponse = httpClient.execute(httpDelete); int status = httpResponse.getStatusLine().getStatusCode(); InputStream content = null; HttpEntity entity = httpResponse.getEntity(); if (entity != null) { content = entity.getContent(); if (content != null) response = readStream(content); } if (status != HttpURLConnection.HTTP_OK) { errorCode = status; LOGGER.info("Error status=" + status + " Error response=" + response); } if (errorCode == null) LOGGER.info("Status=" + status + "\nResponse=" + response); if (errorCode != null) { LOGGER.warning("Creating exception, error code=" + errorCode + " response=" + response); throw new MambuApiException(errorCode, response); } return response; }

Target:
private String executeDeleteRequest(String urlString, ParamsMap params) throws MalformedURLException, IOException, MambuApiException { String response = ""; Integer errorCode = null; if (params != null && params.size() > 0) { urlString = new String((urlHelper.createUrlWithParams(urlString, params))); } LOGGER.info("DELETE with URL with params=" + urlString); HttpParams httpParameters = new BasicHttpParams(); HttpClient httpClient = new DefaultHttpClient(httpParameters); HttpDelete httpDelete = new HttpDelete(urlString); httpDelete.setHeader("Authorization", "Basic " + encodedAuthorization); HttpResponse httpResponse = httpClient.execute(httpDelete); int status = httpResponse.getStatusLine().getStatusCode(); InputStream content = null; HttpEntity entity = httpResponse.getEntity(); if (entity != null) { content = entity.getContent(); if (content != null) response = readStream(content); } if (status != HttpURLConnection.HTTP_OK) { errorCode = status; LOGGER.info("Error status=" + status + " Error response=" + response); } if (errorCode == null) LOGGER.info("Status=" + status + "\nResponse=" + response); if (errorCode != null) { LOGGER.warning("Creating exception, error code=" + errorCode + " response=" + response + " for url=" + urlString); throw new MambuApiException(errorCode, response); } return response; }
Source:
public Fare lookup (Stop from, Stop to) { return this.ignoreAgencyId ? lookup(from.stopId.split(":")[1], to.stopId.split(":")[1]) : lookup(from.stopId, to.stopId); }

Target:
public Fare lookup (Stop from, Stop to) { if (this.ignoreAgencyId) { String fromWithoutFeedId = from.stopId.split(":", 2)[1]; String toWithoutFeedId = to.stopId.split(":", 2)[1]; return lookup(fromWithoutFeedId, toWithoutFeedId); } else { return lookup(from.stopId, to.stopId); } }
Source:
public void test_write() throws Exception { final SilentServer ss = new SilentServer(); Socket s = new Socket(); int sendBufferSize = 1024; s.setSendBufferSize(sendBufferSize); s.connect(ss.getLocalSocketAddress()); new Killer(s).start(); try { System.err.println("write..."); byte[] buf = new byte[256*1024]; s.getOutputStream().write(buf); fail(); } catch (SocketException expected) { } ss.close(); }

Target:
public void test_write() throws Exception { final SilentServer ss = new SilentServer(128); Socket s = new Socket(); int sendBufferSize = 1024; s.setSendBufferSize(sendBufferSize); sendBufferSize = s.getSendBufferSize(); sendBufferSize *= 2; s.connect(ss.getLocalSocketAddress()); new Killer(s).start(); try { System.err.println("write..."); byte[] buf = new byte[sendBufferSize]; s.getOutputStream().write(buf); fail(); } catch (SocketException expected) { } ss.close(); }
Source:
public final boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof QueueConfig)) { return false; } QueueConfig that = (QueueConfig) o; return backupCount == that.backupCount && asyncBackupCount == that.asyncBackupCount && getMaxSize() == that.getMaxSize() && emptyQueueTtl == that.emptyQueueTtl && statisticsEnabled == that.statisticsEnabled && name.equals(that.name) && getItemListenerConfigs().equals(that.getItemListenerConfigs()) && Objects.equals(queueStoreConfig, that.queueStoreConfig) && Objects.equals(splitBrainProtectionName, that.splitBrainProtectionName) && Objects.equals(mergePolicyConfig, that.mergePolicyConfig); }

Target:
public final boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof QueueConfig)) { return false; } QueueConfig that = (QueueConfig) o; return backupCount == that.backupCount && asyncBackupCount == that.asyncBackupCount && getMaxSize() == that.getMaxSize() && emptyQueueTtl == that.emptyQueueTtl && statisticsEnabled == that.statisticsEnabled && Objects.equals(name, that.name) && getItemListenerConfigs().equals(that.getItemListenerConfigs()) && Objects.equals(queueStoreConfig, that.queueStoreConfig) && Objects.equals(splitBrainProtectionName, that.splitBrainProtectionName) && Objects.equals(mergePolicyConfig, that.mergePolicyConfig); }
Source:
private ModelNode processResponseHeaders(ModelNode responseHeaders) { if (!responseHeaders.hasDefined(ACCESS_CONTROL) || !forServer) { return responseHeaders; } else { ModelNode result = responseHeaders.clone(); for (ModelNode accItem : result.get(ACCESS_CONTROL).asList()) { ModelNode itemAddrNode = accItem.get("absolute-address"); PathAddress itemAddr = PathAddress.pathAddress(itemAddrNode); itemAddrNode.set(proxyController.getProxyNodeAddress().append(itemAddr).toModelNode()); } return result; } }

Target:
private ModelNode processResponseHeaders(ModelNode responseHeaders) { if (!responseHeaders.hasDefined(ACCESS_CONTROL) || !forServer) { return responseHeaders; } else { ModelNode result = responseHeaders.clone(); for (ModelNode accItem : result.get(ACCESS_CONTROL).asList()) { ModelNode itemAddrNode = accItem.get(ABSOLUTE_ADDRESS); PathAddress itemAddr = PathAddress.pathAddress(itemAddrNode); itemAddrNode.set(proxyController.getProxyNodeAddress().append(itemAddr).toModelNode()); } return result; } }
Source:
private Class loadClass(URLClassLoader classLoader, String className) { try { return classLoader.loadClass(className); } catch (ClassNotFoundException e) { LOG.error("Failed to load Task class " + className + " for new task in instance " + _manager .getInstanceName() + " in cluster " + _manager.getClusterName() + "."); throw new IllegalStateException("Class not found for task"); } }

Target:
private Class loadClass(URLClassLoader classLoader, String className) { try { return classLoader.loadClass(className); } catch (ClassNotFoundException e) { String errorMessage = "Failed to load Task class " + className + " for new task in instance " + _manager .getInstanceName() + " in cluster " + _manager.getClusterName() + "."; LOG.error(errorMessage); throw new IllegalStateException(errorMessage); } }
Source:
private void afterVMsRefreshTreatment() { for (Guid vm_guid : _vmsToRerun) { log.errorFormat("Rerun vm {0}. Called from vds {1}", vm_guid, _vds.getName()); ResourceManager.getInstance().RerunFailedCommand(vm_guid, _vds.getId()); } for (Guid vm_guid : _succededToRunVms) { _vdsManager.succededToRunVm(vm_guid); } _autoVmsToRun.removeAll(_vmsToRerun); getVdsEventListener().runFailedAutoStartVMs(_autoVmsToRun); for (Entry<VM, VmDynamic> pair : _vmsClientIpChanged.entrySet()) { getVdsEventListener().processOnClientIpChange(_vds, pair.getValue().getId()); } for (VmDynamic runningVm : _poweringUpVms) { ResourceManager .getInstance() .getEventListener() .processOnVmPoweringUp(_vds.getId(), runningVm.getId(), runningVm.getDisplayIp(), runningVm.getDisplay()); } getVdsEventListener().processOnVmStop(_vmsMovedToDown); for (Guid vm_guid : _vmsToRemoveFromAsync) { ResourceManager.getInstance().RemoveAsyncRunningVm(vm_guid); } }

Target:
private void afterVMsRefreshTreatment() { for (Guid vm_guid : _vmsToRerun) { log.errorFormat("Rerun vm {0}. Called from vds {1}", vm_guid, _vds.getName()); ResourceManager.getInstance().RerunFailedCommand(vm_guid, _vds.getId()); } for (Guid vm_guid : _succededToRunVms) { _vdsManager.succededToRunVm(vm_guid); } getVdsEventListener().updateSlaPolicies(_succededToRunVms, _vds.getId()); _autoVmsToRun.removeAll(_vmsToRerun); getVdsEventListener().runFailedAutoStartVMs(_autoVmsToRun); for (Entry<VM, VmDynamic> pair : _vmsClientIpChanged.entrySet()) { getVdsEventListener().processOnClientIpChange(_vds, pair.getValue().getId()); } for (VmDynamic runningVm : _poweringUpVms) { getVdsEventListener().processOnVmPoweringUp(runningVm.getId()); } getVdsEventListener().processOnVmStop(_vmsMovedToDown); for (Guid vm_guid : _vmsToRemoveFromAsync) { ResourceManager.getInstance().RemoveAsyncRunningVm(vm_guid); } }
Source:
public Entry<Key,Value> next() { try { Entry<Key,Value> result = new KeyValue(new Key(inner.getTopKey()), new Value(inner.getTopValue()).get()); inner.next(); return result; } catch (IOException ex) { throw new UncheckedIOException(ex); } }

Target:
public Entry<Key,Value> next() { try { Entry<Key,Value> result = new KeyValue(new Key(inner.getTopKey()), new Value(inner.getTopValue()).get()); inner.next(); return result; } catch (IOException ex) { throw new NoSuchElementException(); } }
Source:
private OrganizationalUnit createDefaultOrganizationalUnit() { if (!authorizationManager.authorize(OrganizationalUnit.RESOURCE_TYPE, OrganizationalUnitAction.CREATE, sessionInfo.getIdentity())) { return null; } final LibraryPreferences preferences = getPreferences(); final List<String> contributors = new ArrayList<>(); contributors.add(preferences.getOrganizationalUnitPreferences().getOwner()); return ouService.createOrganizationalUnit(preferences.getOrganizationalUnitPreferences().getName(), preferences.getOrganizationalUnitPreferences().getOwner(), preferences.getOrganizationalUnitPreferences().getGroupId(), new ArrayList<>(), contributors); }

Target:
private OrganizationalUnit createDefaultOrganizationalUnit() { if (!authorizationManager.authorize(OrganizationalUnit.RESOURCE_TYPE, OrganizationalUnitAction.CREATE, sessionInfo.getIdentity())) { return null; } final LibraryPreferences preferences = getPreferences(); final List<String> contributors = new ArrayList<>(); contributors.add(preferences.getOrganizationalUnitPreferences().getOwner()); return ouService.createOrganizationalUnit(preferences.getOrganizationalUnitPreferences().getName(), preferences.getOrganizationalUnitPreferences().getOwner(), preferences.getOrganizationalUnitPreferences().getGroupId(), Collections.emptyList(), contributors); }
Source:
void setDiceRollForBombing(final List<Die> dice, final int cost) { removeAll(); add(new JLabel("Cost: " + cost, SwingConstants.LEFT)); add(create(dice)); addBottomLabel(new JLabel()); }

Target:
void setDiceRollForBombing(final List<Die> dice, final int cost) { removeAll(); add(new JLabel("Cost: " + cost, SwingConstants.LEFT)); add(create(dice)); addBottomSpacing(); }
Source:
public static IServer findServerForService(String serviceName) { final IServerType serverType = getServerType(); final Optional<IServer> match = Stream.of(ServerCore.getServers()) .filter(server -> server.getServerType() .equals(serverType) && server.getAttribute(OpenShiftServerUtils.ATTR_SERVICE, "").equals(serviceName)) .findAny(); if (match.isPresent()) { return match.get(); } else { return null; } }

Target:
public static IServer findServerForService(String serviceName) { final IServerType serverType = getServerType(); return Stream.of(ServerCore.getServers()) .filter(server -> server.getServerType() .equals(serverType) && server.getAttribute(OpenShiftServerUtils.ATTR_SERVICE, "").equals(serviceName)) .findFirst().orElse(null); }
Source:
protected void run() throws Failure { IoAcceptor acceptor = daemon.getIoAcceptor(); if (acceptor == null) { throw new Failure(1, "fatal: sshd no longer running"); } if (acceptor instanceof MinaAcceptor) { stdout.print("mina\n"); } else if (acceptor instanceof Nio2Acceptor) { stdout.print("nio2\n"); } else { throw new Failure(1, "fatal: unknown ssh backend"); } }

Target:
protected void run() throws Failure { IoAcceptor acceptor = daemon.getIoAcceptor(); if (acceptor == null) { throw new Failure(1, "fatal: sshd no longer running"); } if (acceptor instanceof MinaAcceptor) { stdout.print("mina\n"); } else if (acceptor instanceof Nio2Acceptor) { stdout.print("nio2\n"); } else { stdout.print("unknown ssh backend\n"); } }
Source:
public BigDecimal convertPressure(BigDecimal value) { if (this == DEFAULT_PRESSURE_UNIT) { return value; } else if (this == INHG) { return value.multiply(new BigDecimal(0.02952998751)); } else { return value.multiply(new BigDecimal(0.750061683)); } }

Target:
public BigDecimal convertPressure(BigDecimal value) { if (this == DEFAULT_PRESSURE_UNIT) { return value; } else if (this == INHG) { return value.multiply(MBAR_TO_INHG); } else { return value.multiply(MBAR_TO_MMHG); } }
Source:
public Fragment getItem(int position) { switch (position) { case 0: return new RepositoryReadmeFragment(); case 1: return new RepositoryNewsFragment(); case 2: codeFragment = new RepositoryCodeFragment(); return codeFragment; case 3: commitsFragment = new CommitListFragment(); return commitsFragment; case 4: return new IssuesFragment(); default: return null; } }

Target:
public Fragment getItem(int position) { position = hasReadme ? position : position + 1; switch (position) { case 0: return new RepositoryReadmeFragment(); case 1: return new RepositoryNewsFragment(); case 2: codeFragment = new RepositoryCodeFragment(); return codeFragment; case 3: commitsFragment = new CommitListFragment(); return commitsFragment; case 4: return new IssuesFragment(); default: return null; } }
Source:
public boolean isRelevant() { if (!jenkins.hasPermission(Jenkins.RUN_SCRIPTS))) { return false; } if (rule.getMasterKillSwitch()) { return true; } return jenkins.isUseSecurity() && (jenkins.getComputers().length>1 || !jenkins.clouds.isEmpty() || Relevance.fromExtension() ) ; }

Target:
public boolean isRelevant() { return jenkins.hasPermission(Jenkins.RUN_SCRIPTS) && jenkins.isUseSecurity(); }
Source:
public void smokes() throws Exception { AtomicReference<Proc> proc = new AtomicReference<>(); try { JNLPLauncher launcher = new JNLPLauncher(true); launcher.setWebSocket(true); DumbSlave s = new DumbSlave("remote", tmp.newFolder("agent").getAbsolutePath(), launcher); r.jenkins.addNode(s); String secret = ((SlaveComputer) s.toComputer()).getJnlpMac(); File slaveJar = tmp.newFile(); FileUtils.copyURLToFile(new Slave.JnlpJar("slave.jar").getURL(), slaveJar); proc.set(r.createLocalLauncher().launch().cmds( JavaEnvUtils.getJreExecutable("java"), "-jar", slaveJar.getAbsolutePath(), "-jnlpUrl", r.getURL() + "computer/remote/slave-agent.jnlp", "-secret", secret ).stdout(System.out).start()); r.waitOnline(s); assertEquals("response", s.getChannel().call(new DummyTask())); assertNotNull(s.getChannel().call(new FatTask())); FreeStyleProject p = r.createFreeStyleProject(); p.setAssignedNode(s); p.getBuildersList().add(Functions.isWindows() ? new BatchFile("echo hello") : new Shell("dd if=/dev/random count=1024 bs=200")); r.buildAndAssertSuccess(p); s.toComputer().getLogText().writeLogTo(0, System.out); } finally { if (proc.get() != null) { proc.get().kill(); while (r.jenkins.getComputer("remote").isOnline()) { LOGGER.info("waiting for computer to go offline"); Thread.sleep(250); } } } }

Target:
public void smokes() throws Exception { AtomicReference<Proc> proc = new AtomicReference<>(); try { JNLPLauncher launcher = new JNLPLauncher(true); launcher.setWebSocket(true); DumbSlave s = new DumbSlave("remote", tmp.newFolder("agent").getAbsolutePath(), launcher); r.jenkins.addNode(s); String secret = ((SlaveComputer) s.toComputer()).getJnlpMac(); File slaveJar = tmp.newFile(); FileUtils.copyURLToFile(new Slave.JnlpJar("slave.jar").getURL(), slaveJar); proc.set(r.createLocalLauncher().launch().cmds( JavaEnvUtils.getJreExecutable("java"), "-jar", slaveJar.getAbsolutePath(), "-jnlpUrl", r.getURL() + "computer/remote/slave-agent.jnlp", "-secret", secret ).stdout(System.out).start()); r.waitOnline(s); assertEquals("response", s.getChannel().call(new DummyTask())); assertNotNull(s.getChannel().call(new FatTask())); FreeStyleProject p = r.createFreeStyleProject(); p.setAssignedNode(s); p.getBuildersList().add(Functions.isWindows() ? new BatchFile("echo hello") : new Shell("echo hello")); r.buildAndAssertSuccess(p); s.toComputer().getLogText().writeLogTo(0, System.out); } finally { if (proc.get() != null) { proc.get().kill(); while (r.jenkins.getComputer("remote").isOnline()) { LOGGER.info("waiting for computer to go offline"); Thread.sleep(250); } } } }
Source:
public void testElapsedTimeAndSessionOverlapping() throws InterruptedException, SipException, ParseException, InvalidArgumentException { deployApplication(ConcurrencyControlMode.SipSession); String fromName = "sender"; String fromSipAddress = "sip-servlets.com"; SipURI fromAddress = senderProtocolObjects.addressFactory.createSipURI( fromName, fromSipAddress); String toUser = "receiverWithTag"; String toSipAddress = "sip-servlets.com"; SipURI toAddress = senderProtocolObjects.addressFactory.createSipURI( toUser, toSipAddress); sender.setSendBye(false); sender.sendSipRequest("INVITE", fromAddress, toAddress, null, null, false); Thread.sleep(2000); sender.sendInDialogSipRequest("INFO", "1", "text", "plain", null, null); Thread.sleep(100); sender.sendInDialogSipRequest("INFO", "2", "text", "plain", null, null); Thread.sleep(100); sender.sendInDialogSipRequest("INFO", "3", "text", "plain", null, null); Thread.sleep(100); sender.sendBye(); Thread.sleep(20000); assertTrue(!sender.isServerErrorReceived()); assertTrue(sender.isAckSent()); assertTrue(sender.getOkToByeReceived()); }

Target:
public void testElapsedTimeAndSessionOverlapping() throws InterruptedException, SipException, ParseException, InvalidArgumentException { deployApplication(ConcurrencyControlMode.SipSession); String fromName = "sender"; String fromSipAddress = "sip-servlets.com"; SipURI fromAddress = senderProtocolObjects.addressFactory.createSipURI( fromName, fromSipAddress); String toUser = "receiver"; String toSipAddress = "sip-servlets.com"; SipURI toAddress = senderProtocolObjects.addressFactory.createSipURI( toUser, toSipAddress); sender.setSendBye(false); sender.sendSipRequest("INVITE", fromAddress, toAddress, null, null, false); Thread.sleep(2000); sender.sendInDialogSipRequest("INFO", "1", "text", "plain", null, null); Thread.sleep(100); sender.sendInDialogSipRequest("INFO", "2", "text", "plain", null, null); Thread.sleep(100); sender.sendInDialogSipRequest("INFO", "3", "text", "plain", null, null); Thread.sleep(100); sender.sendBye(); Thread.sleep(20000); assertTrue(!sender.isServerErrorReceived()); assertTrue(sender.isAckSent()); assertTrue(sender.getOkToByeReceived()); }
Source:
private boolean isMethodFiltered(final String className, final String superClassName, final int access, final String name, final String desc) { if ("java/lang/Enum".equals(superClassName)) { if ("values".equals(name) && desc.equals("()[L" + className + ";")) { return true; } if ("valueOf".equals(name) && desc.equals("(Ljava/lang/String;)L" + className + ";")) { return true; } } return (access & Opcodes.ACC_SYNTHETIC) != 0 && !name.startsWith("lambda$"); }

Target:
private boolean isMethodFiltered(final String className, final String superClassName, final int access, final String name, final String desc) { if ("java/lang/Enum".equals(superClassName)) { if ("values".equals(name) && ("()[L" + className + ";").equals(desc)) { return true; } if ("valueOf".equals(name) && ("(Ljava/lang/String;)L" + className + ";") .equals(desc)) { return true; } } return (access & Opcodes.ACC_SYNTHETIC) != 0 && !name.startsWith("lambda$"); }
Source:
static boolean isSystemLevelClass(ASTUserClass node) { List<TypeRef> interfaces = node.getNode().getDefiningType().getCodeUnitDetails().getInterfaceTypeRefs(); boolean hasWhitelistedInterfaces = false; for (TypeRef intObject : interfaces) { if (isWhitelisted(intObject.getNames())) { hasWhitelistedInterfaces = true; break; } } return hasWhitelistedInterfaces; }

Target:
static boolean isSystemLevelClass(ASTUserClass node) { List<TypeRef> interfaces = node.getNode().getDefiningType().getCodeUnitDetails().getInterfaceTypeRefs(); for (TypeRef intObject : interfaces) { if (isWhitelisted(intObject.getNames())) { return true; } } return false; }
Source:
private void assertNicAvailable(Nic nic) { assertPredicate(new Predicate<String>() { @Override public boolean apply(String args) { String[] params = args.split(","); Nic nic = nicApi().getNic(params[0], params[1], params[2]); if (nic == null || nic.metadata() == null) return false; return nic.metadata().state() == State.AVAILABLE; } }, complexId(nic.dataCenterId(), testServer.id(), nic.id())); }

Target:
private void assertNicAvailable(Nic nic) { assertPredicate(new Predicate<Nic>() { @Override public boolean apply(Nic testNic) { Nic nic = nicApi().get(testNic.dataCenterId(), testNic.serverId(), testNic.id()); if (nic == null || nic.metadata() == null) return false; return nic.metadata().state() == State.AVAILABLE; } }, nic); }
Source:
private static void executePost(HttpUrl url, byte[] data) throws IOException { RequestBody requestBody = data == null ? RequestBody.create(MediaType.parse("text/plain"), "") : RequestBody.create(MediaType.parse("application/octet-stream"), data); ; Request request = new Request.Builder() .url(url) .post(requestBody) .build(); Response response = httpClient.newCall(request).execute(); if (!response.isSuccessful()) { String responseBody = response.body() != null ? response.body().string() : ""; throw new SolrClientUtilsException(response.code(), "Unable to upload binary\n" + responseBody); } }

Target:
private static void executePost(HttpUrl url, byte[] data) throws IOException { RequestBody requestBody = data == null ? RequestBody.create(MediaType.parse("text/plain"), "") : RequestBody.create(MediaType.parse("application/octet-stream"), data); ; Request request = new Request.Builder() .url(url) .post(requestBody) .build(); Response response = httpClient.newCall(request).execute(); if (!response.isSuccessful()) { String responseBody = ""; if (response.body() != null) { responseBody = response.body().string(); response.close(); } throw new SolrClientUtilsException(response.code(), "Unable to upload binary\n" + responseBody); } if (response.body() != null) { response.close(); } }
Source:
public DefaultStatisticsServiceConfiguration withLatencyHistorySize(int size) { if (size <= 0) { throw new IllegalArgumentException("Latency history size must be a positive integer."); } this.latencyHistorySize = size; return this; }

Target:
public DefaultStatisticsServiceConfiguration withLatencyHistorySize(int size) { if (size <= 0) { throw new IllegalArgumentException("Latency history size must be a positive integer"); } this.latencyHistorySize = size; return this; }
Source:
public void testCustomPartitionCountOverridesDefaultIfLarger() throws Exception { byte[] ratherBigPayload = new byte[2048]; Arrays.fill(ratherBigPayload, (byte) 65); KafkaTestBinder binder = (KafkaTestBinder) getBinder(); DirectChannel moduleOutputChannel = new DirectChannel(); QueueChannel moduleInputChannel = new QueueChannel(); Properties producerProperties = new Properties(); producerProperties.put(BinderPropertyKeys.MIN_PARTITION_COUNT, "10"); Properties consumerProperties = new Properties(); consumerProperties.put(BinderPropertyKeys.MIN_PARTITION_COUNT, "10"); long uniqueBindingId = System.currentTimeMillis(); Binding<MessageChannel> producerBinding = binder.bindProducer("foo" + uniqueBindingId + ".0", moduleOutputChannel, producerProperties); Binding<MessageChannel> consumerBinding = binder.bindConsumer("foo" + uniqueBindingId + ".0", null, moduleInputChannel, consumerProperties); Message<?> message = org.springframework.integration.support.MessageBuilder.withPayload(ratherBigPayload).build(); binderBindUnbindLatency(); moduleOutputChannel.send(message); Message<?> inbound = moduleInputChannel.receive((int)(2000 * timeoutMultiplier)); assertNotNull(inbound); assertArrayEquals(ratherBigPayload, (byte[]) inbound.getPayload()); Collection<Partition> partitions = binder.getCoreBinder().getConnectionFactory().getPartitions( "foo" + uniqueBindingId + ".0"); assertThat(partitions, hasSize(10)); binder.unbind(producerBinding); binder.unbind(consumerBinding); }

Target:
public void testCustomPartitionCountOverridesDefaultIfLarger() throws Exception { byte[] ratherBigPayload = new byte[2048]; Arrays.fill(ratherBigPayload, (byte) 65); KafkaTestBinder binder = (KafkaTestBinder) getBinder(); DirectChannel moduleOutputChannel = new DirectChannel(); QueueChannel moduleInputChannel = new QueueChannel(); Properties producerProperties = new Properties(); producerProperties.put(BinderPropertyKeys.MIN_PARTITION_COUNT, "10"); Properties consumerProperties = new Properties(); consumerProperties.put(BinderPropertyKeys.MIN_PARTITION_COUNT, "10"); long uniqueBindingId = System.currentTimeMillis(); Binding<MessageChannel> producerBinding = binder.bindProducer("foo" + uniqueBindingId + ".0", moduleOutputChannel, producerProperties); Binding<MessageChannel> consumerBinding = binder.bindConsumer("foo" + uniqueBindingId + ".0", null, moduleInputChannel, consumerProperties); Message<?> message = org.springframework.integration.support.MessageBuilder.withPayload(ratherBigPayload).build(); binderBindUnbindLatency(); moduleOutputChannel.send(message); Message<?> inbound = receive(moduleInputChannel); assertNotNull(inbound); assertArrayEquals(ratherBigPayload, (byte[]) inbound.getPayload()); Collection<Partition> partitions = binder.getCoreBinder().getConnectionFactory().getPartitions( "foo" + uniqueBindingId + ".0"); assertThat(partitions, hasSize(10)); binder.unbind(producerBinding); binder.unbind(consumerBinding); }
Source:
public void testExceptionConfirmPattern() { DispatchCallback callback = new DispatchCallback(); SqlLine line = new SqlLine(); assertEquals(Boolean.FALSE, line.getOpts().getConfirm()); thrown.expect(IllegalArgumentException.class); thrown.expectMessage(containsString("invalid regex")); line.runCommands( Collections.singletonList("!set confirmPattern " + "\"^(?i*:(TRUNCATE|ALTER))\""), callback); thrown.expect(IllegalArgumentException.class); thrown.expectMessage(containsString("null")); line.runCommands( Collections.singletonList("!set confirmPattern "), callback); }

Target:
public void testExceptionConfirmPattern() { try { SqlLine line = new SqlLine(); ByteArrayOutputStream os = new ByteArrayOutputStream(); assertEquals(Boolean.FALSE, line.getOpts().getConfirm()); SqlLine.Status status = begin(line, os, false, "-e", "!set confirmPattern \"^(?i*:(TRUNCATE|ALTER))\""); assertThat(status, equalTo(SqlLine.Status.OK)); assertThat(os.toString("UTF8"), containsString("invalid regex")); os.reset(); } catch (Throwable e) { throw new RuntimeException(e); } }
Source:
public void testPutAll() throws Exception { final Map<String, String> originalStoreContent = getEntryMap(KEY_SET_A, KEY_SET_B); final FakeStore fakeStore = new FakeStore(originalStoreContent); this.store = spy(fakeStore); final Ehcache<String, String> ehcache = this.getEhcache(); final Map<String, String> contentUpdates = getAltEntryMap("new_", fanIn(KEY_SET_A, KEY_SET_C, KEY_SET_D)); ehcache.putAll(contentUpdates); verify(cacheEventListener, times(18)).onEvent(argThat(isCreatedOrUpdated)); try { ehcache.getRuntimeConfiguration().deregisterCacheEventListener(cacheEventListener); fail(); } catch (UnsupportedOperationException e) { } }

Target:
public void testPutAll() throws Exception { buildStore(getEntryMap(KEY_SET_A, KEY_SET_B)); final Ehcache<String, String> ehcache = getEhcache(); final Map<String, String> contentUpdates = getAltEntryMap("new_", fanIn(KEY_SET_A, KEY_SET_C, KEY_SET_D)); ehcache.putAll(contentUpdates); int invocations = KEY_SET_A.size() + KEY_SET_C.size() + KEY_SET_D.size(); verify(cacheEventListener, times(invocations)).onEvent(argThat(isCreatedOrUpdated)); }
Source:
public void setupTest() { assumeTrue(CtfTmfTestTrace.KERNEL.exists()); fTrace = CtfTmfTestTrace.KERNEL.getTrace(); Document doc = null; try { DocumentBuilderFactory dbFactory = DocumentBuilderFactory .newInstance(); DocumentBuilder dBuilder; dBuilder = dbFactory.newDocumentBuilder(); doc = dBuilder.parse(TmfXmlTestFiles.VALID_FILE.getFile()); doc.getDocumentElement().normalize(); } catch (ParserConfigurationException e) { fail("Xml document parse exception"); } catch (SAXException e) { fail("Exception parsing xml file"); } catch (IOException e) { fail("File io exception"); } assertNotNull(doc); NodeList stateproviderNodes = doc .getElementsByTagName(TmfXmlStrings.STATE_PROVIDER); Element node = (Element) stateproviderNodes.item(0); fModule = new XmlStateSystemModule(); String moduleId = node.getAttribute(TmfXmlStrings.ANALYSIS_ID); fModule.setId(moduleId); fModule.setXmlFile(new Path(TmfXmlTestFiles.VALID_FILE.getFile().getAbsolutePath())); NodeList head = node.getElementsByTagName(TmfXmlStrings.HEAD); XmlHeadInfo headInfo = null; if (head.getLength() == 1) { headInfo = new XmlHeadInfo(head.item(0)); } fModule.setHeadInfo(headInfo); try { fModule.setTrace(fTrace); fModule.schedule(); } catch (TmfAnalysisException e) { fail("Cannot set trace " + e.getMessage()); } }

Target:
public void setupTest() { assumeTrue(CtfTmfTestTrace.KERNEL.exists()); fTrace = CtfTmfTestTrace.KERNEL.getTrace(); Document doc = null; try { DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); doc = dBuilder.parse(TmfXmlTestFiles.VALID_FILE.getFile()); doc.getDocumentElement().normalize(); } catch (ParserConfigurationException e) { fail("Xml document parse exception"); } catch (SAXException e) { fail("Exception parsing xml file"); } catch (IOException e) { fail("File io exception"); } assertNotNull(doc); NodeList stateproviderNodes = doc.getElementsByTagName(TmfXmlStrings.STATE_PROVIDER); Element node = (Element) stateproviderNodes.item(0); fModule = new XmlStateSystemModule(); String moduleId = node.getAttribute(TmfXmlStrings.ANALYSIS_ID); fModule.setId(moduleId); fModule.setXmlFile(new Path(TmfXmlTestFiles.VALID_FILE.getFile().getAbsolutePath())); NodeList head = node.getElementsByTagName(TmfXmlStrings.HEAD); XmlHeadInfo headInfo = null; if (head.getLength() == 1) { headInfo = new XmlHeadInfo(head.item(0)); } fModule.setHeadInfo(headInfo); try { fModule.setTrace(fTrace); fModule.schedule(); } catch (TmfAnalysisException e) { fail("Cannot set trace " + e.getMessage()); } }
Source:
protected void onBeforeClusterItemRendered(TiClusterMarker clusterItem, MarkerOptions markerOptions) { AnnotationProxy anno = clusterItem.getProxy(); if (anno.hasProperty(TiC.PROPERTY_IMAGE)) { TiDrawableReference imageref = TiDrawableReference.fromUrl(anno, (String) anno.getProperty(TiC.PROPERTY_IMAGE)); Bitmap bitmap = imageref.getBitmap(true, false); if (bitmap != null) { try { markerOptions.icon(BitmapDescriptorFactory.fromBitmap(bitmap)); setIconImageDimensions(bitmap.getWidth(), bitmap.getHeight()); } catch (Exception e){} } } if (anno.hasProperty(MapModule.PROPERTY_CENTER_OFFSET)) { HashMap centerOffsetProperty = (HashMap) anno.getProperty(MapModule.PROPERTY_CENTER_OFFSET); TiPoint centerOffset = new TiPoint(centerOffsetProperty, 0.0, 0.0); float offsetX = 0.5f - ((float) centerOffset.getX().getValue() / (float) iconImageWidth); float offsetY = 0.5f - ((float) centerOffset.getY().getValue() / (float) iconImageHeight); markerOptions.anchor(offsetX, offsetY); } }

Target:
protected void onBeforeClusterItemRendered(TiClusterMarker clusterItem, MarkerOptions markerOptions) { AnnotationProxy anno = clusterItem.getProxy(); if (anno.hasProperty(TiC.PROPERTY_IMAGE)) { handleImage(anno, markerOptions, anno.getProperty(TiC.PROPERTY_IMAGE)); } if (anno.hasProperty(MapModule.PROPERTY_CENTER_OFFSET)) { HashMap centerOffsetProperty = (HashMap) anno.getProperty(MapModule.PROPERTY_CENTER_OFFSET); TiPoint centerOffset = new TiPoint(centerOffsetProperty, 0.0, 0.0); float offsetX = 0.5f - ((float) centerOffset.getX().getValue() / (float) iconImageWidth); float offsetY = 0.5f - ((float) centerOffset.getY().getValue() / (float) iconImageHeight); markerOptions.anchor(offsetX, offsetY); } }
Source:
public static long getSnapSizeInBytes() { long size = Long.getLong("zookeeper.snapSizeLimitInKb", 4194304L); return size > 0 ? size * 1024 : size; }

Target:
public static long getSnapSizeInBytes() { long size = Long.getLong("zookeeper.snapSizeLimitInKb", 4194304L); if (size <= 0) { LOG.info("zookeeper.snapSizeLimitInKb set to a non-positive value {}; disabling feature", size); } return size * 1024; }
Source:
public int convert(int time) { boolean timeRespectsSpeed = UserPreferences.timeRespectsSpeed(); if (time > 0 && timeRespectsSpeed) { float speed = Float.parseFloat(UserPreferences.getPlaybackSpeed()); return (int)(time / speed); } else { return time; } }

Target:
public static int convert(int time) { boolean timeRespectsSpeed = UserPreferences.timeRespectsSpeed(); if (time > 0 && timeRespectsSpeed) { float speed = Float.parseFloat(UserPreferences.getPlaybackSpeed()); return (int)(time / speed); } return time; }
Source:
public void addClientLibraries(ClientLibraryType type, Collection<String> categories) { Set<String> categoriesSet = clientLibraries.getOrDefault(type, new LinkedHashSet<>()); for (String category : categories) { categoriesSet.add(category); } clientLibraries.put(type, categoriesSet); }

Target:
public void addClientLibraries(ClientLibraryType type, Collection<String> categories) { Set<String> categoriesSet = clientLibraries.getOrDefault(type, new LinkedHashSet<>()); categoriesSet.addAll(categories); clientLibraries.put(type, categoriesSet); }
Source:
public Iterable<ReleaseAsset> iterate() { return new RtPagination<ReleaseAsset>( this.request.uri().back() .method(Request.GET), new RtPagination.Mapping<ReleaseAsset, JsonObject>() { @Override public ReleaseAsset map(final JsonObject value) { return RtReleaseAssets.this.get( value.getInt(ID) ); } } ); }

Target:
public Iterable<ReleaseAsset> iterate() { return new RtPagination<ReleaseAsset>( this.request.uri().back() .method(Request.GET), new RtPagination.Mapping<ReleaseAsset, JsonObject>() { @Override public ReleaseAsset map(final JsonObject value) { return RtReleaseAssets.this.get( value.getInt("id") ); } } ); }
Source:
private void handleTitles(List<StructuredProperty> titleList, DataSetReference.Builder metaBuilder) { if (CollectionUtils.isNotEmpty(titleList)) { List<CharSequence> titles = new ArrayList<CharSequence>(); for (StructuredProperty titleProp : titleList) { if (fieldApprover.approve(titleProp.getDataInfo())) { titles.add(titleProp.getValue()); } } metaBuilder.setTitles(titles); } }

Target:
private void handleTitles(List<StructuredProperty> titleList, DataSetReference.Builder metaBuilder) { if (CollectionUtils.isNotEmpty(titleList)) { metaBuilder.setTitles(titleList.stream().filter(titleProp -> fieldApprover.approve(titleProp.getDataInfo())) .map(StructuredProperty::getValue).collect(Collectors.toList())); } }
Source:
public void validate_contract_with_no_type_sub_children() throws Exception { final ProcessDefinitionBuilder builder = new ProcessDefinitionBuilder().createNewInstance("test", "1"); builder.addContract().addInput("name", "desc").addChildren().addInput("name", "desc"); expectedException.expect(InvalidProcessDefinitionException.class); expectedException.expectMessage("Type not set on the contract input <name> of contract of the process"); builder.done(); }

Target:
public void validate_contract_with_no_type_sub_children() throws Exception { final ProcessDefinitionBuilder builder = new ProcessDefinitionBuilder().createNewInstance("test", "1"); builder.addContract().addInput("name", "desc").addChildren().addInput("name", "desc"); expectedException.expect(InvalidProcessDefinitionException.class); expectedException.expectMessage("Type not set on the contract input <name> on the process-level contract"); builder.done(); }
Source:
private void initialCacheUpdate() { try { log.debug("Initial Cache update in progress.."); Collection<Condition> conditions = definitions.getAllConditions(); for (Condition c : conditions) { String triggerId = c.getTriggerId(); CacheKey cacheKey = new CacheKey(c.getTenantId(), c.getDataId()); initialPublish(cacheKey, triggerId); if (c instanceof CompareCondition) { String data2Id = ((CompareCondition) c).getData2Id(); CacheKey cacheKey2 = new CacheKey(c.getTenantId(), data2Id); initialPublish(cacheKey2, triggerId); } } log.debugf("Published after update=%s", publishCache.size()); if (log.isTraceEnabled()) { publishCache.entrySet().stream().forEach(e -> log.tracef("Published: %s", e.getValue())); } } catch (Exception e) { log.error("Failed to load conditions to create Id filters. All data being forwarded to alerting!", e); return; } }

Target:
private void initialCacheUpdate() { try { log.debug("Initial Cache update in progress.."); publishCache.startBatch(); publishDataIdsCache.startBatch(); Collection<Condition> conditions = definitions.getAllConditions(); for (Condition c : conditions) { String triggerId = c.getTriggerId(); TriggerKey triggerKey = new TriggerKey(c.getTenantId(), triggerId); Set<String> dataIds = new HashSet<>(); dataIds.add(c.getDataId()); if (c instanceof CompareCondition) { String data2Id = ((CompareCondition) c).getData2Id(); dataIds.add(data2Id); } Set<String> prevDataIds = publishDataIdsCache.get(triggerKey); if (prevDataIds == null) { prevDataIds = new HashSet<>(); } prevDataIds.addAll(dataIds); publishDataIdsCache.put(triggerKey, prevDataIds); addPublishCache(c.getTenantId(), triggerId, dataIds); } log.debugf("Published after update=%s", publishCache.size()); if (log.isTraceEnabled()) { publishCache.entrySet().stream().forEach(e -> log.tracef("Published: %s", e.getValue())); } publishDataIdsCache.endBatch(true); publishCache.endBatch(true); } catch (Exception e) { log.error("Failed to load conditions to create Id filters. All data being forwarded to alerting!", e); publishDataIdsCache.endBatch(false); publishCache.endBatch(false); return; } }
Source:
private Guid getVdsToRunOn(Iterable<VDS> vdss, boolean isMigrate) { StringBuilder sb = new StringBuilder(); final List<VDS> readyToRun = new ArrayList<VDS>(); for (VDS curVds : vdss) { if (validateHostIsReadyToRun(curVds, sb, isMigrate) == ValidationResult.VALID&&validateHostIsTrusted(curVds)){ readyToRun.add(curVds); } } if (readyToRun.isEmpty()) { log.info(sb.toString()); return Guid.Empty; } else { if (log.isDebugEnabled()) { log.debug(sb.toString()); } return getBestVdsToRun(readyToRun); } }

Target:
private Guid getVdsToRunOn(Iterable<VDS> vdss, boolean isMigrate) { StringBuilder sb = new StringBuilder(); final List<VDS> readyToRun = new ArrayList<VDS>(); for (VDS curVds : vdss) { if (validateHostIsReadyToRun(curVds, sb, isMigrate) == ValidationResult.VALID){ readyToRun.add(curVds); } } if (readyToRun.isEmpty()) { log.info(sb.toString()); return Guid.Empty; } else { if (log.isDebugEnabled()) { log.debug(sb.toString()); } return getBestVdsToRun(readyToRun); } }
Source:
public void delta(Delta delta, PersistenceExceptionHandler exceptionHandler) { checkWritesAllowed(); while (!queuedDeltas.isEmpty()) { Delta extraDelta = queuedDeltas.remove(0); doDelta(extraDelta, exceptionHandler, false); } doDelta(delta, exceptionHandler, false); }

Target:
public void delta(Delta delta, PersistenceExceptionHandler exceptionHandler) { checkWritesAllowed(); while (!queuedDeltas.isEmpty()) { Delta extraDelta = queuedDeltas.remove(0); doDelta(extraDelta, exceptionHandler, true); } doDelta(delta, exceptionHandler, false); }
Source:
public LiveStreamSettingsModule() { logger.debug("Creating a new instance of Modules.CuePointsManager"); mapLiveEntryToBaseSystemTime = new HashMap<>(); }

Target:
public LiveStreamSettingsModule() { logger.debug("Creating a new instance of Modules.CuePointsManager"); mapLiveEntryToBaseSystemTime = new ConcurrentHashMap<String, long[]>(); }
Source:
public String getDescription() { return "Taking a screenshot."; }

Target:
public String getDescription() { return name; }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_feedback); setTitle(getResources().getString(R.string.feedback_label)); Intent intent = this.getIntent(); CheckBox sendLogs = (CheckBox) findViewById(R.id.feedback_send_logs); if (intent != null) { mAction = intent.getExtras().getString("CallingAction"); if (mAction.equals("no")) { Log.d(TAG, "Thumbs down tapped"); dislikeButton = findViewById(R.id.ImageBtn_Dislike); dislikeButton.setSelected(true); } else if (mAction.equals("yes")) { Log.d(TAG, "Thumbs up tapped"); likeButton = findViewById(R.id.ImageBtn_like); likeButton.setSelected(true); } } if (Application.getPrefs() .getBoolean(getString(R.string.preferences_key_user_share_logs), true)) { sendLogs.setChecked(true); } else { sendLogs.setChecked(false); } }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_feedback); setTitle(getResources().getString(R.string.feedback_label)); Intent intent = this.getIntent(); CheckBox sendLogs = (CheckBox) findViewById(R.id.feedback_send_logs); if (intent != null) { int response = intent.getIntExtra(RESPONSE, 0); mLogFile = intent.getExtras().getString(LOG_FILE); Log.d(TAG, "Intent LOG_FILE :" + mLogFile); if(response == FEEDBACK_YES) { mUserResponse = "yes"; } else { mUserResponse = "no"; } if (mUserResponse.equals("no")) { Log.d(TAG, "Thumbs down tapped"); dislikeButton = findViewById(R.id.ImageBtn_Dislike); dislikeButton.setSelected(true); } else if (mUserResponse.equals("yes")) { Log.d(TAG, "Thumbs up tapped"); likeButton = findViewById(R.id.ImageBtn_like); likeButton.setSelected(true); } } if (Application.getPrefs() .getBoolean(getString(R.string.preferences_key_user_share_logs), true)) { sendLogs.setChecked(true); } else { sendLogs.setChecked(false); } }
Source:
public boolean isAccumulatorAnnotation(AnnotationMirror anm) { return AnnotationUtils.areSameByClass(anm, ACC); }

Target:
public boolean isAccumulatorAnnotation(AnnotationMirror anm) { return AnnotationUtils.areSameByClass(anm, accumulator); }