auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public MemorySplit( @JsonProperty("tableHandle") MemoryTableHandle tableHandle, @JsonProperty("partNumber") int partNumber, @JsonProperty("totalPartsPerWorker") int totalPartsPerWorker, @JsonProperty("address") HostAddress address, @JsonProperty("expectedRows") long expectedRows) { checkState(partNumber >= 0, "partNumber must be >= 0"); checkState(totalPartsPerWorker >= 1, "totalPartsPerWorker must be >= 1"); checkState(totalPartsPerWorker > partNumber, "totalPartsPerWorker must be > partNumber"); this.tableHandle = requireNonNull(tableHandle, "tableHandle is null"); this.partNumber = partNumber; this.totalPartsPerWorker = totalPartsPerWorker; this.addresses = ImmutableList.of(requireNonNull(address, "address is null")); this.expectedRows = expectedRows; }

Target:
public MemorySplit( @JsonProperty("tableHandle") MemoryTableHandle tableHandle, @JsonProperty("partNumber") int partNumber, @JsonProperty("totalPartsPerWorker") int totalPartsPerWorker, @JsonProperty("address") HostAddress address, @JsonProperty("expectedRows") long expectedRows) { checkState(partNumber >= 0, "partNumber must be >= 0"); checkState(totalPartsPerWorker >= 1, "totalPartsPerWorker must be >= 1"); checkState(totalPartsPerWorker > partNumber, "totalPartsPerWorker must be > partNumber"); this.tableHandle = requireNonNull(tableHandle, "tableHandle is null"); this.partNumber = partNumber; this.totalPartsPerWorker = totalPartsPerWorker; this.address = requireNonNull(address, "address is null"); this.expectedRows = expectedRows; }
Source:
public int getLowestClusterHBaseVersion() { return 0; }

Target:
public int getLowestClusterHBaseVersion() { return getDelegate().getLowestClusterHBaseVersion(); }
Source:
private static Output processNewLetter( Output state, String letter) { if (state.guess.contains(letter) || state.misses.contains(letter)) { throw new IllegalArgumentException("Letter " + letter + " was already played"); } if (state.secret.contains(letter)) { Set<String> newGuess = new HashSet<>(state.guess); newGuess.add(letter); String discovered = state.secret.chars() .mapToObj(i -> String.valueOf((char) i)) .map(c -> newGuess.contains(c) ? c : "_") .collect(joining()); return new Output( state.secret, discovered, newGuess, state.misses, state.parts, discovered.contains("_") ? Status.PLAYING : Status.WIN); } else { Set<String> newMisses = new HashSet<>(state.misses); newMisses.add(letter); List<Part> newParts = new ArrayList<>(state.parts); newParts.add(order[newParts.size()]); Status newStatus = newMisses.size() >= order.length ? Status.LOSS : Status.PLAYING; return new Output( state.secret, state.discovered, state.guess, newMisses, newParts, newStatus); } }

Target:
private static Output processNewLetter( Output state, String letter) { if (state.isLetterAlreadyPlayed(letter)) { throw new IllegalArgumentException("Letter " + letter + " was already played"); } if (state.isLetterInSecret(letter)) { return processCorrectGuess(state, letter); } else { return processIncorrectGuess(state, letter); } }
Source:
public String toString() { return "ConnectionRetryConfig{" + "initialBackoffMillis=" + initialBackoffMillis + ", maxBackoffMillis=" + maxBackoffMillis + ", multiplier=" + multiplier + ", failOnMaxBackoff=" + failOnMaxBackoff + ", jitter=" + jitter + ", enabled=" + enabled + '}'; }

Target:
public String toString() { return "ConnectionRetryConfig{" + "enabled=" + enabled + ", initialBackoffMillis=" + initialBackoffMillis + ", maxBackoffMillis=" + maxBackoffMillis + ", multiplier=" + multiplier + ", failOnMaxBackoff=" + failOnMaxBackoff + ", jitter=" + jitter + '}'; }
Source:
protected File getDependency(ArtifactDescription artifactDescription) throws DeploymentException { try { Artifact artifact = artifactFactory.createArtifact(artifactDescription.getGroupId(), artifactDescription.getArtifactId(), artifactDescription.getVersion(), null, artifactDescription.getType()); log.info("Resolving " + artifact); artifactResolver.resolve(artifact, mavenProject.getRemoteArtifactRepositories(), localRepository); return artifact.getFile(); } catch (AbstractArtifactResolutionException e) { throw new DeploymentException("Couldn't download artifact: " + e.getMessage(), e); } }

Target:
protected File getDependency(ArtifactDescription artifactDescription) throws DeploymentException { try { Artifact artifact = artifactFactory.createArtifact(artifactDescription.getGroupId(), artifactDescription.getArtifactId(), artifactDescription.getVersion(), null, artifactDescription.getType()); log.info("Resolving " + artifact); artifactResolver.resolve(artifact, mavenProject.getRemoteArtifactRepositories(), localRepository); return artifact.getFile(); } catch (AbstractArtifactResolutionException e) { throw new DeploymentException("Fail download artifact: " + artifactDescription.toString(), e); } }
Source:
public static String readDefaultTopic(final byte[] keystore, final char[] password) { try { final KeyStore keyStore = KeyStore.getInstance(KEYSTORE_TYPE); keyStore.load(new ByteArrayInputStream(keystore), password); final Enumeration<String> aliases = keyStore.aliases(); while (aliases.hasMoreElements()) { final String alias = aliases.nextElement(); final X509Certificate certificate = (X509Certificate) keyStore.getCertificate(alias); final X500Principal subjectX500Principal = certificate.getSubjectX500Principal(); final String subject = subjectX500Principal.getName(); if (subject != null ) { final Pattern pattern = Pattern.compile(TOPIC_PATTERN); final Matcher matcher = pattern.matcher(subject); if (matcher.matches()) { return matcher.group(1); } } } } catch (Exception e) { LOGGER.error("Error parsing .p12 file content", e); } return null; }

