auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Template saveTemplate(final IHTMLPage page, final User user, final PageForm pageForm) throws BadRequestException, DotDataException, DotSecurityException, IOException { try { final Host host = getHost(pageForm.getHostId(), user); Template template = getTemplate(page, user, pageForm); template.setDrawed(true); pageForm.getChanges().forEach(containerUUIDChanged -> { ContainerUUID old = containerUUIDChanged.getOld(); ContainerUUID aNew = containerUUIDChanged.getNew(); try { MultiTreeFactory.updateMultiTree(page.getIdentifier(), old.getIdentifier(), old.getUUID(), aNew.getUUID()); } catch (DotDataException e) { e.printStackTrace(); } }); return this.templateAPI.saveTemplate(template, host, user, false); } catch (Exception e) { throw new DotRuntimeException(e); } }

Target:
public Template saveTemplate(final IHTMLPage page, final User user, final PageForm pageForm) throws BadRequestException, DotDataException, DotSecurityException, IOException { try { final Host host = getHost(pageForm.getHostId(), user); Template template = getTemplate(page, user, pageForm); template.setDrawed(true); pageForm.getChanges().forEach(containerUUIDChanged -> { final ContainerUUID old = containerUUIDChanged.getOld(); final ContainerUUID aNew = containerUUIDChanged.getNew(); try { multiTreeAPI.updateMultiTree(page.getIdentifier(), old.getIdentifier(), old.getUUID(), aNew.getUUID()); } catch (DotDataException e) { Logger.error(this.getClass(),"Exception on saveTemplate exception message: " + e.getMessage(), e); } }); return this.templateAPI.saveTemplate(template, host, user, false); } catch (Exception e) { throw new DotRuntimeException(e); } }
Source:
public void setOutputStream(PrintStream outputStream) { this.outputStream = outputStream; }

Target:
void setOutputStream(PrintStream outputStream) { this.outputStream = outputStream; }
Source:
protected void executeVmCommand() { RemoveMemoryVolumesParameters parameters = new RemoveMemoryVolumesParameters(snapshot, getVmId()); runInternalAction(ActionType.RemoveMemoryVolumes, parameters); snapshot.setMemoryDiskId(null); snapshot.setMetadataDiskId(null); snapshotDao.update(snapshot); setSucceeded(true); }

Target:
protected void executeVmCommand() { snapshot.setMemoryDiskId(null); snapshot.setMetadataDiskId(null); snapshotDao.update(snapshot); RemoveMemoryVolumesParameters parameters = new RemoveMemoryVolumesParameters(snapshot, getVmId()); runInternalAction(ActionType.RemoveMemoryVolumes, parameters); setSucceeded(true); }
Source:
public static Set<String> getMappingTargetNamesBy(Predicate<Mapping> predicate, Set<Mapping> mappings) { return mappings.stream().filter( predicate ).map( Mapping::getTargetName ).collect( Collectors.toSet() ); }

Target:
public static Set<String> getMappingTargetNamesBy(Predicate<Mapping> predicate, Set<Mapping> mappings) { return mappings.stream() .filter( predicate ) .map( Mapping::getTargetName ) .collect( Collectors.toCollection( LinkedHashSet::new ) ); }
Source:
private void initGuidepostDepth() throws IOException, SQLException { if (guidePostPerRegionBytes != null || guidePostWidthBytes != null) { getGuidePostDepthFromStatement(); LOG.info("Guide post depth determined from SQL statement: " + guidePostDepth); } else { long guidepostWidth = getGuidePostDepthFromSystemCatalog(getHTableForSystemCatalog()); if (guidepostWidth >= 0) { this.guidePostDepth = guidepostWidth; LOG.info("Guide post depth determined from SYSTEM.CATALOG: " + guidePostDepth); } else { this.guidePostDepth = StatisticsUtil.getGuidePostDepth( configuration.getInt( QueryServices.STATS_GUIDEPOST_PER_REGION_ATTRIB, QueryServicesOptions.DEFAULT_STATS_GUIDEPOST_PER_REGION), configuration.getLong( QueryServices.STATS_GUIDEPOST_WIDTH_BYTES_ATTRIB, QueryServicesOptions.DEFAULT_STATS_GUIDEPOST_WIDTH_BYTES), region.getTableDesc()); LOG.info("Guide post depth determined from global configuration: " + guidePostDepth); } } }

Target:
private void initGuidepostDepth() throws IOException, SQLException { if (guidePostPerRegionBytes != null || guidePostWidthBytes != null) { getGuidePostDepthFromStatement(); LOG.info("Guide post depth determined from SQL statement: " + guidePostDepth); } else { long guidepostWidth = getGuidePostDepthFromSystemCatalog(); if (guidepostWidth >= 0) { this.guidePostDepth = guidepostWidth; LOG.info("Guide post depth determined from SYSTEM.CATALOG: " + guidePostDepth); } else { this.guidePostDepth = StatisticsUtil.getGuidePostDepth( configuration.getInt( QueryServices.STATS_GUIDEPOST_PER_REGION_ATTRIB, QueryServicesOptions.DEFAULT_STATS_GUIDEPOST_PER_REGION), configuration.getLong( QueryServices.STATS_GUIDEPOST_WIDTH_BYTES_ATTRIB, QueryServicesOptions.DEFAULT_STATS_GUIDEPOST_WIDTH_BYTES), region.getTableDesc()); LOG.info("Guide post depth determined from global configuration: " + guidePostDepth); } } }
Source:
protected Collection<DRepresentationDescriptor> getRepresentationDescriptors(Session session, String key, EObject value) { Collection<DRepresentationDescriptor> reps = Lists.newArrayList(); for (EObject repDescriptor : session.getServices().getCustomData(key, value)) { if (repDescriptor instanceof DRepresentationDescriptor && isSupported((DRepresentationDescriptor) repDescriptor)) { reps.add((DRepresentationDescriptor) repDescriptor); } } return reps; }

Target:
protected Collection<DRepresentationDescriptor> getRepresentationDescriptors(Session session, String key, EObject value) { Collection<DRepresentationDescriptor> reps = Lists.newArrayList(); for (EObject repDescriptor : session.getServices().getCustomData(key, value)) { if (repDescriptor instanceof DRepresentationDescriptor && isSupported(((DRepresentationDescriptor) repDescriptor).getRepresentation())) { reps.add((DRepresentationDescriptor) repDescriptor); } } return reps; }
Source:
private void checkCookieBuilder(AssignmentExpressionTree assignment) { if (assignment.expression().is(Tree.Kind.METHOD_INVOCATION) && assignment.variable().is(Tree.Kind.IDENTIFIER)) { MethodInvocationTree mit = (MethodInvocationTree) assignment.expression(); if (PLAY_COOKIE_BUILDER.matches(mit) && isIgnoredCookieName(mit.arguments())) { ignoredVariables.add((VariableSymbol) ((IdentifierTree) assignment.variable()).symbol()); } } }

