auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void executePerformWithNoIncludeRegionsSuccess() { RestoreRedundancyRequest restoreRedundancyRequest = new RestoreRedundancyRequest(); restoreRedundancyRequest.setReassignPrimaries(true); RestoreRedundancyResultsImpl restoreRedundancyResultsImpl = new RestoreRedundancyResultsImpl(); restoreRedundancyResultsImpl.setStatusMessage(BOGUS_PASS_MESSAGE); restoreRedundancyResultsImpl.setSuccess(true); Map<String, RegionRedundancyStatus> satisfied = restoreRedundancyResultsImpl.getSatisfiedRedundancyRegionResults(); RegionRedundancyStatusImpl regionRedundancyStatusImpl = new RegionRedundancyStatusImpl(1, 1, REGION_1, RegionRedundancyStatus.RedundancyStatus.SATISFIED); satisfied.put(REGION_1, regionRedundancyStatusImpl); RestoreRedundancyPerformer spyRedundancyPerformer = Mockito.spy(restoreRedundancyPerformer); Mockito.doReturn(restoreRedundancyResultsImpl).when(spyRedundancyPerformer) .executeFunctionAndGetFunctionResult(Mockito.any(RestoreRedundancyFunction.class), Mockito.any(Object.class), Mockito.any( DistributedMember.class)); RestoreRedundancyResults restoreRedundancyResult = spyRedundancyPerformer .perform(internalCacheForClientAccess, restoreRedundancyRequest, false); assertThat(restoreRedundancyResult.getSuccess()).isTrue(); }

Target:
public void executePerformWithNoIncludeRegionsSuccess() { RestoreRedundancyRequest restoreRedundancyRequest = new RestoreRedundancyRequest(); restoreRedundancyRequest.setReassignPrimaries(true); RestoreRedundancyResultsImpl restoreRedundancyResultsImpl = new RestoreRedundancyResultsImpl(); restoreRedundancyResultsImpl.setStatusMessage(BOGUS_PASS_MESSAGE); restoreRedundancyResultsImpl.setSuccess(true); Map<String, RegionRedundancyStatus> satisfied = restoreRedundancyResultsImpl.getSatisfiedRedundancyRegionResults(); RegionRedundancyStatusImpl regionRedundancyStatusImpl = new RegionRedundancyStatusImpl(1, 1, REGION_1, RegionRedundancyStatus.RedundancyStatus.SATISFIED); satisfied.put(REGION_1, regionRedundancyStatusImpl); RestoreRedundancyPerformer spyRedundancyPerformer = spy(restoreRedundancyPerformer); doReturn(restoreRedundancyResultsImpl).when(spyRedundancyPerformer) .executeFunctionAndGetFunctionResult(any(RestoreRedundancyFunction.class), any(Object.class), any( DistributedMember.class)); RestoreRedundancyResults restoreRedundancyResult = spyRedundancyPerformer .perform(internalCacheForClientAccess, restoreRedundancyRequest, false); assertThat(restoreRedundancyResult.getSuccess()).isTrue(); }
Source:
public void testEncryptionAlgorithmSSECWithNoEncryptionKey() throws Throwable { expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage("The value of property " + "fs.s3a.server-side-encryption-key must not be null"); Configuration conf = super.createConfiguration(); conf.set(Constants.SERVER_SIDE_ENCRYPTION_ALGORITHM, S3AEncryptionMethods .SSE_C.getMethod()); conf.set(Constants.SERVER_SIDE_ENCRYPTION_KEY, null); S3AContract contract = (S3AContract) createContract(conf); contract.init(); assumeEnabled(); FileSystem fileSystem = contract.getTestFileSystem(); assertNotNull("null filesystem", fileSystem); URI fsURI = fileSystem.getUri(); LOG.info("Test filesystem = implemented by {}", fsURI, fileSystem); assertEquals("wrong filesystem of " + fsURI, contract.getScheme(), fsURI.getScheme()); fileSystem.initialize(fsURI, conf); }

Target:
public void testEncryptionAlgorithmSSECWithNoEncryptionKey() throws Throwable { assumeEnabled(); intercept(IllegalArgumentException.class, "The value of property " + Constants.SERVER_SIDE_ENCRYPTION_KEY + " must not be null", () -> { Configuration conf = super.createConfiguration(); conf.set(Constants.SERVER_SIDE_ENCRYPTION_ALGORITHM, S3AEncryptionMethods.SSE_C.getMethod()); conf.set(Constants.SERVER_SIDE_ENCRYPTION_KEY, null); S3AContract contract = (S3AContract) createContract(conf); contract.init(); FileSystem fileSystem = contract.getTestFileSystem(); assertNotNull("null filesystem", fileSystem); URI fsURI = fileSystem.getUri(); LOG.info("Test filesystem = implemented by {}", fsURI, fileSystem); assertEquals("wrong filesystem of " + fsURI, contract.getScheme(), fsURI.getScheme()); fileSystem.initialize(fsURI, conf); throw new Exception("Do not reach here"); }); }
Source:
public void purgeMrrtReportTemplate_shouldDeleteReportTemplateFromDatabaseAndAlsoDeleteTemplateFileFromTheSystem() throws Exception { setUpTemporaryFolder(); MrrtReportTemplate template = new MrrtReportTemplate(); File templateFile = new File(radiologyProperties.getReportTemplateHome(), java.util.UUID.randomUUID() .toString()); templateFile.createNewFile(); template.setDcTermsTitle("sample title"); template.setDcTermsDescription("sample description"); template.setDcTermsIdentifier("identifier3"); template.setPath(templateFile.getAbsolutePath()); MrrtReportTemplate saved = mrrtReportTemplateService.saveMrrtReportTemplate(template); assertNotNull(mrrtReportTemplateService.getMrrtReportTemplate(saved.getId())); File savedFile = new File(saved.getPath()); assertThat(savedFile.exists(), is(true)); mrrtReportTemplateService.purgeMrrtReportTemplate(saved); assertNull(mrrtReportTemplateService.getMrrtReportTemplate(saved.getId())); assertThat(savedFile.exists(), is(false)); }