Target:
public static String readDefaultTopic(final byte[] keystore, final char[] password) { try { final KeyStore keyStore = KeyStore.getInstance(KEYSTORE_TYPE); keyStore.load(new ByteArrayInputStream(keystore), password); final Enumeration<String> aliases = keyStore.aliases(); while (aliases.hasMoreElements()) { final String alias = aliases.nextElement(); final X509Certificate certificate = (X509Certificate) keyStore.getCertificate(alias); final X500Principal subjectX500Principal = certificate.getSubjectX500Principal(); final String subject = subjectX500Principal.getName(); if (subject != null ) { final Pattern pattern = Pattern.compile(TOPIC_PATTERN); final Matcher matcher = pattern.matcher(subject); if (matcher.matches()) { return matcher.group(1); } } } } catch (Exception e) { LOGGER.error("Error parsing .p12 file content", e); } LOGGER.info("No topic inside the .p12 file was found"); return null; }
Source:
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_on_this_day, container, false); unbinder = ButterKnife.bind(this, view); int age = requireActivity().getIntent().getIntExtra(AGE, 0); wiki = requireActivity().getIntent().getParcelableExtra(WIKISITE); date = DateUtil.getDefaultDateFor(age); yearClickedOnCardView = requireActivity().getIntent().getIntExtra(YEAR, -1); setUpToolbar(); eventsRecycler.setLayoutManager(new LinearLayoutManager(getContext(), RecyclerView.VERTICAL, false)); final int topDecorationDp = 24; eventsRecycler.addItemDecoration(new HeaderMarginItemDecoration(topDecorationDp, 0)); setUpRecycler(eventsRecycler); errorView.setBackClickListener(v -> requireActivity().finish()); final int animDelay = (requireActivity().getWindow().getSharedElementEnterTransition() != null && savedInstanceState == null) ? 500 : 0; onThisDayTitleView.postDelayed(() -> { if (!isAdded() || onThisDayTitleView == null) { return; } updateContents(age); }, animDelay); progressBar.setVisibility(GONE); eventsRecycler.setVisibility(GONE); errorView.setVisibility(GONE); return view; }

Target:
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_on_this_day, container, false); unbinder = ButterKnife.bind(this, view); int age = requireActivity().getIntent().getIntExtra(AGE, 0); wiki = requireActivity().getIntent().getParcelableExtra(WIKISITE); date = DateUtil.getDefaultDateFor(age); yearOnCardView = requireActivity().getIntent().getIntExtra(YEAR, -1); setUpToolbar(); eventsRecycler.setLayoutManager(new LinearLayoutManager(getContext(), RecyclerView.VERTICAL, false)); final int topDecorationDp = 24; eventsRecycler.addItemDecoration(new HeaderMarginItemDecoration(topDecorationDp, 0)); setUpRecycler(eventsRecycler); errorView.setBackClickListener(v -> requireActivity().finish()); setUpTransitionAnimation(savedInstanceState, age); progressBar.setVisibility(GONE); eventsRecycler.setVisibility(GONE); errorView.setVisibility(GONE); return view; }
Source:
public Component getTableCellRendererComponent(final JTable table, final Object value, final boolean isSelected, final boolean hasFocus, final int row, final int column) { EditedStyleItem item = null; if (value instanceof EditedStyleItem) { item = (EditedStyleItem) value; } final Component returnedComponent = myDelegate.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); if (item == null) { returnedComponent.setBackground(isSelected ? table.getSelectionBackground() : table.getBackground()); } if (item != null && item.getSourceStyle().equals(((AttributesTableModel) table.getModel()).getSelectedStyle())) { returnedComponent.setFont(table.getFont().deriveFont(Font.BOLD)); } else { returnedComponent.setFont(table.getFont()); } if (!(returnedComponent instanceof JComponent)) { return returnedComponent; } final JComponent jComponent = (JComponent)returnedComponent; Point mousePos = table.getMousePosition(); if (mousePos != null && item != null) { if (table.getCellRect(row, column, true).contains(mousePos)) { final ItemResourceValue resValue = ((EditedStyleItem)value).getItemResourceValue(); Configuration configuration = item.getSourceStyle().getConfiguration(); String toolTipText = ThemeEditorUtils.generateToolTipText(resValue, configuration.getModule(), configuration); jComponent.setToolTipText(toolTipText); } } else { jComponent.setToolTipText(null); } return returnedComponent; }

Target:
public Component getTableCellRendererComponent(final JTable table, final Object value, final boolean isSelected, final boolean hasFocus, final int row, final int column) { EditedStyleItem item = (value instanceof EditedStyleItem) ? (EditedStyleItem) value : null; final Component returnedComponent = myDelegate.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); if (item != null && item.getSourceStyle().equals(((AttributesTableModel) table.getModel()).getSelectedStyle())) { returnedComponent.setFont(table.getFont().deriveFont(Font.BOLD)); } else { returnedComponent.setFont(table.getFont()); } if (item != null && !item.isPublicAttribute()) { returnedComponent.setForeground(JBColor.GRAY); } else { returnedComponent.setForeground(table.getForeground()); } if (!(returnedComponent instanceof JComponent)) { return returnedComponent; } final JComponent jComponent = (JComponent)returnedComponent; Point mousePos = table.getMousePosition(); if (mousePos != null && item != null) { if (table.getCellRect(row, column, true).contains(mousePos)) { final ItemResourceValue resValue = ((EditedStyleItem)value).getItemResourceValue(); Configuration configuration = item.getSourceStyle().getConfiguration(); String toolTipText = ThemeEditorUtils.generateToolTipText(resValue, configuration.getModule(), configuration); jComponent.setToolTipText(toolTipText); } } else { jComponent.setToolTipText(null); } return returnedComponent; }
Source:
private boolean isSpringBootConfigurable(MavenProject mavenProject) { String springBootActivation = mavenProject.getProperties().getProperty("m2e.springboot.activation"); boolean configureSpringBoot; if (springBootActivation == null) { IPreferenceStore store = Activator.getDefault().getPreferenceStore(); configureSpringBoot = store.getBoolean(Activator.CONFIGURE_SPRING_BOOT); } else { configureSpringBoot = Boolean.valueOf(springBootActivation); } return configureSpringBoot; }

Target:
private boolean isSpringBootConfigurable(MavenProject mavenProject) { String springBootActivation = mavenProject.getProperties().getProperty(ACTIVATION_PROPERTY); boolean configureSpringBoot; if (springBootActivation == null) { IPreferenceStore store = Activator.getDefault().getPreferenceStore(); configureSpringBoot = store.getBoolean(Activator.CONFIGURE_SPRING_BOOT); } else { configureSpringBoot = Boolean.valueOf(springBootActivation); } return configureSpringBoot; }
Source:
public void tearDown() { if (testRealm != null) { testRealm.close(); } Realm.deleteRealm(realmConfig); }