Target:
private void checkCookieBuilder(AssignmentExpressionTree assignment) { if (assignment.expression().is(Tree.Kind.METHOD_INVOCATION) && (assignment.variable().is(Tree.Kind.IDENTIFIER) || assignment.variable().is(Tree.Kind.MEMBER_SELECT))) { MethodInvocationTree mit = (MethodInvocationTree) assignment.expression(); VariableSymbol variableSymbol = getVariableSymbol(assignment); if (variableSymbol != null) { addToIgnoredVariables(variableSymbol, mit); } } }
Source:
public PenaltyCodesManager(ScoreBoard parent) { super(parent, null, "", ScoreBoard.Child.PENALTY_CODES, PenaltyCodesManager.class, Child.class); this.parent = parent; parent.addScoreBoardListener(new ConditionalScoreBoardListener(Rulesets.class, Rulesets.Child.CURRENT_RULE, rulesetChangeListener)); }

Target:
public PenaltyCodesManager(ScoreBoard parent) { super(parent, null, "", ScoreBoard.Child.PENALTY_CODES, PenaltyCodesManager.class, Child.class); this.parent = parent; loadFromJSON(parent.getRulesets().get(Rule.PENALTIES_FILE)); parent.addScoreBoardListener(new ConditionalScoreBoardListener(Rulesets.class, Rulesets.Child.CURRENT_RULE, rulesetChangeListener)); }
Source:
protected boolean supports(Class<?> clazz) { return true; }

Target:
protected boolean supports(Class<?> clazz) { return Serializable.class.isAssignableFrom(clazz); }
Source:
public void testSetMigration() { dao.setNetworkExclusivelyAsMigration(existingNetworkCluster.getClusterId(), existingNetworkCluster.getNetworkId()); List<NetworkCluster> allForCluster = dao.getAllForCluster(existingNetworkCluster.getClusterId()); for (NetworkCluster net : allForCluster) { if (net.getClusterId().equals(existingNetworkCluster.getClusterId()) && net.getNetworkId().equals(existingNetworkCluster.getNetworkId())) { assertTrue(net.isMigration()); } else { assertFalse(net.isMigration()); } } }

Target:
public void testSetMigration() { dao.setNetworkExclusivelyAsMigration(existingNetworkCluster.getClusterId(), existingNetworkCluster.getNetworkId()); List<NetworkCluster> allForCluster = dao.getAllForCluster(existingNetworkCluster.getClusterId()); for (NetworkCluster net : allForCluster) { if (net.getId().equals(existingNetworkCluster.getId())) { assertTrue(net.isMigration()); } else { assertFalse(net.isMigration()); } } }
Source:
ForeignHost presend(long hsId, VoltMessage message) { int hostId = (int)hsId; if (hostId == m_localHostId) { Mailbox mbox = m_siteMailboxes.get(hsId); if (mbox != null) { mbox.deliver(message); return null; } else { m_networkLog.info("Mailbox is not registered for site id " + CoreUtils.getSiteIdFromHSId(hsId)); return null; } } ImmutableCollection<ForeignHost> fhosts = m_foreignHosts.get(hostId); if (fhosts.isEmpty()) { if (!m_knownFailedHosts.containsKey(hostId)) { m_networkLog.warn( "Attempted to send a message to foreign host with id " + hostId + " but there is no such host."); } return null; } ForeignHost fhost = null; if (fhosts.size() == 1 || CoreUtils.getSiteIdFromHSId(hsId) < 0 ) { fhost = getPrimary(fhosts, hostId); } else { if (m_hasAllSecondaryConnectionCreated) { fhost = m_fhMapping.get(hsId); if (fhost == null) { int index = Math.abs(m_nextForeignHost.getAndIncrement() % fhosts.size()); fhost = (ForeignHost) fhosts.toArray()[index]; if (m_hostLog.isDebugEnabled()) { m_hostLog.debug("bind " + CoreUtils.getHostIdFromHSId(hsId) + ":" + CoreUtils.getSiteIdFromHSId(hsId) + " to " + fhost.hostnameAndIPAndPort()); } bindForeignHost(hsId, fhost); } } else { fhost = getPrimary(fhosts, hostId); } } if (!fhost.isUp()) { if (!m_shuttingDown) { m_networkLog.info("Attempted delivery of message to failed site: " + CoreUtils.hsIdToString(hsId)); } return null; } return fhost; }

Target:
ForeignHost presend(long hsId, VoltMessage message) { int hostId = (int)hsId; if (hostId == m_localHostId) { Mailbox mbox = m_siteMailboxes.get(hsId); if (mbox != null) { mbox.deliver(message); return null; } else { networkLog.info("Mailbox is not registered for site id " + CoreUtils.getSiteIdFromHSId(hsId)); return null; } } ImmutableCollection<ForeignHost> fhosts = m_foreignHosts.get(hostId); if (fhosts.isEmpty()) { if (!m_knownFailedHosts.containsKey(hostId)) { networkLog.warn( "Attempted to send a message to foreign host with id " + hostId + " but there is no such host."); } return null; } ForeignHost fhost = null; if (fhosts.size() == 1 || CoreUtils.getSiteIdFromHSId(hsId) < 0 ) { fhost = getPrimary(fhosts, hostId); } else { if (m_hasAllSecondaryConnectionCreated) { fhost = m_fhMapping.get(hsId); if (fhost == null) { int index = Math.abs(m_nextForeignHost.getAndIncrement() % fhosts.size()); fhost = (ForeignHost) fhosts.toArray()[index]; if (hostLog.isDebugEnabled()) { hostLog.debug("bind " + CoreUtils.getHostIdFromHSId(hsId) + ":" + CoreUtils.getSiteIdFromHSId(hsId) + " to " + fhost.hostnameAndIPAndPort()); } bindForeignHost(hsId, fhost); } } else { fhost = getPrimary(fhosts, hostId); } } if (!fhost.isUp()) { if (!m_shuttingDown) { networkLog.info("Attempted delivery of message to failed site: " + CoreUtils.hsIdToString(hsId)); } return null; } return fhost; }
Source:
public void cacheSerializers() throws Exception { CacheConfiguration<Long, String> cacheConfiguration = CacheConfigurationBuilder.newCacheConfigurationBuilder() .withResourcePools(ResourcePoolsBuilder.newResourcePoolsBuilder().heap(10, EntryUnit.ENTRIES).offheap(10, MemoryUnit.MB)) .withKeySerializer((Serializer) new LongSerializer()) .withValueSerializer(new CharSequenceSerializer()) .buildConfig(Long.class, String.class); CacheManager cacheManager = CacheManagerBuilder.newCacheManagerBuilder() .withCache("cache", cacheConfiguration) .build(true); Cache<Long, String> cache = cacheManager.getCache("cache", Long.class, String.class); cache.put(1L, "one"); assertThat(cache.get(1L), equalTo("one")); cacheManager.close(); }