Target:
public void purgeMrrtReportTemplate_shouldDeleteReportTemplateFromDatabaseAndAlsoDeleteTemplateFileFromTheSystem() throws Exception { setUpTemporaryFolder(); MrrtReportTemplate template = new MrrtReportTemplate(); File templateFile = new File(radiologyProperties.getReportTemplateHome(), java.util.UUID.randomUUID() .toString()); templateFile.createNewFile(); template.setDcTermsTitle("sample title"); template.setDcTermsDescription("sample description"); template.setDcTermsIdentifier("identifier3"); template.setPath(templateFile.getAbsolutePath()); MrrtReportTemplate saved = mrrtReportTemplateService.saveMrrtReportTemplate(template); assertNotNull(saved.getId()); File savedFile = new File(saved.getPath()); assertThat(savedFile.exists(), is(true)); mrrtReportTemplateService.purgeMrrtReportTemplate(saved); assertNull(mrrtReportTemplateService.getMrrtReportTemplate(saved.getId())); assertThat(savedFile.exists(), is(false)); }
Source:
private List<String> getSearchTermFieldValues(QueryResponse solrResponse) { Map<String, Suggestion> suggestions = solrResponse.getSpellCheckResponse().getSuggestionMap(); Set<String> fieldValues = suggestions.keySet(); removeResourceFieldValue(fieldValues); return new ArrayList<>(fieldValues); }

Target:
private List<String> getSearchTermFieldValues(QueryResponse solrResponse) { Set<String> fieldValues = solrResponse.getSpellCheckResponse().getSuggestionMap().keySet(); removeResourceFieldValue(fieldValues); return new ArrayList<>(fieldValues); }
Source:
public static void setJavaClassPath(URL[] antClasspath) { StringBuilder buff = new StringBuilder(); File file = null; for (URL element : antClasspath) { try { try { URL thisURL = URIUtil.toURI(element).toURL(); file = URIUtil.toFile(FileLocator.toFileURL(thisURL).toURI()); } catch (URISyntaxException e) { file = new File(FileLocator.toFileURL(element).getPath()); AntUIPlugin.log(e); e.printStackTrace(); } } catch (IOException e) { continue; } buff.append(file.getAbsolutePath()); buff.append("; "); } org.apache.tools.ant.types.Path systemClasspath = new org.apache.tools.ant.types.Path(null, buff.substring(0, buff.length() - 2)); org.apache.tools.ant.types.Path.systemClasspath = systemClasspath; }

Target:
public static void setJavaClassPath(URL[] antClasspath) { StringBuilder buff = new StringBuilder(); File file = null; for (URL url : antClasspath) { try { try { URL thisURL = URIUtil.toURI(url).toURL(); file = URIUtil.toFile(FileLocator.toFileURL(thisURL).toURI()); } catch (URISyntaxException e) { file = new File(FileLocator.toFileURL(url).getPath()); AntUIPlugin.log(e); e.printStackTrace(); } } catch (IOException e) { continue; } buff.append(file.getAbsolutePath()); buff.append("; "); } org.apache.tools.ant.types.Path systemClasspath = new org.apache.tools.ant.types.Path(null, buff.substring(0, buff.length() - 2)); org.apache.tools.ant.types.Path.systemClasspath = systemClasspath; }
Source:
public HelixNotifier(HelixPropertyStoreConfig storeConfig) { if (storeConfig == null) { throw new IllegalArgumentException("storeConfig and metricRegistry cannot be null"); } long startTimeMs = System.currentTimeMillis(); logger.info("Starting a HelixNotifier"); ZkClient zkClient = new ZkClient(storeConfig.zkClientConnectString, storeConfig.zkClientSessionTimeoutMs, storeConfig.zkClientConnectionTimeoutMs, new ZNRecordSerializer()); List<String> subscribedPaths = Collections.singletonList(storeConfig.rootPath + HelixNotifier.TOPIC_PATH); HelixPropertyStore<ZNRecord> helixStore = new ZkHelixPropertyStore<>(new ZkBaseDataAccessor<>(zkClient), storeConfig.rootPath, subscribedPaths); logger.info("HelixPropertyStore started with zkClientConnectString={}, zkClientSessionTimeoutMs={}, " + "zkClientConnectionTimeoutMs={}, rootPath={}, subscribedPaths={}", storeConfig.zkClientConnectString, storeConfig.zkClientSessionTimeoutMs, storeConfig.zkClientConnectionTimeoutMs, storeConfig.rootPath, subscribedPaths); this.helixStore = helixStore; long startUpTimeInMs = System.currentTimeMillis() - startTimeMs; logger.info("HelixNotifier started, took ms", startUpTimeInMs); }

Target:
public HelixNotifier(HelixPropertyStoreConfig storeConfig) { if (storeConfig == null) { throw new IllegalArgumentException("storeConfig cannot be null"); } long startTimeMs = System.currentTimeMillis(); logger.info("Starting a HelixNotifier"); ZkClient zkClient = new ZkClient(storeConfig.zkClientConnectString, storeConfig.zkClientSessionTimeoutMs, storeConfig.zkClientConnectionTimeoutMs, new ZNRecordSerializer()); List<String> subscribedPaths = Collections.singletonList(storeConfig.rootPath + HelixNotifier.TOPIC_PATH); HelixPropertyStore<ZNRecord> helixStore = new ZkHelixPropertyStore<>(new ZkBaseDataAccessor<>(zkClient), storeConfig.rootPath, subscribedPaths); logger.info("HelixPropertyStore started with zkClientConnectString={}, zkClientSessionTimeoutMs={}, " + "zkClientConnectionTimeoutMs={}, rootPath={}, subscribedPaths={}", storeConfig.zkClientConnectString, storeConfig.zkClientSessionTimeoutMs, storeConfig.zkClientConnectionTimeoutMs, storeConfig.rootPath, subscribedPaths); this.helixStore = helixStore; long startUpTimeInMs = System.currentTimeMillis() - startTimeMs; logger.info("HelixNotifier started, took ms", startUpTimeInMs); }
Source:
public void setup() { initVds(); initConditions(); when(vdsManager.getRefreshStatistics()).thenReturn(false); vmsMonitoring = Mockito.spy( new VmsMonitoring(vdsManager, vds) { @Override public DbFacade getDbFacade() { return dbFacade; } @Override protected void auditLog(AuditLogableBase auditLogable, AuditLogType logType) { AuditLog al = new AuditLog(); al.setlog_type(logType); mockAuditLogDao.save(al); } @Override protected Map[] getVmInfo(List<String> vmsToUpdate) { return vmInfo; } @Override protected List<VmDynamic> getPoweringUpVms() { return poweringUpVms; } } ); }

