auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Model bodyToInternalModel(final String extResourceId, final InputStream stream, final MediaType contentType, final HttpIdentifierConverter idTranslator) throws RepositoryRuntimeException, BadRequestException { final Model model = parseBodyAsModel(stream, contentType, extResourceId); final List<Statement> insertStatements = new ArrayList<>(); final StmtIterator stmtIterator = model.listStatements(); while (stmtIterator.hasNext()) { final Statement stmt = stmtIterator.nextStatement(); if (stmt.getSubject().isURIResource()) { final String originalSubj = stmt.getSubject().getURI(); final String subj = idTranslator.inExternalDomain(originalSubj) ? idTranslator.toInternalId(originalSubj) : originalSubj; RDFNode obj = stmt.getObject(); if (stmt.getObject().isResource()) { final String objString = stmt.getObject().asResource().getURI(); if (idTranslator.inExternalDomain(objString)) { obj = model.getResource(idTranslator.toInternalId(objString)); } } if (!subj.equals(originalSubj) || !obj.equals(stmt.getObject())) { insertStatements.add(new StatementImpl(model.getResource(subj), stmt.getPredicate(), obj)); stmtIterator.remove(); } } } model.add(insertStatements); log.debug("Model: {}", model); return model; }

Target:
public Model bodyToInternalModel(final String extResourceId, final InputStream stream, final MediaType contentType, final HttpIdentifierConverter idTranslator) throws RepositoryRuntimeException, BadRequestException { final Model model = parseBodyAsModel(stream, contentType, extResourceId); final List<Statement> insertStatements = new ArrayList<>(); final StmtIterator stmtIterator = model.listStatements(); while (stmtIterator.hasNext()) { final Statement stmt = stmtIterator.nextStatement(); if (stmt.getSubject().isURIResource()) { final String originalSubj = stmt.getSubject().getURI(); final String subj = idTranslator.inExternalDomain(originalSubj) ? idTranslator.toInternalId(originalSubj) : originalSubj; RDFNode obj = stmt.getObject(); if (stmt.getObject().isResource()) { final String objString = stmt.getObject().asResource().getURI(); if (idTranslator.inExternalDomain(objString)) { obj = model.getResource(idTranslator.toInternalId(objString)); } } if (!subj.equals(originalSubj) || !obj.equals(stmt.getObject())) { insertStatements.add(new StatementImpl(model.getResource(subj), stmt.getPredicate(), obj)); stmtIterator.remove(); } } else { log.debug("Subject is not a URI resource, skipping", stmt.getSubject()); } } model.add(insertStatements); log.debug("Model: {}", model); return model; }
Source:
public void testWithParameters() throws IOException { try (Analyzer ws = newHomoglyphFilter()) { TokenStream ts = ws.tokenStream("", input); BaseTokenStreamTestCase.assertTokenStreamContents(ts, expected); } }

Target:
public void testWithParameters() throws IOException { try (Analyzer ws = newHomoglyphFilter()) { TokenStream ts = ws.tokenStream("", input); assertTokenStreamContents(ts, expected); } }
Source:
boolean upgradeIfNecessary(AbstractProject<?,?> job) throws IOException { if (!isUpgradeNeeded()) { return false; } int i = projectName.lastIndexOf('/'); if (i != -1 && projectName.indexOf('=', i) != -1 && Jenkins.getInstance().getItem(projectName, job.getParent(), Job.class) == null) { project = projectName.substring(0, i); parameters = projectName.substring(i + 1); } else { project = projectName; parameters = null; } Logger.getLogger(CopyArtifact.class.getName()).log(Level.INFO, "Split {0} into {1} with parameters {2}", new Object[] {projectName, project, parameters}); projectName = null; job.save(); return true; }

Target:
private boolean upgradeIfNecessary(AbstractProject<?,?> job) throws IOException { if (isUpgradeNeeded()) { int i = projectName.lastIndexOf('/'); if (i != -1 && projectName.indexOf('=', i) != -1 && Jenkins.getInstance().getItem(projectName, job.getParent(), Job.class) == null) { project = projectName.substring(0, i); parameters = projectName.substring(i + 1); } else { project = projectName; parameters = null; } LOGGER.log(Level.INFO, "Split {0} into {1} with parameters {2}", new Object[] {projectName, project, parameters}); projectName = null; job.save(); return true; } else { return false; } }
Source:
public PointDescription getPointDescription(@NonNull Context ctx) { if (isPersonal()) { return new PointDescription(PointDescription.POINT_TYPE_FAVORITE, getName(ctx)); } else { return getPointDescription(); } }

Target:
public PointDescription getPointDescription(@NonNull Context ctx) { return new PointDescription(PointDescription.POINT_TYPE_FAVORITE, getDisplayName(ctx)); }
Source:
protected void doGet(final HttpServletRequest req, final HttpServletResponse rsp) throws IOException { final StringBuilder rdr = new StringBuilder(); rdr.append(URLEncoder.encode(urlProvider.get(), "UTF-8")); rdr.append('#'); rdr.append(getToken(req)); CacheHeaders.setNotCacheable(rsp); rsp.sendRedirect(rdr.toString()); }

Target:
protected void doGet(final HttpServletRequest req, final HttpServletResponse rsp) throws IOException { final StringBuilder rdr = new StringBuilder(); rdr.append(urlProvider.get()); rdr.append('#'); rdr.append(getToken(req)); CacheHeaders.setNotCacheable(rsp); rsp.sendRedirect(rdr.toString()); }
Source:
public String toString() { String subscription = "Subscription [id = " + getId(); if (product != null) { subscription += getProduct().getId(); } if (owner != null) { subscription += ", owner = " + getOwner().getKey(); } return subscription + "]"; }

