auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Object[][] getMetricClasses(){ return new Object[][]{ {TargetedPcrMetrics.class}, {HsMetrics.class}, {TargetMetrics.class}, {CollectRawWgsMetrics.RawWgsMetrics.class}, {CollectWgsMetricsWithNonZeroCoverage.WgsMetricsWithNonZeroCoverage.class} }; }

Target:
public Iterator<Object[]> getMetricClasses() { final ClassFinder classFinder = new ClassFinder(); classFinder.find("picard", MetricBase.class); return classFinder.getClasses().stream() .map(c -> new Object[]{c}) .iterator(); }
Source:
public void registerService(final ServiceDescription description) { if (mdnsClient == null) { servicesToRegisterQueue.add(description); } else { Runnable runnable = new Runnable() { @Override public void run() { try { logger.debug("Registering new service at port {}", description.serviceType, description.servicePort); mdnsClient.registerService(description); } catch (IOException e) { logger.error(e.getMessage()); } catch (IllegalStateException e) { logger.debug("Not registering service {}, because service is already deactivated!", description.serviceType); } } }; Executors.newSingleThreadExecutor().execute(runnable); } }

Target:
public void registerService(final ServiceDescription description) { if (mdnsClient == null) { servicesToRegisterQueue.add(description); } else { Runnable runnable = new Runnable() { @Override public void run() { try { mdnsClient.registerService(description); } catch (IOException e) { logger.error(e.getMessage()); } catch (IllegalStateException e) { logger.debug("Not registering service {}, because service is already deactivated!", description.serviceType); } } }; Executors.newSingleThreadExecutor().execute(runnable); } }
Source:
public void accept(final Socket socket) throws IOException { throw new NotImplementedException(); }

Target:
public void accept(final Socket socket) throws IOException { throw new UnsupportedOperationException(); }
Source:
private void loadInitialState(ITmfStateProvider provider) { for (ITmfStateSystem ss : getStateSystems()) { if (ss instanceof ITmfStateSystemBuilder) { ITmfStateSystemBuilder ssb = (ITmfStateSystemBuilder) ss; final ITmfTrace trace = getTrace(); if (trace == null) { throw new IllegalStateException(); } StateSnapshot snapshot = StateSnapshot.read(Paths.get(trace.getPath()), ss.getSSID()); if (snapshot == null || provider.getVersion() != snapshot.getVersion()) { continue; } for (Entry<List<String>, ITmfStateInterval> attributeSnapshot : snapshot.getStates().entrySet()) { List<String> attributePath = Objects.requireNonNull(attributeSnapshot.getKey()); int quark = ssb.getQuarkAbsoluteAndAdd(attributePath.toArray(new String[attributePath.size()])); ITmfStateInterval interval = Objects.requireNonNull(attributeSnapshot.getValue()); Object initialState = interval.getValue(); ssb.modifyAttribute(Math.max(interval.getStartTime(), ssb.getStartTime()), initialState, quark); } } } }

Target:
private void loadInitialState(ITmfStateProvider provider) { final ITmfTrace trace = getTrace(); if (trace == null) { throw new IllegalStateException("Trace is null. It should be impossible to load states. "); } File path = new File(trace.getPath()); path = path.isDirectory() ? path : path.getParentFile(); if (path == null) { throw new IllegalStateException("Trace does not seem to have a file backing it : " + trace); } for (ITmfStateSystem ss : getStateSystems()) { if (ss instanceof ITmfStateSystemBuilder) { ITmfStateSystemBuilder ssb = (ITmfStateSystemBuilder) ss; StateSnapshot snapshot = StateSnapshot.read(path.toPath(), ss.getSSID()); if (snapshot == null || provider.getVersion() != snapshot.getVersion()) { continue; } for (Entry<List<String>, ITmfStateInterval> attributeSnapshot : snapshot.getStates().entrySet()) { List<String> attributePath = Objects.requireNonNull(attributeSnapshot.getKey()); int quark = ssb.getQuarkAbsoluteAndAdd(attributePath.toArray(new String[attributePath.size()])); ITmfStateInterval interval = Objects.requireNonNull(attributeSnapshot.getValue()); Object initialState = interval.getValue(); ssb.modifyAttribute(Math.max(interval.getStartTime(), ssb.getStartTime()), initialState, quark); } } } }
Source:
public List<DiskOfferingVO> listAllBySizeAndProvisioningType(long size, Storage.ProvisioningType provisioningType) { StringBuilder sql = new StringBuilder(SizeDiskOfferingSearch); TransactionLegacy txn = TransactionLegacy.currentTxn(); List<DiskOfferingVO> offerings = new ArrayList<>(); try(PreparedStatement pstmt = txn.prepareStatement(sql.toString());){ if(pstmt != null) { pstmt.setLong(1, size); pstmt.setString(2, provisioningType.toString()); try(ResultSet rs = pstmt.executeQuery();) { while (rs.next()) { offerings.add(toEntityBean(rs, false)); } }catch (SQLException e) { throw new CloudRuntimeException("Exception while listing disk offerings by size: " + e.getMessage(), e); } } return offerings; } catch (SQLException e) { throw new CloudRuntimeException("Exception while listing disk offerings by size: " + e.getMessage(), e); } }

Target:
public List<DiskOfferingVO> listAllBySizeAndProvisioningType(long size, Storage.ProvisioningType provisioningType) { StringBuilder sql = new StringBuilder(SizeDiskOfferingSearch); TransactionLegacy txn = TransactionLegacy.currentTxn(); List<DiskOfferingVO> offerings = new ArrayList<>(); try(PreparedStatement pstmt = txn.prepareStatement(sql.toString());){ if(pstmt != null) { pstmt.setLong(1, size); pstmt.setString(2, provisioningType.toString()); try(ResultSet rs = pstmt.executeQuery()) { while (rs.next()) { offerings.add(toEntityBean(rs, false)); } } catch (SQLException e) { throw new CloudRuntimeException("Exception while listing disk offerings by size: " + e.getMessage(), e); } } return offerings; } catch (SQLException e) { throw new CloudRuntimeException("Exception while listing disk offerings by size: " + e.getMessage(), e); } }
Source:
public void nullMessageProcessPhaseInRegistry() throws Exception { when(mockMuleContext.getTransactionManager()).thenReturn(null); when(mockMuleContext.getConfiguration().getId()).thenReturn("appName"); processAndVerifyDefaultPhasesUsingRegistryPhases(null); }