Target:
public void setup() { initVds(); initConditions(); when(vdsManager.getRefreshStatistics()).thenReturn(false); vmsMonitoring = Mockito.spy( new VmsMonitoring(vdsManager, vds) { @Override public DbFacade getDbFacade() { return dbFacade; } @Override protected void auditLog(AuditLogableBase auditLogable, AuditLogType logType) { AuditLog al = new AuditLog(); al.setLogType(logType); mockAuditLogDao.save(al); } @Override protected Map[] getVmInfo(List<String> vmsToUpdate) { return vmInfo; } @Override protected List<VmDynamic> getPoweringUpVms() { return poweringUpVms; } } ); }
Source:
public Server getOrCreateServer(final String serverId) throws DotDataException { Server tryServer = getServer(serverId); if(tryServer==null || tryServer.getServerId() ==null) { LocalTransaction.wrap(() ->{ Server newServer = new Server(); newServer.setServerId(serverId); newServer.setIpAddress(ClusterFactory.getIPAdress()); String hostName = "localhost"; try { hostName = InetAddress.getLocalHost().getHostName(); } catch (UnknownHostException e) { Logger.error(ClusterFactory.class, "Error trying to get the host name. ", e); } newServer.setName(hostName); saveServer(newServer); String port=ClusterFactory.getNextAvailablePort(newServer.getServerId(), ServerPort.CACHE_PORT); Config.setProperty(ServerPort.CACHE_PORT.getPropertyName(), port); newServer.setCachePort(Integer.parseInt(port)); port=new ESClient().getNextAvailableESPort(newServer.getServerId(), newServer.getIpAddress(), String.valueOf(newServer.getEsTransportTcpPort())); Config.setProperty(ServerPort.ES_TRANSPORT_TCP_PORT.getPropertyName(), port); newServer.setEsTransportTcpPort(Integer.parseInt(port)); port=ClusterFactory.getNextAvailablePort(newServer.getServerId(), ServerPort.ES_HTTP_PORT); Config.setProperty(ServerPort.ES_HTTP_PORT.getPropertyName(), port); newServer.setEsHttpPort(Integer.parseInt(port)); updateServer(newServer); try { writeHeartBeatToDisk(newServer.getServerId()); } catch (IOException e) { Logger.error(ClusterFactory.class, "Could not write Server ID to file system" , e); } }); } return serverFactory.getServer(serverId); }

Target:
public Server getOrCreateServer(final String serverId) throws DotDataException { Server tryServer = getServer(serverId); if(tryServer==null || tryServer.getServerId() ==null) { LocalTransaction.wrap(() ->{ getServerTransaction(serverId); }); } return serverFactory.getServer(serverId); }
Source:
void createTransactionAndRollbackMessagesTest(MessagingEntityType entityType) { setSender(entityType, TestUtils.USE_CASE_DEFAULT, isSessionEnabled); final String messageId = UUID.randomUUID().toString(); final ServiceBusMessage message = getMessage(messageId, isSessionEnabled); sendMessage(message).block(OPERATION_TIMEOUT); setReceiver(entityType, TestUtils.USE_CASE_DEFAULT, isSessionEnabled); AtomicReference<ServiceBusTransactionContext> transaction = new AtomicReference<>(); StepVerifier.create(receiver.createTransaction()) .assertNext(txn -> { transaction.set(txn); assertNotNull(transaction); }) .verifyComplete(); StepVerifier.create(receiver.receiveMessages() .concatMap(receivedMessage -> receiver.complete(receivedMessage).thenReturn(receivedMessage)).next()) .assertNext(receivedMessage -> { assertMessageEquals(receivedMessage, messageId, isSessionEnabled); messagesPending.decrementAndGet(); }).verifyComplete(); StepVerifier.create(receiver.rollbackTransaction(transaction.get())) .verifyComplete(); }

Target:
void createTransactionAndRollbackMessagesTest(MessagingEntityType entityType) { setSender(entityType, TestUtils.USE_CASE_DEFAULT, isSessionEnabled); final String messageId = UUID.randomUUID().toString(); final ServiceBusMessage message = getMessage(messageId, isSessionEnabled); sendMessage(message).block(OPERATION_TIMEOUT); setReceiver(entityType, TestUtils.USE_CASE_DEFAULT, isSessionEnabled); AtomicReference<ServiceBusTransactionContext> transaction = new AtomicReference<>(); StepVerifier.create(receiver.createTransaction()) .assertNext(txn -> { transaction.set(txn); assertNotNull(transaction); }) .verifyComplete(); StepVerifier.create(receiver.receiveMessages() .flatMap(receivedMessage -> receiver.complete(receivedMessage).thenReturn(receivedMessage)).take(1)) .assertNext(receivedMessage -> { assertMessageEquals(receivedMessage, messageId, isSessionEnabled); messagesPending.decrementAndGet(); }).verifyComplete(); StepVerifier.create(receiver.rollbackTransaction(transaction.get())) .verifyComplete(); }
Source:
private ShadowActivity navigateFormEntry(Intent formEntryIntent) { FormEntryActivity formEntryActivity = Robolectric.buildActivity(FormEntryActivity.class).withIntent(formEntryIntent) .create().start().resume().get(); ImageButton nextButton = (ImageButton)formEntryActivity.findViewById(R.id.nav_btn_next); assertTrue(nextButton.getTag().equals(FormEntryActivity.NAV_STATE_DONE)); ODKView odkView = formEntryActivity.getODKView(); IntegerWidget favoriteNumber = (IntegerWidget)odkView.getWidgets().get(0); favoriteNumber.setAnswer("2"); assertTrue(nextButton.getTag().equals(FormEntryActivity.NAV_STATE_NEXT)); nextButton.performClick(); ShadowActivity shadowFormEntryActivity = Shadows.shadowOf(formEntryActivity); while (!shadowFormEntryActivity.isFinishing()) { Log.d(TAG, "Waiting for the form to save and the form entry activity to finish"); } return shadowFormEntryActivity; }