Target:
public void tearDown() { if (testRealm != null) { testRealm.close(); } }
Source:
protected void subscribeActual(final Observer<? super T> o) { publisher.subscribe(new Subscriber<T>() { @Override public void onComplete() { o.onComplete(); } @Override public void onError(Throwable t) { o.onError(t); } @Override public void onNext(T t) { o.onNext(t); } @Override public void onSubscribe(Subscription inner) { o.onSubscribe(Disposables.from(inner)); inner.request(Long.MAX_VALUE); } }); }

Target:
protected void subscribeActual(final Observer<? super T> o) { publisher.subscribe(new PublisherSubscriber<T>(o)); }
Source:
public static Request getRequest(final Request incomingRequest) throws TranslationException { if (incomingRequest == null) { throw new IllegalArgumentException("incomingRequest == null"); } Code code = incomingRequest.getCode(); Type type = incomingRequest.getType(); Request outgoingRequest = new Request(code); outgoingRequest.setConfirmable(type == Type.CON); byte[] payload = incomingRequest.getPayload(); outgoingRequest.setPayload(payload); URI serverUri; try { String proxyUriString = URLDecoder.decode( incomingRequest.getOptions().getProxyUri(), "UTF-8"); serverUri = new URI(proxyUriString); } catch (UnsupportedEncodingException e) { LOGGER.warn("UTF-8 do not support this encoding: {}", e); throw new TranslationException("UTF-8 do not support this encoding", e); } catch (URISyntaxException e) { LOGGER.warn("Cannot translate the server uri {}", e); throw new TranslationException("Cannot translate the server uri", e); } OptionSet options = new OptionSet(incomingRequest.getOptions()); options.removeProxyUri(); options.removeBlock1(); options.removeBlock2(); options.clearUriPath(); options.clearUriQuery(); outgoingRequest.setOptions(options); if (serverUri != null) { outgoingRequest.setURI(serverUri); } LOGGER.debug("Incoming request translated correctly"); return outgoingRequest; }

Target:
public static Request getRequest(final Request incomingRequest) throws TranslationException { if (incomingRequest == null) { throw new IllegalArgumentException("incomingRequest == null"); } Code code = incomingRequest.getCode(); Type type = incomingRequest.getType(); Request outgoingRequest = new Request(code); outgoingRequest.setConfirmable(type == Type.CON); byte[] payload = incomingRequest.getPayload(); outgoingRequest.setPayload(payload); URI serverUri; try { String proxyUriString = URLDecoder.decode( incomingRequest.getOptions().getProxyUri(), "UTF-8"); serverUri = new URI(proxyUriString); } catch (UnsupportedEncodingException e) { LOGGER.warn("UTF-8 do not support this encoding", e); throw new TranslationException("UTF-8 do not support this encoding", e); } catch (URISyntaxException e) { LOGGER.warn("Cannot translate the server uri", e); throw new TranslationException("Cannot translate the server uri", e); } OptionSet options = new OptionSet(incomingRequest.getOptions()); options.removeProxyUri(); options.removeBlock1(); options.removeBlock2(); options.clearUriPath(); options.clearUriQuery(); outgoingRequest.setOptions(options); if (serverUri != null) { outgoingRequest.setURI(serverUri); } LOGGER.debug("Incoming request translated correctly"); return outgoingRequest; }
Source:
public void testMultiThreadPush() throws InterruptedException, TimeoutException, ExecutionException { final int numPushThreads = 8; final int numPushPerThread = 1000; final int pushValue = 1; final CountDownLatch countDownLatch = new CountDownLatch(numPushThreads); final Runnable[] threads = new Runnable[numPushThreads]; for (int index = 0; index < numPushThreads; ++index) { final int key = index % 4; threads[index] = () -> { for (int push = 0; push < numPushPerThread; ++push) { worker.push(key, pushValue); } countDownLatch.countDown(); }; } ThreadUtils.runConcurrently(threads); final boolean allThreadsFinished = countDownLatch.await(10, TimeUnit.SECONDS); worker.close(CLOSE_TIMEOUT); assertTrue(MSG_THREADS_SHOULD_FINISH, allThreadsFinished); verify(mockSender, times(numPushThreads * numPushPerThread)).sendPushMsg(anyString(), anyObject(), eq(pushValue)); }

Target:
public void testMultiThreadPush() throws InterruptedException, TimeoutException, ExecutionException, NetworkException { final int numPushThreads = 8; final int numKeys = 4; final int numPushPerThread = 1000; final int pushValue = 1; final CountDownLatch countDownLatch = new CountDownLatch(numPushThreads); final Runnable[] threads = new Runnable[numPushThreads]; for (int index = 0; index < numPushThreads; ++index) { final int key = index % numKeys; threads[index] = () -> { for (int push = 0; push < numPushPerThread; ++push) { worker.push(key, pushValue); } countDownLatch.countDown(); }; } ThreadUtils.runConcurrently(threads); final boolean allThreadsFinished = countDownLatch.await(10, TimeUnit.SECONDS); worker.close(CLOSE_TIMEOUT); assertTrue(MSG_THREADS_SHOULD_FINISH, allThreadsFinished); verify(mockSender, times(numPushThreads * numPushPerThread)).sendPushMsg(anyString(), anyObject(), eq(pushValue)); }
Source:
public void checkPreviewUpdatedAfterStopResume() { IdlingRegistry.getInstance().register(mActivityRule.getActivity().getViewIdlingResource()); pressHomeButton(); mActivityRule.getActivity().resetViewIdlingResource(); mIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_NEW_TASK); mActivityRule.getActivity().startActivity(mIntent); onView(withId(R.id.textureView)).check(matches(isDisplayed())); IdlingRegistry.getInstance().unregister( mActivityRule.getActivity().getViewIdlingResource()); }

