auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private List<InitialStop> findIntermodalStops(Facility facility, Person person, double departureTime, Direction direction, RaptorParameters parameters, SwissRailRaptorData data) { SwissRailRaptorConfigGroup srrCfg = parameters.getConfig(); double x = facility.getCoord().getX(); double y = facility.getCoord().getY(); List<InitialStop> initialStops = new ArrayList<>(); switch (srrCfg.getIntermodalAccessEgressModeSelection()) { case CalcLeastCostModePerStop: for (IntermodalAccessEgressParameterSet parameterSet : srrCfg.getIntermodalAccessEgressParameterSets()) { addInitialStopsForParamSet(facility, person, departureTime, direction, parameters, data, x, y, initialStops, parameterSet); } break; case RandomSelectOneModePerRoutingRequestAndDirection: int counter = 0; do { int rndSelector = (int) (MatsimRandom.getRandom().nextDouble() * srrCfg.getIntermodalAccessEgressParameterSets().size()); addInitialStopsForParamSet(facility, person, departureTime, direction, parameters, data, x, y, initialStops, srrCfg.getIntermodalAccessEgressParameterSets().get(rndSelector)); counter++; } while (initialStops.isEmpty() && counter < 2 * srrCfg.getIntermodalAccessEgressParameterSets().size()); break; default: throw new RuntimeException(srrCfg.getIntermodalAccessEgressModeSelection() + " : not implemented!"); } return initialStops; }

Target:
private List<InitialStop> findIntermodalStops(Facility facility, Person person, double departureTime, Direction direction, RaptorParameters parameters, SwissRailRaptorData data) { SwissRailRaptorConfigGroup srrCfg = parameters.getConfig(); double x = facility.getCoord().getX(); double y = facility.getCoord().getY(); List<InitialStop> initialStops = new ArrayList<>(); switch (srrCfg.getIntermodalAccessEgressModeSelection()) { case CalcLeastCostModePerStop: for (IntermodalAccessEgressParameterSet parameterSet : srrCfg.getIntermodalAccessEgressParameterSets()) { addInitialStopsForParamSet(facility, person, departureTime, direction, parameters, data, x, y, initialStops, parameterSet); } break; case RandomSelectOneModePerRoutingRequestAndDirection: int counter = 0; do { int rndSelector = random.nextInt(srrCfg.getIntermodalAccessEgressParameterSets().size()); addInitialStopsForParamSet(facility, person, departureTime, direction, parameters, data, x, y, initialStops, srrCfg.getIntermodalAccessEgressParameterSets().get(rndSelector)); counter++; } while (initialStops.isEmpty() && counter < 2 * srrCfg.getIntermodalAccessEgressParameterSets().size()); break; default: throw new RuntimeException(srrCfg.getIntermodalAccessEgressModeSelection() + " : not implemented!"); } return initialStops; }
Source:
private Set<String> validateJobId(final Job job) { final Set<String> errors = Sets.newHashSet(); final JobId jobId = job.getId(); final JobId recomputedId = job.toBuilder().build().getId(); if (jobId == null) { errors.add(format("Job id was not specified.")); } else { final String jobIdName = jobId.getName(); if (jobIdName == null || jobIdName.isEmpty()) { errors.add(format("Job name was not specified.")); } else { if (!NAME_VERSION_PATTERN.matcher(jobIdName).matches()) { errors.add(format("Job name may only contain [0-9a-zA-Z-_.].")); } if (!recomputedId.getName().equals(jobIdName)) { errors.add(format("Id name mismatch: %s != %s", jobIdName, recomputedId.getName())); } } final String jobIdVersion = jobId.getVersion(); if (jobIdVersion == null || jobIdVersion.isEmpty()) { errors.add(format("Job version was not specified.")); } else { if (!NAME_VERSION_PATTERN.matcher(jobIdVersion).matches()) { errors.add(format("Job version may only contain [0-9a-zA-Z-_.].")); } if (!recomputedId.getVersion().equals(jobIdVersion)) { errors.add(format("Id version mismatch: %s != %s", jobIdVersion, recomputedId.getVersion())); } } final String jobIdHash = jobId.getHash(); if (jobIdHash == null || jobIdHash.isEmpty()) { errors.add(format("Job hash was not specified.")); } else { if (jobIdHash.indexOf(':') != -1) { errors.add(format("Job hash contains colon.")); } if (!recomputedId.getHash().equals(jobIdHash)) { errors.add(format("Id hash mismatch: %s != %s", jobIdHash, recomputedId.getHash())); } } } return errors; }

Target:
private Set<String> validateJobId(final Job job) { final Set<String> errors = Sets.newHashSet(); final JobId jobId = job.getId(); final String jobIdVersion = jobId.getVersion(); final String jobIdHash = jobId.getHash(); final JobId recomputedId = job.toBuilder().build().getId(); if (jobId == null) { errors.add(format("Job id was not specified.")); return errors; } errors.addAll(validateJobName(jobId, recomputedId)); errors.addAll(validateJobVersion(jobIdVersion, recomputedId)); errors.addAll(validateJobHash(jobIdHash, recomputedId)); return errors; }
Source:
private LookupSourceFactory buildHash( boolean parallelBuild, TaskContext taskContext, List<Integer> hashChannels, RowPagesBuilder buildPages, Optional<InternalJoinFilterFunction> filterFunction) { BuildSideSetup buildSideSetup = setupBuildSide(parallelBuild, taskContext, hashChannels, buildPages, filterFunction); buildLookupSource(buildSideSetup); return buildSideSetup.lookupSourceFactory; }

Target:
private LookupSourceFactory buildHash( boolean parallelBuild, TaskContext taskContext, List<Integer> hashChannels, RowPagesBuilder buildPages, Optional<InternalJoinFilterFunction> filterFunction) { BuildSideSetup buildSideSetup = setupBuildSide(parallelBuild, taskContext, hashChannels, buildPages, filterFunction, false, SINGLE_STREAM_SPILLER_FACTORY); buildLookupSource(buildSideSetup); return buildSideSetup.getLookupSourceFactory(); }
Source:
public static WebArchive createTestArchive() { return ShrinkWrap.create(WebArchive.class, "transactional-test.war") .addPackage(TransactionalChangedByExtensionTest.class.getPackage()) .addClass(Transactional.class) .addAsWebInfResource( new StringAsset("com.hp.mwtests.ts.jta.cdi.transactional.stereotype.extension.AddTransactionalAnnotationExtension"), "classes/META-INF/services/javax.enterprise.inject.spi.Extension") .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); }