Target:
private ShadowActivity navigateFormEntry(Intent formEntryIntent) { FormEntryActivity formEntryActivity = Robolectric.buildActivity(FormEntryActivity.class).withIntent(formEntryIntent) .create().start().resume().get(); ImageButton nextButton = (ImageButton)formEntryActivity.findViewById(R.id.nav_btn_next); ODKView odkView = formEntryActivity.getODKView(); IntegerWidget favoriteNumber = (IntegerWidget)odkView.getWidgets().get(0); favoriteNumber.setAnswer("2"); assertTrue(nextButton.getTag().equals(FormEntryActivity.NAV_STATE_NEXT)); nextButton.performClick(); ShadowActivity shadowFormEntryActivity = Shadows.shadowOf(formEntryActivity); while (!shadowFormEntryActivity.isFinishing()) { Log.d(TAG, "Waiting for the form to save and the form entry activity to finish"); } return shadowFormEntryActivity; }
Source:
private void runTasks() { delegate.getSinkChannel().suspendWrites(); delegate.getSourceChannel().suspendReads(); List<Runnable> tasks = new ArrayList<>(); Runnable t = engine.getDelegatedTask(); while (t != null) { tasks.add(t); t = engine.getDelegatedTask(); } synchronized (this) { outstandingTasks += tasks.size(); for (final Runnable task : tasks) { getWorker().execute(new Runnable() { @Override public void run() { try { task.run(); } finally { synchronized (SslConduit.this) { if (outstandingTasks == 1) { getWriteThread().execute(new Runnable() { @Override public void run() { synchronized (SslConduit.this) { SslConduit.this.notifyAll(); --outstandingTasks; try { doHandshake(); } catch (IOException | RuntimeException | Error e) { IoUtils.safeClose(connection); UndertowLogger.REQUEST_LOGGER.error("Closing SSLConduit after exception on handshake", e); } if (anyAreSet(state, FLAG_READS_RESUMED)) { wakeupReads(); } if (anyAreSet(state, FLAG_WRITES_RESUMED)) { resumeWrites(); } } } }); } else { outstandingTasks--; } } } } }); } } }

Target:
private void runTasks() { delegate.getSinkChannel().suspendWrites(); delegate.getSourceChannel().suspendReads(); List<Runnable> tasks = new ArrayList<>(); Runnable t = engine.getDelegatedTask(); while (t != null) { tasks.add(t); t = engine.getDelegatedTask(); } synchronized (this) { outstandingTasks += tasks.size(); for (final Runnable task : tasks) { getWorker().execute(new Runnable() { @Override public void run() { try { task.run(); } finally { synchronized (SslConduit.this) { if (outstandingTasks == 1) { getWriteThread().execute(new Runnable() { @Override public void run() { synchronized (SslConduit.this) { SslConduit.this.notifyAll(); --outstandingTasks; try { doHandshake(); } catch (IOException | RuntimeException | Error e) { UndertowLogger.REQUEST_LOGGER.error("Closing SSLConduit after exception on handshake", e); IoUtils.safeClose(connection); } if (anyAreSet(state, FLAG_READS_RESUMED)) { wakeupReads(); } if (anyAreSet(state, FLAG_WRITES_RESUMED)) { resumeWrites(); } } } }); } else { outstandingTasks--; } } } } }); } } }
Source:
public Pair<String, String[]> createWhereAndroid(String[] fieldNames, Object[] values, EncryptedModel em, Persistable p){ org.commcare.modern.util.Pair<String, String[]> mPair = DatabaseHelper.createWhere(fieldNames, values, em, p); Pair<String, String[]> returnPair = new Pair<String, String[]>(mPair.first, mPair.second); return returnPair; }

Target:
public Pair<String, String[]> createWhereAndroid(String[] fieldNames, Object[] values, EncryptedModel em, Persistable p){ org.commcare.modern.util.Pair<String, String[]> mPair = DatabaseHelper.createWhere(fieldNames, values, em, p); return new Pair<>(mPair.first, mPair.second); }
Source:
private Configuration createConfiguration(AppReference appReference) { AppConfig appConfig = YamlFileParser.parse(appReference.getConfiguration(), AppConfig.class); Configuration configuration = new Configuration(); configuration.setContextPath(appConfig.getContextPath()); configuration.setThemeName(appConfig.getTheme()); configuration.setLoginPageUri(appConfig.getLoginPageUri()); configuration.setSessionManager(appConfig.getSessionManager()); Map<Integer, String> errorPageUris = appConfig.getErrorPages().entrySet().stream() .filter(entry -> NumberUtils.isNumber(entry.getKey())) .collect(toMap(entry -> Integer.valueOf(entry.getKey()), Map.Entry::getValue)); configuration.setErrorPageUris(errorPageUris); configuration.setDefaultErrorPageUri(appConfig.getErrorPages().get("default")); configuration.setMenus(appConfig.getMenus().stream() .map(AppConfig.Menu::toConfigurationMenu) .collect(toList())); configuration.setCsrfIgnoreUris(Sets.newHashSet(appConfig.getSecurity().getCsrfIgnoreUris())); configuration.setXssIgnoreUris(Sets.newHashSet(appConfig.getSecurity().getXssIgnoreUris())); configuration.setResponseHeaders(appConfig.getSecurity().getResponseHeaders().toConfigurationResponseHeaders()); configuration.setOther(appConfig.getOther()); return configuration; }

Target:
private Configuration createConfiguration(AppReference appReference) { AppConfig appConfig = YamlFileParser.parse(appReference.getConfiguration(), AppConfig.class); Configuration configuration = new Configuration(); configuration.setContextPath(appConfig.getContextPath()); configuration.setThemeName(appConfig.getTheme()); configuration.setLoginPageUri(appConfig.getLoginPageUri()); configuration.setSessionManagerFactoryClassName(appConfig.getSessionManagement().getFactoryClassName()); configuration.setSessionTimeout(appConfig.getSessionManagement().getTimeout()); Map<Integer, String> errorPageUris = appConfig.getErrorPages().entrySet().stream() .filter(entry -> NumberUtils.isNumber(entry.getKey())) .collect(toMap(entry -> Integer.valueOf(entry.getKey()), Map.Entry::getValue)); configuration.setErrorPageUris(errorPageUris); configuration.setDefaultErrorPageUri(appConfig.getErrorPages().get("default")); configuration.setMenus(appConfig.getMenus().stream() .map(AppConfig.Menu::toConfigurationMenu) .collect(toList())); configuration.setCsrfIgnoreUris(Sets.newHashSet(appConfig.getSecurity().getCsrfIgnoreUris())); configuration.setXssIgnoreUris(Sets.newHashSet(appConfig.getSecurity().getXssIgnoreUris())); configuration.setResponseHeaders(appConfig.getSecurity().getResponseHeaders().toConfigurationResponseHeaders()); configuration.setOther(appConfig.getOther()); return configuration; }
Source:
public boolean isBound(Input newInput) { return data.containsValue(newInput) && newInput != null; }

Target:
public boolean isBound(Input newInput) { return newInput != null && data.containsValue(newInput) ; }
Source:
private void updateActiveConfiguration() { final boolean[] fire = new boolean[] { false }; IWorkspaceRunnable runnable = new IWorkspaceRunnable() { @Override public void run(IProgressMonitor monitor) throws CoreException { synchronized (sync) { if (! live) { return; } ICProjectDescription projectDescription = CoreModel.getDefault().getProjectDescriptionManager().getProjectDescription(project); setActiveConfiguration(projectDescription != null ? projectDescription.getActiveConfiguration() : null); qmakeInfo = null; fire[0] = true; } } }; try { if (ResourcesPlugin.getWorkspace().isTreeLocked()) { runnable.run(null); } else { ResourcesPlugin.getWorkspace().run(runnable, project, IWorkspace.AVOID_UPDATE, null); } } catch (CoreException e) { QtPlugin.log(e); } if (fire[0]) { notifyListeners(); } }