Target:
public void checkPreviewUpdatedAfterStopResume() { IdlingRegistry.getInstance().register(mActivityRule.getActivity().getViewIdlingResource()); onView(withId(R.id.textureView)).check(matches(isDisplayed())); pressHomeButton(); mActivityRule.getActivity().resetViewIdlingResource(); mIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_NEW_TASK); mActivityRule.getActivity().startActivity(mIntent); onView(withId(R.id.textureView)).check(matches(isDisplayed())); IdlingRegistry.getInstance().unregister( mActivityRule.getActivity().getViewIdlingResource()); }
Source:
public void testTmfTraceMultiTimestamps() { assertEquals("getCacheSize", BLOCK_SIZE, fTrace.getCacheSize()); assertEquals("getTraceSize", NB_EVENTS, fTrace.getNbEvents()); assertEquals("getRange-start", 1, fTrace.getTimeRange().getStartTime().getValue()); assertEquals("getRange-end", NB_EVENTS, fTrace.getTimeRange().getEndTime().getValue()); assertEquals("getStartTime", 1, fTrace.getStartTime().getValue()); assertEquals("getEndTime", NB_EVENTS, fTrace.getEndTime().getValue()); List<ITmfCheckpoint> checkpoints = fTrace.getIndexer().getCheckpoints(); assertTrue("Checkpoints exist", checkpoints != null); assertEquals("Checkpoints size", NB_EVENTS / BLOCK_SIZE, checkpoints.size()); TmfTimestamp seekTs = new TmfTimestamp(101, -3, 0); ITmfContext ctx = fTrace.seekEvent(seekTs); ITmfEvent event = fTrace.getNext(ctx); assertTrue(ctx.getRank() == 99); assertTrue((seekTs.compareTo(event.getTimestamp(), false) == 0)); event = fTrace.getNext(ctx); assertTrue(ctx.getRank() == 100); assertTrue((seekTs.compareTo(event.getTimestamp(), false) == 0)); event = fTrace.getNext(ctx); assertTrue(ctx.getRank() == 101); assertTrue((seekTs.compareTo(event.getTimestamp(), false) == 0)); }

Target:
public void testTmfTraceMultiTimestamps() { assertEquals("getCacheSize", BLOCK_SIZE, fTrace.getCacheSize()); assertEquals("getTraceSize", NB_EVENTS, fTrace.getNbEvents()); assertEquals("getRange-start", 1, fTrace.getTimeRange().getStartTime().getValue()); assertEquals("getRange-end", NB_EVENTS, fTrace.getTimeRange().getEndTime().getValue()); assertEquals("getStartTime", 1, fTrace.getStartTime().getValue()); assertEquals("getEndTime", NB_EVENTS, fTrace.getEndTime().getValue()); List<ITmfCheckpoint> checkpoints = fTrace.getIndexer().getCheckpoints(); assertTrue("Checkpoints exist", checkpoints != null); assertEquals("Checkpoints size", NB_EVENTS / BLOCK_SIZE + 1, checkpoints.size()); TmfTimestamp seekTs = new TmfTimestamp(101, -3, 0); ITmfContext ctx = fTrace.seekEvent(seekTs); ITmfEvent event = fTrace.getNext(ctx); assertTrue(ctx.getRank() == 99); assertTrue((seekTs.compareTo(event.getTimestamp(), false) == 0)); event = fTrace.getNext(ctx); assertTrue(ctx.getRank() == 100); assertTrue((seekTs.compareTo(event.getTimestamp(), false) == 0)); event = fTrace.getNext(ctx); assertTrue(ctx.getRank() == 101); assertTrue((seekTs.compareTo(event.getTimestamp(), false) == 0)); }
Source:
public int read(byte b[], int off, int len) throws IOException { if (b == null) { throw new NullPointerException(); } else if (off < 0 || len < 0 || len > b.length - off) { throw new IndexOutOfBoundsException(); } else if (len == 0) { return 0; } if (endOfInput && !bbuf.hasRemaining()) { return -1; } int totalRead = 0; while (len > 0 && !endOfInput) { if (bbuf.hasRemaining()) { int remaining = Math.min(len, bbuf.remaining()); bbuf.get(b, off, remaining); totalRead += remaining; off += remaining; len -= remaining; if (len >= 0) { return totalRead; } } advance(); } if (endOfInput && !bbuf.hasRemaining()) { return -1; } return totalRead; }

Target:
public int read(byte b[], int off, int len) throws IOException { if (b == null) { throw new NullPointerException(); } else if (off < 0 || len < 0 || len > b.length - off) { throw new IndexOutOfBoundsException(); } else if (len == 0) { return 0; } if (endOfInput && !bbuf.hasRemaining()) { return -1; } int totalRead = 0; while (len > 0 && !endOfInput) { if (bbuf.hasRemaining()) { int remaining = Math.min(len, bbuf.remaining()); bbuf.get(b, off, remaining); totalRead += remaining; off += remaining; len -= remaining; if (len == 0) { return totalRead; } } advance(); } if (endOfInput && !bbuf.hasRemaining() && totalRead == 0) { return -1; } return totalRead; }
Source:
public void testColorReferencesCardinality() { List<EReference> referencesWithWrongCardinality = Lists.newArrayList(); Predicate<EReference> shouldBeRequired = new Predicate<EReference>() { @Override public boolean apply(EReference input) { return !input.isRequired(); } }; Iterables.addAll(referencesWithWrongCardinality, Iterables.filter(colorReferences, shouldBeRequired)); Assert.assertTrue(getMessage(referencesWithWrongCardinality), referencesWithWrongCardinality.isEmpty()); }

Target:
public void testColorReferencesCardinality() { List<EReference> referencesWithWrongCardinality = Lists.newArrayList(); Predicate<EReference> shouldBeRequired = new Predicate<EReference>() { @Override public boolean apply(EReference input) { return !input.isRequired() && !specialColorRefs.contains(input); } }; Iterables.addAll(referencesWithWrongCardinality, Iterables.filter(colorReferences, shouldBeRequired)); Assert.assertTrue(getMessage(referencesWithWrongCardinality), referencesWithWrongCardinality.isEmpty()); }
Source:
public VariantToMongoDbObjectConverter variantToMongoDbObjectConverter(InputParameters inputParameters) { if (VariantSource.Aggregation.NONE.equals(inputParameters.getVcfAggregation())) { return new VariantToMongoDbObjectConverter(false, false, true, includeSourceLine); } else { return new VariantToMongoDbObjectConverter(true, true, false, includeSourceLine); } }