Target:
public static WebArchive createTestArchive() { return ShrinkWrap.create(WebArchive.class, "transactional-test.war") .addPackage(TransactionalChangedByExtensionTest.class.getPackage()) .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml") .addAsServiceProvider(javax.enterprise.inject.spi.Extension.class, AddTransactionalAnnotationExtension.class); }
Source:
public Assignment apply(Task task, TaskContext taskContext, String excludedUser) { List<OrganizationalEntity> excluded = ((InternalPeopleAssignments)task.getPeopleAssignments()).getExcludedOwners(); UserInfo userInfo = (UserInfo) ((org.jbpm.services.task.commands.TaskContext)taskContext).get(EnvironmentName.TASK_USER_INFO); List<OrganizationalEntity> potentialOwners = task.getPeopleAssignments().getPotentialOwners().stream() .filter(oe -> oe instanceof User && !excluded.contains(oe)) .collect(Collectors.toList()); task.getPeopleAssignments().getPotentialOwners().stream().filter(oe -> oe instanceof Group) .forEach(oe -> { Iterator<OrganizationalEntity> groupUsers = userInfo.getMembersForGroup((Group)oe); if (groupUsers != null) { groupUsers.forEachRemaining(user -> { if (user != null && !excluded.contains(user) && !potentialOwners.contains(user)) { potentialOwners.add(user); } }); } }); logger.info("Asking the load calculator for task loads for the users {}",calculator.getIdentifier(),potentialOwners); List<User> users = potentialOwners.stream().map(entityToUser).collect(Collectors.toList()); Collection<UserTaskLoad> loads = calculator.getUserTaskLoads(users, taskContext); UserTaskLoad lightestLoad = loads.stream().min(UserTaskLoad::compareTo).orElse(null); return lightestLoad != null ? new Assignment(lightestLoad.getUser().getId()):null; }

Target:
public Assignment apply(Task task, TaskContext taskContext, String excludedUser) { List<OrganizationalEntity> excluded = ((InternalPeopleAssignments)task.getPeopleAssignments()).getExcludedOwners(); UserInfo userInfo = (UserInfo) ((org.jbpm.services.task.commands.TaskContext)taskContext).get(EnvironmentName.TASK_USER_INFO); List<OrganizationalEntity> potentialOwners = task.getPeopleAssignments().getPotentialOwners().stream() .filter(oe -> oe instanceof User && !excluded.contains(oe) && !oe.getId().equals(excludedUser)) .collect(Collectors.toList()); task.getPeopleAssignments().getPotentialOwners().stream().filter(oe -> oe instanceof Group) .forEach(oe -> { Iterator<OrganizationalEntity> groupUsers = userInfo.getMembersForGroup((Group)oe); if (groupUsers != null) { groupUsers.forEachRemaining(user -> { if (user != null && !excluded.contains(user) && !potentialOwners.contains(user) && !user.getId().equals(excludedUser)) { potentialOwners.add(user); } }); } }); logger.debug("Asking the load calculator for task loads for the users {}",calculator.getIdentifier(),potentialOwners); List<User> users = potentialOwners.stream().map(entityToUser).collect(Collectors.toList()); Collection<UserTaskLoad> loads = calculator.getUserTaskLoads(users, taskContext); UserTaskLoad lightestLoad = loads.stream().min(UserTaskLoad::compareTo).orElse(null); return lightestLoad != null ? new Assignment(lightestLoad.getUser().getId()):null; }
Source:
public void endVist_shouldSetTheStopDateTimeOfVisit() { Visit visit = visitService.getVisit(1); assertNull(visit.getStopDatetime()); Date date = new Date(); visitService.endVisit(visit, date); }

Target:
public void endVist_shouldSetTheStopDateTimeOfVisit() throws ParseException { executeDataSet(VISITS_ATTRIBUTES_XML); Visit visit = visitService.getVisit(1); assertNull(visit.getStopDatetime()); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date date = dateFormat.parse("2019-09-16 00:00:00"); visit.setStopDatetime(date); visitService.endVisit(visit, visit.getStopDatetime()); }
Source:
public void testGetBlogTags() { JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID); List jsonList = previewPage.getJsonList(); Assert.assertFalse("GetPublicActivityStream returned no results", jsonList.isEmpty()); }

Target:
public void testGetBlogTags() { JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID); List jsonList = previewPage.getJsonList(); Assert.assertFalse("GetBlogTags returned no results", jsonList.isEmpty()); }
Source:
public void triggerPoolMonitoringJob() { try { poolMonitoringJob.cancel(true); } catch (Throwable t) { log.debug("Exception cancelling existing job: {}", ExceptionUtils.getRootCauseMessage(t)); } poolMonitoringJob = schedulerService.scheduleWithFixedDelay( this::managePrestartedVmsInAllVmPools, 0, vmPoolMonitorIntervalInMinutes, TimeUnit.MINUTES); }

Target:
public void triggerPoolMonitoringJob() { try { poolMonitoringJob.cancel(false); } catch (Throwable t) { log.debug("Exception cancelling existing job: {}", ExceptionUtils.getRootCauseMessage(t)); } poolMonitoringJob = schedulerService.scheduleWithFixedDelay( this::managePrestartedVmsInAllVmPools, 0, vmPoolMonitorIntervalInMinutes, TimeUnit.MINUTES); }
Source:
public static boolean isKeepAlive(HttpMessage message) { boolean connectionClose = message.headers().containsValue(HttpHeaderNames.CONNECTION, HttpHeaderValues.CLOSE, true); if (connectionClose) { return false; } if (message.protocolVersion().isKeepAliveDefault()) { return !connectionClose; } else { return message.headers().containsValue(HttpHeaderNames.CONNECTION, HttpHeaderValues.KEEP_ALIVE, true); } }

Target:
public static boolean isKeepAlive(HttpMessage message) { return !message.headers().containsValue(HttpHeaderNames.CONNECTION, HttpHeaderValues.CLOSE, true) && (message.protocolVersion().isKeepAliveDefault() || message.headers().containsValue(HttpHeaderNames.CONNECTION, HttpHeaderValues.KEEP_ALIVE, true)); }
Source:
private static URL toURL(File f) { try { return f.toURI().toURL(); } catch (MalformedURLException e) { throw new IllegalStateException(e); } }

Target:
private static URL toURL(File f) { try { return f.toURI().toURL(); } catch (MalformedURLException e) { throw new IllegalArgumentException(e); } }
Source:
CorfuRecord<V, M> update(@Nonnull final K key, @Nonnull final V value, @Nullable final M metadata) { boolean beganNewTxn = false; try { beganNewTxn = TxBegin(); return corfuTable.put(key, new CorfuRecord<>(value, metadata)); } finally { if (beganNewTxn) { TxEnd(); } } }