Target:
private void updateActiveConfiguration() { final boolean[] fire = new boolean[] { false }; IWorkspaceRunnable runnable = new IWorkspaceRunnable() { @Override public void run(IProgressMonitor monitor) throws CoreException { synchronized (sync) { if (! live) { return; } ICProjectDescription projectDescription = CoreModel.getDefault().getProjectDescriptionManager().getProjectDescription(project); setActiveConfiguration(projectDescription != null ? projectDescription.getActiveConfiguration() : null); qmakeInfo = null; fire[0] = true; } } }; try { ResourcesPlugin.getWorkspace().run(runnable, project, IWorkspace.AVOID_UPDATE, null); } catch (CoreException e) { QtPlugin.log(e); } if (fire[0]) { notifyListeners(); } }
Source:
public String toString() { return "Alert{" + "tenantId='" + tenantId + '\'' + ", alertId='" + alertId + '\'' + ", triggerId='" + triggerId + '\'' + ", ctime=" + ctime + ", evalSets=" + evalSets + ", severity=" + severity + ", status=" + status + ", ackTime=" + ackTime + ", ackBy='" + ackBy + '\'' + ", resolvedTime=" + resolvedTime + ", resolvedBy='" + resolvedBy + '\'' + ", notes=" + notes + ", trigger=" + trigger + ", dampening=" + dampening + ", resolvedEvalSets=" + resolvedEvalSets + ", context=" + context + '}'; }

Target:
String toString() { return "Alert" + '[' + "tenantId='" + tenantId + '\'' + ", alertId='" + alertId + '\'' + ", triggerId='" + triggerId + '\'' + ", ctime=" + ctime + ", severity=" + severity + ", status=" + status + ", ackTime=" + ackTime + ", ackBy='" + ackBy + '\'' + ", resolvedTime=" + resolvedTime + ", resolvedBy='" + resolvedBy + '\'' + ", notes=" + notes + ", trigger=" + trigger + ", dampening=" + dampening + ", context=" + context + ']'; }
Source:
private static void addFormattedText(XWPFRun run, String text, int fontSize, boolean bold, String rrggbbColor) { addFormattedText(run, text, "Calibri", fontSize, bold, rrggbbColor); }

Target:
private static void addFormattedText(XWPFRun run, String text, int fontSize, boolean bold, String rrggbbColor) { addFormattedText(run, text, FONT_FAMILY, fontSize, bold, rrggbbColor); }
Source:
public StreamGraph generate() { runtimeExecutionMode = determineExecutionMode(runtimeExecutionMode); streamGraph = new StreamGraph(executionConfig, checkpointConfig, savepointRestoreSettings); configureStreamGraph(streamGraph, runtimeExecutionMode); alreadyTransformed = new HashMap<>(); for (Transformation<?> transformation: transformations) { transform(transformation); } final StreamGraph builtStreamGraph = streamGraph; alreadyTransformed.clear(); alreadyTransformed = null; streamGraph = null; return builtStreamGraph; }

Target:
public StreamGraph generate() { streamGraph = new StreamGraph(executionConfig, checkpointConfig, savepointRestoreSettings); configureStreamGraph(streamGraph); alreadyTransformed = new HashMap<>(); for (Transformation<?> transformation: transformations) { transform(transformation); } final StreamGraph builtStreamGraph = streamGraph; alreadyTransformed.clear(); alreadyTransformed = null; streamGraph = null; return builtStreamGraph; }
Source:
public void doFilter(RefUpdatedEvent hook) throws IOException { String gitComment = getComment(hook.refUpdate.project, hook.refUpdate.newRev); log.debug("Git commit " + hook.refUpdate.newRev + ": " + gitComment); URL gitUrl = getGitUrl(hook); if (gitUrl != null) { String[] issues = getIssueIds(gitComment); for (String issue : issues) { log.debug("Adding GitWeb URL " + gitUrl + " to issue " + issue); its.addRelatedLink(issue, gitUrl, "Git: " + hook.refUpdate.newRev); } } }

Target:
public void doFilter(RefUpdatedEvent hook) throws IOException { String gitComment = getComment(hook.refUpdate.project, hook.refUpdate.newRev); log.debug("Git commit " + hook.refUpdate.newRev + ": " + gitComment); URL gitUrl = getGitUrl(hook); if (gitUrl == null) { return; } String[] issues = getIssueIds(gitComment); for (String issue : issues) { log.debug("Adding GitWeb URL " + gitUrl + " to issue " + issue); its.addRelatedLink(issue, gitUrl, "Git: " + hook.refUpdate.newRev); } }
Source:
public List<Group> getSpecialGroups(Context context, HttpServletRequest request) { try { if (context.getCurrentUser() != null && (EPersonServiceFactory.getInstance().getEPersonService().getPasswordHash(context.getCurrentUser()) != null && StringUtils.isNotBlank(EPersonServiceFactory.getInstance().getEPersonService().getPasswordHash(context.getCurrentUser()).toString()))) { String groupName = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("authentication-password.login.specialgroup"); if ((groupName != null) && (!groupName.trim().equals(""))) { Group specialGroup = EPersonServiceFactory.getInstance().getGroupService().findByName(context, groupName); if (specialGroup == null) { log.warn(LogManager.getHeader(context, "password_specialgroup", "Group defined in modules/authentication-password.cfg login.specialgroup does not exist")); return ListUtils.EMPTY_LIST; } else { return Arrays.asList(specialGroup); } } } } catch (Exception e) { log.error(LogManager.getHeader(context,"getSpecialGroups",""),e); } return ListUtils.EMPTY_LIST; }