Target:
public String toString() { String subscription = "Subscription [id = " + getId(); if (product != null) { subscription += ", product = " + getProduct().getId(); } if (owner != null) { subscription += ", owner = " + getOwner().getKey(); } return subscription + "]"; }
Source:
protected boolean validate() { DiskValidator diskValidator = new DiskValidator(getDiskImage()); List<Pair<VM, VmDevice>> vmsForDisk = vmDao.getVmsWithPlugInfo(getDiskImage().getId()); if (!validate(diskValidator.isDiskExists()) || !validate(diskValidator.isDiskPluggedToVmsThatAreNotDown(false, vmsForDisk))) { return false; } setStoragePoolId(getDiskImage().getStoragePoolId()); if (!validate(new StoragePoolValidator(getStoragePool()).isUp())) { return false; } if (!FeatureSupported.qcowCompatSupported(getStoragePool().getCompatibilityVersion())) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_AMEND_NOT_SUPPORTED_BY_DC_VERSION, String.format("$dataCenterVersion %s", getStoragePool().getCompatibilityVersion().toString())); } if (getDiskImage().getVmEntityType().isTemplateType()) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_CANT_AMEND_TEMPLATE_DISK); } setStorageDomainId(getDiskImage().getStorageIds().get(0)); StorageDomainValidator storageDomainValidator = new StorageDomainValidator(getStorageDomain()); if (!validate(storageDomainValidator.isDomainExistAndActive())) { return false; } DiskImagesValidator diskImagesValidator = new DiskImagesValidator(Collections.singletonList(getDiskImage())); return validate(diskImagesValidator.diskImagesNotIllegal()) && validate(diskImagesValidator.diskImagesNotLocked()); }

Target:
protected boolean validate() { DiskValidator diskValidator = new DiskValidator(getDiskImage()); if (!validate(diskValidator.isDiskExists())) { return false; } List<Pair<VM, VmDevice>> vmsForDisk = vmDao.getVmsWithPlugInfo(getDiskImage().getId()); if (!validate(diskValidator.isDiskPluggedToVmsThatAreNotDown(false, vmsForDisk))) { return false; } setStoragePoolId(getDiskImage().getStoragePoolId()); if (!validate(new StoragePoolValidator(getStoragePool()).isUp())) { return false; } if (!FeatureSupported.qcowCompatSupported(getStoragePool().getCompatibilityVersion())) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_AMEND_NOT_SUPPORTED_BY_DC_VERSION, String.format("$dataCenterVersion %s", getStoragePool().getCompatibilityVersion().toString())); } if (getDiskImage().getVmEntityType().isTemplateType()) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_CANT_AMEND_TEMPLATE_DISK); } setStorageDomainId(getDiskImage().getStorageIds().get(0)); StorageDomainValidator storageDomainValidator = new StorageDomainValidator(getStorageDomain()); if (!validate(storageDomainValidator.isDomainExistAndActive())) { return false; } DiskImagesValidator diskImagesValidator = new DiskImagesValidator(Collections.singletonList(getDiskImage())); return validate(diskImagesValidator.diskImagesNotIllegal()) && validate(diskImagesValidator.diskImagesNotLocked()); }
Source:
private void refresh() { final TmfTraceManager tm = TmfTraceManager.getInstance(); Display.getDefault().asyncExec(new Runnable() { @Override public void run() { if (fTimeGraphCombo.isDisposed()) { return; } ITimeGraphEntry[] entries = null; synchronized (fEntryListMap) { fEntryList = fEntryListMap.get(fTrace); if (fEntryList == null) { fEntryList = new ArrayList<ControlFlowEntry>(); } entries = fEntryList.toArray(new ITimeGraphEntry[0]); } Arrays.sort(entries, fControlFlowEntryComparator); fTimeGraphCombo.setInput(entries); fTimeGraphCombo.getTimeGraphViewer().setTimeBounds(fStartTime, fEndTime); long timestamp = fTrace == null ? 0 : tm.getCurrentTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue(); long startTime = fTrace == null ? 0 : tm.getCurrentRange().getStartTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue(); long endTime = fTrace == null ? 0 : tm.getCurrentRange().getEndTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue(); startTime = Math.max(startTime, fStartTime); endTime = Math.min(endTime, fEndTime); fTimeGraphCombo.getTimeGraphViewer().setSelectedTime(timestamp, false); fTimeGraphCombo.getTimeGraphViewer().setStartFinishTime(startTime, endTime); for (TreeColumn column : fTimeGraphCombo.getTreeViewer().getTree().getColumns()) { column.pack(); } startZoomThread(startTime, endTime); } }); }

Target:
private void refresh() { Display.getDefault().asyncExec(new Runnable() { @Override public void run() { if (fTimeGraphCombo.isDisposed()) { return; } ITimeGraphEntry[] entries = null; synchronized (fEntryListMap) { fEntryList = fEntryListMap.get(fTrace); if (fEntryList == null) { fEntryList = new ArrayList<ControlFlowEntry>(); } entries = fEntryList.toArray(new ITimeGraphEntry[0]); } Arrays.sort(entries, fControlFlowEntryComparator); fTimeGraphCombo.setInput(entries); fTimeGraphCombo.getTimeGraphViewer().setTimeBounds(fStartTime, fEndTime); final TmfTraceManager tm = TmfTraceManager.getInstance(); long timestamp = fTrace == null ? 0 : tm.getCurrentTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue(); long startTime = fTrace == null ? 0 : tm.getCurrentRange().getStartTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue(); long endTime = fTrace == null ? 0 : tm.getCurrentRange().getEndTime().normalize(0, ITmfTimestamp.NANOSECOND_SCALE).getValue(); startTime = Math.max(startTime, fStartTime); endTime = Math.min(endTime, fEndTime); fTimeGraphCombo.getTimeGraphViewer().setSelectedTime(timestamp, false); fTimeGraphCombo.getTimeGraphViewer().setStartFinishTime(startTime, endTime); for (TreeColumn column : fTimeGraphCombo.getTreeViewer().getTree().getColumns()) { column.pack(); } startZoomThread(startTime, endTime); } }); }
Source:
public QpidConnection(QpidConfigBuilder config, Configuration candlepinConfiguration) { try { this.producerMap = new HashMap<>(); this.config = config; this.candlepinConfig = candlepinConfiguration; this.producerMap = new HashMap<>(); ctx = createInitialContext(); connectionFactory = createConnectionFactory(); } catch (NamingException e) { throw new RuntimeException(e); } }

Target:
public QpidConnection(QpidConfigBuilder config, Configuration candlepinConfiguration) { try { this.config = config; this.candlepinConfig = candlepinConfiguration; this.producerMap = new HashMap<>(); ctx = createInitialContext(); connectionFactory = createConnectionFactory(); } catch (NamingException e) { throw new RuntimeException(e); } }
Source:
private Attribute(String key, State state, String value) { if (key == null) throw new NullPointerException( "The key of an attribute should not be null"); this.key = key; this.state = state != null ? state : State.CUSTOM; this.value = value; }