Target:
CorfuRecord<V, M> update(@Nonnull final K key, @Nonnull final V value, @Nullable final M metadata) { boolean beganNewTxn = false; try { beganNewTxn = TxBegin(); M newMetadata = null; if (metadataOptions.isMetadataEnabled()) { if (metadata == null) { throw new RuntimeException("Table::update needs non-null metadata"); } CorfuRecord<V, M> previous = corfuTable.get(key); M previousMetadata = Optional.ofNullable(previous) .map(CorfuRecord::getMetadata) .orElse((M)metadataOptions.getDefaultMetadataInstance()); validateVersion(previousMetadata, metadata); newMetadata = getNewMetadata(previousMetadata, metadata); } return corfuTable.put(key, new CorfuRecord<>(value, newMetadata)); } finally { if (beganNewTxn) { TxEnd(); } } }
Source:
public GridMetricManager(GridKernalContext ctx) { super(ctx, ctx.config().getMetricExporterSpi()); ctx.addNodeAttribute(ATTR_PHY_RAM, totalSysMemory()); heap = new MemoryUsageMetrics(SYS_METRICS, metricName("memory", "heap")); nonHeap = new MemoryUsageMetrics(SYS_METRICS, metricName("memory", "nonheap")); heap.update(mem.getHeapMemoryUsage()); nonHeap.update(mem.getNonHeapMemoryUsage()); MetricRegistry sysreg = registry(SYS_METRICS); gcCpuLoad = sysreg.doubleMetric(GC_CPU_LOAD, "GC CPU load."); cpuLoad = sysreg.doubleMetric(CPU_LOAD, "CPU load."); sysreg.register("SystemLoadAverage", os::getSystemLoadAverage, Double.class, null); sysreg.register(UP_TIME, rt::getUptime, null); sysreg.register(THREAD_CNT, threads::getThreadCount, null); sysreg.register(PEAK_THREAD_CNT, threads::getPeakThreadCount, null); sysreg.register(TOTAL_STARTED_THREAD_CNT, threads::getTotalStartedThreadCount, null); sysreg.register(DAEMON_THREAD_CNT, threads::getDaemonThreadCount, null); sysreg.register("CurrentThreadCpuTime", threads::getCurrentThreadCpuTime, null); sysreg.register("CurrentThreadUserTime", threads::getCurrentThreadUserTime, null); HistogramMetric cacheOperationsBlockedDurationHistogram = new HistogramMetric(CACHE_OPERATIONS_BLOCKED_DURATION_HISTOGRAM, "Histogram of cache operations blocked duration in milliseconds.", getDurationHistogramBounds()); sysreg.register(cacheOperationsBlockedDurationHistogram); }

Target:
public GridMetricManager(GridKernalContext ctx) { super(ctx, ctx.config().getMetricExporterSpi()); ctx.addNodeAttribute(ATTR_PHY_RAM, totalSysMemory()); heap = new MemoryUsageMetrics(SYS_METRICS, metricName("memory", "heap")); nonHeap = new MemoryUsageMetrics(SYS_METRICS, metricName("memory", "nonheap")); heap.update(mem.getHeapMemoryUsage()); nonHeap.update(mem.getNonHeapMemoryUsage()); MetricRegistry sysreg = registry(SYS_METRICS); gcCpuLoad = sysreg.doubleMetric(GC_CPU_LOAD, "GC CPU load."); cpuLoad = sysreg.doubleMetric(CPU_LOAD, "CPU load."); sysreg.register("SystemLoadAverage", os::getSystemLoadAverage, Double.class, null); sysreg.register(UP_TIME, rt::getUptime, null); sysreg.register(THREAD_CNT, threads::getThreadCount, null); sysreg.register(PEAK_THREAD_CNT, threads::getPeakThreadCount, null); sysreg.register(TOTAL_STARTED_THREAD_CNT, threads::getTotalStartedThreadCount, null); sysreg.register(DAEMON_THREAD_CNT, threads::getDaemonThreadCount, null); sysreg.register("CurrentThreadCpuTime", threads::getCurrentThreadCpuTime, null); sysreg.register("CurrentThreadUserTime", threads::getCurrentThreadUserTime, null); MetricRegistry pmeReg = registry(PME_METRICS); long[] pmeBounds = new long[] {500, 1000, 5000, 30000}; pmeReg.histogram(PME_DURATION_HISTOGRAM, pmeBounds, "Histogram of PME durations in milliseconds."); pmeReg.histogram(PME_OPS_BLOCKED_DURATION_HISTOGRAM, pmeBounds, "Histogram of cache operations blocked PME durations in milliseconds."); }
Source:
protected boolean approveRequest(IEditCommandRequest request) { boolean result = super.approveRequest(request); if (!result) { if (request instanceof CreateElementRequest) { Object context = request.getEditHelperContext(); if (context instanceof EObject) { EObject owner = (EObject) context; EReference reference = getContainmentFeature((CreateElementRequest) request); if (reference != null && reference.getEContainingClass() == null) { return false; } if ((reference != null) && reference.getEContainingClass().isSuperTypeOf(owner.eClass()) && !reference.isContainment()) { for (EReference next : UmlUtils.getSupersets(reference)) { if (next.isContainment()) { result = true; break; } } } } } } return result; }

Target:
protected boolean approveRequest(IEditCommandRequest request) { boolean result = super.approveRequest(request); if (!result) { if (request instanceof CreateElementRequest) { Object context = request.getEditHelperContext(); if (context instanceof EObject) { EObject owner = (EObject) context; EReference reference = getContainmentFeature((CreateElementRequest) request); if (reference != null && reference.getEContainingClass() != null && reference.getEContainingClass().isSuperTypeOf(owner.eClass()) && !reference.isContainment()) { for (EReference next : UmlUtils.getSupersets(reference)) { if (next.isContainment()) { result = true; break; } } } } } } return result; }
Source:
public int hashCode() { int result = (_networkAcl ? 1 : 0); result = 31 * result + (_networkUuid != null ? _networkUuid.hashCode() : 0); result = 31 * result + (_networkDomainUuid != null ? _networkDomainUuid.hashCode() : 0); result = 31 * result + (_vpcOrSubnetUuid != null ? _vpcOrSubnetUuid.hashCode() : 0); result = 31 * result + (_networkName != null ? _networkName.hashCode() : 0); result = 31 * result + (_isL2Network ? 1 : 0); result = 31 * result + (_aclRules != null ? _aclRules.hashCode() : 0); result = 31 * result + (int) (_networkId ^ (_networkId >>> 32)); result = 31 * result + (_egressDefaultPolicy ? 1 : 0); result = 31 * result + (_acsIngressAcl != null ? _acsIngressAcl.hashCode() : 0); result = 31 * result + (_networkReset ? 1 : 0); result = 31 * result + (_domainTemplateName != null ? _domainTemplateName.hashCode() : 0); return result; }