Target:
public VariantToMongoDbObjectConverter variantToMongoDbObjectConverter(InputParameters inputParameters) { boolean includeSamples, includeStats; if (VariantSource.Aggregation.NONE.equals(inputParameters.getVcfAggregation())) { includeSamples = true; includeStats = false; } else { includeSamples = false; includeStats = true; } return new VariantToMongoDbObjectConverter(includeStats, includeSamples); }
Source:
public Integer parse(CharSequence text) throws ParseException { MatchResult match = RegExp.compile("^(\\d+)\\s*(\\w*)$").exec(text.toString().trim()); if (match == null) { return 0; } String prefix = match.getGroup(1); String suffix = match.getGroup(2); 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(constant.mb())) { 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()); if (match == null) { return 0; } String prefix = match.getGroup(1); String suffix = match.getGroup(2); Integer size = null; try { size = Integer.parseInt(prefix); } catch (NumberFormatException e) { return 0; } if (suffix.equalsIgnoreCase(constant.tb()) || suffix.equalsIgnoreCase(constant.t()) || suffix.equalsIgnoreCase(constant.tib())) { return size * 1024 * 1024; } else if (suffix.equalsIgnoreCase(constant.gb()) || suffix.equalsIgnoreCase(constant.g()) || suffix.equalsIgnoreCase(constant.gib())) { return size * 1024; } else if (suffix.equalsIgnoreCase(constant.mb()) || suffix.equalsIgnoreCase(constant.m()) || suffix.equalsIgnoreCase(constant.mib())) { return size; } else if (StringHelper.isNullOrEmpty(suffix)) { return size; } else { return 0; } }
Source:
public <T extends ModuleType> Collection<T> getModuleTypes(Locale locale) { Collection<ModuleType> values = providedObjectsHolder.values(); if (values.isEmpty()) { return Collections.<T>emptyList(); } Collection<ModuleType> toReturn = new LinkedList<ModuleType>(); toReturn.addAll(values); return (Collection<T>) toReturn; }

Target:
public <T extends ModuleType> Collection<T> getModuleTypes(Locale locale) { Collection<ModuleType> values = providedObjectsHolder.values(); if (values.isEmpty()) { return Collections.<T>emptyList(); } return (Collection<T>) new LinkedList<ModuleType>(values); }
Source:
private static List<IProject> collectSelectedProjects(ExecutionEvent event) { ISelection currentSelection = HandlerUtil.getCurrentSelection(event); if (currentSelection instanceof IStructuredSelection) { IStructuredSelection selection = (IStructuredSelection) currentSelection; @SuppressWarnings("unchecked") ImmutableList<IProject> selectedProjects = FluentIterable.from(selection.toList()) .transform(new AdapterFunction<IProject>(IProject.class, Platform.getAdapterManager())) .filter(Predicates.hasGradleNature()).toList(); return selectedProjects; } return ImmutableList.of(); }

Target:
private static List<IProject> collectSelectedProjects(ExecutionEvent event) { ISelection currentSelection = HandlerUtil.getCurrentSelection(event); if (currentSelection instanceof IStructuredSelection) { IStructuredSelection selection = (IStructuredSelection) currentSelection; @SuppressWarnings("unchecked") ImmutableList<IProject> selectedProjects = FluentIterable.from(selection.toList()) .transform(new AdapterFunction<IProject>(IProject.class, Platform.getAdapterManager())) .filter(Predicates.hasGradleNature()).toList(); return selectedProjects; } else { return ImmutableList.of(); } }
Source:
public Stream<Allele> filterAllelesForFinalSet() { return newAlleles.stream().filter(a -> !a.equals(GATKVCFConstants.NON_REF_SYMBOLIC_ALLELE)) .filter(a -> !a.isReference()) .filter(a -> !(a.isSymbolic() && vc.isSymbolic())) .filter(Allele::isCalled) ; }

Target:
private Stream<Allele> filterAllelesForFinalSet() { return newAlleles.stream().filter(a -> !a.equals(GATKVCFConstants.NON_REF_SYMBOLIC_ALLELE)) .filter(a -> !a.isReference()) .filter(a -> !(a.isSymbolic() && vc.isSymbolic())) .filter(Allele::isCalled) ; }
Source:
public void testClientCertificatePem() throws Exception { HttpServlet servlet = new HttpServlet() { @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException { X509Certificate[] certs = (X509Certificate[]) request.getAttribute("javax.servlet.request.X509Certificate"); if ((certs == null) || (certs.length == 0)) { throw new RuntimeException("No client certificate"); } if (certs.length > 1) { throw new RuntimeException("Received multiple client certificates"); } X509Certificate cert = certs[0]; response.getWriter().write(cert.getSubjectX500Principal().getName()); response.setStatus(HttpServletResponse.SC_OK); } }; config.setHttpEnabled(false) .setAdminEnabled(false) .setHttpsEnabled(true) .setHttpsPort(0) .setKeystorePath(getResource("clientcert-pem/server.pem").getPath()) .setKeystorePassword("airlift") .setTrustStorePath(getResource("clientcert-pem/ca.crt").getPath()); createAndStartServer(servlet); HttpClientConfig clientConfig = new HttpClientConfig() .setKeyStorePath(getResource("clientcert-pem/client.pem").getPath()) .setKeyStorePassword("airlift") .setTrustStorePath(getResource("clientcert-pem/ca.crt").getPath()); System.out.println(httpServerInfo.getHttpsUri()); try (JettyHttpClient httpClient = new JettyHttpClient(clientConfig)) { StringResponse response = httpClient.execute( prepareGet().setUri(httpServerInfo.getHttpsUri()).build(), createStringResponseHandler()); assertEquals(response.getStatusCode(), HttpServletResponse.SC_OK); assertEquals(response.getBody(), "CN=testing,OU=Client,O=Airlift,L=Palo Alto,ST=CA,C=US"); } }

Target:
public void testClientCertificatePem() throws Exception { config.setHttpEnabled(false) .setAdminEnabled(false) .setHttpsEnabled(true) .setHttpsPort(0) .setKeystorePath(getResource("clientcert-pem/server.pem").getPath()) .setKeystorePassword("airlift") .setTrustStorePath(getResource("clientcert-pem/ca.crt").getPath()); createAndStartServer(createCertTestServlet()); HttpClientConfig clientConfig = new HttpClientConfig() .setKeyStorePath(getResource("clientcert-pem/client.pem").getPath()) .setKeyStorePassword("airlift") .setTrustStorePath(getResource("clientcert-pem/ca.crt").getPath()); assertClientCertificateRequest(clientConfig); }
Source:
public String getHostnameForHostID(int hostId) { if (hostId == m_localHostId) { return CoreUtils.getHostnameOrAddress(); } Iterator<ForeignHost> it = m_foreignHosts.get(hostId).iterator(); if (it.hasNext()) { ForeignHost fh = it.next(); return fh.hostname(); } else { return "UNKNOWN"; } }