Target:
public void nullMessageProcessPhaseInRegistry() throws Exception { when(mockMuleContext.getTransactionManager()).thenReturn(null); processAndVerifyDefaultPhasesUsingRegistryPhases(null); }
Source:
protected void subscribeActual(SingleObserver<? super T> observer) { Disposable d = Disposables.empty(); observer.onSubscribe(d); if (d.isDisposed()) { return; } T value; try { value = ObjectHelper.requireNonNull(callable.call(), "Callable returned null"); } catch (Throwable ex) { Exceptions.throwIfFatal(ex); if (!d.isDisposed()) { observer.onError(ex); } else { RxJavaPlugins.onError(ex); } return; } if (!d.isDisposed()) { observer.onSuccess(value); } }

Target:
protected void subscribeActual(SingleObserver<? super T> observer) { Disposable d = Disposables.empty(); observer.onSubscribe(d); if (d.isDisposed()) { return; } T value; try { value = ObjectHelper.requireNonNull(callable.call(), "The callable returned a null value"); } catch (Throwable ex) { Exceptions.throwIfFatal(ex); if (!d.isDisposed()) { observer.onError(ex); } else { RxJavaPlugins.onError(ex); } return; } if (!d.isDisposed()) { observer.onSuccess(value); } }
Source:
private static void markRbFailed() { Prefs.setRequestSuccessCounter(-1); }

Target:
private static void markRbFailed() { Prefs.setRequestSuccessCounter(FAILED); }
Source:
private PackedRefList readPackedRefs() throws IOException { while (true) { final FileSnapshot snapshot = FileSnapshot.save(packedRefsFile); final BufferedReader br; final MessageDigest digest = Constants.newMessageDigest(); try { br = new BufferedReader(new InputStreamReader( new DigestInputStream(new FileInputStream(packedRefsFile), digest), CHARSET)); } catch (FileNotFoundException noPackedRefs) { return PackedRefList.NO_PACKED_REFS; } try { return new PackedRefList(parsePackedRefs(br), snapshot, ObjectId.fromRaw(digest.digest())); } catch (IOException e) { if (isStaleFileHandle(e)) { continue; } throw e; } finally { br.close(); } } }

Target:
private PackedRefList readPackedRefs() throws IOException { int maxStaleRetries = 5; int retries = 0; while (true) { final FileSnapshot snapshot = FileSnapshot.save(packedRefsFile); final BufferedReader br; final MessageDigest digest = Constants.newMessageDigest(); try { br = new BufferedReader(new InputStreamReader( new DigestInputStream(new FileInputStream(packedRefsFile), digest), CHARSET)); } catch (FileNotFoundException noPackedRefs) { return PackedRefList.NO_PACKED_REFS; } try { return new PackedRefList(parsePackedRefs(br), snapshot, ObjectId.fromRaw(digest.digest())); } catch (IOException e) { if (FileUtils.isStaleFileHandle(e) && retries < maxStaleRetries) { retries++; continue; } throw e; } finally { br.close(); } } }
Source:
public static void before() { SWTBotUtils.openTrace(TRACE_PROJECT_NAME, fTestFile.getAbsolutePath(), TRACE_TYPE); fEditorBot = SWTBotUtils.activateEditor(fBot, fTestFile.getName()); }

Target:
public void before() { SWTBotUtils.openTrace(TRACE_PROJECT_NAME, fTestFile.getAbsolutePath(), TRACE_TYPE); fEditorBot = SWTBotUtils.activateEditor(fBot, fTestFile.getName()); }
Source:
ClientFactory clientFactory() { ClientFactoryBuilder builder = new ClientFactoryBuilder() .useHttp2Preface(false); clientFactoryCustomizer().accept(builder); return builder.build(); }

Target:
ClientFactory clientFactory() { ClientFactoryBuilder builder = new ClientFactoryBuilder() .workerGroup(EventLoopGroups.newEventLoopGroup( Flags.numCommonWorkers(), "armeria-common-worker", true), true) .useHttp2Preface(false); clientFactoryCustomizer().accept(builder); return builder.build(); }
Source:
default CustomAttribute[] getAttributes() { return null; }

Target:
default CustomAttribute[] getAttributes() { return new CustomAttribute[]{}; }
Source:
public void update(PopulatorContext context) throws PopulatorException { DefaultHttpClient httpclient = new DefaultHttpClient(); try { URL xcri = new URL(context.getURI()); InputStream input = null; if ("file".equals(xcri.getProtocol())) { input = xcri.openStream(); } else { HttpHost targetHost = new HttpHost(xcri.getHost(), xcri.getPort(), xcri.getProtocol()); httpclient.getCredentialsProvider().setCredentials( new AuthScope(targetHost.getHostName(), targetHost.getPort()), new UsernamePasswordCredentials(context.getUser(), context.getPassword())); HttpGet httpget = new HttpGet(xcri.toURI()); HttpResponse response = httpclient.execute(targetHost, httpget); HttpEntity entity = response.getEntity(); if (HttpStatus.SC_OK != response.getStatusLine().getStatusCode()) { throw new IllegalStateException( "Invalid response ["+response.getStatusLine().getStatusCode()+"]"); } input = entity.getContent(); } if (null == input) { throw new PopulatorException("No Input for Importer"); } process(context.getName(), input); } catch (MalformedURLException e) { log.warn("MalformedURLException ["+context.getURI()+"]", e); throw new PopulatorException(e.getLocalizedMessage()); } catch (IllegalStateException e) { log.warn("IllegalStateException ["+context.getURI()+"]", e); throw new PopulatorException(e.getLocalizedMessage()); } catch (IOException e) { log.warn("IOException ["+context.getURI()+"]", e); throw new PopulatorException(e.getLocalizedMessage()); } catch (URISyntaxException e) { log.warn("URISyntaxException ["+context.getURI()+"]", e); throw new PopulatorException(e.getLocalizedMessage()); } catch (JDOMException e) { log.warn("JDOMException ["+context.getURI()+"]", e); throw new PopulatorException(e.getLocalizedMessage()); } catch (InvalidElementException e) { log.warn("InvalidElementException ["+context.getURI()+"]", e); throw new PopulatorException(e.getLocalizedMessage()); } finally { httpclient.getConnectionManager().shutdown(); } }