Target:
public int hashCode() { int result = super.hashCode(); result = 31 * result + (_networkAcl ? 1 : 0); result = 31 * result + (_networkUuid != null ? _networkUuid.hashCode() : 0); result = 31 * result + (_networkDomainUuid != null ? _networkDomainUuid.hashCode() : 0); result = 31 * result + (_vpcOrSubnetUuid != null ? _vpcOrSubnetUuid.hashCode() : 0); result = 31 * result + (_networkName != null ? _networkName.hashCode() : 0); result = 31 * result + (_isL2Network ? 1 : 0); result = 31 * result + (_aclRules != null ? _aclRules.hashCode() : 0); result = 31 * result + (int) (_networkId ^ (_networkId >>> 32)); result = 31 * result + (_egressDefaultPolicy ? 1 : 0); result = 31 * result + (_acsIngressAcl != null ? _acsIngressAcl.hashCode() : 0); result = 31 * result + (_networkReset ? 1 : 0); result = 31 * result + (_domainTemplateName != null ? _domainTemplateName.hashCode() : 0); return result; }
Source:
public void write( @Nonnull Writer writer, @Nonnull Server server, @Nonnull Query query, @Nonnull Iterable<Result> results) throws IOException { try ( JsonGenerator g = jsonFactory.createGenerator(writer); ) { g.useDefaultPrettyPrinter(); g.writeStartObject(); g.writeStringField("request", "sender data"); g.writeArrayFieldStart("data"); for (Result result : results) { log.debug("Query result: {}", result); String zabbixHostName = server.getAlias() != null ? server.getAlias() : server.getHost(); String key = "jmxtrans." + KeyUtils.getKeyString(query, result, typeNames); Object value = result.getValue(); g.writeStartObject(); g.writeStringField("host", zabbixHostName); g.writeStringField("key", key); g.writeStringField("value", value.toString()); g.writeNumberField("clock", result.getEpoch() / 1000); g.writeEndObject(); } g.writeEndArray(); g.writeNumberField("clock", System.currentTimeMillis() / 1000); g.writeEndObject(); g.flush(); } }

Target:
public void write( @Nonnull Writer writer, @Nonnull Server server, @Nonnull Query query, @Nonnull Iterable<Result> results) throws IOException { try ( JsonGenerator g = jsonFactory.createGenerator(writer); ) { g.useDefaultPrettyPrinter(); g.writeStartObject(); g.writeStringField("request", "sender data"); g.writeArrayFieldStart("data"); for (Result result : results) { log.debug("Query result: {}", result); String key = "jmxtrans." + KeyUtils.getKeyString(query, result, typeNames); Object value = result.getValue(); g.writeStartObject(); g.writeStringField("host", server.getLabel()); g.writeStringField("key", key); g.writeStringField("value", value.toString()); g.writeNumberField("clock", result.getEpoch() / 1000); g.writeEndObject(); } g.writeEndArray(); g.writeNumberField("clock", System.currentTimeMillis() / 1000); g.writeEndObject(); g.flush(); } }
Source:
public MatchFilter[] getActiveMatchFilters() { MatchFilter[] result = super.getActiveMatchFilters(); if (result == null) { List<MatchFilter> filters = new ArrayList<>(); if (CUIPlugin.getDefault().getDialogSettings().getBoolean(KEY_SHOW_POLYMORPHIC_CALLS)) { filters.add(HidePolymorphicCalls.FILTER); } if (CUIPlugin.getDefault().getDialogSettings().getBoolean(KEY_HIDE_READ_ONLY_REFERENCES)) { filters.add(HideReadWriteReferences.READ_ONLY_FILTER); } if (CUIPlugin.getDefault().getDialogSettings().getBoolean(KEY_HIDE_WRITE_REFERENCES)) { filters.add(HideReadWriteReferences.WRITE_FILTER); } return filters.toArray(new MatchFilter[0]); } return result; }

Target:
public MatchFilter[] getActiveMatchFilters() { MatchFilter[] result = super.getActiveMatchFilters(); if (result == null) { List<MatchFilter> filters = new ArrayList<>(); if (CUIPlugin.getDefault().getDialogSettings().getBoolean(KEY_SHOW_POLYMORPHIC_CALLS)) { filters.add(HidePolymorphicCalls.FILTER); } if (CUIPlugin.getDefault().getDialogSettings().getBoolean(KEY_HIDE_READ_ONLY_REFERENCES)) { filters.add(HideReadOnlyReferences.READ_ONLY_FILTER); } return filters.toArray(new MatchFilter[filters.size()]); } return result; }
Source:
private NearbyPage constructNearbyPage(@NonNull String title, double lat, double lon) { Location location = new Location(title); location.setLatitude(lat); location.setLongitude(lon); return new NearbyPage(location); }

Target:
private NearbyPage constructNearbyPage(@NonNull String title, double lat, double lon) { Location location = new Location(""); location.setLatitude(lat); location.setLongitude(lon); return new NearbyPage(title, location); }
Source:
public void addInteraction(final IMockInteraction interaction) { interactions.add(new MockInteractionDecorator(interaction) { final int myRegistrationZone = currentRegistrationZone; @Override public Object accept(IMockInvocation invocation) { WrongInvocationOrderError wrongInvocationOrderError = null; if (currentExecutionZone > myRegistrationZone) { wrongInvocationOrderError = new WrongInvocationOrderError(decorated, invocation, previousInvocations); } currentExecutionZone = myRegistrationZone; if (previousInvocations.size() == MAX_PREVIOUS_INVOCATIONS) { previousInvocations.remove(); } previousInvocations.add(invocation); Object result = null; Throwable invocationException = null; try { result = super.accept(invocation); } catch (AssertionError | Exception e) { invocationException = e; } ExceptionUtil.throwWithSuppressed(invocationException, wrongInvocationOrderError); return result; } @Override public String describeMismatch(IMockInvocation invocation) { return interaction.describeMismatch(invocation); } }); }

