auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public short getShortFromAllowedValues(String name, Short defaultVal, Short[] allowedValues) { Set<Object> allowedValuesSet = new HashSet<>(Arrays.asList(allowedValues)); Short v = containsKey(name) ? Short.parseShort(getProperty(name)) : defaultVal; if (allowedValuesSet.contains(v)) { return v; } else { throw new IllegalArgumentException( name + " has value " + v + " which is not among the allowed values: " + allowedValuesSet); } }

Target:
public Short getShortFromAllowedValues(String name, Short defaultVal, Short[] allowedValues) { List<Short> allowedValuesList = Arrays.asList(allowedValues); Short v = containsKey(name) ? Short.parseShort(getProperty(name)) : defaultVal; if (allowedValuesList.contains(v)) { return v; } else { throw new IllegalArgumentException( name + " has value " + v + " which is not among the allowed values: " + allowedValuesList); } }
Source:
protected OneStreamStateHandlerOperator() { this.latestTimestampBeforeCheckpoint = 0L; this.recoveredCheckpointTimestamp = 0L; this.checkpointMap = new TreeMap<>(); }

Target:
protected OneStreamStateHandlerOperator() { this.latestTimestampBeforeCheckpoint = 0L; this.recoveredCheckpointTimestamp = 0L; this.checkpointMap = new ConcurrentSkipListMap<>(); }
Source:
public Table getTable() { String realTableId = cachingTableSpec.getConfig().get(REAL_TABLE_ID); ReadableTable table = (ReadableTable) taskContext.getTable(realTableId); String cacheTableId = cachingTableSpec.getConfig().get(CACHE_TABLE_ID); ReadWriteTable cache; if (cacheTableId != null) { cache = (ReadWriteTable) taskContext.getTable(cacheTableId); } else { cache = createDefaultCacheTable(realTableId); } tableCaches.add(Pair.of(table, cache)); boolean isWriteAround = Boolean.parseBoolean(cachingTableSpec.getConfig().get(WRITE_AROUND)); return new CachingTable(table, cache, isWriteAround); }

Target:
public Table getTable() { String realTableId = cachingTableSpec.getConfig().get(REAL_TABLE_ID); ReadableTable table = (ReadableTable) taskContext.getTable(realTableId); String cacheTableId = cachingTableSpec.getConfig().get(CACHE_TABLE_ID); ReadWriteTable cache; if (cacheTableId != null) { cache = (ReadWriteTable) taskContext.getTable(cacheTableId); } else { cache = createDefaultCacheTable(realTableId); } tableCaches.add(Pair.of(table, cache)); int stripes = Integer.parseInt(cachingTableSpec.getConfig().get(LOCK_STRIPES)); boolean isWriteAround = Boolean.parseBoolean(cachingTableSpec.getConfig().get(WRITE_AROUND)); return new CachingTable(cachingTableSpec.getId(), table, cache, stripes, isWriteAround); }
Source:
public void showLinkPreview(PageTitle title, int entrySource, @Nullable Location location) { if (getSupportFragmentManager().findFragmentByTag(LINK_PREVIEW_FRAGMENT_TAG) == null) { DialogFragment linkPreview = app.isLinkPreviewExperimental() ? LinkPreviewDialogB.newInstance(title, entrySource) : LinkPreviewDialog.newInstance(title, entrySource, location); linkPreview.show(getSupportFragmentManager(), LINK_PREVIEW_FRAGMENT_TAG); } }

Target:
public void showLinkPreview(PageTitle title, int entrySource, @Nullable Location location) { if (getSupportFragmentManager().findFragmentByTag(LINK_PREVIEW_FRAGMENT_TAG) == null) { DialogFragment linkPreview = LinkPreviewDialog.newInstance(title, entrySource, location); linkPreview.show(getSupportFragmentManager(), LINK_PREVIEW_FRAGMENT_TAG); } }
Source:
public static void startServerInstance(File dataDir, ServerCnxnFactory factory, String hostPort) throws IOException, InterruptedException, KeeperException.NoNodeException { final int port = getPort(hostPort); LOG.info("STARTING server instance 127.0.0.1:{}", port); ZooKeeperServer zks = new ZooKeeperServer(dataDir, dataDir, 3000); factory.startup(zks); Assert.assertTrue("waiting for server up", ClientBase.waitForServerUp( "127.0.0.1:" + port, CONNECTION_TIMEOUT, factory.isSecure())); }

Target:
public static void startServerInstance(File dataDir, ServerCnxnFactory factory, String hostPort) throws IOException, InterruptedException { final int port = getPort(hostPort); LOG.info("STARTING server instance 127.0.0.1:{}", port); ZooKeeperServer zks = new ZooKeeperServer(dataDir, dataDir, 3000); factory.startup(zks); Assert.assertTrue("waiting for server up", ClientBase.waitForServerUp( "127.0.0.1:" + port, CONNECTION_TIMEOUT, factory.isSecure())); }
Source:
private void goThroughShop() { State.setCoins(COINS); mainMenu(MAIN_SHOP); final ObservableList<Skin> skinList = Skin.loadSkinsToList(); assertEquals(State.getSkin(), skinList.get(0)); shopBuyEquipSkin(SHOP_SKIN_IRONMAN); assertEquals(State.getSkin(), skinList.get(0)); shopBuyEquipSkin(SHOP_SKIN_CAPTAIN); assertEquals(State.getSkin(), skinList.get(0)); shopBuyEquipSkin(SHOP_SKIN_CAPTAIN); assertEquals(State.getSkin(), skinList.get(1)); shopBuyEquipSkin(SHOP_SKIN_IRONMAN); assertEquals(State.getSkin(), skinList.get(0)); shopScreen(SHOP_BACK); }