Target:
public String getHostnameForHostID(int hostId) { if (hostId == m_localHostId) { return CoreUtils.getHostnameOrAddress(); } Iterator<ForeignHost> it = m_foreignHosts.get(hostId).iterator(); if (it.hasNext()) { ForeignHost fh = it.next(); return fh.hostname(); } return "UNKNOWN"; }
Source:
public void commitTransaction() { nativeCommitTransaction(nativePtr); invokeListenerIfSchemaChanged(); }

Target:
public void commitTransaction() { nativeCommitTransaction(nativePtr); }
Source:
public static Extension create(Builder builder) { return new HeadingAnchorExtension(builder.defaultId, builder.idPrefix, builder.idSuffix); }

Target:
private static Extension create(Builder builder) { return new HeadingAnchorExtension(builder.defaultId, builder.idPrefix, builder.idSuffix); }
Source:
private void removeExistContainer(String containerName) { try { docker.killContainer(containerName); } catch (DockerException | InterruptedException e) { LOGGER.error(e.getMessage(), e); } finally { try { docker.removeContainer(containerName); } catch (DockerException | InterruptedException e) { LOGGER.error(e.getMessage(), e); } } }

Target:
private void removeExistContainer(String containerName) { boolean isExist = false; try { final List<Container> containers = docker.listContainers(DockerClient.ListContainersParam.allContainers()); for (Container container : containers) { for (String name : container.names()) { if (StringUtils.equals(name, "/" + containerName)) { isExist = true; break; } } } if (isExist == true) { LOGGER.info("kill exist container {}", containerName); docker.killContainer(containerName); } } catch (DockerException | InterruptedException e) { LOGGER.error(e.getMessage(), e); } finally { try { if (isExist == true) { docker.removeContainer(containerName); } } catch (DockerException | InterruptedException e) { LOGGER.error(e.getMessage(), e); } } }
Source:
public Collection<UstDebugInfoBinaryFile> getAllBinaries() { waitForCompletion(); ITmfStateSystem ss = checkNotNull(getStateSystem()); Set<UstDebugInfoBinaryFile> files = new TreeSet<>(); ImmutableList.Builder<Integer> builder = ImmutableList.builder(); List<Integer> vpidQuarks = ss.getSubAttributes(-1, false); for (Integer vpidQuark : vpidQuarks) { builder.addAll(ss.getSubAttributes(vpidQuark, false)); } List<Integer> baddrQuarks = builder.build(); for (Integer baddrQuark : baddrQuarks) { List<Integer> buildIdQuarks = ss.getSubAttributes(baddrQuark, false); for (Integer buildIdQuark : buildIdQuarks) { String buildId = ss.getAttributeName(buildIdQuark); ITmfStateInterval interval = StateSystemUtils.queryUntilNonNullValue(ss, buildIdQuark, ss.getStartTime(), Long.MAX_VALUE); if (interval == null) { throw new IllegalStateException(); } String filePath = interval.getStateValue().unboxStr(); try { int isPicQuark = ss.getQuarkRelative(buildIdQuark, UstDebugInfoStateProvider.IS_PIC_ATTRIB); int isPicVal = ss.querySingleState(interval.getStartTime(), isPicQuark).getStateValue().unboxInt(); boolean isPic = (isPicVal == 0 ? false : true); files.add(new UstDebugInfoBinaryFile(filePath, buildId, isPic)); } catch (AttributeNotFoundException e) { throw new IllegalStateException("Missing expected \"isPic\" attribute"); } catch (StateSystemDisposedException e) { } } } return files; }

Target:
public Collection<UstDebugInfoBinaryFile> getAllBinaries() { waitForCompletion(); ITmfStateSystem ss = checkNotNull(getStateSystem()); Set<UstDebugInfoBinaryFile> files = new TreeSet<>(); ImmutableList.Builder<Integer> builder = ImmutableList.builder(); List<Integer> vpidQuarks = ss.getSubAttributes(-1, false); for (Integer vpidQuark : vpidQuarks) { builder.addAll(ss.getSubAttributes(vpidQuark, false)); } List<Integer> baddrQuarks = builder.build(); for (Integer baddrQuark : baddrQuarks) { List<Integer> buildIdQuarks = ss.getSubAttributes(baddrQuark, false); for (Integer buildIdQuark : buildIdQuarks) { String buildId = ss.getAttributeName(buildIdQuark); ITmfStateInterval interval = StateSystemUtils.queryUntilNonNullValue(ss, buildIdQuark, ss.getStartTime(), Long.MAX_VALUE); if (interval == null) { throw new IllegalStateException(); } String filePath = interval.getStateValue().unboxStr(); try { int isPicQuark = ss.getQuarkRelative(buildIdQuark, UstDebugInfoStateProvider.IS_PIC_ATTRIB); int isPicVal = ss.querySingleState(interval.getStartTime(), isPicQuark).getStateValue().unboxInt(); boolean isPic = (isPicVal != 0); files.add(new UstDebugInfoBinaryFile(filePath, buildId, isPic)); } catch (AttributeNotFoundException e) { throw new IllegalStateException("Missing expected \"is_pic\" attribute"); } catch (StateSystemDisposedException e) { } } } return files; }
Source:
protected synchronized CDOLockState[] getLockStates(Collection<CDOID> ids, boolean loadOnDemand) { List<CDOID> missing = new LinkedList<CDOID>(); List<CDOLockState> lockStates = new LinkedList<CDOLockState>(); for (CDOID id : ids) { CDOLockState lockState = null; InternalCDOObject obj = getObject(id, false); if (obj != null) { lockState = this.lockStates.get(obj); } if (lockState != null) { lockStates.add(lockState); } else { missing.add(id); } } if (loadOnDemand && (missing.size() > 0 || ids.isEmpty())) { CDOSessionProtocol sessionProtocol = session.getSessionProtocol(); CDOLockState[] loadedLockStates = sessionProtocol.getLockStates(viewID, missing); List<CDOLockState> newLockStateForCache = new ArrayList<CDOLockState>(loadedLockStates.length + missing.size()); for (CDOLockState loadedLockState : loadedLockStates) { lockStates.add(loadedLockState); newLockStateForCache.add(loadedLockState); CDOID cdoID = CDOIDUtil.getCDOID(loadedLockState.getLockedObject()); if (cdoID != null) { missing.remove(cdoID); } } for (CDOID missingLockStateForCDOID : missing) { CDOLockState defaultLockState = CDOLockUtil.createLockState(missingLockStateForCDOID); lockStates.add(defaultLockState); newLockStateForCache.add(defaultLockState); } if (options().isLockNotificationEnabled()) { updateLockStates(newLockStateForCache.toArray(new CDOLockState[loadedLockStates.length + missing.size()])); } } return lockStates.toArray(new CDOLockState[lockStates.size()]); }