Target:
public void cacheSerializers() throws Exception { CacheConfiguration<Long, String> cacheConfiguration = CacheConfigurationBuilder.newCacheConfigurationBuilder() .withResourcePools(ResourcePoolsBuilder.newResourcePoolsBuilder().heap(10, EntryUnit.ENTRIES).offheap(10, MemoryUnit.MB)) .withKeySerializer((Serializer) new LongSerializer()) .withValueSerializer((Serializer) new CharSequenceSerializer()) .buildConfig(Long.class, String.class); CacheManager cacheManager = CacheManagerBuilder.newCacheManagerBuilder() .withCache("cache", cacheConfiguration) .build(true); Cache<Long, String> cache = cacheManager.getCache("cache", Long.class, String.class); cache.put(1L, "one"); assertThat(cache.get(1L), equalTo("one")); cacheManager.close(); }
Source:
public DatabaseUserConfigLoader(HiveConf conf) throws UserConfigLoaderException { super(conf); String className = conf.get(GrillConfConstants.GRILL_SERVER_USER_RESOLVER_DB_DRIVER_NAME); String jdbcUrl = conf.get(GrillConfConstants.GRILL_SERVER_USER_RESOLVER_DB_JDBC_URL); String userName = conf.get(GrillConfConstants.GRILL_SERVER_USER_RESOLVER_DB_JDBC_USERNAME); String pass = conf.get(GrillConfConstants.GRILL_SERVER_USER_RESOLVER_DB_JDBC_PASSWORD); if(pass == null) { pass = ""; } querySql = conf.get(GrillConfConstants.GRILL_SERVER_USER_RESOLVER_DB_QUERY); keys = conf.get(GrillConfConstants.GRILL_SERVER_USER_RESOLVER_DB_KEYS).split("\\s*,\\s*", -1); if(anyNull(className, jdbcUrl, userName, pass, querySql, keys)) { throw new UserConfigLoaderException("You need to specify all of the following in conf: [" + GrillConfConstants.GRILL_SERVER_USER_RESOLVER_DB_DRIVER_NAME + ", " + GrillConfConstants.GRILL_SERVER_USER_RESOLVER_DB_JDBC_URL + ", " + GrillConfConstants.GRILL_SERVER_USER_RESOLVER_DB_JDBC_USERNAME + ", " + GrillConfConstants.GRILL_SERVER_USER_RESOLVER_DB_JDBC_PASSWORD + ", " + GrillConfConstants.GRILL_SERVER_USER_RESOLVER_DB_QUERY + ", " + GrillConfConstants.GRILL_SERVER_USER_RESOLVER_DB_KEYS + ", " + "]"); } ds = getDataSourceFromConf(conf); }

Target:
public DatabaseUserConfigLoader(HiveConf conf) throws UserConfigLoaderException { super(conf); String className = conf.get(GrillConfConstants.GRILL_SERVER_USER_RESOLVER_DB_DRIVER_NAME); String jdbcUrl = conf.get(GrillConfConstants.GRILL_SERVER_USER_RESOLVER_DB_JDBC_URL); String userName = conf.get(GrillConfConstants.GRILL_SERVER_USER_RESOLVER_DB_JDBC_USERNAME); String pass = conf.get(GrillConfConstants.GRILL_SERVER_USER_RESOLVER_DB_JDBC_PASSWORD, ""); querySql = conf.get(GrillConfConstants.GRILL_SERVER_USER_RESOLVER_DB_QUERY); keys = conf.get(GrillConfConstants.GRILL_SERVER_USER_RESOLVER_DB_KEYS).split("\\s*,\\s*", -1); if(anyNull(className, jdbcUrl, userName, pass, querySql, keys)) { throw new UserConfigLoaderException("You need to specify all of the following in conf: [" + GrillConfConstants.GRILL_SERVER_USER_RESOLVER_DB_DRIVER_NAME + ", " + GrillConfConstants.GRILL_SERVER_USER_RESOLVER_DB_JDBC_URL + ", " + GrillConfConstants.GRILL_SERVER_USER_RESOLVER_DB_JDBC_USERNAME + ", " + GrillConfConstants.GRILL_SERVER_USER_RESOLVER_DB_JDBC_PASSWORD + ", " + GrillConfConstants.GRILL_SERVER_USER_RESOLVER_DB_QUERY + ", " + GrillConfConstants.GRILL_SERVER_USER_RESOLVER_DB_KEYS + ", " + "]"); } ds = getDataSourceFromConf(conf); }
Source:
public ServerEvaluationStrategyProvider(Map<String, ServerEvaluationStrategy> strategies, @Named("che.docker.server_evaluation_strategy") String chosenStrategy) { if (strategies.containsKey(chosenStrategy)) { this.strategy = strategies.get(chosenStrategy); } else { LOG.warn(String.format("Property che.docker.server_evaluation_strategy=%s" + " does not refer to implemented strategy. Using default.", chosenStrategy)); this.strategy = strategies.get(DEFAULT_STRATEGY_NAME); } }

Target:
public ServerEvaluationStrategyProvider(Map<String, ServerEvaluationStrategy> strategies, @Named("che.docker.server_evaluation_strategy") String chosenStrategy) { if (strategies.containsKey(chosenStrategy)) { this.strategy = strategies.get(chosenStrategy); } else { this.strategy = null; } this.chosenStrategy = chosenStrategy; }
Source:
private NetworkClusterDao getNetworkClusterDao() { return DbFacade.getInstance().getNetworkClusterDao(); }

Target:
private static NetworkClusterDao getNetworkClusterDao() { return DbFacade.getInstance().getNetworkClusterDao(); }
Source:
public Map<String, FieldValueRecommender> createDefaultParametersToOptimize() { Map<String, FieldValueRecommender> parametersToOptimize = Maps.newHashMap(); parametersToOptimize.putAll(wrappedBuilderBuilder.createDefaultParametersToOptimize()); parametersToOptimize.put("halfLifeOfNegative", new FixedOrderRecommender(5, 10, 20)); parametersToOptimize.put("halfLifeOfPositive", new FixedOrderRecommender(5, 10, 20)); return parametersToOptimize; }