Target:
public List<Group> getSpecialGroups(Context context, HttpServletRequest request) { try { if (context.getCurrentUser() != null && StringUtils.isNotBlank(EPersonServiceFactory.getInstance().getEPersonService().getPasswordHash(context.getCurrentUser()).toString())) { String groupName = DSpaceServicesFactory.getInstance().getConfigurationService().getProperty("authentication-password.login.specialgroup"); if ((groupName != null) && (!groupName.trim().equals(""))) { Group specialGroup = EPersonServiceFactory.getInstance().getGroupService().findByName(context, groupName); if (specialGroup == null) { log.warn(LogManager.getHeader(context, "password_specialgroup", "Group defined in modules/authentication-password.cfg login.specialgroup does not exist")); return ListUtils.EMPTY_LIST; } else { return Arrays.asList(specialGroup); } } } } catch (Exception e) { log.error(LogManager.getHeader(context,"getSpecialGroups",""),e); } return ListUtils.EMPTY_LIST; }
Source:
public void testCheck() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(JavadocTagContinuationIndentationCheck.class); final String[] expected = { "47: " + getCheckMessage(MSG_KEY, 4), "109: " + getCheckMessage(MSG_KEY, 4), "112: " + getCheckMessage(MSG_KEY, 4), "203: " + getCheckMessage(MSG_KEY, 4), "206: " + getCheckMessage(MSG_KEY, 4), "221: " + getCheckMessage(MSG_KEY, 4), "223: " + getCheckMessage(MSG_KEY, 4), "285: " + getCheckMessage(MSG_KEY, 4), "288: " + getCheckMessage(MSG_KEY, 4), "290: " + getCheckMessage(MSG_KEY, 4), "310: " + getCheckMessage(MSG_KEY, 4), "322: " + getCheckMessage(MSG_KEY, 4), "324: " + getCheckMessage(MSG_KEY, 4), }; verify(checkConfig, getPath("InputJavaDocTagContinuationIndentation.java"), expected); }

Target:
public void testCheck() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(JavadocTagContinuationIndentationCheck.class); final String[] expected = { "47: " + getCheckMessage(MSG_KEY, 4), "109: " + getCheckMessage(MSG_KEY, 4), "112: " + getCheckMessage(MSG_KEY, 4), "203: " + getCheckMessage(MSG_KEY, 4), "206: " + getCheckMessage(MSG_KEY, 4), "221: " + getCheckMessage(MSG_KEY, 4), "223: " + getCheckMessage(MSG_KEY, 4), "285: " + getCheckMessage(MSG_KEY, 4), "288: " + getCheckMessage(MSG_KEY, 4), "290: " + getCheckMessage(MSG_KEY, 4), "310: " + getCheckMessage(MSG_KEY, 4), "322: " + getCheckMessage(MSG_KEY, 4), "324: " + getCheckMessage(MSG_KEY, 4), }; verify(checkConfig, getPath("InputJavadocTagContinuationIndentation.java"), expected); }
Source:
private void getPhonebook() { try { ContentResponse contentResponse = httpClient.newRequest(phonebookUrl).method(HttpMethod.GET) .timeout(2, TimeUnit.SECONDS).send(); InputStream xml = new ByteArrayInputStream(contentResponse.getContent()); JAXBContext context = JAXBContext.newInstance(PhonebooksType.class); Unmarshaller um = context.createUnmarshaller(); PhonebooksType phonebooksType = um.unmarshal(new StreamSource(xml), PhonebooksType.class).getValue(); phonebookName = phonebooksType.getPhonebook().getName(); phonebook = phonebooksType.getPhonebook().getContact().stream().map(contact -> { String contactName = contact.getPerson().getRealName(); return contact.getTelephony().getNumber().stream() .collect(Collectors.toMap(number -> normalizeNumber(number.getValue()), number -> contactName, (nameA, nameB) -> mergeSameContactNames(nameA, nameB))); }).collect(HashMap::new, HashMap::putAll, HashMap::putAll); logger.debug("Downloaded phonebook {}: {}", phonebookName, phonebook); } catch (JAXBException | InterruptedException | ExecutionException | TimeoutException e) { logger.warn("Failed to get phonebook with URL {}:", phonebookUrl, e); } }

Target:
private void getPhonebook() { try { ContentResponse contentResponse = httpClient.newRequest(phonebookUrl).method(HttpMethod.GET) .timeout(2, TimeUnit.SECONDS).send(); InputStream xml = new ByteArrayInputStream(contentResponse.getContent()); JAXBContext context = JAXBContext.newInstance(PhonebooksType.class); Unmarshaller um = context.createUnmarshaller(); PhonebooksType phonebooksType = um.unmarshal(new StreamSource(xml), PhonebooksType.class).getValue(); phonebookName = phonebooksType.getPhonebook().getName(); phonebook = phonebooksType.getPhonebook().getContact().stream().map(contact -> { String contactName = contact.getPerson().getRealName(); return contact.getTelephony().getNumber().stream() .collect(Collectors.toMap(number -> normalizeNumber(number.getValue()), number -> contactName, this::mergeSameContactNames)); }).collect(HashMap::new, HashMap::putAll, HashMap::putAll); logger.debug("Downloaded phonebook {}: {}", phonebookName, phonebook); } catch (JAXBException | InterruptedException | ExecutionException | TimeoutException e) { logger.warn("Failed to get phonebook with URL {}:", phonebookUrl, e); } }
Source:
public boolean equals(Object o) { return o == this || o instanceof AwaitCommand && equalTo((AwaitCommand) o); }

Target:
public boolean equals(Object o) { return o == this || o instanceof NotifyCommand && equalTo((NotifyCommand) o); }
Source:
void deleteEntityViaMigration() { ProjectId id = createId(42); TestProcessManager entity = createEntity(id); repository().store(entity); repository().applyMigration(id, new MarkPmDeleted<>()); Optional<TestProcessManager> found = repository().find(id); assertThat(found.isPresent()).isTrue(); assertThat(found.get() .isDeleted()).isTrue(); }

Target:
void deleteEntityViaMigration() { ProjectId id = createId(42); TestProcessManager entity = createEntity(id); repository().store(entity); repository().applyMigration(id, new MarkPmDeleted<>()); Optional<TestProcessManager> found = repository().find(id); assertThat(found).isPresent(); assertThat(found.get() .isDeleted()).isTrue(); }
Source:
protected boolean canDoAction() { if (getDiskImage() == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_NOT_EXIST); } try { if (!validate(new StorageDomainValidator(getStorageDomain()).isDomainExistAndActive())) { return false; } } catch (Exception e) { e.printStackTrace(); } if (!getDiskImage().getParentId().equals(Guid.Empty)) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_CONFIGURATION_NOT_SUPPORTED); } for (VM vm : getVmDAO().getVmsListForDisk(getDiskImage().getId())) { if (vm.getStatus() != VMStatus.Down) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_RUNNING); } } return true; }