Target:
protected synchronized CDOLockState[] getLockStates(Collection<CDOID> ids, boolean loadOnDemand) { List<CDOID> missing = new LinkedList<CDOID>(); List<CDOLockState> lockStates = new LinkedList<CDOLockState>(); for (CDOID id : ids) { CDOLockState lockState = null; InternalCDOObject obj = getObject(id, false); if (obj != null) { lockState = this.lockStates.get(obj); } if (lockState != null) { lockStates.add(lockState); } else { missing.add(id); } } if (loadOnDemand && (missing.size() > 0 || ids.isEmpty())) { CDOSessionProtocol sessionProtocol = session.getSessionProtocol(); CDOLockState[] loadedLockStates = sessionProtocol.getLockStates(viewID, missing); List<CDOLockState> newLockStateForCache = new ArrayList<CDOLockState>(loadedLockStates.length + missing.size()); for (CDOLockState loadedLockState : loadedLockStates) { lockStates.add(loadedLockState); newLockStateForCache.add(loadedLockState); CDOID cdoID = CDOIDUtil.getCDOID(loadedLockState.getLockedObject()); if (cdoID != null) { missing.remove(cdoID); } } for (CDOID missingLockStateForCDOID : missing) { CDOLockState defaultLockState = CDOLockUtil.createLockState(missingLockStateForCDOID); lockStates.add(defaultLockState); newLockStateForCache.add(defaultLockState); } if (options().isLockNotificationEnabled()) { updateLockStates(newLockStateForCache.toArray(new CDOLockState[newLockStateForCache.size()])); } } return lockStates.toArray(new CDOLockState[lockStates.size()]); }
Source:
public void registerDefaults() { Comparator<ItemStack> TYPE = Comparator.comparing(i -> i.getType().getId()); this.comparators.put("TYPE", TYPE); Comparator<ItemStack> SIZE = Comparator.comparing(ItemStack::getQuantity); this.comparators.put("SIZE", SIZE); Comparator<ItemStack> TYPE_SIZE = TYPE.thenComparing(SIZE); this.comparators.put("TYPE_SIZE", TYPE_SIZE); this.comparators.put("DEFAULT", TYPE_SIZE); Properties PROPERTIES = new Properties(); this.comparators.put("PROPERTIES", PROPERTIES); ItemDataComparator ITEM_DATA = new ItemDataComparator(); this.comparators.put("ITEM_DATA", ITEM_DATA); this.comparators.put("ITEM_DATA_IGNORE_DAMAGE", new ItemDataComparator(DamageableData.class)); this.comparators.put("IGNORE_SIZE", TYPE.thenComparing(PROPERTIES).thenComparing(ITEM_DATA)); this.comparators.put("ALL", TYPE.thenComparing(SIZE).thenComparing(PROPERTIES).thenComparing(ITEM_DATA)); }

Target:
public void registerDefaults() { Comparator<ItemStack> type = Comparator.comparing(i -> i.getType().getId()); this.comparators.put("TYPE", type); Comparator<ItemStack> size = Comparator.comparing(ItemStack::getQuantity); this.comparators.put("SIZE", size); Comparator<ItemStack> typeSize = type.thenComparing(size); this.comparators.put("TYPE_SIZE", typeSize); this.comparators.put("DEFAULT", typeSize); Properties properties = new Properties(); this.comparators.put("PROPERTIES", properties); ItemDataComparator itemData = new ItemDataComparator(); this.comparators.put("ITEM_DATA", itemData); this.comparators.put("ITEM_DATA_IGNORE_DAMAGE", new ItemDataComparator(DamageableData.class)); this.comparators.put("IGNORE_SIZE", type.thenComparing(properties).thenComparing(itemData)); this.comparators.put("ALL", type.thenComparing(size).thenComparing(properties).thenComparing(itemData)); }
Source:
public void initialize() { logger.info("Initializing ..."); peerEurekaNodes.start(); try { registry.init(peerEurekaNodes); } catch (Exception e) { logger.error("Error occurred while initializing registry", e); } logger.info("Initialized"); }

Target:
public void initialize() { logger.info("Initializing ..."); peerEurekaNodes.start(); try { registry.init(peerEurekaNodes); } catch (Exception e) { throw new RuntimeException(e); } logger.info("Initialized"); }
Source:
public Analysis analyze(Statement statement, boolean isDescribe) { Statement rewrittenStatement = StatementRewrite.rewrite(session, metadata, sqlParser, queryExplainer, statement, parameters, accessControl); Analysis analysis = new Analysis(rewrittenStatement, parameters, isDescribe); StatementAnalyzer analyzer = new StatementAnalyzer(analysis, metadata, sqlParser, accessControl, session); analyzer.analyze(rewrittenStatement, Optional.empty()); analysis.getTableColumnReferences().forEach((identity, tableColumnReferences) -> { AccessControl identityAccessControl = identity.equals(session.getIdentity()) ? accessControl : new ViewAccessControl(accessControl); tableColumnReferences.forEach((tableName, columns) -> identityAccessControl.checkCanSelectFromColumns(session.getRequiredTransactionId(), identity, tableName, ImmutableSet.copyOf(columns))); }); return analysis; }

Target:
public Analysis analyze(Statement statement, boolean isDescribe) { Statement rewrittenStatement = StatementRewrite.rewrite(session, metadata, sqlParser, queryExplainer, statement, parameters, accessControl); Analysis analysis = new Analysis(rewrittenStatement, parameters, isDescribe); StatementAnalyzer analyzer = new StatementAnalyzer(analysis, metadata, sqlParser, accessControl, session); analyzer.analyze(rewrittenStatement, Optional.empty()); analysis.getTableColumnReferences().forEach((accessControlInfo, tableColumnReferences) -> tableColumnReferences.forEach((tableName, columns) -> accessControlInfo.getAccessControl().checkCanSelectFromColumns( session.getRequiredTransactionId(), accessControlInfo.getIdentity(), tableName, columns))); return analysis; }
Source:
public SlotCollection getSlots() { return slots; }