Target:
private Attribute(String key, State state, String value) { if (key == null) throw new NullPointerException( "The key of an attribute should not be null"); if (state == null) throw new NullPointerException( "The state of an attribute should not be null"); this.key = key; this.state = state; this.value = value; }
Source:
private void updateSslVerifyUser(boolean value) { StoredConfig userConfig = null; try { userConfig = SystemReader.getInstance().getUserConfig(); updateSslVerify(userConfig, value); } catch (IOException | ConfigInvalidException e) { LOG.error(MessageFormat.format(JGitText.get().userConfigInvalid, userConfig, e)); } }

Target:
private void updateSslVerifyUser(boolean value) { StoredConfig userConfig = null; try { userConfig = SystemReader.getInstance().getUserConfig(); updateSslVerify(userConfig, value); } catch (IOException | ConfigInvalidException e) { LOG.error(e.getMessage(), e); } }
Source:
public Set<String> doGetExpired(Set<String> candidates) { final long now = System.currentTimeMillis(); return candidates .stream() .filter( c -> { SessionData sessionData = sessionDataMap.get(c); return sessionData != null && sessionData.getExpiry() > now; }) .collect(Collectors.toSet()); }

Target:
public Set<String> doGetExpired(Set<String> candidates) { final long now = System.currentTimeMillis(); return candidates.stream().filter(c -> isExpired(c, now)).collect(Collectors.toSet()); }
Source:
static Context notInLambda() { return new Context(null, null); }

Target:
public static Context notInLambda() { return new Context(null, null); }
Source:
private static Set<SymbolicValue> computedFrom(@Nullable SymbolicValue symbolicValue) { if (symbolicValue == null) { return Collections.emptySet(); } HashSet<SymbolicValue> result = new HashSet<>(); result.add(symbolicValue); symbolicValue.computedFrom().forEach(sv -> result.addAll(computedFrom(sv))); return result; }

Target:
private static Set<SymbolicValue> computedFrom(@Nullable SymbolicValue symbolicValue) { if (symbolicValue == null) { return Collections.emptySet(); } Set<SymbolicValue> result = new HashSet<>(); result.add(symbolicValue); symbolicValue.computedFrom().forEach(sv -> result.addAll(computedFrom(sv))); return result; }
Source:
protected void executeQueryCommand() { List<VM> vmList = getDbFacade().getVmDao() .getAllForNetwork(getParameters().getNetworkId()); List<VmNetworkInterface> vmNetworkInterfaceList = getDbFacade().getVmNetworkInterfaceDao() .getAllForNetwork(getParameters().getNetworkId()); final Map<Guid, VM> vmsById = Entities.businessEntitiesById(vmList); List<PairQueryable<VmNetworkInterface, VM>> vmInterfaceVmPairs = new ArrayList<PairQueryable<VmNetworkInterface, VM>>(); for (VmNetworkInterface vmNetworkInterface : vmNetworkInterfaceList) { VM vm = vmsById.get(vmNetworkInterface.getVmId()); if (getParameters().getRunningVms() == null || VM.isStatusDown(vm.getStatus()) != getParameters().getRunningVms()) { vmInterfaceVmPairs.add(new PairQueryable<VmNetworkInterface, VM>(vmNetworkInterface, vm)); } } getQueryReturnValue().setReturnValue(vmInterfaceVmPairs); }

Target:
protected void executeQueryCommand() { List<VM> vmList = getDbFacade().getVmDao() .getAllForNetwork(getParameters().getNetworkId()); List<VmNetworkInterface> vmNetworkInterfaceList = getDbFacade().getVmNetworkInterfaceDao() .getAllForNetwork(getParameters().getNetworkId()); final Map<Guid, VM> vmsById = Entities.businessEntitiesById(vmList); List<PairQueryable<VmNetworkInterface, VM>> vmInterfaceVmPairs = new ArrayList<PairQueryable<VmNetworkInterface, VM>>(); for (VmNetworkInterface vmNetworkInterface : vmNetworkInterfaceList) { VM vm = vmsById.get(vmNetworkInterface.getVmId()); if (getParameters().getRunningVms() == null || getParameters().getRunningVms().equals(vm.isStatusUp())) { vmInterfaceVmPairs.add(new PairQueryable<VmNetworkInterface, VM>(vmNetworkInterface, vm)); } } getQueryReturnValue().setReturnValue(vmInterfaceVmPairs); }
Source:
protected void onMessage(Context context, Intent intent) { Log.d(LOG_TAG, "onMessage - context: " + context); Bundle extras = intent.getExtras(); if (extras != null) { if (!FORCE_SHOW && PushPlugin.isInForeground()) { extras.putBoolean(FOREGROUND, true); PushPlugin.sendExtras(extras); } else { extras.putBoolean(FOREGROUND, false); String message = this.getMessageText(extras); String title = getString(extras, TITLE, ""); if ((message != null && message.length() != 0) || (title != null && title.length() != 0)) { createNotification(context, extras); } } } }

Target:
protected void onMessage(Context context, Intent intent) { Log.d(LOG_TAG, "onMessage - context: " + context); Bundle extras = intent.getExtras(); if (extras != null) { SharedPreferences prefs = context.getSharedPreferences(PushPlugin.COM_ADOBE_PHONEGAP_PUSH, Context.MODE_PRIVATE); boolean forceShow = prefs.getBoolean(FORCE_SHOW, false); if (!forceShow && PushPlugin.isInForeground()) { extras.putBoolean(FOREGROUND, true); PushPlugin.sendExtras(extras); } else if (forceShow && PushPlugin.isInForeground()) { extras.putBoolean(FOREGROUND, true); showNotificationIfPossible(context, extras); } else { extras.putBoolean(FOREGROUND, false); showNotificationIfPossible(context, extras); } } }
Source:
public void setAcceptableValues(Collection<Object> values) { Collection<String> stringValues = new ArrayList<String>(); for (Object value : values) { stringValues.add((String) value); } suggestOracle.clear(); suggestOracle.addAll(stringValues); suggestOracle.setDefaultSuggestionsFromText(stringValues); }

Target:
public void setAcceptableValues(Collection<Object> values) { Collection<String> stringValues = Linq.Cast(values); suggestOracle.clear(); suggestOracle.addAll(stringValues); suggestOracle.setDefaultSuggestionsFromText(stringValues); }
Source:
public void process(Report report, Properties configuration) { try { URL url = new URL(configuration.getProperty("connection url")); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("POST"); connection.setRequestProperty("Content-Type", "text/html; charset=UTF-8"); connection.setDoOutput(true); connection.connect(); if (report.getRenderedOutput() != null && "true".equalsIgnoreCase(configuration.getProperty("Add report"))) { String addcontent = configuration.getProperty(("Add report") + configuration.getProperty("subject")); if (report.getOutputContentType().contains("text") || report.getOutputContentType().contains("html")) { addcontent = new String(report.getRenderedOutput(),"UTF-8"); } OutputStreamWriter writer = new OutputStreamWriter( connection.getOutputStream()); writer.write(addcontent); writer.flush(); writer.close(); } } catch (Exception e) { throw new RuntimeException("Error occurred while sending report via http POST", e); } }