Target:
protected boolean canDoAction() { if (getDiskImage() == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_NOT_EXIST); } if (!validate(new StorageDomainValidator(getStorageDomain()).isDomainExistAndActive())) { return false; } if (!getDiskImage().getParentId().equals(Guid.Empty)) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_CONFIGURATION_NOT_SUPPORTED); } for (VM vm : getVmDAO().getVmsListForDisk(getDiskImage().getId())) { if (vm.getStatus() != VMStatus.Down) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_RUNNING); } } return true; }
Source:
public static void main(String[] args) throws Exception { Locale.setDefault(Locale.ENGLISH); Context.init(args); Log.info("Starting server..."); Context.getServerManager().start(); if (Context.getWebServer() != null) { Context.getWebServer().start(); } Timer timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { @Override public void run() { try { Context.getDataManager().clearPositionsHistory(); } catch (Exception error) { Log.warning(error); } } }, 10*1000, 24*60*60*1000); Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { Log.info("Shutting down server..."); if (Context.getWebServer() != null) { Context.getWebServer().stop(); } Context.getServerManager().stop(); } }); }

Target:
public static void main(String[] args) throws Exception { Locale.setDefault(Locale.ENGLISH); Context.init(args); Log.info("Starting server..."); Context.getServerManager().start(); if (Context.getWebServer() != null) { Context.getWebServer().start(); } Timer timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { @Override public void run() { try { Context.getDataManager().clearPositionsHistory(); } catch (SQLException error) { Log.warning(error); } } }, CLEAN_DELAY, CLEAN_PERIOD); Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { Log.info("Shutting down server..."); if (Context.getWebServer() != null) { Context.getWebServer().stop(); } Context.getServerManager().stop(); } }); }
Source:
void save(File file) throws IOException { if (facets.isEmpty()) { file.getParentFile().mkdirs(); AtomicFileWriter afw = new AtomicFileWriter(file); try { try (PrintWriter w = new PrintWriter(afw)) { w.println("<?xml version='1.1' encoding='UTF-8'?>"); w.println("<fingerprint>"); w.print(" <timestamp>"); w.print(DATE_CONVERTER.toString(timestamp)); w.println("</timestamp>"); if (original != null) { w.println(" <original>"); w.print(" <name>"); w.print(Util.xmlEscape(original.name)); w.println("</name>"); w.print(" <number>"); w.print(original.number); w.println("</number>"); w.println(" </original>"); } w.print(" <md5sum>"); w.print(Util.toHexString(md5sum)); w.println("</md5sum>"); w.print(" <fileName>"); w.print(Util.xmlEscape(fileName)); w.println("</fileName>"); w.println(" <usages>"); for (Entry<String, RangeSet> e : usages.entrySet()) { w.println(" <entry>"); w.print(" <string>"); w.print(Util.xmlEscape(e.getKey())); w.println("</string>"); w.print(" <ranges>"); w.print(RangeSet.ConverterImpl.serialize(e.getValue())); w.println("</ranges>"); w.println(" </entry>"); } w.println(" </usages>"); w.println(" <facets/>"); w.print("</fingerprint>"); w.flush(); } afw.commit(); } finally { afw.abort(); } } else { getConfigFile(file).write(this); } }

Target:
void save(File file) throws IOException { if (facets.isEmpty()) { file.getParentFile().mkdirs(); AtomicFileWriter afw = new AtomicFileWriter(file); try { PrintWriter w = new PrintWriter(afw); w.println("<?xml version='1.1' encoding='UTF-8'?>"); w.println("<fingerprint>"); w.print(" <timestamp>"); w.print(DATE_CONVERTER.toString(timestamp)); w.println("</timestamp>"); if (original != null) { w.println(" <original>"); w.print(" <name>"); w.print(Util.xmlEscape(original.name)); w.println("</name>"); w.print(" <number>"); w.print(original.number); w.println("</number>"); w.println(" </original>"); } w.print(" <md5sum>"); w.print(Util.toHexString(md5sum)); w.println("</md5sum>"); w.print(" <fileName>"); w.print(Util.xmlEscape(fileName)); w.println("</fileName>"); w.println(" <usages>"); for (Map.Entry<String,RangeSet> e : usages.entrySet()) { w.println(" <entry>"); w.print(" <string>"); w.print(Util.xmlEscape(e.getKey())); w.println("</string>"); w.print(" <ranges>"); w.print(RangeSet.ConverterImpl.serialize(e.getValue())); w.println("</ranges>"); w.println(" </entry>"); } w.println(" </usages>"); w.println(" <facets/>"); w.print("</fingerprint>"); w.flush(); afw.commit(); } finally { afw.abort(); } } else { getConfigFile(file).write(this); } }
Source:
public static boolean areEquivalent(String left, String right) { if ((left == null) && (right == null)) return true; if ((left == null) || (right == null)) return false; if (left.equals(right)) return true; String leftName = stripGenerics(toSimpleName(left)); String rightName = stripGenerics(toSimpleName(right)); String leftPackage = getPackage(left); String rightPackage = getPackage(right); if (leftName.equals(rightName)) { if (!leftPackage.isEmpty() && !rightPackage.isEmpty()) { return leftPackage.equals(rightPackage); } return !(!leftPackage.isEmpty() && !rightPackage.isEmpty()); } return false; }

Target:
public static boolean areEquivalent(String left, String right) { if (left.equals(notNull(right))) return true; String leftName = stripGenerics(toSimpleName(left)); String rightName = stripGenerics(toSimpleName(right)); String leftPackage = getPackage(left); String rightPackage = getPackage(right); if (leftName.equals(rightName)) { if (!leftPackage.isEmpty() && !rightPackage.isEmpty()) { return leftPackage.equals(rightPackage); } return !(!leftPackage.isEmpty() && !rightPackage.isEmpty()); } return false; }
Source:
public void handleEvent(@NonNull ITmfStateSystemBuilder ss, @NonNull ITmfEvent event) throws AttributeNotFoundException { ITmfEventField content = event.getContent(); long ts = event.getTimestamp().getValue(); Integer phydisk = ((Long) content.getField(getLayout().fieldBlockDeviceId()).getValue()).intValue(); Integer sector = ((Long) content.getField(getLayout().fieldBlockSector()).getValue()).intValue(); Integer nrSector = ((Long) content.getField(getLayout().fieldBlockNrSector()).getValue()).intValue(); Integer rwbs = ((Long) content.getField(getLayout().fieldBlockRwbs()).getValue()).intValue(); DiskWriteModel disk = fStateProvider.getDisk(phydisk); if (nrSector.intValue() == 0) { return; } Bio bio = new Bio(sector, nrSector, disk, rwbs); Request request = new Request(bio); disk.addWaitingRequest(ts, request); }