Target:
private void goThroughShop() { State.setCoins(COINS); mainMenu(MAIN_SHOP); final ObservableList<Skin> skinList = Skin.loadSkinsToList(); assertEquals(State.getSkin(), skinList.get(SHOP_SKIN_NOOB)); shopBuyEquipSkin(SHOP_SKIN_NOOB); assertEquals(State.getSkin(), skinList.get(SHOP_SKIN_NOOB)); shopBuyEquipSkin(SHOP_SKIN_ANDY); assertEquals(State.getSkin(), skinList.get(SHOP_SKIN_NOOB)); shopBuyEquipSkin(SHOP_SKIN_ANDY); assertEquals(State.getSkin(), skinList.get(SHOP_SKIN_ANDY)); shopBuyEquipSkin(SHOP_SKIN_NOOB); assertEquals(State.getSkin(), skinList.get(SHOP_SKIN_NOOB)); shopScreen(SHOP_BACK); }
Source:
public Set<PatternWrapper> getPatterns() { final Set<PatternWrapper> patterns = new HashSet<>(); if (isNewColumn() || !isNewFactPattern()) { final BRLRuleModel brlRuleModel = new BRLRuleModel(presenter.getModel()); final List<String> variables = brlRuleModel.getLHSPatternVariables(); variables.stream().forEach(var -> { final String factType = brlRuleModel.getLHSBoundFact(var).getFactType(); final boolean isNegated = brlRuleModel.getLHSBoundFact(var).isNegated(); patterns.add(new PatternWrapper(factType, var, isNegated)); }); } if (isNewColumn() || isNewFactPattern()) { final BRLRuleModel brlRuleModel = new BRLRuleModel(presenter.getModel()); final List<String> variables = brlRuleModel.getRHSBoundFacts(); variables.stream().forEach(var -> { final String factType = brlRuleModel.getRHSBoundFact(var).getFactType(); patterns.add(new PatternWrapper(factType, var)); }); } return patterns; }

Target:
public Set<PatternWrapper> getPatterns() { final Set<PatternWrapper> patterns = new HashSet<>(); if (isNewColumn() || !isNewFactPattern()) { final BRLRuleModel brlRuleModel = new BRLRuleModel(presenter.getModel()); final List<String> variables = brlRuleModel.getLHSPatternVariables(); variables.forEach(var -> { final String factType = brlRuleModel.getLHSBoundFact(var).getFactType(); final boolean isNegated = brlRuleModel.getLHSBoundFact(var).isNegated(); patterns.add(new PatternWrapper(factType, var, isNegated)); }); } if (isNewColumn() || isNewFactPattern()) { final BRLRuleModel brlRuleModel = new BRLRuleModel(presenter.getModel()); final List<String> variables = brlRuleModel.getRHSBoundFacts(); variables.forEach(var -> { final String factType = brlRuleModel.getRHSBoundFact(var).getFactType(); patterns.add(new PatternWrapper(factType, var)); }); } return patterns; }
Source:
private OverviewStatsBuilder.OverviewStats.AnswerButtonsOverview toOverview(int type, ArrayList<double[]> list) { OverviewStatsBuilder.OverviewStats.AnswerButtonsOverview answerButtonsOverview = new OverviewStatsBuilder.OverviewStats.AnswerButtonsOverview(); for (double[] elements : list) { if (elements[0] != type) { continue; } answerButtonsOverview.total += elements[2]; answerButtonsOverview.correct += elements[1] == 1 ? 0 : elements[2]; } return answerButtonsOverview; }

Target:
private AnswerButtonsOverview toOverview(int type, ArrayList<double[]> list) { AnswerButtonsOverview answerButtonsOverview = new AnswerButtonsOverview(); final int INDEX_TYPE = 0; final int INDEX_EASE = 1; final int INDEX_COUNT = 2; final double EASE_AGAIN = 1d; for (double[] elements : list) { if (elements[INDEX_TYPE] != type) { continue; } double answersCountForTypeAndEase = elements[INDEX_COUNT]; boolean isAgain = elements[INDEX_EASE] == EASE_AGAIN; answerButtonsOverview.total += answersCountForTypeAndEase; answerButtonsOverview.correct += isAgain ? 0 : answersCountForTypeAndEase; } return answerButtonsOverview; }
Source:
protected void showDialog(Bundle state) { super.showDialog(state); Typeface typeface = TypefaceCache.getTypeface(getContext(), TypefaceCache.FAMILY_OPEN_SANS, Typeface.BOLD, TypefaceCache.VARIATION_LIGHT); int buttonColor = ContextCompat.getColor(getContext(), R.color.blue_medium); final AlertDialog dialog = (AlertDialog) getDialog(); Button positiveButton = dialog.getButton(DialogInterface.BUTTON_POSITIVE); Button negativeButton = dialog.getButton(DialogInterface.BUTTON_NEGATIVE); if (positiveButton != null) { dialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String error = null; CharSequence text = getEditText().getText(); if (mValidationType == ValidationType.EMAIL) { error = validateEmail(text); } else if (!TextUtils.isEmpty(text) && mValidationType == ValidationType.URL) { error = validateUrl(text); } if (error != null) { getEditText().setError(error); } else { callChangeListener(text); dialog.dismiss(); } } }); positiveButton.setTextColor(buttonColor); positiveButton.setTypeface(typeface); } if (negativeButton != null) { negativeButton.setTextColor(buttonColor); negativeButton.setTypeface(typeface); } }

Target:
protected void showDialog(Bundle state) { super.showDialog(state); final AlertDialog dialog = (AlertDialog) getDialog(); Button positiveButton = dialog.getButton(DialogInterface.BUTTON_POSITIVE); if (positiveButton != null) { positiveButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String error = null; CharSequence text = getEditText().getText(); if (mValidationType == ValidationType.EMAIL) { error = validateEmail(text); } else if (!TextUtils.isEmpty(text) && mValidationType == ValidationType.URL) { error = validateUrl(text); } if (error != null) { getEditText().setError(error); } else { callChangeListener(text); dialog.dismiss(); } } }); } CharSequence summary = getSummary(); if (TextUtils.isEmpty(summary)) { getEditText().setText(""); } else { getEditText().setText(summary); getEditText().setSelection(0, summary.length()); } getEditText().setError(null); }
Source:
public static SortedSet<Text> getDefaultSplits() { SortedSet<Text> splits = new TreeSet<>(); String splitsFn = "src/main/resources/default-splits.txt"; try { try (BufferedReader br = new BufferedReader(new FileReader(new File(splitsFn)))) { String line; while ((line = br.readLine()) != null) { splits.add(new Text(line)); } } } catch (IOException e) { log.error("Failed to find splits file - {}", splitsFn); } return splits; }

Target:
public static SortedSet<Text> getDefaultSplits() { SortedSet<Text> splits = new TreeSet<>(); InputStream is = IndexEnv.class.getClassLoader().getResourceAsStream("default-splits.txt"); try { try (BufferedReader br = new BufferedReader(new InputStreamReader(is))) { String line; while ((line = br.readLine()) != null) { splits.add(new Text(line)); } } } catch (IOException e) { log.error("Failed to read default-splits.txt resource", e); System.exit(-1); } return splits; }
Source:
public SchemaBuilder addMultiValueDimension(String dimensionName, DataType dataType, int maxLength, Object defaultNullValue) { _schema.addField(new DimensionFieldSpec(dimensionName, dataType, false, maxLength, defaultNullValue)); return this; }