Target:
public Map<String, FieldValueRecommender> createDefaultParametersToOptimize() { Map<String, FieldValueRecommender> parametersToOptimize = Maps.newHashMap(); parametersToOptimize.putAll(wrappedBuilderBuilder.createDefaultParametersToOptimize()); parametersToOptimize.put(HALF_LIFE_OF_NEGATIVE, new FixedOrderRecommender(5.0, 10.0, 20.0)); parametersToOptimize.put(HALF_LIFE_OF_POSITIVE, new FixedOrderRecommender(5.0, 10.0, 20.0)); return parametersToOptimize; }
Source:
public void updateModel(final @Nullable ISegmentStore<ISegment> dataInput) { Display.getDefault().asyncExec(new Runnable() { @Override public void run() { if (!fTableViewer.getTable().isDisposed()) { ISegmentStore<ISegment> data = dataInput; ITmfTrace trace = TmfTraceManager.getInstance().getActiveTrace(); if (trace == null) { fAnalysisModule = null; } else { fAnalysisModule = TmfTraceUtils.getAnalysisModuleOfClass(trace, LatencyAnalysis.class, LatencyAnalysis.ID); } fTableViewer.getTable().setTopIndex(0); fTableViewer.setSelection(StructuredSelection.EMPTY); if (data == null) { fTableViewer.setInput(null); fTableViewer.setItemCount(0); return; } fTableViewer.setInput(data); if (data.getNbElements() <= Integer.MAX_VALUE) { fTableViewer.setItemCount((int) data.getNbElements()); } else { fTableViewer.setItemCount(Integer.MAX_VALUE); } } } }); }

Target:
public void updateModel(final @Nullable ISegmentStore<ISegment> dataInput) { final TableViewer tableViewer = getTableViewer(); Display.getDefault().asyncExec(new Runnable() { @Override public void run() { if (!tableViewer.getTable().isDisposed()) { ISegmentStore<ISegment> data = dataInput; ITmfTrace trace = TmfTraceManager.getInstance().getActiveTrace(); if (trace == null) { fAnalysisModule = null; } else { fAnalysisModule = TmfTraceUtils.getAnalysisModuleOfClass(trace, LatencyAnalysis.class, LatencyAnalysis.ID); } tableViewer.getTable().setTopIndex(0); tableViewer.setSelection(StructuredSelection.EMPTY); if (data == null) { tableViewer.setInput(null); tableViewer.setItemCount(0); return; } tableViewer.setInput(data); if (data.getNbElements() <= Integer.MAX_VALUE) { tableViewer.setItemCount((int) data.getNbElements()); } else { tableViewer.setItemCount(Integer.MAX_VALUE); } } } }); }
Source:
RuntimeException closeZombieTasks(final Set<TaskId> lostTasks, final List<TopicPartition> lostTaskChangelogs) { final AtomicReference<RuntimeException> firstException = new AtomicReference<>(null); for (final TaskId id : lostTasks) { if (suspended.containsKey(id)) { log.debug("Closing the suspended stream task {}.", id); firstException.compareAndSet(null, closeSuspended(true, suspended.get(id))); } else if (created.containsKey(id)) { log.debug("Closing the created stream task {}.", id); firstException.compareAndSet(null, closeNonRunning(true, created.get(id), lostTaskChangelogs)); } else if (restoring.containsKey(id)) { log.debug("Closing the restoring stream task {}.", id); firstException.compareAndSet(null, closeRestoring(true, created.get(id), lostTaskChangelogs)); } else if (running.containsKey(id)) { log.debug("Closing the running stream task {}.", id); firstException.compareAndSet(null, closeRunning(true, running.get(id), lostTaskChangelogs)); } else { log.warn("Skipping closing the lost stream task as it was already removed.", id); } } prevActiveTasks.clear(); prevActiveTasks.addAll(running.keySet()); if (!prevActiveTasks.isEmpty()) { log.error("Found still running after closing all tasks lost as zombies", taskTypeName); firstException.compareAndSet(null, new IllegalStateException("Not all lost tasks were closed as zombies")); } return firstException.get(); }

Target:
RuntimeException closeZombieTasks(final Set<TaskId> lostTasks, final List<TopicPartition> lostTaskChangelogs) { final AtomicReference<RuntimeException> firstException = new AtomicReference<>(null); for (final TaskId id : lostTasks) { if (suspended.containsKey(id)) { log.debug("Closing the zombie suspended stream task {}.", id); firstException.compareAndSet(null, closeSuspended(true, suspended.get(id))); } else if (created.containsKey(id)) { log.debug("Closing the zombie created stream task {}.", id); firstException.compareAndSet(null, closeNonRunning(true, created.get(id), lostTaskChangelogs)); } else if (restoring.containsKey(id)) { log.debug("Closing the zombie restoring stream task {}.", id); firstException.compareAndSet(null, closeRestoring(true, created.get(id), lostTaskChangelogs)); } else if (running.containsKey(id)) { log.debug("Closing the zombie running stream task {}.", id); firstException.compareAndSet(null, closeRunning(true, running.get(id), lostTaskChangelogs)); } else { log.warn("Skipping closing the zombie stream task as it was already removed.", id); } } prevActiveTasks.clear(); prevActiveTasks.addAll(running.keySet()); if (!prevActiveTasks.isEmpty()) { log.error("Found the still running stream tasks after closing all tasks lost as zombies", prevActiveTasks); firstException.compareAndSet(null, new IllegalStateException("Not all lost tasks were closed as zombies")); } return firstException.get(); }
Source:
public void testLazyORFull2() { Container rc = Container.rangeOfOnes(0, 1 << 15); ArrayContainer ac = new ArrayContainer((1 << 15) - 200, 1 << 16); Container rbc = rc.lazyOR(ac); assertEquals(1 << 16, rbc.getCardinality()); assertThat(rbc, instanceOf(RunContainer.class)); }

Target:
public void testLazyORFull2() { Container rc = Container.rangeOfOnes((1 << 10) - 200, 1 << 16); ArrayContainer ac = new ArrayContainer(0, 1 << 10); Container rbc = rc.lazyOR(ac); assertEquals(1 << 16, rbc.getCardinality()); assertThat(rbc, instanceOf(RunContainer.class)); }
Source:
public static void main(String[] args) { List<String> argsList = new ArrayList<>(); argsList.addAll(Arrays.asList(args)); boolean hasServerPort = false; for (String arg : argsList) { if (arg.contains(SERVER_PORT_OPTION)) { hasServerPort = true; return; } } if (!hasServerPort) { argsList.add("--" + SERVER_PORT_OPTION + "=9000"); } SpringApplication.run(HttpSourceApplication.class, argsList.toArray(new String[0])); }

Target:
public static void main(String[] args) { SpringApplication.run(HttpSourceApplication.class, args); }
Source:
private void handlePlusMinus(SymbolicValue left, SymbolicValue right) { if (isZero(left) && isZero(right)) { deferConstraint(Status.ZERO); } else if ((isZero(left) && isNonZero(right)) || (isNonZero(left) && isZero(right))) { deferConstraint(Status.UNDETERMINED); } }

Target:
private void handlePlusMinus(SymbolicValue left, SymbolicValue right) { boolean leftIsZero = isZero(left); if (leftIsZero || isZero(right)) { reuseSymbolicValue(leftIsZero ? right : left); } }
Source:
private int validate (String string) { if (string.length() != 8) { throw new StorageException("Date field should be exactly 8 characters long."); } int year = Integer.parseInt(string.substring(0, 4)); int month = Integer.parseInt(string.substring(4, 6)); int day = Integer.parseInt(string.substring(6, 8)); if (year < 2000 || year > 2100) { throw new StorageException("Date year out of range 2000-2100: " + year); } if (month < 1 || month > 12) { throw new StorageException("Date month out of range 1-12: " + month); } if (day < 1 || day > 31) { throw new StorageException("Date day out of range 1-31: " + day); } return Integer.parseInt(string); }