Target:
public void handleEvent(@NonNull ITmfStateSystemBuilder ss, @NonNull ITmfEvent event) throws AttributeNotFoundException { ITmfEventField content = event.getContent(); long ts = event.getTimestamp().getValue(); int phydisk = ((Long) content.getField(getLayout().fieldBlockDeviceId()).getValue()).intValue(); Long sector = NonNullUtils.checkNotNull((Long) content.getField(getLayout().fieldBlockSector()).getValue()); int nrSector = ((Long) content.getField(getLayout().fieldBlockNrSector()).getValue()).intValue(); int rwbs = ((Long) content.getField(getLayout().fieldBlockRwbs()).getValue()).intValue(); DiskWriteModel disk = fStateProvider.getDisk(phydisk); if (nrSector == 0) { return; } BlockIO bio = new BlockIO(sector, nrSector, disk, rwbs); Request request = new Request(bio); disk.addWaitingRequest(ts, request); }
Source:
private boolean isInStudy(Set<Roles> roles, StudyIdentifier studyId, Survey survey) { if (studyId == null || (!roles.isEmpty() && roles.contains(Roles.ADMIN))) { return true; } if (survey == null || survey.getStudyIdentifier() == null) { return false; } return survey.getStudyIdentifier().equals(studyId.getIdentifier()); }

Target:
private boolean isInStudy(Set<Roles> roles, StudyIdentifier studyId, Survey survey) { if (studyId == null || roles.contains(Roles.ADMIN)) { return true; } if (survey == null || survey.getStudyIdentifier() == null) { return false; } return survey.getStudyIdentifier().equals(studyId.getIdentifier()); }
Source:
private LuceneQuery<PersonName> getPersonNameLuceneQuery(String query, boolean includeVoided) { StringBuilder newQuery = new StringBuilder(); newQuery.append("givenName:\"").append(query).append("\" OR familyName:\"").append(query) .append("\" OR middleName:\"").append(query).append("\""); LuceneQuery<PersonName> luceneQuery = LuceneQuery .newQuery(PersonName.class, sessionFactory.getCurrentSession(), newQuery.toString()); if(!includeVoided){ luceneQuery.include("voided", false); } luceneQuery.skipSame("person.personId"); return luceneQuery; }

Target:
private LuceneQuery<PersonName> getPersonNameLuceneQuery(String query, boolean includeVoided) { String[] fields = {"givenName", "givenNameExact", "middleName", "middleNameExact", "familyName", "familyNameExact", "familyName2", "familyName2Exact"}; LuceneQuery<PersonName> luceneQuery = LuceneQuery .newQuery(PersonName.class, sessionFactory.getCurrentSession(), query, fields); if(!includeVoided){ luceneQuery.include("voided", false); luceneQuery.include("person.voided", false); } return luceneQuery; }
Source:
public Sorting convert(Sort sort) { Iterator<Order> order = sort.iterator(); if (order.hasNext()) { Order next = order.next(); String property = next.getProperty(); if (!property.equals(RELEVANCE)) { return new Sorting(JudgmentIndexField.valueOf(property).getFieldName(), convertDirection(next.getDirection())); } } return Sorting.relevanceSorting(); }

Target:
public Sorting convert(Sort sort) { Iterator<Order> order = sort.iterator(); if (order.hasNext()) { Order next = order.next(); String property = next.getProperty(); String fieldName = ""; try { fieldName = JudgmentIndexField.valueOf(property).getFieldName(); } catch (IllegalArgumentException e) { return Sorting.relevanceSorting(); } if (!property.equals(RELEVANCE)) { return new Sorting(fieldName, convertDirection(next.getDirection())); } } return Sorting.relevanceSorting(); }
Source:
private static Form flip(Form binaryLogicalOperation) { switch (binaryLogicalOperation) { case AND: return OR; case OR: return AND; } throw new UnsupportedOperationException("Invalid binary logical operation"); }

Target:
private static Form flip(Form binaryLogicalOperation) { switch (binaryLogicalOperation) { case AND: return OR; case OR: return AND; } throw new UnsupportedOperationException("Invalid binary logical operation: " + binaryLogicalOperation); }
Source:
public SqlStatements define(String key, Object value) { synchronized (this) { attributes.put(key, value); } return this; }

Target:
public SqlStatements define(String key, Object value) { attributes.put(key, value); return this; }
Source:
private void deliverFailure(@NonNull final Throwable error) { handler.post(new Runnable() { @Override public void run() { if (progressCallback != null) { progressCallback.finishProcess(); } if (errorNotification != null) { if (refreshListener != null) { errorNotification.showError(R.string.reset_no_network_message, FontAwesomeIcons.fa_wifi, R.string.lbl_reload, new View.OnClickListener() { @Override public void onClick(View v) { if (NetworkUtil.isConnected(context)) { refreshListener.onRefresh(); } } }); } else { errorNotification.showError(context, error); } } onFailure(error); } }); }

Target:
private void deliverFailure(@NonNull final Throwable error) { handler.post(new Runnable() { @Override public void run() { if (progressCallback != null) { progressCallback.finishProcess(); } if (errorNotification != null) { if (refreshListener != null) { errorNotification.showError(context, error, R.string.lbl_reload, new View.OnClickListener() { @Override public void onClick(View v) { if (NetworkUtil.isConnected(context)) { refreshListener.onRefresh(); } } }); } else { errorNotification.showError(context, error); } } onFailure(error); onFinish(); } }); }
Source:
public Vector3f getSpawnPosition(World world, EntityRef clientEntity) { return new Vector3f(new Vector3i(LASUtils.FLOATING_PLATFORM_POSITION) .add(0, 5, 0)); }

Target:
public Vector3f getSpawnPosition(World world, EntityRef clientEntity) { return new Vector3f(LASUtils.FLOATING_PLATFORM_POSITION) .add(0.0f, 5.0f, 0.0f); }
Source:
@Test public void invalidCenterCrop() { try { new RequestBuilder().centerCrop(); fail("Center crop without resize should throw exception."); } catch (IllegalStateException expected) { } try { new RequestBuilder().centerInside().centerCrop(); fail("Calling center crop after center inside should throw exception."); } catch (IllegalStateException expected) { } }

Target:
@Test public void invalidCenterCrop() { try { new RequestBuilder().centerCrop(); fail("Center crop without resize should throw exception."); } catch (IllegalStateException expected) { } try { new RequestBuilder().resize(10, 10).centerInside().centerCrop(); fail("Calling center crop after center inside should throw exception."); } catch (IllegalStateException expected) { } }
Source:
public ParseGeoPoint getLocation() { return (ParseGeoPoint) getClient().get("location"); }

Target:
public ParseGeoPoint getLocation() { return getClient().getLocation(); }