Target:
public SchemaBuilder addMultiValueDimension(String dimensionName, DataType dataType, int maxLength, Object defaultNullValue) { Preconditions.checkArgument(dataType == STRING, "The maxLength field only applies to STRING field right now"); _schema.addField(new DimensionFieldSpec(dimensionName, dataType, false, maxLength, defaultNullValue)); return this; }
Source:
public List<BibEntry> performSearch(String query) { List<BibEntry> result = fetchers.parallelStream().flatMap(searchBasedFetcher -> { try { return searchBasedFetcher.performSearch(query).stream(); } catch (FetcherException e) { LOGGER.warn(String.format("%s API request failed", searchBasedFetcher.getName()), e); return Stream.empty(); } }).limit(maximumNumberOfReturnedResults) .collect(Collectors.toList()); ConvertToBibtexCleanup converter = new ConvertToBibtexCleanup(); result.forEach(converter::cleanup); return result; }

Target:
public List<BibEntry> performSearch(String query) { ImportCleanup cleanup = new ImportCleanup(BibDatabaseMode.BIBTEX); return fetchers.parallelStream() .flatMap(searchBasedFetcher -> { try { return searchBasedFetcher.performSearch(query).stream(); } catch (FetcherException e) { LOGGER.warn(String.format("%s API request failed", searchBasedFetcher.getName()), e); return Stream.empty(); } }) .limit(maximumNumberOfReturnedResults) .map(cleanup::doPostCleanup) .collect(Collectors.toList()); }
Source:
protected void resultsHide() { super.resultsHide(); String topPosition = getDropdown().css("top"); if(topPosition.equals("-9000px") && isMobileAnimated()) { final int windowHeight = Window.getClientHeight(); int speed = getMobileAnimationSpeed(); getDropdown() .css("top", "0") .css("left", "0") .css("right", "0") .animate("top: 1000px, left: 0, right: 0", speed*2, new Function() { public void f() { getDropdown() .css("bottom", "") .css(isRTL() ? "left" : "right", "") .css("top", windowHeight + 20 + "px") .css(isRTL() ? "right" : "left", "-9000px"); } }); } else { getDropdown().css("bottom", "").css(isRTL() ? "left" : "right", ""); } }

Target:
protected void resultsHide() { super.resultsHide(); String topPosition = getDropdown().css("top"); if (topPosition.equals("-9000px") && getOptions().isMobileAnimation()) { final int windowHeight = Window.getClientHeight(); int speed = getOptions().getMobileAnimationSpeed(); getDropdown() .css("top", "0") .css("left", "0") .css("right", "0") .animate("top: 1000px, left: 0, right: 0", speed * 2, new Function() { public void f() { getDropdown() .css("bottom", "") .css(isRTL() ? "left" : "right", "") .css("top", windowHeight + 20 + "px") .css(isRTL() ? "right" : "left", "-9000px"); } }); } else { getDropdown().css("bottom", "").css(isRTL() ? "left" : "right", ""); } }
Source:
public Publisher<ResultSummary> printAllProductsReactor() { String query = "MATCH (p:Product) WHERE p.id = $id RETURN p.title"; Map<String,Object> parameters = Collections.singletonMap( "id", 0 ); return Flux.using( driver::rxSession, session -> session.readTransaction( tx -> { RxResult result = tx.run( query, parameters ); return Flux.from( result.records() ) .doOnNext( record -> System.out.println( record.get( 0 ).asString() ) ).then( Mono.from( result.summary() ) ); } ), RxSession::close ); }

Target:
public Flux<ResultSummary> printAllProductsReactor() { String query = "MATCH (p:Product) WHERE p.id = $id RETURN p.title"; Map<String,Object> parameters = Collections.singletonMap( "id", 0 ); return Flux.using( driver::rxSession, session -> session.readTransaction( tx -> { RxResult result = tx.run( query, parameters ); return Flux.from( result.records() ) .doOnNext( record -> System.out.println( record.get( 0 ).asString() ) ).then( Mono.from( result.summary() ) ); } ), RxSession::close ); }
Source:
protected void executeCommand() { initializeStorageDomain(); String storage = (getStorageDomain().getStorage() != null) ? getStorageDomain().getStorage() : ""; getStorageDomain().setStorage(""); addStorageDomainInDb(); if(StringUtils.isEmpty(storage)) { storage = createVG(); } getStorageDomain().setStorage(storage); if (StringUtils.isNotEmpty(getStorageDomain().getStorage()) && addStorageDomainInIrs()) { updateStorageDomainDynamicFromIrs(); proceedVGLunsInDb(); blockStorageDomainHelper.fillMetadataDevicesInfo(getStorageDomain().getStorageStaticData(), getVds().getStoragePoolId()); storageDomainStaticDao.update(getStorageDomain().getStorageStaticData()); setSucceeded(true); } }

Target:
protected void executeCommand() { initializeStorageDomain(); String storage = (getStorageDomain().getStorage() != null) ? getStorageDomain().getStorage() : ""; getStorageDomain().setStorage(""); addStorageDomainInDb(); if(StringUtils.isEmpty(storage)) { storage = createVG(); } getStorageDomain().setStorage(storage); if (StringUtils.isNotEmpty(getStorageDomain().getStorage()) && addStorageDomainInIrs()) { updateStorageDomainDynamicFromIrs(); proceedVGLunsInDb(); blockStorageDomainHelper.fillMetadataDevicesInfo(getStorageDomain().getStorageStaticData(), getVds().getId()); storageDomainStaticDao.update(getStorageDomain().getStorageStaticData()); setSucceeded(true); } }
Source:
public AuditLogType getAuditLogTypeValue() { switch (getActionState()) { case EXECUTE: if (getParameters().getDiskInfo().getDiskStorageType() == DiskStorageType.IMAGE || getParameters().getDiskInfo().getDiskStorageType() == DiskStorageType.CINDER) { return getExecuteAuditLogTypeValue(getSucceeded()); } else { return getEndSuccessAuditLogTypeValue(getSucceeded()); } case END_SUCCESS: return getEndSuccessAuditLogTypeValue(getSucceeded()); default: return AuditLogType.USER_ADD_DISK_FINISHED_FAILURE; } }