Target:
private int validate (String string) { LocalDate date = null; try { date = LocalDate.parse(string, gtfsDateFormat); } catch (DateTimeParseException ex) { throw new StorageException(NewGTFSErrorType.DATE_FORMAT, string); } int year = date.getYear(); if (year < 2000 || year > 2100) { throw new StorageException(NewGTFSErrorType.DATE_RANGE, string); } return Integer.parseInt(string); }
Source:
private void moveScreen(Direction direction) { FormController formController = getFormController(); if (formController == null) { Timber.w("FormController has a null value"); swipeHandler.setBeenSwiped(false); return; } if (audioRecorderViewModel.isRecording().getValue()) { DialogUtils.showIfNotShowing(RecordingWarningDialogFragment.class, getSupportFragmentManager()); swipeHandler.setBeenSwiped(false); return; } if (direction == FORWARDS && formController.getEvent() == FormEntryController.EVENT_END_OF_FORM) { swipeHandler.setBeenSwiped(false); return; } else if (direction == BACKWARDS && !allowMovingBackwards) { swipeHandler.setBeenSwiped(false); return; } state = null; switch (direction) { case FORWARDS: if (!saveBeforeNextView(formController)) { formEntryViewModel.moveForward(); formIndexAnimationHandler.handle(formController.getFormIndex()); } break; case BACKWARDS: if (formController.currentPromptIsQuestion()) { saveAnswersForCurrentScreen(DO_NOT_EVALUATE_CONSTRAINTS); } formEntryViewModel.moveBackward(); formIndexAnimationHandler.handle(formController.getFormIndex()); break; } }

Target:
private boolean moveScreen(Direction direction) { FormController formController = getFormController(); if (formController == null) { Timber.w("FormController has a null value"); return false; } if (audioRecorderViewModel.isRecording().getValue()) { DialogUtils.showIfNotShowing(RecordingWarningDialogFragment.class, getSupportFragmentManager()); return false; } if (direction == FORWARDS) { if (formController.getEvent() == FormEntryController.EVENT_END_OF_FORM) { return false; } if (!saveBeforeNextView(formController)) { formEntryViewModel.moveForward(); formIndexAnimationHandler.handle(formController.getFormIndex()); return true; } else { return false; } } else { if (formController.isCurrentQuestionFirstInForm() || !allowMovingBackwards) { return false; } if (formController.currentPromptIsQuestion()) { saveAnswersForCurrentScreen(DO_NOT_EVALUATE_CONSTRAINTS); } formEntryViewModel.moveBackward(); formIndexAnimationHandler.handle(formController.getFormIndex()); return true; } }
Source:
public void createOrReplaceOrder(Order order) throws OrderServiceFailureException, NetworkFailureException { this.throwRandomError(); if (order.getId() == null) { Order newOrder = new Order(); newOrder.setId(UUID.randomUUID().toString()); newOrder.setContent(order.getContent()); logger.info(String.format("Order created: %s", newOrder)); } else { logger.info(String.format("Order updated %s", order)); } this.throwRandomError(); }

Target:
public void createOrReplaceOrder(Order order) throws OrderServiceFailureException, NetworkFailureException { this.throwRandomError(); try { TimeUnit.MICROSECONDS.sleep(50); } catch (InterruptedException e) { throw new RuntimeException(e); } if (order.getId() == null) { Order newOrder = new Order(); newOrder.setId(UUID.randomUUID().toString()); newOrder.setContent(order.getContent()); logger.info(String.format("Order created: %s", newOrder)); } else { logger.info(String.format("Order updated %s", order)); } this.throwRandomError(); }
Source:
public static NonNullList<Fluid> getFluids(String name) { NonNullList<Fluid> ret = NonNullList.<Fluid>create(); if (NAME_TO_FLUIDS.containsKey(name = name.toLowerCase())) { ret.addAll(NAME_TO_FLUIDS.get(name)); } return ret; }

Target:
public static NonNullList<Fluid> getFluids(String name) { NonNullList<Fluid> ret = NonNullList.<Fluid>create(); if (nameExists(name)) { ret.addAll(NAME_TO_FLUIDS.get(name.toLowerCase(Locale.ENGLISH))); } return ret; }
Source:
public void testGlobalFunctionNameInBooleanExpressionDepth2() { test("var a = {b: function(){}}; a.b.c = 1; if (a.b) x(a.b.c);", "var a$b = function(){}; var a$b$c = 1; if (a$b) x(a$b$c);"); test("var a = { b: function(){}}; a.b.c = 1; " + "if (a.b) x(a.b.c);", "var a = {b: function(){}}; var a$b$c = 1; if (a.b) x(a$b$c);"); test("var a = {b: function(){}}; a.b.c = 1; " + "if (a.b) x(a.b.c);", "var a$b = function(){}; a$b.c = 1; if (a$b) x(a$b.c);"); }

Target:
public void testGlobalFunctionNameInBooleanExpressionDepth2() { test("var a = {b: function(){}}; a.b.c = 1; if (a.b) x(a.b.c);", "var a$b = function(){}; var a$b$c = 1; if (a$b) x(a$b$c);"); testSame("var a = { b: function(){}}; a.b.c = 1; " + "if (a.b) x(a.b.c);"); test("var a = {b: function(){}}; a.b.c = 1; " + "if (a.b) x(a.b.c);", "var a$b = function(){}; a$b.c = 1; if (a$b) x(a$b.c);"); }
Source:
public void testMoreOptionsAllItemsExist() { onTopBarView() .performOpenMoreOptions(); onOptionsMenu() .checkItemExists(R.string.menu_load_image) .checkItemExists(R.string.menu_hide_menu) .checkItemExists(R.string.help_title) .checkItemExists(R.string.pocketpaint_menu_about) .checkItemDoesNotExist(R.string.menu_save_image) .checkItemDoesNotExist(R.string.menu_save_copy) .checkItemDoesNotExist(R.string.menu_new_image) .checkItemExists(R.string.menu_discard_image) .checkItemExists(R.string.menu_export); }

Target:
public void testMoreOptionsAllItemsExist() { onTopBarView() .performOpenMoreOptions(); onOptionsMenu() .checkItemExists(R.string.menu_load_image) .checkItemExists(R.string.menu_hide_menu) .checkItemExists(R.string.help_title) .checkItemExists(R.string.pocketpaint_menu_about) .checkItemDoesNotExist(R.string.menu_save_image) .checkItemDoesNotExist(R.string.menu_save_copy) .checkItemDoesNotExist(R.string.menu_new_image) .checkItemDoesNotExist(R.string.menu_rate_us) .checkItemExists(R.string.menu_discard_image) .checkItemExists(R.string.menu_export); }
Source:
public IdentityLinkedHashMap<Expression, Type> getCoercions() { return NodeRefCollections.toIdentityMap(coercions); }