Target:
public void process(Report report, Properties configuration) { OutputStreamWriter writer = null; try { if (report.getRenderedOutput() != null && "true".equalsIgnoreCase(configuration.getProperty(ADD_REPORT))) { URL url = new URL(configuration.getProperty(CONNECTION_URL)); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("POST"); String outPutContentType = report.getOutputContentType(); connection.setRequestProperty("Content-Type", "outPutContentType; charset=UTF-8"); connection.setDoOutput(true); connection.connect(); String addContent = configuration.getProperty(SUBJECT,""); addContent = new String(report.getRenderedOutput(),"UTF-8"); writer = new OutputStreamWriter( connection.getOutputStream()); writer.write(addContent); writer.flush(); } } catch (Exception e) { throw new RuntimeException("Error occurred while sending report via http POST", e); } finally { IOUtils.closeQuietly(writer); } }
Source:
public long nanosToCycles(long nanos) { CTFTrace trace = fTrace; if (trace != null) { return trace.timestampNanoToCycles(nanos - trace.getClock().getClockOffsetNs()) + trace.getOffset(); } return 0; }

Target:
public long nanosToCycles(long nanos) { CTFTrace trace = fTrace; if (trace != null) { return trace.timestampNanoToCycles(nanos) + trace.getOffset(); } return 0; }
Source:
public void testStripsInvalidCharactersFromHostname() { origApp.start(ImmutableList.of(origApp.newLocalhostProvisioningLocation())); cluster.resize(1); assertDnsEntityEventuallyHasActiveMembers(1); EntityLocal e = (EntityLocal) Iterables.getOnlyElement(cluster.getMembers()); e.setAttribute(PrefixAndIdEnricher.SENSOR, " _-pretend.hostname.10.0.0.7.my-cloud.com"); EntityTestUtils.assertAttributeEqualsEventually(dns, BindDnsServer.A_RECORDS, ImmutableMap.of("pretendhostname10007my-cloudcom", e.getAttribute(Attributes.ADDRESS))); }

Target:
public void testStripsInvalidCharactersFromHostname() { origApp.start(ImmutableList.of(origApp.newLocalhostProvisioningLocation())); cluster.resize(1); assertDnsEntityEventuallyHasActiveMembers(1); EntityLocal e = (EntityLocal) Iterables.getOnlyElement(cluster.getMembers()); e.setAttribute(PrefixAndIdEnricher.SENSOR, " _-pretend.hostname.10.0.0.7.my-cloud.com"); EntityTestUtils.assertAttributeEqualsEventually(dns, BindDnsServer.A_RECORDS, ImmutableMap.of("pretend-hostname-10-0-0-7-my-cloud-com", e.getAttribute(Attributes.ADDRESS))); }
Source:
public Entry(Snapshot snapshot, boolean includeGlobalState, boolean partial, State state, List<IndexId> indices, long startTime, long repositoryStateId, ImmutableOpenMap<ShardId, ShardSnapshotStatus> shards, String failure) { this.state = state; this.snapshot = snapshot; this.includeGlobalState = includeGlobalState; this.partial = partial; this.indices = indices; this.startTime = startTime; if (shards == null) { this.shards = ImmutableOpenMap.of(); this.waitingIndices = ImmutableOpenMap.of(); } else { this.shards = shards; this.waitingIndices = findWaitingIndices(shards); } this.repositoryStateId = repositoryStateId; this.failure = failure; }

Target:
public Entry(Snapshot snapshot, boolean includeGlobalState, boolean partial, State state, List<IndexId> indices, long startTime, long repositoryStateId, ImmutableOpenMap<ShardId, ShardSnapshotStatus> shards, String failure) { this.state = state; this.snapshot = snapshot; this.includeGlobalState = includeGlobalState; this.partial = partial; this.indices = indices; this.startTime = startTime; if (shards == null) { this.shards = ImmutableOpenMap.of(); this.waitingIndices = ImmutableOpenMap.of(); } else { this.shards = shards; this.waitingIndices = findWaitingIndices(shards); assert assertShardsConsistent(state, indices, shards); } this.repositoryStateId = repositoryStateId; this.failure = failure; }
Source:
private <T> void mandatoryCheck(T t, String message) { try { requireNonNull(t, message); } catch (NullPointerException ex) { error().data("field", t.getClass().getSimpleName()).logAndThrow(ex, "NullPointerException when calling TimeSeriesCellWriter"); } }

Target:
private <T> void mandatoryCheck(T t, String message) { try { requireNonNull(t, message); } catch (NullPointerException ex) { error().data("field", t.getClass().getSimpleName()).logAndThrow(new RuntimeException(ex), "NullPointerException when calling TimeSeriesCellWriter"); } }
Source:
private String authRegistryHeader(final AuthRegistryConfig authRegistryConfig) throws DockerException { if (authRegistryConfig == null) { return "null"; } try { String authRegistryJson = ObjectMapperProvider.objectMapper().writeValueAsString(authRegistryConfig); String apiVersion = version().apiVersion(); int versionComparison = versionCompare(apiVersion, "1.19"); if (versionComparison < 0) { authRegistryJson = "{\"configs\":" + authRegistryJson + "}"; } else if (versionComparison == 0) { authRegistryJson = "{\"auths\":" + authRegistryJson + "}"; } log.debug("Registry Config Json {}", authRegistryJson); String authRegistryEncoded = Base64.encodeAsString(authRegistryJson); log.debug("Registry Config Encoded {}", authRegistryEncoded); return authRegistryEncoded; } catch (JsonProcessingException | InterruptedException ex) { throw new DockerException("Could not encode X-Registry-Config header", ex); } }