Target:
public AuditLogType getAuditLogTypeValue() { switch (getActionState()) { case EXECUTE: if (isDiskStorageTypeRequiresExecuteState()) { return getExecuteAuditLogTypeValue(getSucceeded()); } else { return getEndSuccessAuditLogTypeValue(getSucceeded()); } case END_SUCCESS: return getEndSuccessAuditLogTypeValue(getSucceeded()); default: return AuditLogType.USER_ADD_DISK_FINISHED_FAILURE; } }
Source:
private void fastSyncDbJobs() { if (blockStore.getBestBlock().getNumber() > 0 && blockStore.getChainBlockByNumber(1) == null) { FastSyncManager fastSyncManager = ctx.getBean(FastSyncManager.class); if (!fastSyncManager.isEndedOrNotStarted()) { return; } logger.info("DB is filled using Fast Sync with skipHistory, adopting headerStore"); ((BlockchainImpl) blockchain).setHeaderStore(ctx.getBean(HeaderStore.class)); } fastSyncDbMigrateHeadersUpdateTotalDiff(); }

Target:
private void fastSyncDbJobs() { if (blockStore.getBestBlock().getNumber() > 0 && blockStore.getChainBlockByNumber(1) == null) { FastSyncManager fastSyncManager = ctx.getBean(FastSyncManager.class); if (fastSyncManager.isInProgress()) { return; } logger.info("DB is filled using Fast Sync with skipHistory, adopting headerStore"); ((BlockchainImpl) blockchain).setHeaderStore(ctx.getBean(HeaderStore.class)); } MigrateHeaderSourceTotalDiff tempMigration = new MigrateHeaderSourceTotalDiff(ctx, blockStore, blockchain, config); tempMigration.run(); }
Source:
public ParSeqRestClient build() { if (_inboundRequestContextFinder == null) { LOGGER.debug("InboundRequestContextFinder not specified, using default one"); } InboundRequestContextFinder inboundRequestContextFinder = _inboundRequestContextFinder == null ? () -> Optional.empty() : _inboundRequestContextFinder; if (_config != null) { LOGGER.debug("One config specified"); _configs = Collections.singletonMap(DEFAULT_CONFIG, _config); _configChooser = (irc, r) -> DEFAULT_CONFIG; } else if (_configs == null) { throw new IllegalStateException("One type of config has to be specified using either setConfig() or setMultipleConfigs()."); } else { LOGGER.debug("Multiple configs specified"); } RequestConfigProvider configProvider = new MultipleRequestConfigProvider(_configs, _configChooser, inboundRequestContextFinder); Function<Request<?>, RequestContext> requestContextProvider = (_requestContextProvider == null) ? requet -> new RequestContext() : _requestContextProvider; ParSeqRestClient parseqClient = new ParSeqRestClient(_restClient, configProvider, requestContextProvider); if (_batchingSupport != null) { LOGGER.debug("Found batching support"); _batchingSupport.registerStrategy(parseqClient); } else { LOGGER.debug("Did not find batching support"); } return parseqClient; }

Target:
public ParSeqRestClient build() { if (_inboundRequestContextFinder == null) { LOGGER.debug("InboundRequestContextFinder not specified, using default one"); } InboundRequestContextFinder inboundRequestContextFinder = _inboundRequestContextFinder == null ? () -> Optional.empty() : _inboundRequestContextFinder; if (_config != null) { LOGGER.debug("One config specified"); _configs = Collections.singletonMap(DEFAULT_CONFIG, _config); _configChooser = (irc, r) -> DEFAULT_CONFIG; } else if (_configs == null) { throw new IllegalStateException("One type of config has to be specified using either setConfig() or setMultipleConfigs()."); } else { LOGGER.debug("Multiple configs specified"); } RequestConfigProvider configProvider = new MultipleRequestConfigProvider(_configs, _configChooser, inboundRequestContextFinder); Function<Request<?>, RequestContext> requestContextProvider = (_requestContextProvider == null) ? request -> new RequestContext() : _requestContextProvider; ParSeqRestClient parseqClient = new ParSeqRestClient(_restClient, configProvider, requestContextProvider); if (_batchingSupport != null) { LOGGER.debug("Found batching support"); _batchingSupport.registerStrategy(parseqClient); } else { LOGGER.debug("Did not find batching support"); } return parseqClient; }
Source:
protected void run() throws Exception { if (localName != null && gitdir != null) throw die(CLIText.get().conflictingUsageOf_git_dir_andArguments); final URIish uri = new URIish(sourceUri); File localNameF; if (localName == null) { try { localName = uri.getHumanishName() + (isBare ? Constants.DOT_GIT_EXT : ""); localNameF = new File(SystemReader.getInstance().getProperty( Constants.OS_USER_DIR), localName); } catch (IllegalArgumentException e) { throw die(MessageFormat.format( CLIText.get().cannotGuessLocalNameFrom, sourceUri)); } } else localNameF = new File(localName); if (branch == null) branch = Constants.HEAD; CloneCommand command = Git.cloneRepository(); command.setURI(sourceUri).setRemote(remoteName).setBare(isBare) .setNoCheckout(noCheckout).setBranch(branch) .setCloneSubmodules(cloneSubmodules); command.setGitDir(gitdir == null ? null : new File(gitdir)); command.setDirectory(localNameF); boolean msgs = quiet == null || !quiet.booleanValue(); if (msgs) { command.setProgressMonitor(new TextProgressMonitor(errw)) .setCallback(this); outw.println(MessageFormat.format( CLIText.get().cloningInto, localName)); outw.flush(); } try { db = command.call().getRepository(); if (msgs && db.resolve(Constants.HEAD) == null) outw.println(CLIText.get().clonedEmptyRepository); } catch (InvalidRemoteException e) { throw die(MessageFormat.format(CLIText.get().doesNotExist, sourceUri)); } finally { if (db != null) db.close(); } if (msgs) { outw.println(); outw.flush(); } }