Target:
public Map<NodeRef<Expression>, Type> getCoercions() { return unmodifiableMap(coercions); }
Source:
public RuntimeInstance get() { String rl = "resource.loader"; String pkg = "org.apache.velocity.runtime.resource.loader"; Properties p = new Properties(); p.setProperty(RuntimeConstants.VM_PERM_INLINE_LOCAL, "false"); p.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS, Slf4jLogChute.class.getName()); p.setProperty("runtime.log.logsystem.log4j.category", "velocity"); if (site.mail_dir.isDirectory()) { p.setProperty(rl, "file, class"); p.setProperty("file." + rl + ".class", pkg + ".FileResourceLoader"); p.setProperty("file." + rl + ".path", site.mail_dir.getAbsolutePath()); p.setProperty("class." + rl + ".class", pkg + ".ClasspathResourceLoader"); } else { p.setProperty(rl, "class"); p.setProperty("class." + rl + ".class", pkg + ".ClasspathResourceLoader"); } RuntimeInstance ri = new RuntimeInstance(); try { ri.init(p); } catch (Exception err) { throw new ProvisionException("Cannot configure Velocity templates", err); } return ri; }

Target:
public RuntimeInstance get() { String rl = "resource.loader"; String pkg = "org.apache.velocity.runtime.resource.loader"; Properties p = new Properties(); p.setProperty(RuntimeConstants.VM_PERM_INLINE_LOCAL, "true"); p.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS, Slf4jLogChute.class.getName()); p.setProperty("runtime.log.logsystem.log4j.category", "velocity"); if (site.mail_dir.isDirectory()) { p.setProperty(rl, "file, class"); p.setProperty("file." + rl + ".class", pkg + ".FileResourceLoader"); p.setProperty("file." + rl + ".path", site.mail_dir.getAbsolutePath()); p.setProperty("class." + rl + ".class", pkg + ".ClasspathResourceLoader"); } else { p.setProperty(rl, "class"); p.setProperty("class." + rl + ".class", pkg + ".ClasspathResourceLoader"); } RuntimeInstance ri = new RuntimeInstance(); try { ri.init(p); } catch (Exception err) { throw new ProvisionException("Cannot configure Velocity templates", err); } return ri; }
Source:
public AmazonServiceException handle(HttpResponse errorResponse) throws Exception { Document document; try { document = XpathUtils.documentFrom(errorResponse.getContent()); } catch (SAXParseException e) { AmazonServiceException exception = new AmazonServiceException(String.format("Unable to unmarshall error response (%s)", e.getMessage()), e); exception.setErrorCode(String.format("%s (%s)", errorResponse.getStatusText(), errorResponse.getStatusCode())); exception.setErrorType(AmazonServiceException.ErrorType.Unknown); exception.setStatusCode(HttpStatus.SC_INTERNAL_SERVER_ERROR); return exception; } for (Unmarshaller<AmazonServiceException, Node> unmarshaller : unmarshallerList) { AmazonServiceException ase = unmarshaller.unmarshall(document); if (ase != null) { ase.setStatusCode(errorResponse.getStatusCode()); return ase; } } throw new AmazonClientException("Unable to unmarshall error response from service"); }