Target:
private String authRegistryHeader(final AuthRegistryConfig authRegistryConfig) throws DockerException { if (authRegistryConfig == null) { return "null"; } try { String authRegistryJson = ObjectMapperProvider.objectMapper().writeValueAsString(authRegistryConfig); final String apiVersion = version().apiVersion(); final int versionComparison = compareVersion(apiVersion, "1.19"); if (versionComparison < 0) { authRegistryJson = "{\"configs\":" + authRegistryJson + "}"; } else if (versionComparison == 0) { authRegistryJson = "{\"auths\":" + authRegistryJson + "}"; } log.debug("Registry Config Json {}", authRegistryJson); String authRegistryEncoded = Base64.encodeAsString(authRegistryJson); log.debug("Registry Config Encoded {}", authRegistryEncoded); return authRegistryEncoded; } catch (JsonProcessingException | InterruptedException ex) { throw new DockerException("Could not encode X-Registry-Config header", ex); } }
Source:
protected Optional<ManagementClient> getOrchestrator(){ BaseClient baseClient = runtime.getLayoutView().getRuntimeLayout().getBaseClient(nodeForWorkflow); if(baseClient.pingSync()){ log.info("getOrchestrator: orchestrator selected {}", nodeForWorkflow); return Optional.of(runtime.getLayoutView() .getRuntimeLayout().getManagementClient(nodeForWorkflow)); } else{ return Optional.empty(); } }

Target:
protected Optional<ManagementClient> getOrchestrator(){ runtime.invalidateLayout(); Layout layout = new Layout(runtime.getLayoutView().getLayout()); BaseClient baseClient = runtime.getLayoutView().getRuntimeLayout(layout).getBaseClient(nodeForWorkflow); if(baseClient.pingSync()){ log.info("getOrchestrator: orchestrator selected {}", nodeForWorkflow); return Optional.of(runtime.getLayoutView() .getRuntimeLayout(layout).getManagementClient(nodeForWorkflow)); } else{ log.warn("getOrchestrator: a server is not responding to pings", nodeForWorkflow); return Optional.empty(); } }
Source:
public void onPlaceGainFocusEvent(final @Observes PlaceGainFocusEvent placeGainFocusEvent) { if (!placeGainFocusEvent.getPlace().getIdentifier().equals(IDENTIFIER)) { placeManager.closePlace(IDENTIFIER); } }

Target:
public void onPlaceGainFocusEvent(final @Observes PlaceGainFocusEvent placeGainFocusEvent) { if (!Objects.equals(placeGainFocusEvent.getPlace().getIdentifier(), IDENTIFIER)) { placeManager.closePlace(IDENTIFIER); } }
Source:
public Integer parse(CharSequence text) throws ParseException { MatchResult match = RegExp.compile("^(\\d+)\\s*(\\w*)$").exec(text.toString().trim()); MatchResult match_megabytes = RegExp.compile("^(\\d+)\\s*(\\w*)$").exec(messages.megabytes("0")); if (match == null) { return 0; } String prefix = match.getGroup(1); String suffix = match.getGroup(2); String suffix_megabytes = match_megabytes != null ? match_megabytes.getGroup(2) : null; Integer size = null; try { size = Integer.parseInt(prefix); } catch (NumberFormatException e) { return 0; } if (suffix.equalsIgnoreCase("TB") || suffix.equalsIgnoreCase("T")) { return size * 1024 * 1024; } else if (suffix.equalsIgnoreCase("GB") || suffix.equalsIgnoreCase("G")) { return size * 1024; } else if (suffix.equalsIgnoreCase("MB") || suffix.equalsIgnoreCase("M") || (suffix_megabytes != null && suffix.equalsIgnoreCase(suffix_megabytes))) { return size; } else if (StringHelper.isNullOrEmpty(suffix)) { return size; } else { return 0; } }

Target:
public Integer parse(CharSequence text) throws ParseException { MatchResult match = RegExp.compile("^(\\d+)\\s*(\\w*)$").exec(text.toString().trim()); MatchResult match_megabytes = RegExp.compile("^(\\d+)\\s*(\\w*)$").exec(messages.megabytes("0")); if (match == null) { return 0; } String prefix = match.getGroup(1); String suffix = match.getGroup(2); String suffix_megabytes = match_megabytes != null ? match_megabytes.getGroup(2) : null; Integer size = null; try { size = Integer.parseInt(prefix); } catch (NumberFormatException e) { return 0; } if (suffix.equalsIgnoreCase("TB") || suffix.equalsIgnoreCase("T")) { return size * 1024 * 1024; } else if (suffix.equalsIgnoreCase("GB") || suffix.equalsIgnoreCase("G")) { return size * 1024; } else if (suffix.equalsIgnoreCase("MB") || suffix.equalsIgnoreCase("M") || suffix.equalsIgnoreCase(suffix_megabytes)) { return size; } else if (StringHelper.isNullOrEmpty(suffix)) { return size; } else { return 0; } }
Source:
private void installAndUninstallFeatures() { try { if (!StringUtils.isBlank(postInstallFeatureStart)) { featuresService.installFeature( postInstallFeatureStart, EnumSet.of(FeaturesService.Option.NoAutoRefreshBundles)); } if (!StringUtils.isBlank(postInstallFeatureStop)) { featuresService.uninstallFeature(postInstallFeatureStop); } } catch (Exception e) { LOGGER.debug("Error while trying to run the post-install start and stop operations.", e); } }

Target:
private void installAndUninstallFeatures() { try { if (StringUtils.isNotBlank(postInstallFeatureStart)) { featuresService.installFeature( postInstallFeatureStart, EnumSet.of(FeaturesService.Option.NoAutoRefreshBundles)); } if (StringUtils.isNotBlank(postInstallFeatureStop)) { featuresService.uninstallFeature(postInstallFeatureStop); } } catch (Exception e) { LOGGER.debug("Error while trying to run the post-install start and stop operations.", e); } }
Source:
public void testNonexistentProject() { TraceScriptingModule traceScriptingModule = new TraceScriptingModule(); boolean fileExist = true; try { traceScriptingModule.openMinimalTrace(NONEXISTENT_PROJECT, TRACE_FILE, false); } catch (FileNotFoundException e) { fileExist = false; } assertTrue(!fileExist); }