Target:
protected void run() throws Exception { if (localName != null && gitdir != null) throw die(CLIText.get().conflictingUsageOf_git_dir_andArguments); final URIish uri = new URIish(sourceUri); File localNameF; if (localName == null) { try { localName = uri.getHumanishName(); if (isBare) { localName = localName + Constants.DOT_GIT_EXT; } localNameF = new File(SystemReader.getInstance().getProperty( Constants.OS_USER_DIR), localName); } catch (IllegalArgumentException e) { throw die(MessageFormat.format( CLIText.get().cannotGuessLocalNameFrom, sourceUri)); } } else localNameF = new File(localName); if (branch == null) branch = Constants.HEAD; CloneCommand command = Git.cloneRepository(); command.setURI(sourceUri).setRemote(remoteName).setBare(isBare) .setNoCheckout(noCheckout).setBranch(branch) .setCloneSubmodules(cloneSubmodules); command.setGitDir(gitdir == null ? null : new File(gitdir)); command.setDirectory(localNameF); boolean msgs = quiet == null || !quiet.booleanValue(); if (msgs) { command.setProgressMonitor(new TextProgressMonitor(errw)) .setCallback(this); outw.println(MessageFormat.format( CLIText.get().cloningInto, localName)); outw.flush(); } try { db = command.call().getRepository(); if (msgs && db.resolve(Constants.HEAD) == null) outw.println(CLIText.get().clonedEmptyRepository); } catch (InvalidRemoteException e) { throw die(MessageFormat.format(CLIText.get().doesNotExist, sourceUri)); } finally { if (db != null) db.close(); } if (msgs) { outw.println(); outw.flush(); } }
Source:
public Connection getResult(long timeout) throws SQLException { long expiry = System.nanoTime() / (long)1E6 + timeout; synchronized (this) { while (true) { if (result != null) { return result; } if (resultException != null) { if (resultException instanceof SQLException) { resultException.fillInStackTrace(); throw (SQLException) resultException; } else { throw new PSQLException( GT.tr( "Something unusual has occurred to cause the driver to fail. Please report this exception."), PSQLState.UNEXPECTED_ERROR, resultException); } } long delay = expiry - System.nanoTime() / (long)1E6; if (delay <= 0) { abandoned = true; throw new PSQLException(GT.tr("Connection attempt timed out."), PSQLState.CONNECTION_UNABLE_TO_CONNECT); } try { wait(delay); } catch (InterruptedException ie) { Thread.currentThread().interrupt(); abandoned = true; throw new RuntimeException(GT.tr("Interrupted while attempting to connect.")); } } } }

Target:
public Connection getResult(long timeout) throws SQLException { long expiry = TimeUnit.NANOSECONDS.toMillis(System.nanoTime()) + timeout; synchronized (this) { while (true) { if (result != null) { return result; } if (resultException != null) { if (resultException instanceof SQLException) { resultException.fillInStackTrace(); throw (SQLException) resultException; } else { throw new PSQLException( GT.tr( "Something unusual has occurred to cause the driver to fail. Please report this exception."), PSQLState.UNEXPECTED_ERROR, resultException); } } long delay = expiry - TimeUnit.NANOSECONDS.toMillis(System.nanoTime()); if (delay <= 0) { abandoned = true; throw new PSQLException(GT.tr("Connection attempt timed out."), PSQLState.CONNECTION_UNABLE_TO_CONNECT); } try { wait(delay); } catch (InterruptedException ie) { Thread.currentThread().interrupt(); abandoned = true; throw new RuntimeException(GT.tr("Interrupted while attempting to connect.")); } } } }
Source:
public GetTaskListCommandParameters(Guid vdsId) { _vdsId = vdsId; _spUUID = null; }

Target:
public GetTaskListCommandParameters(Guid vdsId) { spUUID = null; }
Source:
ValidationResult validateNotRemovingUsedNetworkByVms(String removedNetworkName) { final List<String> removedNetworkNames = Collections.singletonList(removedNetworkName); final List<String> vmsNames = findActiveVmsUsingNetwork.findNamesOfActiveVmsUsingNetworks(host.getId(), removedNetworkNames); if (vmsNames.isEmpty()) { return ValidationResult.VALID; } else { final int MAX_NUMBER_OF_PRINTED_ITEMS = 5; final String SEPARATOR = ","; EngineMessage engineMessage = EngineMessage.NETWORK_CANNOT_DETACH_NETWORK_USED_BY_VMS; return new ValidationResult(engineMessage, Stream.concat( ReplacementUtils.replaceWith(VAR_NETWORK_NAME, removedNetworkNames, SEPARATOR, MAX_NUMBER_OF_PRINTED_ITEMS).stream(), ReplacementUtils.replaceWith(VAR_VM_NAMES, vmsNames, SEPARATOR, MAX_NUMBER_OF_PRINTED_ITEMS).stream() ).collect(Collectors.toList())); } }

Target:
ValidationResult validateNotRemovingUsedNetworkByVms(String removedNetworkName) { final List<String> removedNetworkNames = Collections.singletonList(removedNetworkName); final List<String> vmsNames = findActiveVmsUsingNetwork.findNamesOfActiveVmsUsingNetworks(host.getId(), removedNetworkNames); if (vmsNames.isEmpty()) { return ValidationResult.VALID; } EngineMessage engineMessage = EngineMessage.NETWORK_CANNOT_DETACH_NETWORK_USED_BY_VMS; return new ValidationResult(engineMessage, Stream.concat( ReplacementUtils.replaceWith(VAR_NETWORK_NAME, removedNetworkNames, SEPARATOR).stream(), ReplacementUtils.replaceWith(VAR_VM_NAMES, vmsNames, SEPARATOR).stream() ).collect(Collectors.toList())); }
Source:
public Optional<Bucket> getBucket(InputRow inputRow) { final Optional<Interval> timeBucket = schema.getDataSchema().getGranularitySpec().bucketInterval( new DateTime( inputRow.getTimestampFromEpoch() ) ); if (!timeBucket.isPresent()) { return Optional.absent(); } DateTime bucketStart = timeBucket.get().getStart(); final ShardSpec actualSpec = shardSpecLookups.get(bucketStart) .getShardSpec( rollupGran.truncate(inputRow.getTimestampFromEpoch()), inputRow ); final HadoopyShardSpec hadoopyShardSpec = hadoopShardSpecLookup.get(bucketStart).get(actualSpec); return Optional.of( new Bucket( hadoopyShardSpec.getShardNum(), bucketStart, actualSpec.getPartitionNum() ) ); }

Target:
public Optional<Bucket> getBucket(InputRow inputRow) { final Optional<Interval> timeBucket = schema.getDataSchema().getGranularitySpec().bucketInterval( new DateTime( inputRow.getTimestampFromEpoch() ) ); if (!timeBucket.isPresent()) { return Optional.absent(); } final DateTime bucketStart = timeBucket.get().getStart(); final ShardSpec actualSpec = shardSpecLookups.get(bucketStart) .getShardSpec( rollupGran.truncate(inputRow.getTimestampFromEpoch()), inputRow ); final HadoopyShardSpec hadoopyShardSpec = hadoopShardSpecLookup.get(bucketStart).get(actualSpec); return Optional.of( new Bucket( hadoopyShardSpec.getShardNum(), bucketStart, actualSpec.getPartitionNum() ) ); }
Source:
public void checkConfigFile(File configFile){ try { ServerFeature servUtil = new ServerFeature(); log.info("serverDirectory: " + serverDirectory + "; exists: " + serverDirectory.exists()); Set<String> features = servUtil.getServerFeatures(serverDirectory); log.info("features: " + features.size()); if (!features.isEmpty()){ List<String> configFeatures = new ArrayList<String>(features); log.info("Configuration features have been added"); runMojo("net.wasdev.wlp.maven.plugins:liberty-maven-plugin", "install-feature", serverName, configFeatures); this.existingConfigFeatures.addAll(configFeatures); ListIterator<String> iterator = this.existingConfigFeatures.listIterator(); while (iterator.hasNext()) { iterator.set(iterator.next().toLowerCase()); } Set<String> set = new HashSet<String>(this.existingConfigFeatures); this.existingConfigFeatures.clear(); this.existingConfigFeatures.addAll(set); for (String test : this.existingConfigFeatures){ log.info("existing: " + test); } } } catch (Exception e) { log.debug("Failed to read configuration file", e); } }