Target:
public void update(PopulatorContext context) throws PopulatorException { try { InputStream input = populatorInput.getInput(context); if (null == input) { throw new PopulatorException("No Input for Importer"); } process(context, input); } catch (MalformedURLException e) { log.warn("MalformedURLException ["+context.getURI()+"]", e); throw new PopulatorException(e.getLocalizedMessage()); } catch (IllegalStateException e) { log.warn("IllegalStateException ["+context.getURI()+"]", e); throw new PopulatorException(e.getLocalizedMessage()); } catch (IOException e) { log.warn("IOException ["+context.getURI()+"]", e); throw new PopulatorException(e.getLocalizedMessage()); } catch (JDOMException e) { log.warn("JDOMException ["+context.getURI()+"]", e); throw new PopulatorException(e.getLocalizedMessage()); } catch (InvalidElementException e) { log.warn("InvalidElementException ["+context.getURI()+"]", e); throw new PopulatorException(e.getLocalizedMessage()); } }
Source:
public void validate(FailureCollector collector) { if (containsMacro(STORAGE_LEVEL)) { return; } String[] allowedStrings = {"DISK_ONLY", "DISK_ONLY_2", "MEMORY_ONLY", "MEMORY_ONLY_2", "MEMORY_ONLY_SER", "MEMORY_ONLY_SER_2", "MEMORY_AND_DISK", "MEMORY_AND_DISK_2", "MEMORY_AND_DISK_SER", "MEMORY_AND_DISK_SER_2"}; if (storageLevel.isEmpty()) { collector.addFailure("Storage level is a required value. ", "Please select the desired storage level.") .withConfigProperty(STORAGE_LEVEL); } else if (!Arrays.asList(allowedStrings).contains(storageLevel.toUpperCase())) { collector .addFailure("Invalid value for Storage Level ", "Please select one of the valid values from the dropdown.") .withConfigProperty(STORAGE_LEVEL); } }

Target:
public void validate(FailureCollector collector) { if (containsMacro(STORAGE_LEVEL)) { return; } Set<String> allowed = new HashSet<>(Arrays.asList( "DISK_ONLY", "DISK_ONLY_2", "MEMORY_ONLY", "MEMORY_ONLY_2", "MEMORY_ONLY_SER", "MEMORY_ONLY_SER_2", "MEMORY_AND_DISK", "MEMORY_AND_DISK_2", "MEMORY_AND_DISK_SER", "MEMORY_AND_DISK_SER_2")); if (!allowed.contains(storageLevel.toUpperCase())) { collector .addFailure("Invalid value for Storage Level.", "Please provide one of the following allowed values: " + allowed.toString()) .withConfigProperty(STORAGE_LEVEL); } }
Source:
private void removeObjectsWithPrefix(String containerAndPrefix) { int separatorIndex = containerAndPrefix.indexOf('/'); if (separatorIndex < 0) { throw new IllegalArgumentException("No / separator found in \"" + containerAndPrefix + "\""); } String container = containerAndPrefix.substring(0, separatorIndex); String prefix = containerAndPrefix.substring(separatorIndex + 1); removeObjectsWithPrefix(container, prefix); }

Target:
private void removeObjectsWithPrefix(String containerAndPrefix) { String[] parts = splitContainerAndKey(containerAndPrefix); String container = parts[0]; String prefix = parts[1]; removeObjectsWithPrefix(container, prefix); }
Source:
private List<DiskImage> getAllDisks(List<DiskImage> newDisksList, List<DiskImage> cloneDisksList) { List<DiskImage> disksList = new ArrayList<>(); disksList.addAll(newDisksList); disksList.addAll(cloneDisksList); return disksList; }

Target:
private static List<DiskImage> getAllDisks(List<DiskImage> newDisksList, List<DiskImage> cloneDisksList) { List<DiskImage> disksList = new ArrayList<>(); disksList.addAll(newDisksList); disksList.addAll(cloneDisksList); return disksList; }
Source:
public void testRemoveEnclosingSquareBrackets() { String list = Arrays.asList(new String[]{"test1", "test2"}).toString(); String nullString = null; assertEquals("test1, test2", StringHelper.removeEnclosingSquareBrackets(list)); assertEquals("test1,test2", StringHelper.removeEnclosingSquareBrackets(" [test1,test2] ")); assertEquals("test", StringHelper.removeEnclosingSquareBrackets("test")); assertEquals("", StringHelper.removeEnclosingSquareBrackets("")); assertEquals(null, nullString); }

Target:
public void testRemoveEnclosingSquareBrackets() { assertEquals("test1, test2", StringHelper.removeEnclosingSquareBrackets("[test1, test2]")); assertEquals("[ \"test\" ]", StringHelper.removeEnclosingSquareBrackets("[[ \"test\" ]]")); assertEquals("test1, [], ] test2", StringHelper.removeEnclosingSquareBrackets("[test1, [], ] test2]")); assertEquals("test", StringHelper.removeEnclosingSquareBrackets("test")); assertEquals(" test ", StringHelper.removeEnclosingSquareBrackets(" test ")); assertEquals("[test", StringHelper.removeEnclosingSquareBrackets("[test")); assertEquals("(test]", StringHelper.removeEnclosingSquareBrackets("(test]")); assertEquals("", StringHelper.removeEnclosingSquareBrackets("")); assertEquals(null, StringHelper.removeEnclosingSquareBrackets(null)); }
Source:
private void populateLanguageValues() { languageBox.getItems().clear(); for (Locale locale : Languages.SUPPORTED_LOCALES) { String item = locale.toLanguageTag() + " : " + BundleUtils.getLabel(locale, Languages.SETTINGS_LABEL_KEYS.get(locale)); if (!locale.equals(Languages.getCurrentLocale())) { item += " (" + BundleUtils.getLabel(Languages.SETTINGS_LABEL_KEYS.get(locale)) + ")"; } Collator coll = Collator.getInstance(locale); languageBox.getItems().add(item); languageBox.getItems().sort(coll); if (Languages.getCurrentLocale().equals(locale)) { languageBox.getSelectionModel().select(item); } } }

Target:
private void populateLanguageValues() { languageBox.getItems().clear(); for (Locale locale : Languages.SUPPORTED_LOCALES) { String item = locale.toLanguageTag() + " : " + BundleUtils.getLabel(locale, Languages.SETTINGS_LABEL_KEYS.get(locale)); <<<<<<< HEAD ======= >>>>>>> 5be3b0d0413202bc5c6b99e8bdc33a78b19c94fb if (!locale.equals(Languages.getCurrentLocale())) { item += " (" + BundleUtils.getLabel(Languages.SETTINGS_LABEL_KEYS.get(locale)) + ")"; } languageBox.getItems().add(item); if (Languages.getCurrentLocale().equals(locale)) { languageBox.getSelectionModel().select(item); } } Collator coll = Collator.getInstance(); languageBox.getItems().sort(coll); }
Source:
public boolean isValid(AuthDTO dto, ConstraintValidatorContext context) { Optional<AuthEntry> auth = catalog.findByInfo(dto.info); if (!auth.isPresent()) { context.buildConstraintViolationWithTemplate(dto.type + " type is not valid for " + dto.info + " Auth Info!").addConstraintViolation(); return false; } return true; }