Target:
public void addInteraction(final IMockInteraction interaction) { interactions.add(new MockInteractionDecorator(interaction) { final int myRegistrationZone = currentRegistrationZone; @Override public Object accept(IMockInvocation invocation) { WrongInvocationOrderError wrongInvocationOrderError = null; if (currentExecutionZone > myRegistrationZone) { wrongInvocationOrderError = new WrongInvocationOrderError(decorated, invocation, previousInvocationsInReverseOrder); } currentExecutionZone = myRegistrationZone; if (previousInvocationsInReverseOrder.size() == MAX_PREVIOUS_INVOCATIONS) { previousInvocationsInReverseOrder.removeLast(); } previousInvocationsInReverseOrder.addFirst(invocation); Object result = null; Throwable invocationException = null; try { result = super.accept(invocation); } catch (AssertionError | Exception e) { invocationException = e; } ExceptionUtil.throwWithSuppressed(invocationException, wrongInvocationOrderError); return result; } @Override public String describeMismatch(IMockInvocation invocation) { return interaction.describeMismatch(invocation); } }); }
Source:
private CoreEvent getRetryExhaustedEvent(CoreEvent exhaustionCauseEvent, Throwable retryExhaustedException) { ErrorBuilder errorBuilder = ErrorBuilder.builder(retryExhaustedException) .errorType(errorTypeLocator.lookupErrorType(retryExhaustedException)); exhaustionCauseEvent.getError().ifPresent(error -> errorBuilder.errors(Collections.singletonList(error))); return CoreEvent.builder(exhaustionCauseEvent).error(errorBuilder.build()).build(); }

Target:
private CoreEvent getRetryExhaustedEvent(CoreEvent exhaustionCauseEvent, Throwable retryExhaustedException) { ErrorBuilder errorBuilder = ErrorBuilder.builder(retryExhaustedException) .errorType(retryExhaustedErrorType); return CoreEvent.builder(exhaustionCauseEvent).error(errorBuilder.build()).build(); }
Source:
public ScriptExecutionException(String causeMessage) { super(ERROR_CODE, new RuntimeException(causeMessage)); }

Target:
public ScriptExecutionException(String causeMessage) { super(ERROR_CODE); this.causeMessage = requireNonNull(causeMessage); }
Source:
protected boolean executeAnalysis(IProgressMonitor monitor) throws TmfAnalysisException { ITmfTrace trace = checkNotNull(getTrace()); final @Nullable String dataFileName = getDataFileName(); if (dataFileName != null) { String dir = TmfTraceManager.getSupplementaryFileDir(trace); final Path file = Paths.get(dir, dataFileName); if (Files.exists(file)) { try (ObjectInputStream ois = new ObjectInputStream(Files.newInputStream(file))) { Object[] segmentArray = readObject(ois); final ISegmentStore<ISegment> store = new ArrayListStore<>(); for (Object element : segmentArray) { if (element instanceof ISegment) { ISegment segment = (ISegment) element; store.add(segment); } } fSegmentStore = store; sendUpdate(store); return true; } catch (IOException | ClassNotFoundException | ClassCastException e) { try { Files.delete(file); } catch (IOException e1) { } } } } ISegmentStore<ISegment> segmentStore = new TreeMapStore<>(); boolean completed = buildAnalysisSegments(segmentStore, monitor); if (!completed) { return false; } fSegmentStore = segmentStore; if (dataFileName != null) { String dir = TmfTraceManager.getSupplementaryFileDir(trace); final Path file = Paths.get(dir, dataFileName); try (ObjectOutputStream oos = new ObjectOutputStream(Files.newOutputStream(file))) { oos.writeObject(segmentStore.toArray()); } catch (IOException e) { } } sendUpdate(segmentStore); return true; }

Target:
protected boolean executeAnalysis(IProgressMonitor monitor) throws TmfAnalysisException { ITmfTrace trace = checkNotNull(getTrace()); final @Nullable String dataFileName = getDataFileName(); if (dataFileName != null) { String dir = TmfTraceManager.getSupplementaryFileDir(trace); final Path file = Paths.get(dir, dataFileName); if (Files.exists(file)) { try (ObjectInputStream ois = new ObjectInputStream(Files.newInputStream(file))) { Object[] segmentArray = readObject(ois); final ISegmentStore<ISegment> store = new ArrayListStore<>(); for (Object element : segmentArray) { if (element instanceof ISegment) { ISegment segment = (ISegment) element; store.add(segment); } } fSegmentStore = store; sendUpdate(store); return true; } catch (IOException | ClassNotFoundException | ClassCastException e) { try { Files.delete(file); } catch (IOException e1) { } } } } ISegmentStore<ISegment> segmentStore = new ArrayListStore<>(); boolean completed = buildAnalysisSegments(segmentStore, monitor); if (!completed) { return false; } fSegmentStore = segmentStore; if (dataFileName != null) { String dir = TmfTraceManager.getSupplementaryFileDir(trace); final Path file = Paths.get(dir, dataFileName); try (ObjectOutputStream oos = new ObjectOutputStream(Files.newOutputStream(file))) { oos.writeObject(segmentStore.toArray()); } catch (IOException e) { } } sendUpdate(segmentStore); return true; }
Source:
@Test public void testFilterAndProjectWithMultiJoin() throws Exception { final FilterMultiJoinMergeRule filterMultiJoinMergeRule = new FilterMultiJoinMergeRule(LogicalFilter.class, RelFactories.LOGICAL_BUILDER); final ProjectMultiJoinMergeRule projectMultiJoinMergeRule = new ProjectMultiJoinMergeRule(LogicalProject.class, RelFactories.LOGICAL_BUILDER); HepProgram program = new HepProgramBuilder() .addMatchOrder(HepMatchOrder.BOTTOM_UP) .addRuleInstance(JoinToMultiJoinRule.INSTANCE) .addRuleCollection(Arrays.asList(filterMultiJoinMergeRule, projectMultiJoinMergeRule)) .build(); checkPlanning(program, "select * from (select * from emp e1 left outer join dept d on e1.deptno = d.deptno " + "where d.deptno > 3) where ename LIKE 'bar'"); }