Target:
public void checkConfigFile(File configFile){ try { ServerFeature servUtil = new ServerFeature(); Set<String> features = servUtil.getServerFeatures(serverDirectory); features.removeAll(existingFeatures); if (!features.isEmpty()){ List<String> configFeatures = new ArrayList<String>(features); log.info("Configuration features have been added"); runMojo("net.wasdev.wlp.maven.plugins:liberty-maven-plugin", "install-feature", serverName, configFeatures); this.existingFeatures.addAll(features); } } catch (Exception e) { log.debug("Failed to read configuration file", e); } }
Source:
public ThreadPoolFactory threadPoolFactory() { try { ClassLoader loader = Thread.currentThread().getContextClassLoader(); Class<?> cls = loader.loadClass( "com.github.tomakehurst.wiremock.jetty9.QueuedThreadPoolFactory" ); return (ThreadPoolFactory) cls.newInstance(); } catch (Exception e) { return throwUnchecked(e, null); } }

Target:
public ThreadPoolFactory threadPoolFactory() { return new QueuedThreadPoolFactory(); }
Source:
protected void before() throws Throwable { if (session == null) { throw new IllegalStateException("Session was not initialized"); } session.execute(String.format("CREATE KEYSPACE %s WITH durable_writes = false AND " + "replication = {'class': 'SimpleStrategy', 'replication_factor' : 1};", keyspaceName)); session.execute(String.format("USE %s;", keyspaceName)); }

Target:
protected void before() throws Throwable { Assert.state(session != null, "Session was not initialized"); session.execute(String.format("CREATE KEYSPACE %s WITH durable_writes = false AND " + "replication = {'class': 'SimpleStrategy', 'replication_factor' : 1};", keyspaceName)); session.execute(String.format("USE %s;", keyspaceName)); }
Source:
public UndefinedThrowable() { this(NotificationLevel.STEP); }

Target:
public UndefinedThrowable() { super("This step is undefined", null, false, false); }
Source:
protected static void start(CommandLine commandLine) throws Exception { ProActiveConfiguration.load(); if (!commandLine.hasOption("no-router")) { startRouter(); } hsqldbServer = new SchedulerHsqldbStarter(); hsqldbServer.startIfNeeded(); String rmUrl = getRmUrl(commandLine); setCleanDatabaseProperties(commandLine); setCleanNodesourcesProperty(commandLine); rmUrl = connectToOrStartResourceManager(commandLine, rmUrl); if (commandLine.hasOption("rm-only")) { return; } SchedulerAuthenticationInterface sai = startScheduler(commandLine, rmUrl); schedAuthInter = sai; rmURL = rmUrl; if (!commandLine.hasOption("no-rest")) { List<String> applicationUrls = (new JettyStarter().deployWebApplications(rmUrl, sai.getHostURL())); if (applicationUrls != null) { for (String applicationUrl : applicationUrls) { if (applicationUrl.endsWith("/rest")) { if (!PASchedulerProperties.SCHEDULER_REST_URL.isSet()) { PASchedulerProperties.SCHEDULER_REST_URL.updateProperty(applicationUrl); } } } } } addShutdownMessageHook(); }

Target:
protected static void start(CommandLine commandLine) throws Exception { ProActiveConfiguration.load(); if (!commandLine.hasOption("no-router")) { startRouter(); } hsqldbServer = new SchedulerHsqldbStarter(); hsqldbServer.startIfNeeded(); String rmUrl = getRmUrl(commandLine); setCleanDatabaseProperties(commandLine); setCleanNodesourcesProperty(commandLine); rmUrl = connectToOrStartResourceManager(commandLine, rmUrl); if (commandLine.hasOption("rm-only")) { return; } SchedulerAuthenticationInterface schedulerAuthenticationInterface = startScheduler(commandLine, rmUrl); schedAuthInter = schedulerAuthenticationInterface; rmURL = rmUrl; if (!commandLine.hasOption("no-rest")) { List<String> applicationUrls = (new JettyStarter().deployWebApplications(rmUrl, schedulerAuthenticationInterface.getHostURL())); if (applicationUrls != null) { for (String applicationUrl : applicationUrls) { if (applicationUrl.endsWith("/rest")) { if (!PASchedulerProperties.SCHEDULER_REST_URL.isSet()) { PASchedulerProperties.SCHEDULER_REST_URL.updateProperty(applicationUrl); } } } } } addShutdownMessageHook(); }
Source:
private HttpMessage createHttpMessageFromFilename(String filename) throws HttpMalformedHeaderException, IOException { HttpMessage msg = new HttpMessage(); String requestUri = URI; requestUri = requestUri.startsWith("http") ? requestUri : "http://" + requestUri; msg.setRequestHeader("GET " + requestUri + " HTTP/1.1"); msg.setResponseHeader( "HTTP/1.1 200 OK\r\n" + "Content-Type: image/jpg\r\n" ); msg.setResponseBody(Files.readAllBytes(Paths.get(IMAGES_DIR + "/" + filename ))); return msg; }

Target:
private HttpMessage createHttpMessageFromFilename(String filename) throws HttpMalformedHeaderException, IOException { HttpMessage msg = new HttpMessage(); String requestUri = URI; msg.setRequestHeader("GET " + requestUri + " HTTP/1.1"); msg.setResponseHeader( "HTTP/1.1 200 OK\r\n" + "Content-Type: image/jpg\r\n" ); msg.setResponseBody(Files.readAllBytes(Paths.get(IMAGES_DIR + "/" + filename ))); return msg; }
Source:
public void updateCustom(SolApplication solApplication, SolInputManager.InputPointer[] inputPointers, boolean clickedOutside) { if (englishControl.isJustOff()) { locale = "en"; } if (germanControl.isJustOff()) { locale = "de"; } if (exitControl.isJustOff()) { if (locale != null) { solApplication.getOptions().setLocale(locale); } solApplication.getOptions().save(); Gdx.app.exit(); } }