Target:
public boolean isValid(AuthDTO dto, ConstraintValidatorContext context) { Optional<AuthEntry> auth = catalog.findByInfo(dto.info); if (!auth.isPresent()) { context.buildConstraintViolationWithTemplate(dto.info + " is invalid Auth Info!").addConstraintViolation(); return false; } if (!auth.get().containsType(dto.type)) { context.buildConstraintViolationWithTemplate(dto.type + " type is not valid for " + dto.info + " Auth Info!").addConstraintViolation(); return false; } return true; }
Source:
protected String buildErrorEmailSubject() { return "Error occurred during Corporate Billed Corporate Paid batch upload process"; }

Target:
protected String buildErrorEmailSubject() { return configurationService.getPropertyValueAsString(CuFPKeyConstants.ERROR_CBCP_BATCH_UPLOAD_EMAIL_SUBJECT); }
Source:
public boolean isSnapshotAllowed() { if (containsKey(SrampConstants.SRAMP_SNAPSHOT_ALLOWED)) { String value = getConfigProperty(SrampConstants.SRAMP_SNAPSHOT_ALLOWED, "false"); if (StringUtils.isNotBlank(value) && value.equals("true")) { return true; } else { return false; } } else { if (isSnapshot()) { return true; } else { return false; } } }

Target:
public boolean isSnapshotAllowed() { if (containsKey(SrampConstants.SRAMP_SNAPSHOT_ALLOWED)) { String value = getConfigProperty(SrampConstants.SRAMP_SNAPSHOT_ALLOWED, "false"); return StringUtils.isNotBlank(value) && value.equals("true"); } else { return isSnapshot(); } }
Source:
private void onTest() { flush(); startProgress(null); Frontend.RunAction(VdcActionType.TestProviderConnectivity, new ProviderParameters(provider), new IFrontendActionAsyncCallback() { @Override public void executed(FrontendActionAsyncResult result) { VdcReturnValueBase res = result.getReturnValue(); if (res != null && !res.getSucceeded() && res.getFault().getError().equals(VdcBllErrors.PROVIDER_SSL_FAILURE)) { AsyncQuery getCertChainQuery = new AsyncQuery(); getCertChainQuery.asyncCallback = new INewAsyncCallback() { @Override public void onSuccess(Object model, Object result) { if (result != null) { ConfirmationModel confirmationModel = getImportChainConfirmationModel((String) result); sourceListModel.setConfirmWindow(confirmationModel); } else { stopProgress(); setTestResultValue((VdcQueryReturnValue) result); } } }; AsyncDataProvider.GetProviderCertificateChain(getCertChainQuery, provider); } else { stopProgress(); setTestResultValue(res); } } }, null, false); }

Target:
private void onTest() { flush(); startProgress(null); Frontend.RunAction(VdcActionType.TestProviderConnectivity, new ProviderParameters(provider), new IFrontendActionAsyncCallback() { @Override public void executed(FrontendActionAsyncResult result) { VdcReturnValueBase res = result.getReturnValue(); if (isFailedOnSSL(res)) { AsyncQuery getCertChainQuery = new AsyncQuery(); getCertChainQuery.asyncCallback = new INewAsyncCallback() { @Override public void onSuccess(Object model, Object result) { if (result != null) { ConfirmationModel confirmationModel = getImportChainConfirmationModel((String) result); sourceListModel.setConfirmWindow(confirmationModel); } else { stopProgress(); setTestResultValue((VdcQueryReturnValue) result); } } }; AsyncDataProvider.GetProviderCertificateChain(getCertChainQuery, provider); } else { stopProgress(); setTestResultValue(res); } } }, null, false); }
Source:
public Set<ClientSourceId> getTrackedClients() { return Collections.unmodifiableSet(trackedClients); }

Target:
public Stream<ClientSourceId> getTrackedClients() { return clientMessageTrackers.stream() .flatMap(tracker -> tracker.getTrackedClients().stream()) .distinct(); }
Source:
private boolean isTwitterConfigured() { List<String> twitterConfigs = Arrays.asList( getResources().getString(R.string.twitter_app_id), getResources().getString(R.string.twitter_consumer_key), getResources().getString(R.string.twitter_consumer_secret) ); return !twitterConfigs.contains(UNCHANGED_CONFIG_VALUE); }

Target:
private boolean isTwitterConfigured() { List<String> twitterConfigs = Arrays.asList( getResources().getString(R.string.twitter_consumer_key), getResources().getString(R.string.twitter_consumer_secret) ); return !twitterConfigs.contains(UNCHANGED_CONFIG_VALUE); }
Source:
public ColumnFilter build() { if (built) { return null; } UserGroupCallback userGroupCallback = new CustomUserGroupCallbackImpl(); List<String> potOwners = (List<String>)parameters.get("potOwner"); List<String> potOwnersList = new ArrayList<String>(); for(String potOwner: potOwners) { potOwnersList.add(potOwner); potOwnersList.addAll(userGroupCallback.getGroupsForUser(potOwner)); } String columnName = "potOwner"; ColumnFilter filter = FilterFactory.AND( FilterFactory.in("potOwner",potOwnersList)); filter.setColumnId(columnName); built = true; return filter; }

Target:
public ColumnFilter build() { if (built) { return null; } String columnName = "potOwner"; UserGroupCallback userGroupCallback = UserDataServiceProvider.getUserGroupCallback(); List<String> potOwners = (List<String>)parameters.get(columnName); List<String> potOwnersList = new ArrayList<String>(); for(String potOwner: potOwners) { potOwnersList.add(potOwner); if(userGroupCallback.getGroupsForUser(potOwner) != null) { potOwnersList.addAll(userGroupCallback.getGroupsForUser(potOwner)); } } ColumnFilter filter = FilterFactory.AND( FilterFactory.in(columnName,potOwnersList)); filter.setColumnId(columnName); built = true; return filter; }
Source:
private void checkJobClientConfigured() { Preconditions.checkNotNull(jobClient, "Job client must be configured before first use."); }

Target:
private void checkJobClientConfigured() { Preconditions.checkNotNull(jobClient, "Job client must be configured before first use."); Preconditions.checkNotNull(gateway, "Coordination request gateway must be configured before first use."); }
Source:
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { if (TextUtils.equals(getResources().getString(R.string.pref_searchProvider), key)) { setupSummaries(); SearchEngineFactory.setDefault(sharedPreferences.getString(key, null)); } }