Target:
public void testNonexistentProject() { TraceScriptingModule traceScriptingModule = new TraceScriptingModule(); boolean fileExist = true; try { traceScriptingModule.openMinimalTrace(NONEXISTENT_PROJECT, TRACE_FILE, false); } catch (FileNotFoundException e) { assertEquals(TraceScriptingModule.ERROR_INIT, e.getMessage()); fileExist = false; } assertTrue(!fileExist); }
Source:
public ViewBinder(Context ctx, ILogger logger) { setLogger(logger); setContext(ctx); mConverterService = new ValueConverterService(getLogger()); mResourceService = new ResourceService(getLogger()); SourceBindingFactory sourceFactory = new SourceBindingFactory(getLogger()); TargetBindingFactory targetFactory = new TargetBindingFactory(getLogger()); BindingSpecificationParser bindingParser = new BindingSpecificationParser(mConverterService, mResourceService, getLogger()); BindingSpecificationListParser listParser = new BindingSpecificationListParser(bindingParser, getLogger()); mBinder = new TextSpecificationBinder(listParser, sourceFactory, targetFactory, getLogger()); mViewResolver = new ChainedViewResolver(new ViewResolver(getLogger())); mInflaterFactory = new BindableLayoutInflaterFactory(this, mViewResolver); setFontManager(new FontManager(getLogger())); registerDefaultConverters(); }

Target:
public ViewBinder(Context ctx, ILogger logger) { setLogger(logger); setContext(ctx); init(); }
Source:
public void setSize(int size) { if (size < 9 || size > 54 || size % 9 != 0) { throw new IllegalArgumentException("Invalid size! Size must be one of: [9, 18, 27, 36, 45, 54]"); } this.size = size; cfg.setValue(PlayerBackpack.backpacks + id + ".size", size); Inventory inv = Bukkit.createInventory(null, size, "Backpack [" + size + " Slots]"); for (int slot = 0; slot < this.inventory.getSize(); slot++) { inv.setItem(slot, this.inventory.getItem(slot)); } this.inventory = inv; markDirty(); }

Target:
public void setSize(int size) { if (size < 9 || size > 54 || size % 9 != 0) { throw new IllegalArgumentException("Invalid size! Size must be one of: [9, 18, 27, 36, 45, 54]"); } this.size = size; cfg.setValue(CONFIG_PREFIX + id + ".size", size); Inventory inv = Bukkit.createInventory(null, size, "Backpack [" + size + " Slots]"); for (int slot = 0; slot < this.inventory.getSize(); slot++) { inv.setItem(slot, this.inventory.getItem(slot)); } this.inventory = inv; markDirty(); }
Source:
public void getPersonPhoto(@PathVariable("id") Long id, HttpServletResponse response) throws IOException, SQLException { Person person = personService.getPersonById(id); if(person.getPhoto() == null) { throw new RestException("No photo found for user", 404); } response.addHeader("Content-Type", "image/jpeg"); ServletOutputStream outStream = response.getOutputStream(); IOUtils.copy(person.getPhoto().getBinaryStream(), outStream); outStream.flush(); outStream.close(); }

Target:
public void getPersonPhoto(@PathVariable("id") Long id, HttpServletResponse response) throws IOException, SQLException { Avatar avatar = personService.getPersonPhoto(id); response.addHeader("Content-Type", "image/jpeg"); ServletOutputStream outStream = response.getOutputStream(); IOUtils.copy(avatar.getAvatar().getBinaryStream(), outStream); outStream.flush(); outStream.close(); }
Source:
public Tuple exec(Tuple input) throws IOException { Tuple t = mTupleFactory.newTuple(3); try { DataBag bg = (DataBag) input.get(0); Double d = null; if(bg.iterator().hasNext()) { Tuple tp = bg.iterator().next(); d = (Double)tp.get(0); } t.set(0, d); t.set(1, d*d); if (d == null) t.set(2, 0L); else t.set(2, 1L); return t; } catch(NumberFormatException nfe) { try { t.set(0, null); t.set(1, null); t.set(2, 0L); } catch (ExecException e) { throw e; } return t; } catch (ExecException ee) { throw ee; } catch (Exception e) { int errCode = 2106; String msg = "Error while computing variance in " + this.getClass().getSimpleName(); throw new ExecException(msg, errCode, PigException.BUG, e); } }

Target:
public Tuple exec(Tuple input) throws IOException { Tuple t = mTupleFactory.newTuple(3); try { DataBag bg = (DataBag) input.get(0); Double d = null; if(bg.iterator().hasNext()) { Tuple tp = bg.iterator().next(); d = (Double)tp.get(0); } if (d == null){ t.set(0, null); t.set(1, null); t.set(2, 0L); } else { t.set(0, d); t.set(1, d*d); t.set(2, 1L); } return t; } catch(NumberFormatException nfe) { try { t.set(0, null); t.set(1, null); t.set(2, 0L); } catch (ExecException e) { throw e; } return t; } catch (ExecException ee) { throw ee; } catch (Exception e) { int errCode = 2106; String msg = "Error while computing variance in " + this.getClass().getSimpleName(); throw new ExecException(msg, errCode, PigException.BUG, e); } }
Source:
public void scrollSelectedCellIntoView_CellSelected_WithDeltaXScroll() { when(gridData.getSelectedCellsOrigin()).thenReturn(new GridData.SelectedCell(0,0)); when(gridData.getRow(0)).thenReturn(gridRow); when(gridRow.getHeight()).thenReturn(30d); when(layer.getVisibleBounds()).thenReturn(new BaseBounds(500, 0, BOUNDS_WIDTH, BOUNDS_HEIGHT)); assertTrue(baseKeyboardOperationSpy.scrollSelectedCellIntoView(gridWidget)); verify(layer, times(1)).getViewport(); verify(viewport, times(1)).getTransform(); }