Target:
public void updateCustom(SolApplication solApplication, SolInputManager.InputPointer[] inputPointers, boolean clickedOutside) { SolInputManager inputManager = solApplication.getInputManager(); MenuScreens screens = solApplication.getMenuScreens(); if (englishControl.isJustOff()) { locale = "en"; updateLocale(solApplication); inputManager.setScreen(solApplication, screens.languageQuery); } if (germanControl.isJustOff()) { locale = "de"; updateLocale(solApplication); inputManager.setScreen(solApplication, screens.languageQuery); } if (backControl.isJustOff()) { inputManager.setScreen(solApplication, screens.options); } }
Source:
public void appendFrom(ReadableByteChannel channel, long size) throws StoreException { MessageInfo messageInfo = messageInfoList.get(messageIndex); if (messageInfo.getSize() != size) { throw new IllegalStateException("Mismatched buffer length for blob: " + messageInfo.getStoreKey().getID()); } ByteBuffer messageBuf = ByteBuffer.allocate((int) size); int bytesRead = 0; try { while (bytesRead < size) { int readResult = channel.read(messageBuf); if (readResult == -1) { throw new IOException( "Channel read returned -1 before reading expected number of bytes, blobId=" + messageInfo.getStoreKey() .getID()); } bytesRead += readResult; } messageBuf.flip(); cloudBlobStore.putBlob(messageInfo, messageBuf, size); messageIndex++; } catch (StoreException se) { throw se; } catch (IOException | CloudStorageException e) { throw new StoreException(e, StoreErrorCodes.IOError); } }

Target:
public void appendFrom(ReadableByteChannel channel, long size) throws StoreException { MessageInfo messageInfo = messageInfoList.get(messageIndex); if (messageInfo.getSize() != size) { throw new IllegalStateException("Mismatched buffer length for blob: " + messageInfo.getStoreKey().getID()); } ByteBuffer messageBuf = ByteBuffer.allocate((int) size); int bytesRead = 0; try { while (bytesRead < size) { int readResult = channel.read(messageBuf); if (readResult == -1) { throw new IOException( "Channel read returned -1 before reading expected number of bytes, blobId=" + messageInfo.getStoreKey() .getID()); } bytesRead += readResult; } messageBuf.flip(); cloudBlobStore.putBlob(messageInfo, messageBuf, size); messageIndex++; } catch (IOException | CloudStorageException e) { throw new StoreException(e, StoreErrorCodes.IOError); } }
Source:
private static int readInt(File f) throws FileNotFoundException { Scanner s = new Scanner(f); try { return s.nextInt(); } finally { s.close(); } }

Target:
private static int readInt(File f) throws FileNotFoundException { try (Scanner s = new Scanner(f)) { return s.nextInt(); } }
Source:
private WarmUpTimeInSeconds(long warmUpTimeInSeconds) { if (warmUpTimeInSeconds < 0) { throw new IllegalArgumentException( String.format("The warm up time value in seconds. must be > 0. Provided value is %s", warmUpTimeInSeconds )); } this.warmUpTimeInSeconds = warmUpTimeInSeconds; }

Target:
private WarmUpTimeInSeconds(long warmUpTimeInSeconds) { if (warmUpTimeInSeconds < 0) { throw new IllegalArgumentException( String.format("The warm up time value in seconds. must be >= 0. Provided value is %s", warmUpTimeInSeconds )); } this.warmUpTimeInSeconds = warmUpTimeInSeconds; }
Source:
protected final void waitUntil(NodeOutputRule.NodeLog result, Matcher<NodeOutputRule.NodeLog> matcher) { waitUntil(() -> result, matcher, OP_TIMEOUT); }

Target:
protected final void waitUntil(NodeOutputRule.NodeLog result, Matcher<NodeOutputRule.NodeLog> matcher) { waitUntil(() -> result, matcher, getAssertTimeout()); }
Source:
public static final String RPAD(String text, Integer count, String pad) { return StringUtils.leftPad(text, count, pad); }

Target:
public static final String RPAD(String text, Integer count, String pad) { return StringUtils.rightPad(text, count, pad); }
Source:
public void testDynamicTaskLoadingNonexistingTaskClass() throws Exception { List<String> taskClasses = new ArrayList<String>(); taskClasses.add("com.mycompany.mocktask.RandomTask"); DynamicTaskConfig taskConfig = new DynamicTaskConfig("Reindex", "src/test/resources/Reindex.jar", "1.0.0", taskClasses, "com.mycompany.mocktask.MockTaskFactory"); String path = TaskConstants.DYNAMICALLY_LOADED_TASK_PATH + "/Reindex"; removePathIfExists(path); _manager.getHelixDataAccessor().getBaseDataAccessor() .create(path, taskConfig.getTaskConfigZNRecord(), AccessOption.PERSISTENT); TaskDriver driver = new TaskDriver(_manager); String workflowName = TestHelper.getTestMethodName(); submitWorkflow(workflowName, driver); try { TaskState finalState = driver.pollForWorkflowState(workflowName, TaskState.COMPLETED, TaskState.FAILED); AssertJUnit.assertEquals(finalState, TaskState.FAILED); } catch (HelixException e) { AssertJUnit.fail(e.getMessage()); } }

Target:
public void testDynamicTaskLoadingNonexistingTaskClass() throws Exception { String taskCommand = "Reindex"; String taskJarPath = "src/test/resources/Random.jar"; String taskVersion = "1.0.0"; String fullyQualifiedTaskClassName = "com.mycompany.mocktask.RandomTask"; String fullyQualifiedTaskFactoryClassName = "com.mycompany.mocktask.MockTaskFactory"; List<String> taskClasses = new ArrayList(); taskClasses.add(fullyQualifiedTaskClassName); DynamicTaskConfig taskConfig = new DynamicTaskConfig(taskCommand, taskJarPath, taskVersion, taskClasses, fullyQualifiedTaskFactoryClassName); String path = TaskConstants.DYNAMICALLY_LOADED_TASK_PATH + "/" + taskCommand; removePathIfExists(path); _manager.getHelixDataAccessor().getBaseDataAccessor() .create(path, taskConfig.getTaskConfigZNRecord(), AccessOption.PERSISTENT); TaskDriver driver = new TaskDriver(_manager); String workflowName = TestHelper.getTestMethodName(); submitWorkflow(workflowName, driver); TaskState finalState = driver.pollForWorkflowState(workflowName, TaskState.COMPLETED, TaskState.FAILED); Assert.assertEquals(finalState, TaskState.FAILED); }
Source:
public SenseLogIndexer(final IndexTankClient indexTankClient, final String senseLogIndexPrefix, final IndexTankClient.Index senseLogBackupIndex, final JedisPool jedisPool) { this.indexTankClient = indexTankClient; this.senseLogIndexPrefix = senseLogIndexPrefix; this.senseLogBackupIndex = senseLogBackupIndex; this.jedisPool = jedisPool; this.documents = Lists.newArrayList(); this.indexes = Maps.newHashMap(); this.index = senseLogBackupIndex; this.lastBlackListFetchDateTime = DateTime.now(DateTimeZone.UTC); this.senseBlackList = getSenseBlackList(); }