Target:
@Test public void testFilterAndProjectWithMultiJoin() throws Exception { final Tester tester = new TesterImpl(getDiffRepos(), false, false, true, false, null, null, SqlToRelConverter.Config.DEFAULT, SqlConformanceEnum.DEFAULT, Contexts.empty()); final HepProgram preProgram = new HepProgramBuilder() .addMatchOrder(HepMatchOrder.BOTTOM_UP) .addRuleCollection(Arrays.asList(MyFilterRule.INSTANCE, MyProjectRule.INSTANCE)) .build(); final FilterMultiJoinMergeRule filterMultiJoinMergeRule = new FilterMultiJoinMergeRule(MyFilter.class, RelFactories.LOGICAL_BUILDER); final ProjectMultiJoinMergeRule projectMultiJoinMergeRule = new ProjectMultiJoinMergeRule(MyProject.class, RelFactories.LOGICAL_BUILDER); HepProgram program = new HepProgramBuilder() .addMatchOrder(HepMatchOrder.BOTTOM_UP) .addRuleInstance(JoinToMultiJoinRule.INSTANCE) .addRuleCollection(Arrays.asList(filterMultiJoinMergeRule, projectMultiJoinMergeRule)) .build(); checkPlanning(tester, preProgram, new HepPlanner(program), "select * from (select * from emp e1 left outer join dept d on e1.deptno = d.deptno " + "where d.deptno > 3)", false); }
Source:
@Override public List<List<String>> lemmatize(List<String> toks, List<String> tags) { return null; }

Target:
public List<List<String>> lemmatize(List<String> toks, List<String> tags) { return null; }
Source:
private VariantSourceEntity getVariantSourceEntity() throws Exception { VariantStudy.StudyType studyType = VariantStudy.StudyType.COLLECTION; VariantSource.Aggregation aggregation = VariantSource.Aggregation.NONE; VcfHeaderReader headerReader = new VcfHeaderReader(new File(input), FILE_ID, STUDY_ID, STUDY_NAME, studyType, aggregation); return headerReader.read(); }

Target:
private VariantSourceEntity getVariantSourceEntity() throws Exception { VcfHeaderReader headerReader = new VcfHeaderReader(new File(input), FILE_ID, STUDY_ID, STUDY_NAME, STUDY_TYPE, AGGREGATION); return headerReader.read(); }
Source:
public void generateRandomAlphanumeric(String key) { if (!propertyStore.contains(key)) { propertyStore.put(key, RandomGenerator.generateRandomAlphanumeric(16)); } }

Target:
public void generateRandomAlphanumeric(String key) { propertyStore.put(key, RandomGenerator.generateRandomAlphanumeric(16)); }
Source:
public List<FailureInfo> getAllFailures(QueryGroup group) { return failures.get(group).stream() .map(exception -> new FailureInfo( exception.getQueryOrigin().getStage(), exception.getErrorCode(), exception.getQueryStats().map(QueryStats::getQueryId))) .collect(toImmutableList()); }

Target:
public List<FailureInfo> getAllFailures(QueryGroup group) { return failures.get(group).stream() .map(exception -> new FailureInfo( exception.getQueryOrigin().getStage(), exception.getErrorCode(), exception.getQueryStats().map(QueryStats::getQueryId), getStackTraceAsString(exception))) .collect(toImmutableList()); }
Source:
private Iterator<Map.Entry<byte[], RowColumnRangeIterator>> partitionByRow(RowColumnRangeIterator rawResults) { PeekingIterator<Map.Entry<Cell, Value>> peekableRawResults = Iterators.peekingIterator(rawResults); return new AbstractIterator<Map.Entry<byte[], RowColumnRangeIterator>>() { byte[] prevRowName; @Override protected Map.Entry<byte[], RowColumnRangeIterator> computeNext() { finishConsumingPreviousRow(peekableRawResults); if (!peekableRawResults.hasNext()) { return endOfData(); } byte[] nextRowName = peekableRawResults.peek().getKey().getRowName(); Iterator<Map.Entry<Cell, Value>> columnsIterator = new AbstractIterator<Map.Entry<Cell, Value>>() { @Override protected Map.Entry<Cell, Value> computeNext() { if (!peekableRawResults.hasNext() || !Arrays.equals(peekableRawResults.peek().getKey().getRowName(), nextRowName)) { return endOfData(); } return peekableRawResults.next(); } }; prevRowName = nextRowName; return Maps.immutableEntry(nextRowName, new LocalRowColumnRangeIterator(columnsIterator)); } private void finishConsumingPreviousRow(PeekingIterator<Map.Entry<Cell, Value>> iter) { int numConsumed = 0; while (iter.hasNext() && Arrays.equals(iter.peek().getKey().getRowName(), prevRowName)) { iter.next(); numConsumed++; } if (numConsumed > 0) { log.warn("Not all columns for row were read. columns were discarded.", UnsafeArg.of("row", Arrays.toString(prevRowName)), SafeArg.of("numColumnDiscarded", numConsumed)); } } }; }

Target:
private Iterator<Map.Entry<byte[], RowColumnRangeIterator>> partitionByRow(RowColumnRangeIterator rawResults) { PeekingIterator<Map.Entry<Cell, Value>> peekableRawResults = Iterators.peekingIterator(rawResults); return new AbstractIterator<Map.Entry<byte[], RowColumnRangeIterator>>() { byte[] prevRowName; @Override protected Map.Entry<byte[], RowColumnRangeIterator> computeNext() { finishConsumingPreviousRow(peekableRawResults); if (!peekableRawResults.hasNext()) { return endOfData(); } byte[] nextRowName = peekableRawResults.peek().getKey().getRowName(); Iterator<Map.Entry<Cell, Value>> columnsIterator = new AbstractIterator<Map.Entry<Cell, Value>>() { @Override protected Map.Entry<Cell, Value> computeNext() { if (!peekableRawResults.hasNext() || !Arrays.equals(peekableRawResults.peek().getKey().getRowName(), nextRowName)) { return endOfData(); } return peekableRawResults.next(); } }; prevRowName = nextRowName; return Maps.immutableEntry(nextRowName, new LocalRowColumnRangeIterator(columnsIterator)); } private void finishConsumingPreviousRow(PeekingIterator<Map.Entry<Cell, Value>> iter) { int numConsumed = 0; while (iter.hasNext() && Arrays.equals(iter.peek().getKey().getRowName(), prevRowName)) { iter.next(); numConsumed++; } if (numConsumed > 0) { log.warn("Not all columns for row were read. columns were discarded.", UnsafeArg.of("row", Arrays.toString(prevRowName)), SafeArg.of("numColumnsDiscarded", numConsumed)); } } }; }
Source:
public void get(String url, boolean isForceRefresh) throws WebDriverException { if (isTestChromeDriver) { if (!url.equalsIgnoreCase(GitHubURL.LOGIN_PAGE)) { UI.events.triggerEvent(new NavigateToPageEvent(url)); } logger.info("Test loading page: " + url); testGet(); } else { if (!isForceRefresh && (driver.getCurrentUrl().equalsIgnoreCase(url))) { logger.info("Already on page: " + url + " will not load it again. "); } else { logger.info("Previous page was: " + driver.getCurrentUrl()); logger.info("Loading page: " + url); driver.get(url); } } }