Target:
public void scrollSelectedCellIntoView_CellSelected_WithDeltaXScroll() { when(gridData.getSelectedCellsOrigin()).thenReturn(new GridData.SelectedCell(0,0)); when(gridData.getRow(0)).thenReturn(gridRow); when(gridRow.getHeight()).thenReturn(30d); when(layer.getVisibleBounds()).thenReturn(new BaseBounds(500, 0, BOUNDS_WIDTH, BOUNDS_HEIGHT)); assertTrue(baseKeyboardOperationSpy.scrollSelectedCellIntoView(gridWidget)); verify(layer, times(1)).getViewport(); verify(viewport, times(1)).getTransform(); verify(transform, times(1)).scale(1, 1); verify(transform, times(1)).translate(500d, 0); }
Source:
ClientConfiguration constructTokenClientConfig(ClientConfiguration apiClientConfiguration) { ClientConfiguration tokenClientConfiguration = new ClientConfiguration(); if (apiClientConfiguration.getClientCredentialsResolver() != null) tokenClientConfiguration.setClientCredentialsResolver(apiClientConfiguration.getClientCredentialsResolver()); if (apiClientConfiguration.isCacheManagerEnabled()) tokenClientConfiguration.setCacheManagerEnabled(apiClientConfiguration.isCacheManagerEnabled()); tokenClientConfiguration.setCacheManagerTti(apiClientConfiguration.getCacheManagerTti()); tokenClientConfiguration.setCacheManagerTtl(apiClientConfiguration.getCacheManagerTtl()); if (apiClientConfiguration.getCacheManagerCaches() != null) tokenClientConfiguration.setCacheManagerCaches(apiClientConfiguration.getCacheManagerCaches()); if (apiClientConfiguration.getRequestAuthenticatorFactory() != null) tokenClientConfiguration.setRequestAuthenticatorFactory(apiClientConfiguration.getRequestAuthenticatorFactory()); if (apiClientConfiguration.getBaseUrlResolver() != null) tokenClientConfiguration.setBaseUrlResolver(apiClientConfiguration.getBaseUrlResolver()); tokenClientConfiguration.setAuthenticationScheme(AuthenticationScheme.OAUTH2); tokenClientConfiguration.setAuthorizationMode(AuthorizationMode.PRIVATE_KEY); tokenClientConfiguration.setClientId(apiClientConfiguration.getClientId()); tokenClientConfiguration.setScopes(apiClientConfiguration.getScopes()); tokenClientConfiguration.setPrivateKey(apiClientConfiguration.getPrivateKey()); tokenClientConfiguration.setRetryMaxElapsed(0); tokenClientConfiguration.setRetryMaxAttempts(1); return tokenClientConfiguration; }

Target:
ClientConfiguration constructTokenClientConfig(ClientConfiguration apiClientConfiguration) { ClientConfiguration tokenClientConfiguration = new ClientConfiguration(); tokenClientConfiguration.setClientCredentialsResolver( new DefaultClientCredentialsResolver(() -> Optional.empty())); tokenClientConfiguration.setRequestAuthenticator(new DisabledAuthenticator()); tokenClientConfiguration.setCacheManagerEnabled(false); if (apiClientConfiguration.getBaseUrlResolver() != null) tokenClientConfiguration.setBaseUrlResolver(apiClientConfiguration.getBaseUrlResolver()); if (apiClientConfiguration.getProxy() != null) tokenClientConfiguration.setProxy(apiClientConfiguration.getProxy()); tokenClientConfiguration.setAuthenticationScheme(AuthenticationScheme.NONE); tokenClientConfiguration.setAuthorizationMode(AuthorizationMode.get(tokenClientConfiguration.getAuthenticationScheme())); tokenClientConfiguration.setClientId(apiClientConfiguration.getClientId()); tokenClientConfiguration.setScopes(apiClientConfiguration.getScopes()); tokenClientConfiguration.setPrivateKey(apiClientConfiguration.getPrivateKey()); tokenClientConfiguration.setRetryMaxElapsed(0); tokenClientConfiguration.setRetryMaxAttempts(1); return tokenClientConfiguration; }
Source:
private Collection<Violation> runValidation(final String file, final boolean result) throws IOException { final Environment.Mock mock = new Environment.Mock(); final File license = this.rule.savePackageInfo( new File(mock.basedir(), CheckstyleValidatorTest.DIRECTORY) ).withLines(CheckstyleValidatorTest.LICENSE) .withEol("\n").file(); final Environment env = mock.withParam( CheckstyleValidatorTest.LICENSE_PROP, this.toUrl(license) ) .withFile( String.format("src/main/java/foo/%s", file), IOUtils.toString( this.getClass().getResourceAsStream(file), Charset.defaultCharset() ) ); final Collection<Violation> results = new CheckstyleValidator(env).validate( env.files(file) ); if (result) { MatcherAssert.assertThat( results, Matchers.<Violation>empty() ); } else { MatcherAssert.assertThat( results, Matchers.not(Matchers.<Violation>empty()) ); } return results; }

Target:
private Collection<Violation> runValidation(final String file, final boolean result) throws IOException { final Environment.Mock mock = new Environment.Mock(); final File license = this.rule.savePackageInfo( new File(mock.basedir(), CheckstyleValidatorTest.DIRECTORY) ).withLines(CheckstyleValidatorTest.LICENSE) .withEol("\n").file(); final Environment env = mock.withParam( CheckstyleValidatorTest.LICENSE_PROP, this.toUrl(license) ) .withFile( String.format("src/main/java/foo/%s", file), new TextOf( new ResourceOf( new FormattedText("com/qulice/checkstyle/%s", file) ) ).asString() ); final Collection<Violation> results = new CheckstyleValidator(env).validate( env.files(file) ); if (result) { MatcherAssert.assertThat( results, Matchers.<Violation>empty() ); } else { MatcherAssert.assertThat( results, Matchers.not(Matchers.<Violation>empty()) ); } return results; }
Source:
public void prepareTestProject() throws Exception { URL resource = getClass().getResource("/projects/plugins/JavaTestRunnerPlugin/testng-tests"); testProjectServiceClient.importProject( ws.getId(), Paths.get(resource.toURI()), PROJECT, ProjectTemplates.CONSOLE_JAVA_SIMPLE); ide.open(ws); ide.waitOpenedWorkspaceIsReadyToUse(); projectExplorer.waitItem(PROJECT); notifications.waitProgressPopupPanelClose(); runCompileCommand(); }

Target:
public void prepareTestProject() throws Exception { URL resource = getClass().getResource("/projects/plugins/JavaTestRunnerPlugin/testng-tests"); CompileCommand compileCommand = new CompileCommand(); testCommandServiceClient.createCommand(DtoConverter.asDto(compileCommand), ws.getId()); testProjectServiceClient.importProject( ws.getId(), Paths.get(resource.toURI()), PROJECT, ProjectTemplates.CONSOLE_JAVA_SIMPLE); ide.open(ws); loader.waitOnClosed(); projectExplorer.waitItem(PROJECT); notifications.waitProgressPopupPanelClose(); try { runCompileCommandByPallete(compileCommand); } catch (TimeoutException ex) { fail("Known random failure <LINK_0>"); } }
Source:
public MetricServiceExecutorConf getWorkerMetricConf() { return MetricServiceExecutorConf.newBuilder() .setMetricFlushPeriodMs(serverMetricFlushPeriodMs) .build(); }