Target:
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { if (TextUtils.equals(PREF_SEARCH_ENGINE_KEY, key)) { final ListPreference searchEnginePref = (ListPreference) findPreference(PREF_SEARCH_ENGINE_KEY); searchEnginePref.setSummary(searchEnginePref.getEntry()); } }
Source:
private void pipeRecord(final String topic, final Long timestamp, final byte[] key, final byte[] value, final Headers headers) { final String topicName = topic; if (!internalTopologyBuilder.getSourceTopicNames().isEmpty()) { validateSourceTopicNameRegexPattern(topic); } final TopicPartition topicPartition = getTopicPartition(topicName); if (topicPartition != null) { final long offset = offsetsByTopicPartition.get(topicPartition).incrementAndGet() - 1; task.addRecords(topicPartition, Collections.singleton(new ConsumerRecord<>( topicName, topicPartition.partition(), offset, timestamp, TimestampType.CREATE_TIME, (long) ConsumerRecord.NULL_CHECKSUM, key == null ? 0 : key.length, value == null ? 0 : value.length, key, value, headers))); task.process(); task.maybePunctuateStreamTime(); task.commit(); captureOutputRecords(); } else { final TopicPartition globalTopicPartition = globalPartitionsByTopic.get(topicName); if (globalTopicPartition == null) { throw new IllegalArgumentException("Unknown topic: " + topicName); } final long offset = offsetsByTopicPartition.get(globalTopicPartition).incrementAndGet() - 1; globalStateTask.update(new ConsumerRecord<>( globalTopicPartition.topic(), globalTopicPartition.partition(), offset, timestamp, TimestampType.CREATE_TIME, (long) ConsumerRecord.NULL_CHECKSUM, key == null ? 0 : key.length, value == null ? 0 : value.length, key, value, headers)); globalStateTask.flushState(); } }

Target:
private void pipeRecord(final String topic, final Long timestamp, final byte[] key, final byte[] value, final Headers headers) { final String topicName = topic; if (!internalTopologyBuilder.getSourceTopicNames().isEmpty()) { validateSourceTopicNameRegexPattern(topic); } final TopicPartition topicPartition = getTopicPartition(topicName); if (topicPartition != null) { final long offset = offsetsByTopicPartition.get(topicPartition).incrementAndGet() - 1; task.addRecords(topicPartition, Collections.singleton(new ConsumerRecord<>( topicName, topicPartition.partition(), offset, timestamp, TimestampType.CREATE_TIME, (long) ConsumerRecord.NULL_CHECKSUM, key == null ? ConsumerRecord.NULL_SIZE : key.length, value == null ? ConsumerRecord.NULL_SIZE : value.length, key, value, headers))); task.process(); task.maybePunctuateStreamTime(); task.commit(); captureOutputRecords(); } else { final TopicPartition globalTopicPartition = globalPartitionsByTopic.get(topicName); if (globalTopicPartition == null) { throw new IllegalArgumentException("Unknown topic: " + topicName); } final long offset = offsetsByTopicPartition.get(globalTopicPartition).incrementAndGet() - 1; globalStateTask.update(new ConsumerRecord<>( globalTopicPartition.topic(), globalTopicPartition.partition(), offset, timestamp, TimestampType.CREATE_TIME, (long) ConsumerRecord.NULL_CHECKSUM, key == null ? ConsumerRecord.NULL_SIZE : key.length, value == null ? ConsumerRecord.NULL_SIZE : value.length, key, value, headers)); globalStateTask.flushState(); } }
Source:
@Override public void run() { String secretName = config.name; if (secretName == null || !validName(secretName)) { throw new IllegalArgumentException(format("Invalid name, must match %s", VALID_NAME_PATTERN)); } byte[] content = {}; if (config.contentProvided) { content = readSecretContent(); } partialUpdateSecret(secretName, content, config); if (!config.contentProvided) { try { InputStreamReader reader = new InputStreamReader(stream, "UTF-8"); if (reader.ready()) { System.out.println("\nWarning: Specify the --content flag to update a secret's content."); System.out.println("The secret has not been updated with any provided content."); } } catch (IOException e) { throw new AssertionError(String.format("Unexpected error trying to create an InputStreamReader for stdin: %s", e.getMessage())); } } }

Target:
@Override public void run() { String secretName = config.name; if (secretName == null || !validName(secretName)) { throw new IllegalArgumentException(format("Invalid name, must match %s", VALID_NAME_PATTERN)); } byte[] content = {}; if (config.contentProvided) { content = readSecretContent(); } partialUpdateSecret(secretName, content, config); if (!config.contentProvided) { try { InputStreamReader reader = new InputStreamReader(stream, "UTF-8"); if (reader.ready()) { System.out.println("\nWarning: Specify the --content flag to update a secret's content."); System.out.println("The secret has not been updated with any provided content."); } } catch (IOException e) { logger.warn("Unexpected error trying to create an InputStreamReader for stdin: '{}'", e.getMessage()); } } }
Source:
private static Target getTarget(ServletRequest request) { Target target = Target.Other; if (request instanceof HttpServletRequest) { HttpServletRequest httpRequest = (HttpServletRequest) request; if ("GET".equals(httpRequest.getMethod())) { String path = httpRequest.getPathInfo(); if (path.endsWith("/apps") || path.endsWith("/apps/")) { target = Target.FullFetch; } else if (path.endsWith("/apps/delta") || path.endsWith("/apps/delta/")) { target = Target.DeltaFetch; } } } return target; }

Target:
private static Target getTarget(ServletRequest request) { Target target = Target.Other; if (request instanceof HttpServletRequest) { HttpServletRequest httpRequest = (HttpServletRequest) request; if ("GET".equals(httpRequest.getMethod())) { Matcher matcher = TARGET_RE.matcher(httpRequest.getPathInfo()); if (matcher.matches()) { if (matcher.groupCount() == 0 || "/".equals(matcher.group(1))) { target = Target.FullFetch; } else if ("/delta".equals(matcher.group(1))) { target = Target.DeltaFetch; } else { target = Target.Application; } } } } return target; }
Source:
public void execute(JobExecutionContext context) throws JobExecutionException { Session session = sessionManager.getCurrentSession(); session.setUserEid("admin"); session.setUserId("admin"); String sql = "SELECT COLLECTION_ID FROM CONTENT_COLLECTION WHERE COLLECTION_ID LIKE \"%LB-CSS%\" "; LOG.debug("SQL to get collection Id for LB-CSS folder " + sql); List<String> collection_ids = sqlService.dbRead(sql); for(String id : collection_ids){ try { ContentCollectionEdit contentCollectionEdit = contentHostingService.editCollection(id); ResourcePropertiesEdit resourceProperties = contentCollectionEdit.getPropertiesEdit(); if(!("true".equals(resourceProperties.getProperty(ResourceProperties.PROP_HIDDEN_WITH_ACCESSIBLE_CONTENT)))){ resourceProperties.addProperty(ResourceProperties.PROP_HIDDEN_WITH_ACCESSIBLE_CONTENT, "true"); } contentHostingService.commitCollection(contentCollectionEdit); } catch (IdUnusedException e) { LOG.error("IdUnusedException " + e); } catch (TypeException e) { LOG.error("TypeException " + e); } catch (PermissionException e) { LOG.error("PermissionException " + e); } catch (InUseException e) { LOG.error("InUseException " + e); } } }