Target:
public void get(String url, boolean isForceRefresh) throws WebDriverException { if (isTestChromeDriver) { if (!url.equalsIgnoreCase(GitHubURL.LOGIN_PAGE)) { UI.events.triggerEvent(new NavigateToPageEvent(url)); } logger.info("Test loading page: " + url); testGet(); } else { if (!isForceRefresh && driver.getCurrentUrl().equalsIgnoreCase(url)) { logger.info("Already on page: " + url + " will not load it again. "); } else { logger.info("Previous page was: " + driver.getCurrentUrl()); logger.info("Loading page: " + url); driver.get(url); } } }
Source:
protected boolean isContainerIsAFormOrAGroup(final EObject element) { if (element != null && element instanceof Group) { return isContainerIsAFormOrAGroup(element.eContainer()); } else { return element != null && element instanceof Form; } }

Target:
protected boolean isContainerIsAFormOrAGroup(final EObject element) { if (element instanceof Group) { return isContainerIsAFormOrAGroup(element.eContainer()); } else { return element instanceof Form; } }
Source:
private LinkedHashSet<String> toLinkedHashSet(String... scope) { final LinkedHashSet<String> result = new LinkedHashSet<>(); Collections.addAll(result, scope); return result; }

Target:
private LinkedHashSet<String> toLinkedHashSet(String... scope) { LinkedHashSet<String> result = new LinkedHashSet<>(); Collections.addAll(result, scope); return result; }
Source:
public static Response call( String masterUrl, OkHttpClient httpClient, String httpMethod, URI relativeUri, @Nullable HttpHeaders headers, @Nullable InputStream body) throws InfrastructureException { if (relativeUri.isAbsolute() || relativeUri.isOpaque()) { throw new InfrastructureException( "The direct infrastructure URL must be relative and not opaque."); } try { URI fullUrl = new URI(masterUrl).resolve(relativeUri); javax.ws.rs.core.MediaType mediaTypeHeader = headers.getMediaType(); String mediaType = mediaTypeHeader == null ? "application/json;charset=utf-8" : mediaTypeHeader.toString(); RequestBody requestBody = body == null ? null : new InputStreamBasedRequestBody(body, mediaType); Call httpCall = httpClient.newCall( new Request.Builder() .url(fullUrl.toURL()) .method(httpMethod, requestBody) .headers(toOkHttpHeaders(headers)) .build()); okhttp3.Response response = httpCall.execute(); Response.ResponseBuilder bld = Response.status(response.code()); for (int i = 0; i < response.headers().size(); ++i) { String name = response.headers().name(i); String value = response.headers().value(i); bld.header(name, value); } ResponseBody responseBody = response.body(); if (responseBody != null) { bld.entity(responseBody.byteStream()); MediaType contentType = responseBody.contentType(); if (contentType != null) { bld.type(contentType.toString()); } } return bld.build(); } catch (URISyntaxException | MalformedURLException e) { throw new InfrastructureException("Could not compose the direct URI.", e); } catch (IOException e) { throw new InfrastructureException("Error sending the direct infrastructure request.", e); } }

Target:
public static Response call( String masterUrl, OkHttpClient httpClient, String httpMethod, URI relativeUri, @Nullable HttpHeaders headers, @Nullable InputStream body) throws InfrastructureException { if (relativeUri.isAbsolute() || relativeUri.isOpaque()) { throw new InfrastructureException( "The direct infrastructure URL must be relative and not opaque."); } try { URL fullUrl = new URI(masterUrl).resolve(relativeUri).toURL(); okhttp3.Response response = callApi(httpClient, fullUrl, httpMethod, headers, body); return convertResponse(response); } catch (URISyntaxException | MalformedURLException e) { throw new InfrastructureException("Could not compose the direct URI.", e); } catch (IOException e) { throw new InfrastructureException("Error sending the direct infrastructure request.", e); } }
Source:
public void testUnresolvedSequencesAreNotFatal() throws Exception { ProducerIdAndEpoch producerIdAndEpoch = new ProducerIdAndEpoch(123456L, (short) 0); apiVersions.update("0", NodeApiVersions.create(ApiKeys.INIT_PRODUCER_ID.id, (short) 0, (short) 3)); TransactionManager txnManager = new TransactionManager(logContext, "testUnresolvedSeq", 60000, 100, apiVersions); setupWithTransactionState(txnManager); doInitTransactions(txnManager, producerIdAndEpoch); txnManager.beginTransaction(); txnManager.failIfNotReadyForSend(); txnManager.maybeAddPartitionToTransaction(tp0); client.prepareResponse(new AddPartitionsToTxnResponse(0, Collections.singletonMap(tp0, Errors.NONE))); sender.runOnce(); Future<RecordMetadata> request1 = appendToAccumulator(tp0); sender.runOnce(); time.sleep(1000L); Future<RecordMetadata> request2 = appendToAccumulator(tp0); sender.runOnce(); assertEquals(2, client.inFlightRequestCount()); sendIdempotentProducerResponse(0, tp0, Errors.NOT_LEADER_FOR_PARTITION, -1); sender.runOnce(); Node node = metadata.fetch().nodes().get(0); time.sleep(1000L); client.disconnect(node.idString()); client.blackout(node, 10); sender.runOnce(); assertFutureFailure(request1, TimeoutException.class); assertTrue(txnManager.hasUnresolvedSequence(tp0)); Future<RecordMetadata> request3 = appendToAccumulator(tp0); sender.runOnce(); assertTrue(txnManager.hasAbortableError()); }

Target:
public void testUnresolvedSequencesAreNotFatal() throws Exception { ProducerIdAndEpoch producerIdAndEpoch = new ProducerIdAndEpoch(123456L, (short) 0); apiVersions.update("0", NodeApiVersions.create(ApiKeys.INIT_PRODUCER_ID.id, (short) 0, (short) 3)); TransactionManager txnManager = new TransactionManager(logContext, "testUnresolvedSeq", 60000, 100, apiVersions); setupWithTransactionState(txnManager); doInitTransactions(txnManager, producerIdAndEpoch); txnManager.beginTransaction(); txnManager.failIfNotReadyForSend(); txnManager.maybeAddPartitionToTransaction(tp0); client.prepareResponse(new AddPartitionsToTxnResponse(0, Collections.singletonMap(tp0, Errors.NONE))); sender.runOnce(); Future<RecordMetadata> request1 = appendToAccumulator(tp0); sender.runOnce(); time.sleep(1000L); appendToAccumulator(tp0); sender.runOnce(); assertEquals(2, client.inFlightRequestCount()); sendIdempotentProducerResponse(0, tp0, Errors.NOT_LEADER_FOR_PARTITION, -1); sender.runOnce(); Node node = metadata.fetch().nodes().get(0); time.sleep(1000L); client.disconnect(node.idString()); client.blackout(node, 10); sender.runOnce(); assertFutureFailure(request1, TimeoutException.class); assertTrue(txnManager.hasUnresolvedSequence(tp0)); sender.runOnce(); assertTrue(txnManager.hasAbortableError()); }
Source:
private ErrorCode(int httpCode) { this.httpCode = httpCode; }