Target:
public SenseLogIndexer(final IndexTankClient indexTankClient, final String senseLogIndexPrefix, final IndexTankClient.Index senseLogBackupIndex, final JedisPool jedisPool) { this.indexTankClient = indexTankClient; this.senseLogIndexPrefix = senseLogIndexPrefix; this.senseLogBackupIndex = senseLogBackupIndex; this.jedisPool = jedisPool; this.documents = Lists.newArrayList(); this.indexes = Maps.newHashMap(); this.index = senseLogBackupIndex; this.lastBlackListFetchDateTime = DateTime.now(DateTimeZone.UTC); this.senseBlackList = Sets.newHashSet(); this.blackListUpdateCount = 0; }
Source:
public void allInsertedNumbersAreLoadedAsBigDecimal_fromCache() { DummyObject dummy = objectStorage.get("DummyObject"); Assert.assertTrue(dummy.configuration.get("testShort") instanceof BigDecimal); Assert.assertTrue(dummy.configuration.get("testInt") instanceof BigDecimal); Assert.assertTrue(dummy.configuration.get("testLong") instanceof BigDecimal); Assert.assertTrue(dummy.configuration.get("testDouble") instanceof BigDecimal); Assert.assertTrue(dummy.configuration.get("testFloat") instanceof BigDecimal); Assert.assertTrue(dummy.configuration.get("testBigDecimal") instanceof BigDecimal); Assert.assertTrue(dummy.configuration.get("testBoolean") instanceof Boolean); Assert.assertTrue(dummy.configuration.get("testString") instanceof String); }

Target:
public void allInsertedNumbersAreLoadedAsBigDecimal_fromCache() { objectStorage.put("DummyObject", new DummyObject()); DummyObject dummy = objectStorage.get("DummyObject"); assertTrue(dummy.configuration.get("testShort") instanceof BigDecimal); assertTrue(dummy.configuration.get("testInt") instanceof BigDecimal); assertTrue(dummy.configuration.get("testLong") instanceof BigDecimal); assertTrue(dummy.configuration.get("testDouble") instanceof BigDecimal); assertTrue(dummy.configuration.get("testFloat") instanceof BigDecimal); assertTrue(dummy.configuration.get("testBigDecimal") instanceof BigDecimal); assertTrue(dummy.configuration.get("testBoolean") instanceof Boolean); assertTrue(dummy.configuration.get("testString") instanceof String); }
Source:
public float getDefaultPlaybackSpeed() { return pref.getFloat(PrefManager.Key.PLAYBACK_SPEED, NORMAL_PLAYBACK_SPEED); }

Target:
public float getDefaultPlaybackSpeed() { return pref.getFloat(PrefManager.Key.PLAYBACK_SPEED, VideoPlaybackSpeed.NORMAL.getSpeedValue()); }
Source:
public void run(StreamApplication streamApp) { JmxServer jmxServer = null; try { jmxServer = new JmxServer(); ContainerModel containerModel = jobModel.getContainers().get(containerId); Object taskFactory = TaskFactoryUtil.createTaskFactory(config, streamApp, this); container = SamzaContainer$.MODULE$.apply( containerModel, config, jobModel.maxChangeLogStreamPartitions, jmxServer, Util.<String, MetricsReporter>javaMapAsScalaMap(new HashMap<>()), taskFactory); container.setContainerListener( new SamzaContainerListener() { @Override public void onContainerStart() { log.info("Container Started"); } @Override public void onContainerStop(boolean invokedExternally) { log.info("Container Stopped"); } @Override public void onContainerFailed(Throwable t) { log.info("Container Failed"); containerException = t; } }); containerHeartbeatMonitor = getContainerHeartbeatMonitor(); if (containerHeartbeatMonitor != null) { containerHeartbeatMonitor.start(); } container.run(); } finally { if (containerHeartbeatMonitor != null) { containerHeartbeatMonitor.stop(); } if (jmxServer != null) { jmxServer.stop(); } } if (containerException != null) { log.error("Container stopped with Exception. Exiting process now.", containerException); System.exit(1); } }

Target:
public void run(StreamApplication streamApp) { ContainerModel containerModel = jobModel.getContainers().get(containerId); Object taskFactory = TaskFactoryUtil.createTaskFactory(config, streamApp, this); container = SamzaContainer$.MODULE$.apply( containerModel, config, jobModel.maxChangeLogStreamPartitions, Util.<String, MetricsReporter>javaMapAsScalaMap(new HashMap<>()), taskFactory); container.setContainerListener( new SamzaContainerListener() { @Override public void onContainerStart() { log.info("Container Started"); } @Override public void onContainerStop(boolean invokedExternally) { log.info("Container Stopped"); } @Override public void onContainerFailed(Throwable t) { log.info("Container Failed"); containerRunnerException = t; } }); startContainerHeartbeatMonitor(); container.run(); stopContainerHeartbeatMonitor(); if (containerRunnerException != null) { log.error("Container stopped with Exception. Exiting process now.", containerRunnerException); System.exit(1); } }
Source:
public void edit(final GlusterVolumeSnapshotModel object) { driver.edit(object); forceWarningLabel.setVisible(object.getForceCreate().getEntity()); }

Target:
public void edit(final GlusterVolumeSnapshotModel object) { driver.edit(object); setForceLabelVisibility(object.getForceCreate().getEntity()); }
Source:
protected void bindCommonIntegration() { bind(ITypeResolver.class).to(UiCommonDefaultTypeResolver.class).in(Singleton.class); bind(FrontendEventsHandlerImpl.class).in(Singleton.class); bind(FrontendFailureEventListener.class).in(Singleton.class); bind(ILogger.class).to(LoggerImpl.class).in(Singleton.class); bindConsoles(); }

Target:
protected void bindCommonIntegration() { bind(ITypeResolver.class).to(UiCommonDefaultTypeResolver.class).asEagerSingleton(); bind(FrontendEventsHandlerImpl.class).in(Singleton.class); bind(FrontendFailureEventListener.class).in(Singleton.class); bind(ILogger.class).to(LoggerImpl.class).in(Singleton.class); bindConsoles(); }