Target:
public void execute(JobExecutionContext context) throws JobExecutionException { ContentCollectionEdit contentCollectionEdit; ResourcePropertiesEdit resourceProperties; Session session = null; String sql = "SELECT COLLECTION_ID FROM CONTENT_COLLECTION WHERE COLLECTION_ID LIKE \"%LB-CSS/\" "; LOG.debug("SQL to get collection Id for LB-CSS folder " + sql); int totalFolders = 0 , foldersUpdated = 0, foldersAlreadySet = 0; try { session = sessionManager.getCurrentSession(); session.setUserEid("admin"); session.setUserId("admin"); List<String> collection_ids = sqlService.dbRead(sql); totalFolders = collection_ids.size(); LOG.info("Number of LB-CSS folders found is " + totalFolders); for (String id : collection_ids) { try { contentCollectionEdit = contentHostingService.editCollection(id); resourceProperties = contentCollectionEdit.getPropertiesEdit(); if (!("true".equals(resourceProperties.getProperty(ResourceProperties.PROP_HIDDEN_WITH_ACCESSIBLE_CONTENT)))) { resourceProperties.addProperty(ResourceProperties.PROP_HIDDEN_WITH_ACCESSIBLE_CONTENT, "true"); foldersUpdated++; LOG.info("Hiding the collection" + id + " from access user "); contentHostingService.commitCollection(contentCollectionEdit); } else { foldersAlreadySet++; contentHostingService.cancelCollection(contentCollectionEdit); LOG.info("The collection " + id +" has already been hidden "); } } catch (SakaiException exception) { LOG.error("Failed to update the LB-CSS folder: " + id, exception); } } } finally { LOG.info("Summary of LBCSSFolderHideJob , Total LB-CSS folders: " + totalFolders + " Updated: " + foldersUpdated + " Collection already hidden: " + foldersAlreadySet); session.invalidate(); } }
Source:
protected Set<Value.Immutable<?>> api$getVanillaValues() { Set<Value.Immutable<?>> vanillaValues = super.api$getVanillaValues(); vanillaValues.add(this.foodLevel().asImmutable()); vanillaValues.add(this.exhaustion().asImmutable()); vanillaValues.add(this.saturation().asImmutable()); vanillaValues.add(this.gameMode().asImmutable()); vanillaValues.add(this.firstPlayed().asImmutable()); vanillaValues.add(this.lastPlayed().asImmutable()); vanillaValues.add(this.sleepingIgnored().asImmutable()); if (this.shadow$getSpectatingEntity() != (ServerPlayerEntity) (Object) this) { this.spectatorTarget().map(Value::asImmutable).ifPresent(vanillaValues::add); } return vanillaValues; }

Target:
protected Set<Value.Immutable<?>> api$getVanillaValues() { final Set<Value.Immutable<?>> values = super.api$getVanillaValues(); values.add(this.foodLevel().asImmutable()); values.add(this.exhaustion().asImmutable()); values.add(this.saturation().asImmutable()); values.add(this.gameMode().asImmutable()); values.add(this.firstPlayed().asImmutable()); values.add(this.lastPlayed().asImmutable()); values.add(this.sleepingIgnored().asImmutable()); this.spectatorTarget().map(Value::asImmutable).ifPresent(values::add); return values; }
Source:
public void testAddPage() throws Exception { GroupByHash groupByHash = createGroupByHash(TEST_SESSION, ImmutableList.of(BIGINT), new int[] {0}, Optional.of(1), 100, JOIN_COMPILER); for (int tries = 0; tries < 2; tries++) { for (int value = 0; value < MAX_GROUP_ID; value++) { Block block = BlockAssertions.createLongsBlock(value); Block hashBlock = TypeUtils.getHashBlock(ImmutableList.of(BIGINT), block); Page page = new Page(block, hashBlock); for (int addValuesTries = 0; addValuesTries < 10; addValuesTries++) { groupByHash.addPage(page); assertEquals(groupByHash.getGroupCount(), tries == 0 ? value + 1 : MAX_GROUP_ID); GroupByIdBlock groupIds = groupByHash.getGroupIds(page).getResult(); assertEquals(groupByHash.getGroupCount(), tries == 0 ? value + 1 : MAX_GROUP_ID); assertEquals(groupIds.getGroupCount(), tries == 0 ? value + 1 : MAX_GROUP_ID); assertEquals(groupIds.getPositionCount(), 1); long groupId = groupIds.getGroupId(0); assertEquals(groupId, value); } } } }

Target:
public void testAddPage() throws Exception { GroupByHash groupByHash = createGroupByHash(TEST_SESSION, ImmutableList.of(BIGINT), new int[] {0}, Optional.of(1), 100, JOIN_COMPILER); for (int tries = 0; tries < 2; tries++) { for (int value = 0; value < MAX_GROUP_ID; value++) { Block block = BlockAssertions.createLongsBlock(value); Block hashBlock = TypeUtils.getHashBlock(ImmutableList.of(BIGINT), block); Page page = new Page(block, hashBlock); for (int addValuesTries = 0; addValuesTries < 10; addValuesTries++) { groupByHash.addPage(page).process(); assertEquals(groupByHash.getGroupCount(), tries == 0 ? value + 1 : MAX_GROUP_ID); Work<GroupByIdBlock> work = groupByHash.getGroupIds(page); work.process(); GroupByIdBlock groupIds = work.getResult(); assertEquals(groupByHash.getGroupCount(), tries == 0 ? value + 1 : MAX_GROUP_ID); assertEquals(groupIds.getGroupCount(), tries == 0 ? value + 1 : MAX_GROUP_ID); assertEquals(groupIds.getPositionCount(), 1); long groupId = groupIds.getGroupId(0); assertEquals(groupId, value); } } } }
Source:
private Currency parseCurrency(CsvRow row, CurveName reference) { Optional<String> currencyStr = row.findValue(CURRENCY_HEADER); if (currencyStr.isPresent()) { return LoaderUtils.parseCurrency(currencyStr.get()); } String referenceStr = reference.getName().toUpperCase(Locale.ENGLISH); try { Optional<IborIndex> ibor = IborIndex.extendedEnum().find(referenceStr); if (ibor.isPresent()) { return ibor.get().getCurrency(); } else { Optional<FloatingRateName> frName = FloatingRateName.extendedEnum().find(referenceStr); if (frName.isPresent()) { return frName.get().getCurrency(); } else if (referenceStr.length() == 3) { return Currency.of(referenceStr); } else if (referenceStr.length() > 3 && referenceStr.charAt(3) == '-' || referenceStr.charAt(3) == '_') { return LoaderUtils.parseCurrency(referenceStr.substring(0, 3)); } else { } } } catch (RuntimeException ex) { } throw new IllegalArgumentException("Unable to parse currency from reference, consider adding a 'Currency' column"); }