Target:
ErrorCode(int httpCode) { this.httpCode = httpCode; }
Source:
public Connector getConnector(String principal, AuthenticationToken token) throws AccumuloException, AccumuloSecurityException { Properties properties = ClientConfConverter.toProperties(clientConf); properties.setProperty(ClientProperty.AUTH_PRINCIPAL.getKey(), principal); properties.setProperty(ClientProperty.INSTANCE_NAME.getKey(), getInstanceName()); SingletonManager.setMode(Mode.CONNECTOR); return new ConnectorImpl(new AccumuloClientImpl(SingletonReservation.fake(), new ClientContext(new ClientInfoImpl(properties, token)), false)); }

Target:
public Connector getConnector(String principal, AuthenticationToken token) throws AccumuloException, AccumuloSecurityException { Properties properties = ClientConfConverter.toProperties(clientConf); properties.setProperty(ClientProperty.AUTH_PRINCIPAL.getKey(), principal); properties.setProperty(ClientProperty.INSTANCE_NAME.getKey(), getInstanceName()); return new ConnectorImpl(new AccumuloClientImpl(SingletonReservation.noop(), new ClientContext(new ClientInfoImpl(properties, token)))); }
Source:
private void launchEditTagsDialog(final Context context, final ShortcutsPojo pojo) { AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setTitle(context.getResources().getString(R.string.tags_add_title)); @SuppressLint("InflateParams") final View v = LayoutInflater.from(context).inflate(R.layout.tags_dialog, null); final MultiAutoCompleteTextView tagInput = v.findViewById(R.id.tag_input); ArrayAdapter<String> adapter = new ArrayAdapter<>(context, android.R.layout.simple_dropdown_item_1line, KissApplication.getApplication(context).getDataHandler().getTagsHandler().getAllTagsAsArray()); tagInput.setTokenizer(new SpaceTokenizer()); tagInput.setText(shortcutPojo.getTags()); tagInput.setAdapter(adapter); builder.setView(v); builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); pojo.setTags(tagInput.getText().toString()); KissApplication.getApplication(context).getDataHandler().getTagsHandler().setTags(pojo.id, pojo.getTags()); pojo.displayTags = pojo.getTags(); String msg = context.getResources().getString(R.string.tags_confirmation_added); Toast.makeText(context, msg, Toast.LENGTH_SHORT).show(); } }); builder.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); AlertDialog dialog = builder.create(); dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE); dialog.show(); }

Target:
private void launchEditTagsDialog(final Context context, final ShortcutsPojo pojo) { AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setTitle(context.getResources().getString(R.string.tags_add_title)); final View v = View.inflate(context, R.layout.tags_dialog, null); final MultiAutoCompleteTextView tagInput = v.findViewById(R.id.tag_input); ArrayAdapter<String> adapter = new ArrayAdapter<>(context, android.R.layout.simple_dropdown_item_1line, KissApplication.getApplication(context).getDataHandler().getTagsHandler().getAllTagsAsArray()); tagInput.setTokenizer(new SpaceTokenizer()); tagInput.setText(shortcutPojo.getTags()); tagInput.setAdapter(adapter); builder.setView(v); builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); pojo.setTags(tagInput.getText().toString()); KissApplication.getApplication(context).getDataHandler().getTagsHandler().setTags(pojo.id, pojo.getTags()); pojo.displayTags = pojo.getTags(); String msg = context.getResources().getString(R.string.tags_confirmation_added); Toast.makeText(context, msg, Toast.LENGTH_SHORT).show(); } }); builder.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); AlertDialog dialog = builder.create(); dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE); dialog.show(); }
Source:
private static Object parse(final String value, final int startIdx, final int endIdx, final boolean allowMore) throws JSONException { final StringTokenizer stringTokenizer = new StringTokenizer(value, startIdx, endIdx); final Object result = parse(stringTokenizer); if (!allowMore) { final char unexpectedValue; try { unexpectedValue = stringTokenizer.nextUnskippable(); } catch (JSONException ignore) { return result; } throw syntaxError("Unexpected symbol " + unexpectedValue, stringTokenizer); } else { return result; } }

Target:
private static Object parse(final String value, final int startIdx, final int endIdx, final boolean allowMore) throws JSONException { final StringTokenizer stringTokenizer = new StringTokenizer(value, startIdx, endIdx); final Object result = parse(stringTokenizer); if (!allowMore) { final char unexpectedValue; try { unexpectedValue = stringTokenizer.nextUnskippable(); } catch (JSONException ignore) { return result; } throw syntaxError("Unexpected symbol '" + unexpectedValue + "'", stringTokenizer); } else { return result; } }
Source:
RequestValueProvider(ExportOptions options) { this.start = options.getBigtableStartRow(); this.stop = options.getBigtableStopRow(); this.maxVersion = options.getBigtableMaxVersions(); this.filter = options.getBigtableFilter(); this.options = options; this.requestContext = RequestContext.create( InstanceName.of(options.getBigtableProject().get(), options.getBigtableInstanceId().get()), options.getBigtableAppProfileId().get()); }

Target:
RequestValueProvider(ExportOptions options) { this.start = options.getBigtableStartRow(); this.stop = options.getBigtableStopRow(); this.maxVersion = options.getBigtableMaxVersions(); this.filter = options.getBigtableFilter(); }
Source:
public void log(IStatus status) { int severity = status.getSeverity(); log(status.getMessage(), severity); if (status.getException() != null) log(status.getException().getMessage(), severity); IStatus[] nestedStatus = status.getChildren(); if (nestedStatus != null) for (IStatus nestedStatu : nestedStatus) { log(nestedStatu); } }

Target:
public void log(IStatus status) { int severity = status.getSeverity(); log(status.getMessage(), severity); if (status.getException() != null) log(status.getException().getMessage(), severity); IStatus[] nestedStatus = status.getChildren(); if (nestedStatus != null) for (IStatus s : nestedStatus) { log(s); } }