Target:
public MetricServiceExecutorConf getWorkerMetricConf() { return MetricServiceExecutorConf.newBuilder() .setCustomMetricCodec(ETDolphinMetricMsgCodec.class) .build(); }
Source:
public void testPKCS12() throws CertificateException, NoSuchAlgorithmException, KeyStoreException, IOException { System.out.println("Testing PKCS12..."); Certificate jkscert = generateCertificate(); String filename = "testks.asdf"; String alias = "alias"; char[] password = "password".toCharArray(); generateKeyStoreWithKey(filename, "pkcs12", alias, password, jkscert); generateKeyStoreWithKey(filename+"b", "pkcs12", alias, password, jkscert); generateKeyStoreWithKey(filename+"c", "pkcs12", alias, password, jkscert); KeyStore loadedStore = KeyStoreUtil.loadKeyStore(providerSupplier, null, new FileInputStream(new File(workingDir, filename)), filename, password); Assert.assertNotNull(loadedStore); Certificate loadedCert = loadedStore.getCertificate(alias); Assert.assertEquals(jkscert, loadedCert); }

Target:
public void testPKCS12() throws CertificateException, NoSuchAlgorithmException, KeyStoreException, IOException { System.out.println("Testing PKCS12..."); Certificate jkscert = generateCertificate(); String filename = "testks.asdf"; String alias = "alias"; char[] password = "password".toCharArray(); generateKeyStoreWithKey(filename, "pkcs12", alias, password, jkscert); KeyStore loadedStore = KeyStoreUtil.loadKeyStore(providerSupplier, null, new FileInputStream(new File(workingDir, filename)), filename, password); Assert.assertNotNull(loadedStore); Certificate loadedCert = loadedStore.getCertificate(alias); Assert.assertEquals(jkscert, loadedCert); }
Source:
public CalDavConfig(List<String> calendar, Type type, int eventNr, Value value) { super(); this.calendar = calendar; this.type = type; this.eventNr = eventNr; this.value = value; }

Target:
public CalDavConfig(List<String> calendar, Type type, int eventNr, Value value) { this.calendar = calendar; this.type = type; this.eventNr = eventNr; this.value = value; }
Source:
public void processLeftData(final MistDataEvent input) { System.out.print("before processLeftData" + state.toString()); final HashMap<K, V> intermediateState = updateState((Tuple2)input.getValue(), state); final HashMap<K, V> output = generateOutput(intermediateState); LOG.log(Level.FINE, "{0} updates the state {1} with input {2} to {3}, and generates {4}", new Object[]{this.getClass().getName(), state, input, intermediateState, output}); input.setValue(output); outputEmitter.emitData(input); state = intermediateState; System.out.println(", after processLeftData" + state.toString()); }

Target:
public void processLeftData(final MistDataEvent input) { final HashMap<K, V> intermediateState = updateState((Tuple2)input.getValue(), state); final HashMap<K, V> output = generateOutput(intermediateState); LOG.log(Level.FINE, "{0} updates the state {1} with input {2} to {3}, and generates {4}", new Object[]{this.getClass().getName(), state, input, intermediateState, output}); input.setValue(output); outputEmitter.emitData(input); state = intermediateState; }
Source:
private void sortFormList(ArrayList<FormInfo> forms, String sortingOrder) { if (sortingOrder.equals(SORT_BY_NAME)) { Collections.sort(forms, new Comparator<FormInfo>() { @Override public int compare(FormInfo lhs, FormInfo rhs) { int cmp = lhs.formDisplayName.compareToIgnoreCase(rhs.formDisplayName); if (cmp != 0) { return cmp; } cmp = lhs.tableId.compareToIgnoreCase(rhs.tableId); if (cmp != 0) { return cmp; } cmp = lhs.formId.compareToIgnoreCase(rhs.formId); if (cmp != 0) { return cmp; } cmp = lhs.formVersion.compareToIgnoreCase(rhs.formVersion); if (cmp != 0) { return cmp; } cmp = lhs.formDisplaySubtext.compareToIgnoreCase(rhs.formDisplaySubtext); return cmp; } }); } else if (sortingOrder.equals(SORT_BY_TABLEID)) { Collections.sort(mItems, new Comparator<FormInfo>() { @Override public int compare(FormInfo left, FormInfo right) { int cmp = left.tableId.compareToIgnoreCase(right.tableId); if (cmp != 0) { return cmp; } cmp = left.formDisplayName.compareToIgnoreCase(right.formDisplayName); if (cmp != 0) { return cmp; } cmp = left.formId.compareToIgnoreCase(right.formId); if (cmp != 0) { return cmp; } cmp = left.formVersion.compareToIgnoreCase(right.formVersion); if (cmp != 0) { return cmp; } cmp = left.formDisplaySubtext.compareToIgnoreCase(right.formDisplaySubtext); return cmp; } }); mAdapter.swapData(mItems); } }

Target:
private void sortFormList(ArrayList<FormInfo> forms, String sortingOrder) { if (sortingOrder.equals(SORT_BY_NAME)) { Collections.sort(forms, new Comparator<FormInfo>() { @Override public int compare(FormInfo lhs, FormInfo rhs) { int cmp = lhs.formDisplayName.compareToIgnoreCase(rhs.formDisplayName); if (cmp != 0) { return cmp; } cmp = lhs.tableId.compareToIgnoreCase(rhs.tableId); if (cmp != 0) { return cmp; } cmp = lhs.formId.compareToIgnoreCase(rhs.formId); if (cmp != 0) { return cmp; } cmp = lhs.formVersion.compareToIgnoreCase(rhs.formVersion); if (cmp != 0) { return cmp; } cmp = lhs.formDisplaySubtext.compareToIgnoreCase(rhs.formDisplaySubtext); return cmp; } }); } else if (sortingOrder.equals(SORT_BY_TABLEID)) { Collections.sort(forms, new Comparator<FormInfo>() { @Override public int compare(FormInfo left, FormInfo right) { int cmp = left.tableId.compareToIgnoreCase(right.tableId); if (cmp != 0) { return cmp; } cmp = left.formDisplayName.compareToIgnoreCase(right.formDisplayName); if (cmp != 0) { return cmp; } cmp = left.formId.compareToIgnoreCase(right.formId); if (cmp != 0) { return cmp; } cmp = left.formVersion.compareToIgnoreCase(right.formVersion); if (cmp != 0) { return cmp; } cmp = left.formDisplaySubtext.compareToIgnoreCase(right.formDisplaySubtext); return cmp; } }); mAdapter.swapData(mItems); } }
Source:
public String getSysprepFileName(int osId, Version version) { return EngineLocalConfig.getInstance().expandString(getValueByVersion(idToUnameLookup.get(osId), "sysprepFileName", version)); }

Target:
public String getSysprepFileName(int osId, Version version) { return getValueByVersion(idToUnameLookup.get(osId), "sysprepFileName", version); }