Target:
private static Currency parseCurrency(CsvRow row, CurveName reference) { Optional<String> currencyStr = row.findValue(CURRENCY_HEADER); if (currencyStr.isPresent()) { return LoaderUtils.parseCurrency(currencyStr.get()); } String referenceStr = reference.getName().toUpperCase(Locale.ENGLISH); try { Optional<IborIndex> ibor = IborIndex.extendedEnum().find(referenceStr); if (ibor.isPresent()) { return ibor.get().getCurrency(); } else { Optional<FloatingRateName> frName = FloatingRateName.extendedEnum().find(referenceStr); if (frName.isPresent()) { return frName.get().getCurrency(); } else if (referenceStr.length() == 3) { return Currency.of(referenceStr); } else if (referenceStr.length() > 3 && referenceStr.charAt(3) == '-' || referenceStr.charAt(3) == '_') { return LoaderUtils.parseCurrency(referenceStr.substring(0, 3)); } else { } } } catch (RuntimeException ex) { } throw new IllegalArgumentException("Unable to parse currency from reference, consider adding a 'Currency' column"); }
Source:
private List<InsightCard> insightCardsWithInfoPreviewAndMissingImages(final List<InsightCard> insightCards) { final List<InsightCard> cardsWithPreview = Lists.newArrayListWithExpectedSize(insightCards.size()); for (InsightCard card : insightCards) { cardsWithPreview.add(card.withInfoPreview(insightProcessor.getInsightPreviewForCategory(card.category))); } return InsightsDAODynamoDB.backfillImagesBasedOnCategory(cardsWithPreview); }

Target:
private List<InsightCard> insightCardsWithInfoPreviewAndMissingImages(final List<InsightCard> insightCards) { final Map<InsightCard.Category, String> categoryNames = insightProcessor.catgegoryNames(); return InsightsDAODynamoDB.backfillImagesBasedOnCategory(insightCards, categoryNames); }
Source:
public StringBuilder getSQL(StringBuilder builder) { return builder.append(getString()).append("::JSON"); }

Target:
public StringBuilder getSQL(StringBuilder builder) { return StringUtils.quoteStringSQL(builder, string).append("::JSON"); }
Source:
private void parseContinuedParamDescription( int baselineIndentation, StringBuilder description) { int continuationIndentation = Integer.MAX_VALUE; while (nextLine()) { if (line.isEmpty()) { description.append('\n'); continue; } int lineIndentation = getIndentation(line); if (lineIndentation <= baselineIndentation) { break; } if (lineIndentation < continuationIndentation) { continuationIndentation = lineIndentation; } String trimmedLine = line.substring(continuationIndentation); description.append('\n'); description.append(trimmedLine); } }

Target:
private void parseContinuedParamDescription( int baselineIndentation, StringBuilder description) { List<String> buffer = new ArrayList(); int continuationIndentation = Integer.MAX_VALUE; while (nextLine()) { if (!line.isEmpty()) { if (getIndentation(line) <= baselineIndentation) { break; } continuationIndentation = Math.min(getIndentation(line), continuationIndentation); } buffer.add(line); } for (String bufLine: buffer) { description.append('\n'); if (!bufLine.isEmpty()) { String trimmedLine = bufLine.substring(continuationIndentation); description.append(trimmedLine); } } }
Source:
protected IDebugEventSetListener getDebugListener(final IProcess[] processes, final ILaunch launch) { return new IDebugEventSetListener() { @Override public void handleDebugEvents(DebugEvent[] events) { if (events != null) { int size = events.length; for (int i = 0; i < size; i++) { if (processes[0] != null && processes[0].equals(events[i].getSource()) && events[i].getKind() == DebugEvent.TERMINATE) { ((LaunchManager)getLaunchManager()).fireUpdate(new ILaunch[] {launch}, LaunchManager.TERMINATE); processTerminated(getServer(), this); DebugPlugin.getDefault().removeDebugEventListener(this); } } } } }; }

Target:
protected IDebugEventSetListener getDebugListener(final IProcess[] processes, final ILaunch launch) { return new IDebugEventSetListener() { @Override public void handleDebugEvents(DebugEvent[] events) { if (events != null) { int size = events.length; for (int i = 0; i < size; i++) { if (processes[0] != null && processes[0].equals(events[i].getSource()) && events[i].getKind() == DebugEvent.TERMINATE) { ((LaunchManager)getLaunchManager()).fireUpdate(new ILaunch[] {launch}, LaunchManager.TERMINATE); processTerminated(getServer(), processes[0], this); DebugPlugin.getDefault().removeDebugEventListener(this); } } } } }; }
Source:
static KeyPairProvider wrap(Iterable<KeyPair> pairs) { return (pairs == null) ? EMPTY_KEYPAIR_PROVIDER : new KeyPairProvider() { @Override public Iterable<KeyPair> loadKeys(SessionContext session) { return pairs; } @Override public KeyPair loadKey(SessionContext session, String type) { for (KeyPair kp : pairs) { String t = KeyUtils.getKeyType(kp); if (Objects.equals(type, t)) { return kp; } } return null; } @Override public Iterable<String> getKeyTypes(SessionContext session) { Set<String> types = new LinkedHashSet<>(); for (KeyPair kp : pairs) { String t = KeyUtils.getKeyType(kp); if (GenericUtils.isEmpty(t)) { continue; } if (!types.add(t)) { continue; } } return types; } }; }