Target:
public AmazonServiceException handle(HttpResponse errorResponse) throws Exception { Document document; try { document = XpathUtils.documentFrom(errorResponse.getContent()); } catch (SAXParseException e) { AmazonServiceException exception = new AmazonServiceException(String.format("Unable to unmarshall error response (%s)", e.getMessage()), e); exception.setErrorCode(String.format("%s %s", errorResponse.getStatusCode(), errorResponse.getStatusText())); exception.setErrorType(AmazonServiceException.ErrorType.Service); return exception; } for (Unmarshaller<AmazonServiceException, Node> unmarshaller : unmarshallerList) { AmazonServiceException ase = unmarshaller.unmarshall(document); if (ase != null) { ase.setStatusCode(errorResponse.getStatusCode()); return ase; } } throw new AmazonClientException("Unable to unmarshall error response from service"); }
Source:
public void recognizeEntitiesSingleText() { final RecognizeEntitiesResult recognizeEntitiesResult = textAnalyticsClient.recognizeEntities("Satya Nadella is the CEO of Microsoft"); for (NamedEntity entity : recognizeEntitiesResult.getNamedEntities()) { System.out.printf( "Recognized entity: %s, entity type: %s, entity subtype: %s, offset: %s, length: %s, score: %s.%n", entity.getText(), entity.getType(), entity.getSubtype() == null || entity.getSubtype().isEmpty() ? "N/A" : entity.getSubtype(), entity.getOffset(), entity.getLength(), entity.getScore()); } END: com.azure.ai.textanalytics.TextAnalyticsClient.recognizeEntities#String }

Target:
public void recognizeEntitiesSingleText() { final RecognizeEntitiesResult recognizeEntitiesResult = textAnalyticsClient.recognizeEntities("Satya Nadella is the CEO of Microsoft"); for (NamedEntity entity : recognizeEntitiesResult.getNamedEntities()) { System.out.printf("Recognized entity: %s, entity type: %s, score: %s.%n", entity.getText(), entity.getType(), entity.getScore()); } END: com.azure.ai.textanalytics.TextAnalyticsClient.recognizeEntities#String }
Source:
private Map<SourceKey, Future<SourceAvailability>> startAvailabilityChecks( final Map<SourceKey, Source> sourceKeyMap) { Map<SourceKey, Future<SourceAvailability>> availabilityFutures = new HashMap<>(); for (final Entry<SourceKey, Source> entry : sourceKeyMap.entrySet()) { final Source source = entry.getValue(); final SourceKey sourceKey = entry.getKey(); boolean sourceIsNotInCache = cache.getIfPresent(sourceKey) == null; if (sourceIsNotInCache) { LOGGER.debug("Found a new SourceKey for source id={}", source.getId()); cache.put(sourceKey, SourceAvailability.unknown()); } LOGGER.trace("Starting a process to check the availability of source id={}", source.getId()); Future<SourceAvailability> sourceAvailabilityFuture = Futures.withTimeout( sourceAvailabilityChecksThreadPool.submit(() -> checkAvailability(source)), DEFAULT_TIMEOUT, DEFAULT_TIMEOUT_TIME_UNIT, pollAllSourcesThreadPool); availabilityFutures.put(sourceKey, sourceAvailabilityFuture); } LOGGER.trace("Successfully submitted availability checks for all of the sources"); return availabilityFutures; }

Target:
private Map<SourceKey, Future<SourceStatus>> startAvailabilityChecks( final Map<SourceKey, Source> sourceKeyMap) { Map<SourceKey, Future<SourceStatus>> sourceStatusFutures = new HashMap<>(); for (final Entry<SourceKey, Source> entry : sourceKeyMap.entrySet()) { final Source source = entry.getValue(); final SourceKey sourceKey = entry.getKey(); LOGGER.trace("Starting a process to check the availability of source id={}", source.getId()); Future<SourceStatus> sourceStatusFuture = Futures.withTimeout( availabilityChecksThreadPool.submit( () -> source.isAvailable() ? SourceStatus.AVAILABLE : SourceStatus.UNAVAILABLE), DEFAULT_TIMEOUT, DEFAULT_TIMEOUT_TIME_UNIT, pollAllSourcesThreadPool); sourceStatusFutures.put(sourceKey, sourceStatusFuture); } LOGGER.trace("Successfully submitted availability checks for all of the sources"); return sourceStatusFutures; }
Source:
public void clientHandling( final PacketValueConfig message, final MessageContext ctx ) { final Container c = Minecraft.getMinecraft().thePlayer.openContainer; if( message.name.equals( "CustomName" ) && c instanceof AEBaseContainer ) { ( (AEBaseContainer) c ).customName = message.value; } else if( message.name.startsWith( "SyncDat." ) ) { ( (AEBaseContainer) c ).stringSync( Integer.parseInt( message.name.substring( 8 ) ), message.value ); } else if( message.name.equals( "CraftingStatus" ) && message.value.equals( "Clear" ) ) { final GuiScreen gs = Minecraft.getMinecraft().currentScreen; if( gs instanceof GuiCraftingCPU ) { ( (GuiCraftingCPU) gs ).clearItems(); } } else if( c instanceof IConfigurableObject ) { final IConfigManager cm = ( (IConfigurableObject) c ).getConfigManager(); for( final Settings e : cm.getSettings() ) { if( e.name().equals( message.name ) ) { final Enum<?> def = cm.getSetting( e ); try { cm.putSetting( e, Enum.valueOf( def.getClass(), message.value ) ); } catch( final IllegalArgumentException err ) { } break; } } } }

Target:
public void clientHandling( final PacketValueConfig message, final MessageContext ctx ) { final Container c = Minecraft.getMinecraft().thePlayer.openContainer; if( message.name.equals( "CustomName" ) && c instanceof AEBaseContainer ) { ( (AEBaseContainer) c ).setCustomName( message.value ); } else if( message.name.startsWith( "SyncDat." ) ) { ( (AEBaseContainer) c ).stringSync( Integer.parseInt( message.name.substring( 8 ) ), message.value ); } else if( message.name.equals( "CraftingStatus" ) && message.value.equals( "Clear" ) ) { final GuiScreen gs = Minecraft.getMinecraft().currentScreen; if( gs instanceof GuiCraftingCPU ) { ( (GuiCraftingCPU) gs ).clearItems(); } } else if( c instanceof IConfigurableObject ) { final IConfigManager cm = ( (IConfigurableObject) c ).getConfigManager(); for( final Settings e : cm.getSettings() ) { if( e.name().equals( message.name ) ) { final Enum<?> def = cm.getSetting( e ); try { cm.putSetting( e, Enum.valueOf( def.getClass(), message.value ) ); } catch( final IllegalArgumentException err ) { } break; } } } }
Source:
public HealthStatus getHealthStatus() { HealthStatus globalHealthStatus = HealthStatus.HEALTHY; Set<HealthStatus> userCacheHealthStatus = getHealthStatus(cacheManager.getCacheNames()); Set<HealthStatus> internalCacheHealthStatus = getHealthStatus(internalCacheRegistry.getInternalCacheNames()); if (userCacheHealthStatus.contains(HealthStatus.UNHEALTHY) || internalCacheHealthStatus.contains(HealthStatus.UNHEALTHY)) { globalHealthStatus = HealthStatus.UNHEALTHY; } else if (userCacheHealthStatus.contains(HealthStatus.REBALANCING) || internalCacheHealthStatus.contains(HealthStatus.REBALANCING)) { globalHealthStatus = HealthStatus.REBALANCING; } return globalHealthStatus; }

Target:
public HealthStatus getHealthStatus() { HealthStatus globalHealthStatus = HealthStatus.HEALTHY; Set<HealthStatus> healthStatuses = Stream.concat(cacheManager.getCacheNames().stream(), internalCacheRegistry.getInternalCacheNames().stream()) .map(cacheName -> cacheManager.getCache(cacheName, false)) .filter(Objects::nonNull) .map(CacheHealthImpl::new) .map(CacheHealthImpl::getStatus) .collect(Collectors.toSet()); if (healthStatuses.contains(HealthStatus.UNHEALTHY)) { globalHealthStatus = HealthStatus.UNHEALTHY; } else if (healthStatuses.contains(HealthStatus.REBALANCING)) { globalHealthStatus = HealthStatus.REBALANCING; } return globalHealthStatus; }
Source:
public void bindTo(MeterRegistry registry) { for (CircuitBreaker circuitBreaker : circuitBreakerRegistry.getAllCircuitBreakers()) { addMetrics(registry, circuitBreaker, circuitBreakerRegistry); } circuitBreakerRegistry.getEventPublisher() .onEntryAdded(event -> addMetrics(registry, event.getAddedEntry())); circuitBreakerRegistry.getEventPublisher() .onEntryRemoved(event -> removeMetrics(registry, event.getRemovedEntry().getName())); circuitBreakerRegistry.getEventPublisher().onEntryReplaced(event -> { removeMetrics(registry, event.getOldEntry().getName()); addMetrics(registry, event.getNewEntry()); }); }

Target:
public void bindTo(MeterRegistry registry) { for (CircuitBreaker circuitBreaker : circuitBreakerRegistry.getAllCircuitBreakers()) { addMetrics(registry, circuitBreaker); } circuitBreakerRegistry.getEventPublisher() .onEntryAdded(event -> addMetrics(registry, event.getAddedEntry())); circuitBreakerRegistry.getEventPublisher() .onEntryRemoved(event -> removeMetrics(registry, event.getRemovedEntry().getName())); circuitBreakerRegistry.getEventPublisher().onEntryReplaced(event -> { removeMetrics(registry, event.getOldEntry().getName()); addMetrics(registry, event.getNewEntry()); }); }
Source:
public void showOpenProjectDialog( FileSystemContext fsContext, ProjectsServerOperations server, String defaultLocation, int defaultType, boolean showNewSession, final ProgressOperationWithInput<OpenProjectParams> onCompleted) { RStudioGinjector.INSTANCE.injectMembers(this); FileDialogs dialogs = RStudioGinjector.INSTANCE.getFileDialogs(); if (Desktop.isDesktop() || !RStudioGinjector.INSTANCE.getSession().getSessionInfo() .getMultiSession()) { dialogs.openFile( "Open Project", fsContext, FileSystemItem.createDir(defaultLocation), "R Projects (*.Rproj)", true, new ProgressOperationWithInput<FileSystemItem>() { @Override public void execute(FileSystemItem input, final ProgressIndicator indicator) { if (input.isDirectory()) { String rprojPath = input.completePath(input.getName() + ".Rproj"); input = FileSystemItem.createFile(rprojPath); } final FileSystemItem projFile = input; server_.createProjectFile( projFile.getPath(), new ServerRequestCallback<Boolean>() { @Override public void onResponseReceived(Boolean success) { onCompleted.execute(new OpenProjectParams(projFile, null, false), indicator); } @Override public void onError(ServerError error) { Debug.logError(error); } }); } }); } else { WebFileDialogs webDialogs = (WebFileDialogs)dialogs; webDialogs.openProject(fsContext, FileSystemItem.createDir(defaultLocation), defaultType, showNewSession, onCompleted); } }

Target:
public void showOpenProjectDialog( FileSystemContext fsContext, ProjectsServerOperations server, String defaultLocation, int defaultType, boolean showNewSession, final ProgressOperationWithInput<OpenProjectParams> onCompleted) { RStudioGinjector.INSTANCE.injectMembers(this); FileDialogs dialogs = RStudioGinjector.INSTANCE.getFileDialogs(); if (Desktop.isDesktop() || !RStudioGinjector.INSTANCE.getSession().getSessionInfo() .getMultiSession()) { dialogs.openFile( "Open Project", fsContext, FileSystemItem.createDir(defaultLocation), "R Projects (*.Rproj)", true, new ProgressOperationWithInput<FileSystemItem>() { @Override public void execute(FileSystemItem input, final ProgressIndicator indicator) { final CommandWithArg<FileSystemItem> onProjectFileReady = new CommandWithArg<FileSystemItem>() { @Override public void execute(FileSystemItem item) { onCompleted.execute( new OpenProjectParams(item, null, false), indicator); } }; if (input == null) return; if (input.isDirectory()) { final String rprojPath = input.completePath(input.getName() + ".Rproj"); final FileSystemItem rprojFile = FileSystemItem.createFile(rprojPath); server_.createProjectFile( rprojFile.getPath(), new ServerRequestCallback<Boolean>() { @Override public void onResponseReceived(Boolean success) { onProjectFileReady.execute(rprojFile); } @Override public void onError(ServerError error) { Debug.logError(error); onProjectFileReady.execute(rprojFile); } }); } else { onProjectFileReady.execute(input); } } }); } else { WebFileDialogs webDialogs = (WebFileDialogs)dialogs; webDialogs.openProject(fsContext, FileSystemItem.createDir(defaultLocation), defaultType, showNewSession, onCompleted); } }
Source:
protected void deliverInternal(VoltMessage message) { assert(lockingVows()); logRxMessage(message); notifyNewLeaderOfTxnDone(); boolean canDeliver = m_scheduler.sequenceForReplay(message); if (message instanceof DumpMessage) { hostLog.warn("Received DumpMessage at " + CoreUtils.hsIdToString(m_hsId)); try { m_scheduler.dump(); } catch (Throwable ignore) { hostLog.warn("Failed to dump the content of the scheduler", ignore); } } if (message instanceof Iv2RepairLogRequestMessage) { handleLogRequest(message); return; } else if (message instanceof Iv2RepairLogResponseMessage) { m_algo.deliver(message); return; } else if (message instanceof RejoinMessage) { m_joinProducer.deliver((RejoinMessage) message); return; } else if (message instanceof RepairLogTruncationMessage) { m_repairLog.deliver(message); return; } else if (message instanceof Iv2InitiateTaskMessage) { if (checkMisroutedIv2IntiateTaskMessage((Iv2InitiateTaskMessage)message)) { return; } initiateSPIMigrationIfRequested((Iv2InitiateTaskMessage)message); } else if (message instanceof FragmentTaskMessage) { if (checkMisroutedFragmentTaskMessage((FragmentTaskMessage)message)) { return; } } else if (message instanceof BalanceSPIMessage) { setBalanceSPIStatus((BalanceSPIMessage)message); return; } if (canDeliver) { m_scheduler.deliver(message); } else { m_repairLog.deliver(message); } }

Target:
protected void deliverInternal(VoltMessage message) { assert(lockingVows()); logRxMessage(message); boolean canDeliver = m_scheduler.sequenceForReplay(message); if (message instanceof DumpMessage) { hostLog.warn("Received DumpMessage at " + CoreUtils.hsIdToString(m_hsId)); try { m_scheduler.dump(); } catch (Throwable ignore) { hostLog.warn("Failed to dump the content of the scheduler", ignore); } } if (message instanceof Iv2RepairLogRequestMessage) { handleLogRequest(message); return; } else if (message instanceof Iv2RepairLogResponseMessage) { m_algo.deliver(message); return; } else if (message instanceof RejoinMessage) { m_joinProducer.deliver((RejoinMessage) message); return; } else if (message instanceof RepairLogTruncationMessage) { m_repairLog.deliver(message); return; } else if (message instanceof Iv2InitiateTaskMessage) { if (checkMisroutedIv2IntiateTaskMessage((Iv2InitiateTaskMessage)message)) { return; } initiateSPIMigrationIfRequested((Iv2InitiateTaskMessage)message); } else if (message instanceof FragmentTaskMessage) { if (checkMisroutedFragmentTaskMessage((FragmentTaskMessage)message)) { return; } } else if (message instanceof MigratePartitionLeaderMessage) { setMigratePartitionLeaderStatus((MigratePartitionLeaderMessage)message); return; } if (canDeliver) { m_scheduler.deliver(message); } else { m_repairLog.deliver(message); } }
Source:
protected void executeCommand() { Provider provider = getDbFacade().getProviderDao().get(getNetwork().getProvidedBy().getProviderId()); NetworkProviderProxy proxy = ProviderProxyFactory.getInstance().create(provider); getNetwork().getProvidedBy().setExternalId(proxy.add(getNetwork())); getNetwork().setVlanId(null); super.executeCommand(); }

Target:
protected void executeCommand() { Provider<?> provider = getDbFacade().getProviderDao().get(getNetwork().getProvidedBy().getProviderId()); NetworkProviderProxy proxy = ProviderProxyFactory.getInstance().create(provider); getNetwork().getProvidedBy().setExternalId(proxy.add(getNetwork())); getNetwork().setVlanId(null); super.executeCommand(); }
Source:
protected static void validateOptions(JobConf job) throws IOException { AccumuloClient conn = InputConfigurator.getConnector(CLASS, job); InputConfigurator.validatePermissions(CLASS, job, conn); }

Target:
protected static void validateOptions(JobConf job) throws IOException { AccumuloClient conn = InputConfigurator.getClient(CLASS, job); InputConfigurator.validatePermissions(CLASS, job, conn); }