Target:
public SlotCollection getSlots() { return this.slots; }
Source:
public FilterSupportStatus isFilterSupported(FilterAdapterContext context, org.apache.hadoop.hbase.filter.RowFilter filter) { ByteArrayComparable comparator = filter.getComparator(); if (!(comparator instanceof RegexStringComparator) && !(comparator instanceof BinaryComparator)) { return FilterSupportStatus.newNotSupported(comparator.getClass().getName() + " comparators are not supported"); } CompareOp operator = filter.getOperator(); if (operator != CompareFilter.CompareOp.EQUAL && operator != CompareFilter.CompareOp.NO_OP) { return FilterSupportStatus.newNotSupported(operator + " operators are not supported"); } return FilterSupportStatus.SUPPORTED; }

Target:
public FilterSupportStatus isFilterSupported( FilterAdapterContext context, org.apache.hadoop.hbase.filter.RowFilter filter) { ByteArrayComparable comparator = filter.getComparator(); if (!(comparator instanceof RegexStringComparator) && !(comparator instanceof BinaryComparator)) { return FilterSupportStatus.newNotSupported(comparator.getClass().getName() + " comparator is not supported"); } if (filter.getOperator() != CompareFilter.CompareOp.EQUAL) { return FilterSupportStatus.newNotSupported(filter.getOperator() + " operator is not supported"); } return FilterSupportStatus.SUPPORTED; }
Source:
public void ensureInputVisible() { scrollIntoViewPending_ = true; Scheduler.get().scheduleDeferred(() -> checkForPendingScroll()); }

Target:
public void ensureInputVisible() { if (!scrollIntoViewPending_) { scrollIntoViewPending_ = true; Scheduler.get().scheduleDeferred(() -> checkForPendingScroll()); } }
Source:
private List<Map<String, Object>> convertJSONObjectToSiteList(JSONObject jsonObject, boolean keepJetpackSites) { List<Map<String, Object>> sites = new ArrayList<Map<String, Object>>(); JSONArray jsonSites = jsonObject.optJSONArray("sites"); if (jsonSites != null) { for (int i = 0; i < jsonSites.length(); i++) { JSONObject jsonSite = jsonSites.optJSONObject(i); Map<String, Object> site = new HashMap<String, Object>(); try { if (jsonSite.getBoolean("jetpack") && !keepJetpackSites) { continue; } site.put("blogName", jsonSite.get("name")); site.put("url", jsonSite.get("URL")); site.put("blogid", jsonSite.get("ID")); site.put("isAdmin", jsonSite.get("user_can_manage")); site.put("isVisible", jsonSite.get("visible")); site.put("capabilities", jsonSite.get("capabilities").toString()); JSONObject plan = jsonSite.getJSONObject("plan"); site.put("planID", plan.get("product_id")); site.put("plan_product_name_short", plan.get("product_name_short")); JSONObject jsonLinks = JSONUtils.getJSONChild(jsonSite, "meta/links"); if (jsonLinks != null) { site.put("xmlrpc", jsonLinks.getString("xmlrpc")); sites.add(site); } else { AppLog.e(T.NUX, "xmlrpc links missing from the me/sites REST response"); } } catch (JSONException e) { AppLog.e(T.NUX, e); } } } return sites; }

Target:
private List<Map<String, Object>> convertJSONObjectToSiteList(JSONObject jsonObject, boolean keepJetpackSites) { List<Map<String, Object>> sites = new ArrayList<Map<String, Object>>(); JSONArray jsonSites = jsonObject.optJSONArray("sites"); if (jsonSites != null) { for (int i = 0; i < jsonSites.length(); i++) { JSONObject jsonSite = jsonSites.optJSONObject(i); Map<String, Object> site = new HashMap<String, Object>(); try { if (jsonSite.getBoolean("jetpack") && !keepJetpackSites) { continue; } site.put("blogName", jsonSite.get("name")); site.put("url", jsonSite.get("URL")); site.put("blogid", jsonSite.get("ID")); site.put("isAdmin", jsonSite.get("user_can_manage")); site.put("isVisible", jsonSite.get("visible")); site.put("capabilities", jsonSite.getString("capabilities")); JSONObject plan = jsonSite.getJSONObject("plan"); site.put("planID", plan.get("product_id")); site.put("plan_product_name_short", plan.get("product_name_short")); JSONObject jsonLinks = JSONUtils.getJSONChild(jsonSite, "meta/links"); if (jsonLinks != null) { site.put("xmlrpc", jsonLinks.getString("xmlrpc")); sites.add(site); } else { AppLog.e(T.NUX, "xmlrpc links missing from the me/sites REST response"); } } catch (JSONException e) { AppLog.e(T.NUX, e); } } } return sites; }
Source:
public static RevCommit getCommonAncestor(Repository repo, AnyObjectId commit1, AnyObjectId commit2) throws IOException { RevWalk rw = new RevWalk(repo); rw.setRevFilter(RevFilter.MERGE_BASE); RevCommit srcRev = lookupCommit(rw, commit1); RevCommit dstRev = lookupCommit(rw, commit2); if (dstRev != null) rw.markStart(dstRev); if (srcRev != null) rw.markStart(srcRev); RevCommit result; result = rw.next(); return result != null ? result : null; }

Target:
public static RevCommit getCommonAncestor(Repository repo, AnyObjectId commit1, AnyObjectId commit2) throws IOException { Assert.isNotNull(repo); Assert.isNotNull(commit1); Assert.isNotNull(commit2); RevWalk rw = new RevWalk(repo); rw.setRevFilter(RevFilter.MERGE_BASE); RevCommit srcRev = rw.lookupCommit(commit1); RevCommit dstRev = rw.lookupCommit(commit2); rw.markStart(dstRev); rw.markStart(srcRev); RevCommit result; result = rw.next(); return result != null ? result : null; }
Source:
public void setDefaultInterface() { Guid vmId = getVmId(); if (!Guid.isNullOrEmpty(vmId)) { getDiskInterface().setSelectedItem(getDisk().getDiskVmElementForVm(vmId).getDiskInterface()); } else { getDiskInterface().setSelectedItem(DiskInterface.VirtIO); } }

Target:
public void setDefaultInterface() { Guid vmId = getVmId(); if (Guid.isNullOrEmpty(vmId)) { getDiskInterface().setSelectedItem(DiskInterface.VirtIO); } else { getDiskInterface().setSelectedItem(getDisk().getDiskVmElementForVm(vmId).getDiskInterface()); } }