Target:
static KeyPairProvider wrap(Iterable<KeyPair> pairs) { return (pairs == null) ? EMPTY_KEYPAIR_PROVIDER : new KeyPairProvider() { @Override public Iterable<KeyPair> loadKeys(SessionContext session) { return pairs; } @Override public KeyPair loadKey(SessionContext session, String type) { for (KeyPair kp : pairs) { String t = KeyUtils.getKeyType(kp); if (Objects.equals(type, t)) { return kp; } } return null; } @Override public Iterable<String> getKeyTypes(SessionContext session) { Collection<String> types = new LinkedHashSet<>(); for (KeyPair kp : pairs) { String t = KeyUtils.getKeyType(kp); if (GenericUtils.isEmpty(t)) { continue; } if (!types.add(t)) { continue; } } return types; } }; }
Source:
public double price(double strike, PutCall putCall) { double price = 0d; if (strike <= cutOffStrike) { double volatility = sabrFunction.getVolatility(forward, strike, timeToExpiry, sabrData); price = BlackFormulaRepository.price(forward, strike, timeToExpiry, volatility, putCall.isCall()); } else { price = extrapolation(strike); if (putCall.isPut()) { price -= (forward - strike); } } return price; }

Target:
public double price(double strike, PutCall putCall) { if (strike <= cutOffStrike) { double volatility = sabrFunction.getVolatility(forward, strike, timeToExpiry, sabrData); return BlackFormulaRepository.price(forward, strike, timeToExpiry, volatility, putCall.isCall()); } double price = extrapolation(strike); if (putCall.isPut()) { price -= (forward - strike); } return price; }
Source:
public void testXml() { String cp = "REST_XML"; RestConnectionProfileWizard.openWizard(cp) .setConnectionUrl("<LINK_0>") .setType(RestConnectionProfileWizard.TYPE_XML) .testConnection() .finish(); String sourceModel = "RestXmlSource"; String viewModel = "RestXmlView"; RestImportWizard.openWizard() .setProfileName(cp) .nextPage() .setProject(PROJECT_NAME) .setSourceModelName(sourceModel) .setViewModelName(viewModel) .setProcedureName(PROCEDURE_NAME) .nextPage() .setJndiName(sourceModel + "DS") .nextPage() .setRootPath("schedule/day/broadcasts/broadcast") .setColumns("pid","start","end","programme/title") .finish(); String vdb = "RestXmlVdb"; VdbWizard.openVdbWizard() .setLocation(PROJECT_NAME) .setName(vdb) .addModel(PROJECT_NAME, viewModel) .finish(); ServersViewExt.getInstance().refreshServer(teiidServer.getName()); modelExplorer.deployVdb(PROJECT_NAME, vdb); TeiidJDBCHelper jdbchelper = new TeiidJDBCHelper(teiidServer, vdb); assertEquals(16, jdbchelper.getNumberOfResults("exec " + viewModel + "." + PROCEDURE_NAME + "()")); }

Target:
public void testXml() { String sourceModel = "RestXmlSource"; String viewModel = "RestXmlView"; RestImportWizard.openWizard() .setProfileName(ConnectionProfileConstants.REST_XML) .nextPage() .setProject(PROJECT_NAME) .setSourceModelName(sourceModel) .setViewModelName(viewModel) .setProcedureName(PROCEDURE_NAME) .nextPage() .setJndiName(sourceModel + "DS") .nextPage() .setRootPath("schedule/day/broadcasts/broadcast") .setColumns("pid","start","end","programme/title") .finish(); String vdb = "RestXmlVdb"; VdbWizard.openVdbWizard() .setLocation(PROJECT_NAME) .setName(vdb) .addModel(PROJECT_NAME, viewModel) .finish(); ServersViewExt.getInstance().refreshServer(teiidServer.getName()); modelExplorer.deployVdb(PROJECT_NAME, vdb); TeiidJDBCHelper jdbchelper = new TeiidJDBCHelper(teiidServer, vdb); assertEquals(16, jdbchelper.getNumberOfResults("exec " + viewModel + "." + PROCEDURE_NAME + "()")); }
Source:
private ProjectNode buildProjectedFilter(PlanBuilder planBuilder, Predicate<Symbol> projectionFilter) { Symbol a = planBuilder.symbol("a"); Symbol b = planBuilder.symbol("b"); return planBuilder.project( Assignments.identity(ImmutableList.of(a, b).stream().filter(projectionFilter).collect(toImmutableSet())), planBuilder.filter( planBuilder.expression("b > 5"), planBuilder.values(a, b))); }

Target:
private ProjectNode buildProjectedFilter(PlanBuilder planBuilder, Predicate<Symbol> projectionFilter) { Symbol a = planBuilder.symbol("a"); Symbol b = planBuilder.symbol("b"); return planBuilder.project( Assignments.identity(Stream.of(a, b).filter(projectionFilter).collect(toImmutableSet())), planBuilder.filter( planBuilder.expression("b > 5"), planBuilder.values(a, b))); }
Source:
public void testVersion() throws Exception { String[] args = new String[]{"-version"}; MyStarter starter = new MyStarter(); starter.run(args); assertEquals(System.getProperty("vertxVersion"), starter.getVersion()); }

Target:
public void testVersion() throws Exception { String[] args = {"-version"}; MyStarter starter = new MyStarter(); starter.run(args); assertEquals(System.getProperty("vertxVersion"), starter.getVersion()); }
Source:
public void setReviewedByCurrentUser(final Key patchKey, final boolean reviewed, AsyncCallback<VoidResult> callback) { run(callback, new Action<VoidResult>() { public VoidResult run(ReviewDb db) throws OrmException { Account.Id account = Common.getAccountId(); AccountPatchReview.Key key = new AccountPatchReview.Key(patchKey, account); AccountPatchReview apr = db.accountPatchReviews().get(key); if (apr == null && reviewed) { db.accountPatchReviews(). insert(Collections.singleton(new AccountPatchReview(patchKey, account))); } else if (!reviewed) { db.accountPatchReviews().delete(Collections.singleton(apr)); } return VoidResult.INSTANCE; } }); }

Target:
public void setReviewedByCurrentUser(final Key patchKey, final boolean reviewed, AsyncCallback<VoidResult> callback) { run(callback, new Action<VoidResult>() { public VoidResult run(ReviewDb db) throws OrmException { Account.Id account = Common.getAccountId(); AccountPatchReview.Key key = new AccountPatchReview.Key(patchKey, account); AccountPatchReview apr = db.accountPatchReviews().get(key); if (apr == null && reviewed) { db.accountPatchReviews(). insert(Collections.singleton(new AccountPatchReview(patchKey, account))); } else if (apr != null && !reviewed) { db.accountPatchReviews().delete(Collections.singleton(apr)); } return VoidResult.INSTANCE; } }); }