auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public SchemaBuilder addMultiValueDimension(String dimensionName, DataType dataType, int maxLength, <START> Object defaultNullValue) { <END> _schema.addField(new DimensionFieldSpec(dimensionName, dataType, false, maxLength, defaultNullValue)); return this; }</code><technical_language>Reformat this</technical_language>

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:
<code>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) <START> .collect(Collectors.toList()); <END> ConvertToBibtexCleanup converter = new ConvertToBibtexCleanup(); result.forEach(converter::cleanup); return result; }</code><technical_language>cleanup done right .limit? If easy, add .forEach .collect initialize converter result variable</technical_language>

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:
<code>protected void resultsHide() { super.resultsHide(); String topPosition = getDropdown().css("top"); <START> if(topPosition.equals("-9000px") && isMobileAnimated()) { <END> 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", ""); } }</code><technical_language>format</technical_language>

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:
<code><START> public Publisher<ResultSummary> printAllProductsReactor() <END> { 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 ); }</code><technical_language>return actual implementation here? In end wanna demonstrate example. fit tests for example</technical_language>

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:
<code>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(), <START> getVds().getStoragePoolId()); <END> storageDomainStaticDao.update(getStorageDomain().getStorageStaticData()); setSucceeded(true); } }</code><technical_language>I flow problematic. happen if hosts in DC, Host call CreateVG other Host try call fillMetadataDevicesInfo</technical_language>

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:
<code>public AuditLogType getAuditLogTypeValue() { switch (getActionState()) { case EXECUTE: <START> if (getParameters().getDiskInfo().getDiskStorageType() == DiskStorageType.IMAGE || <END> 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; } }</code><technical_language>Consider re-extrract this method more meaningless 'isDiskStorageTypeSupportExecute()'</technical_language>

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:
<code><START> private void fastSyncDbJobs() { <END> 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(); }</code><technical_language>WorldManager is place for code. move separate class</technical_language>

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:
<code>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) ? <START> requet -> new RequestContext() : <END> _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; }</code><technical_language>minor: typo for requet</technical_language>

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:
<code>public Connection getResult(long timeout) throws SQLException { <START> long expiry = System.nanoTime() / (long)1E6 + timeout; <END> 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.")); } } } }</code><technical_language>long expiry = TimeUnit.NANOSECONDS.toMillis(System.nanoTime()) + timeout;</technical_language>

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:
<code>public GetTaskListCommandParameters(Guid vdsId) { <START> _vdsId = vdsId; <END> _spUUID = null; }</code><technical_language>I prefer underscores :)</technical_language>

Target:
public GetTaskListCommandParameters(Guid vdsId) { spUUID = null; }
Source:
<code>ValidationResult validateNotRemovingUsedNetworkByVms(String removedNetworkName) { final List<String> removedNetworkNames = Collections.singletonList(removedNetworkName); final List<String> vmsNames = findActiveVmsUsingNetwork.findNamesOfActiveVmsUsingNetworks(host.getId(), removedNetworkNames); <START> if (vmsNames.isEmpty()) { <END> 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())); } }</code><technical_language>I mind, get rid of "else" (will slightly more readable): if (!vmNames){ } return Valid; this is a matter of personal aesthetics, I leave :)</technical_language>

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:
<code>public Optional<Bucket> getBucket(InputRow inputRow) { final Optional<Interval> timeBucket = schema.getDataSchema().getGranularitySpec().bucketInterval( new DateTime( inputRow.getTimestampFromEpoch() ) ); if (!timeBucket.isPresent()) { return Optional.absent(); } <START> DateTime bucketStart = timeBucket.get().getStart(); <END> 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() ) ); }</code><technical_language>final</technical_language>

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:
<code>public void checkConfigFile(File configFile){ try { ServerFeature servUtil = new ServerFeature(); <START> log.info("serverDirectory: " + serverDirectory + "; exists: " + serverDirectory.exists()); <END> 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); } }</code><technical_language>log level info</technical_language>

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:
<code>public ThreadPoolFactory threadPoolFactory() { try { ClassLoader loader = Thread.currentThread().getContextClassLoader(); <START> Class<?> cls = loader.loadClass( <END> "com.github.tomakehurst.wiremock.jetty9.QueuedThreadPoolFactory" ); return (ThreadPoolFactory) cls.newInstance(); } catch (Exception e) { return throwUnchecked(e, null); } }</code><technical_language>do need do this way, instantiating directly</technical_language>

Target:
public ThreadPoolFactory threadPoolFactory() { return new QueuedThreadPoolFactory(); }
Source:
<code>protected void before() throws Throwable { <START> if (session == null) { <END> 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)); }</code><technical_language>Change Assert.state(session != null, "Session initialized");</technical_language>

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:
<code>public UndefinedThrowable() { this(NotificationLevel.STEP); <START> } <END></code><technical_language>This constructor is used. I guess removed</technical_language>

Target:
public UndefinedThrowable() { super("This step is undefined", null, false, false); }
Source:
<code>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; } <START> SchedulerAuthenticationInterface sai = startScheduler(commandLine, rmUrl); <END> 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(); }</code><technical_language>give this "sai" a longer more expressive name</technical_language>

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:
<code>private HttpMessage createHttpMessageFromFilename(String filename) throws HttpMalformedHeaderException, IOException { HttpMessage msg = new HttpMessage(); String requestUri = URI; <START> requestUri = requestUri.startsWith("http") ? requestUri : "http://" + requestUri; <END> 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; }</code><technical_language>This previous statement removed (URI is final)</technical_language>

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:
<code>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(); <START> Gdx.app.exit(); <END> } }</code><technical_language>exit game</technical_language>

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:
<code>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++; <START> } catch (StoreException se) { <END> throw se; } catch (IOException | CloudStorageException e) { throw new StoreException(e, StoreErrorCodes.IOError); } }</code><technical_language>is this clause added? is immediately rethrowing exc</technical_language>

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:
<code>private static int readInt(File f) throws FileNotFoundException { <START> Scanner s = new Scanner(f); try { return s.nextInt(); } finally { s.close(); } <END> }</code><technical_language>I write this as: try (Scanner s = new Scanner(f)) { return s.nextInt(); } (and similar for FileOutputStream below)</technical_language>

Target:
private static int readInt(File f) throws FileNotFoundException { try (Scanner s = new Scanner(f)) { return s.nextInt(); } }
Source:
<code>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", <START> warmUpTimeInSeconds <END> )); } this.warmUpTimeInSeconds = warmUpTimeInSeconds; }</code><technical_language>Incorrect message. Shoul >= Please check</technical_language>

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:
<code>protected final void waitUntil(NodeOutputRule.NodeLog result, Matcher<NodeOutputRule.NodeLog> matcher) { <START> waitUntil(() -> result, matcher, OP_TIMEOUT); <END> }</code><technical_language>overridable getOperationTimeout() method instead</technical_language>

Target:
protected final void waitUntil(NodeOutputRule.NodeLog result, Matcher<NodeOutputRule.NodeLog> matcher) { waitUntil(() -> result, matcher, getAssertTimeout()); }
Source:
<code>public static final String RPAD(String text, Integer count, String pad) { <START> return StringUtils.leftPad(text, count, pad); <END> }</code><technical_language>suggestion return StringUtils.rightPad(text, count, pad); Wrong method</technical_language>

Target:
public static final String RPAD(String text, Integer count, String pad) { return StringUtils.rightPad(text, count, pad); }
Source:
<code>public void testDynamicTaskLoadingNonexistingTaskClass() throws Exception { <START> List<String> taskClasses = new ArrayList<String>(); <END> 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()); } }</code><technical_language>Style</technical_language>

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:
<code>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); <START> this.senseBlackList = getSenseBlackList(); <END> }</code><technical_language>This done here</technical_language>

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:
<code>public void allInsertedNumbersAreLoadedAsBigDecimal_fromCache() { DummyObject dummy = objectStorage.get("DummyObject"); <START> Assert.assertTrue(dummy.configuration.get("testShort") instanceof BigDecimal); <END> 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); }</code><technical_language>assertTrue a static import</technical_language>

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:
<code><START> public float getDefaultPlaybackSpeed() { <END> return pref.getFloat(PrefManager.Key.PLAYBACK_SPEED, NORMAL_PLAYBACK_SPEED); }</code><technical_language>word 'Default' in it. confusing, getVideoPlaybackSpeed</technical_language>

Target:
public float getDefaultPlaybackSpeed() { return pref.getFloat(PrefManager.Key.PLAYBACK_SPEED, VideoPlaybackSpeed.NORMAL.getSpeedValue()); }
Source:
<code>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; } }); <START> containerHeartbeatMonitor = getContainerHeartbeatMonitor(); <END> 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); } }</code><technical_language>re-name getXXX() createXXX() if is creating a new object. OTOH, retain getXX() if returning a cached copy</technical_language>

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:
<code>public void edit(final GlusterVolumeSnapshotModel object) { driver.edit(object); <START> forceWarningLabel.setVisible(object.getForceCreate().getEntity()); <END> }</code><technical_language>method for this, avoid duplicating code: setForceLabelVisibility(object.getForceCreate().getEntity());</technical_language>

Target:
public void edit(final GlusterVolumeSnapshotModel object) { driver.edit(object); setForceLabelVisibility(object.getForceCreate().getEntity()); }
Source:
<code>protected void bindCommonIntegration() { <START> bind(ITypeResolver.class).to(UiCommonDefaultTypeResolver.class).in(Singleton.class); <END> bind(FrontendEventsHandlerImpl.class).in(Singleton.class); bind(FrontendFailureEventListener.class).in(Singleton.class); bind(ILogger.class).to(LoggerImpl.class).in(Singleton.class); bindConsoles(); }</code><technical_language>Please this eager singleton UiCommonDefaultTypeResolver.attachRestApiSessionIdHandler executed login happens. Currently works BaseApplicationInit(which is eager singleton) injects it, I more explicit it</technical_language>

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(); }
Source:
<code>public void testWithAppPolicy() { Reader input = Streams.reader(new ResourceUtils(this).getResourceFromUrl("test-app-with-policy.yaml")); AssemblyTemplate at = platform.pdp().registerDeploymentPlan(input); try { Assembly assembly = at.getInstantiator().newInstance().instantiate(at, platform); log.info("Test - created " + assembly); final Entity app = brooklynMgmt.getEntityManager().getEntity(assembly.getId()); log.info("App - " + app); Assert.assertEquals(app.getDisplayName(), "test-app-with-policy"); Set<Task<?>> tasks = BrooklynTasks.getTasksInEntityContext(brooklynMgmt.getExecutionManager(), app); log.info("Waiting on " + tasks.size() + " task(s)"); for (Task<?> t : tasks) { t.blockUntilEnded(); } log.info("App started:"); Entities.dumpInfo(app); Assert.assertEquals(app.getPolicies().size(), 1); Policy policy = app.getPolicies().iterator().next(); Assert.assertTrue(policy instanceof TestPolicy); Assert.assertEquals(policy.getConfig(TestPolicy.CONF_NAME), "Name from YAML"); Assert.assertEquals(policy.getConfig(TestPolicy.CONF_FROM_FUNCTION), "$brooklyn: is a fun place"); Map<?, ?> leftoverProperties = ((TestPolicy)policy).getLeftoverProperties(); Assert.assertEquals(leftoverProperties.get("policyLiteralValue1"), "Hello"); Assert.assertEquals(leftoverProperties.get("policyLiteralValue2"), "World"); Assert.assertEquals(leftoverProperties.size(), 2); } catch (Exception e) { log.warn("Unable to instantiate " + at + " (rethrowing): " + e); <START> throw Exceptions.propagate(e); <END> } }</code><technical_language>declare test throws Exception throw e wrapping non-runtime-exceptions this. I personally tests declared throws Exception if adjusts a method signature throw a (different) exception tests mind, testing specific exception is thrown</technical_language>

Target:
public void testWithAppPolicy() throws Exception { Entity app = createAndStartApplication("test-app-with-policy.yaml"); waitForApplicationTasks(app); Assert.assertEquals(app.getDisplayName(), "test-app-with-policy"); log.info("App started:"); Entities.dumpInfo(app); Assert.assertEquals(app.getPolicies().size(), 1); Policy policy = app.getPolicies().iterator().next(); Assert.assertTrue(policy instanceof TestPolicy); Assert.assertEquals(policy.getConfig(TestPolicy.CONF_NAME), "Name from YAML"); Assert.assertEquals(policy.getConfig(TestPolicy.CONF_FROM_FUNCTION), "$brooklyn: is a fun place"); Map<?, ?> leftoverProperties = ((TestPolicy) policy).getLeftoverProperties(); Assert.assertEquals(leftoverProperties.get("policyLiteralValue1"), "Hello"); Assert.assertEquals(leftoverProperties.get("policyLiteralValue2"), "World"); Assert.assertEquals(leftoverProperties.size(), 2); }
Source:
<code>public boolean acceptsReleases() { <START> return true; <END> }</code><technical_language>Defaulting true (and below) is a good idea, honest. repositories a snapshot, release policy. Usually, (statistically speaking), more group repositories. Hence, defaulting false more reasonable. Although, this, in a way, is cosmetic</technical_language>

Target:
public boolean acceptsReleases() { return acceptReleases; }
Source:
<code>private void installAllure() throws MavenReportException{ try { getLog().info(String.format("Allure installation directory %s", getInstallDirectory())); getLog().info(String.format("Try to finding out allure %s", reportVersion != null ? reportVersion : ALLURE_DEFAULT_VERSION)); AllureCommandline commandline <START> = new AllureCommandline(Paths.get(getInstallDirectory()), reportVersion, null); <END> if (commandline.allureNotExists()) { getLog().info("Downloading allure commandline..."); commandline.download(allureDownloadUrl, ProxyUtils.getProxy(session, decrypter)); getLog().info("Downloading allure commandline complete"); } } catch (Exception e) { getLog().error("Can't install allure", e); throw new MavenReportException("Can't install allure", e); } }</code><technical_language>constructor arguments instead of null parameter</technical_language>

Target:
private void installAllure() throws MavenReportException{ try { getLog().info(String.format("Allure installation directory %s", getInstallDirectory())); getLog().info(String.format("Try to finding out allure %s", reportVersion != null ? reportVersion : ALLURE_DEFAULT_VERSION)); AllureCommandline commandline = new AllureCommandline(Paths.get(getInstallDirectory()), reportVersion); if (commandline.allureNotExists()) { getLog().info("Downloading allure commandline..."); commandline.download(allureDownloadUrl, ProxyUtils.getProxy(session, decrypter)); getLog().info("Downloading allure commandline complete"); } } catch (Exception e) { getLog().error("Can't install allure", e); throw new MavenReportException("Can't install allure", e); } }
Source:
<code>public void delete(String key, int version) { try { lock.writeLock().lock(); FeatureFlag f = features.get(key); if (f != null && f.getVersion() < version) { <START> f.setDeleted(); <END> f.setVersion(version); features.put(key, f); } else if (f == null) { f = new FeatureFlagBuilder(key) .deleted(true) .version(version) .build(); features.put(key, f); } } finally { lock.writeLock().unlock(); } }</code><technical_language>discussed, builder instead of mutating object</technical_language>

Target:
public void delete(String key, int version) { try { lock.writeLock().lock(); FeatureFlag f = features.get(key); if (f != null && f.getVersion() < version) { FeatureFlagBuilder newBuilder = new FeatureFlagBuilder(f); newBuilder.on(false); newBuilder.version(version); features.put(key, newBuilder.build()); } else if (f == null) { f = new FeatureFlagBuilder(key) .deleted(true) .version(version) .build(); features.put(key, f); } } finally { lock.writeLock().unlock(); } }
Source:
<code>public Provider createProviderFromUser(User user){ Provider p = new Provider(); if (user == null || user.getPerson() == null){ throw new APIException("User cannot be null"); } else if (Context.getProviderService().getProvidersByPerson(user.getPerson()).isEmpty()){ p.setPerson(user.getPerson()); return Context.getProviderService().saveProvider(p); <START> } else { <END> log.warn("Provider already exists for user"); return Context.getProviderService().getProvidersByPerson(user.getPerson()).iterator().next(); } }</code><technical_language>avoid else statement here, is unnecessary (refer [this](<LINK_0> simply write: if (user == null || user.getPerson() == null){ throw new APIException("User null"); } else if (Context.getProviderService().getProvidersByPerson(user.getPerson()).isEmpty()){ p.setPerson(user.getPerson()); return Context.getProviderService().saveProvider(p); } log.warn("Provider exists for user"); return Context.getProviderService().getProvidersByPerson(user.getPerson()).iterator().next();</technical_language>

Target:
public Provider createProviderFromUser(User user){ Provider p = new Provider(); if (user == null || user.getPerson() == null){ throw new APIException("User cannot be null"); } else if (Context.getProviderService().getProvidersByPerson(user.getPerson()).isEmpty()){ p.setPerson(user.getPerson()); return Context.getProviderService().saveProvider(p); } log.warn("Provider already exists for user"); return Context.getProviderService().getProvidersByPerson(user.getPerson()).iterator().next(); }
Source:
<code>public Double getMaxRowCount(Aggregate rel, RelMetadataQuery mq) { if (rel.getGroupSet().isEmpty()) { return 1D; } if (rel.getGroupType() == Aggregate.Group.SIMPLE) { <START> boolean isGroupbyKeysConstant = false; <END> final RelOptPredicateList predicateList = mq.getPulledUpPredicates(rel.getInput()); if (predicateList != null) { isGroupbyKeysConstant = true; for (int key:rel.getGroupSet()) { final RexInputRef ref = rel.getCluster().getRexBuilder().makeInputRef(rel.getInput(), key); if (!predicateList.constantMap.containsKey(ref)) { isGroupbyKeysConstant = false; break; } } if (isGroupbyKeysConstant) { return 1D; } } } final Double rowCount = mq.getMaxRowCount(rel.getInput()); if (rowCount == null) { return null; } return rowCount * rel.getGroupSets().size(); }</code><technical_language>variable defined in L141</technical_language>

Target:
public Double getMaxRowCount(Aggregate rel, RelMetadataQuery mq) { if (rel.getGroupSet().isEmpty()) { return 1D; } if (rel.getGroupType() == Aggregate.Group.SIMPLE) { final RelOptPredicateList predicateList = mq.getPulledUpPredicates(rel.getInput()); if (predicateList != null) { boolean isGroupbyKeysConstant = true; for (int key:rel.getGroupSet()) { final RexInputRef ref = rel.getCluster().getRexBuilder().makeInputRef(rel.getInput(), key); if (!predicateList.constantMap.containsKey(ref)) { isGroupbyKeysConstant = false; break; } } if (isGroupbyKeysConstant) { return 1D; } } } final Double rowCount = mq.getMaxRowCount(rel.getInput()); if (rowCount == null) { return null; } return rowCount * rel.getGroupSets().size(); }
Source:
<code>private String authenticate() throws Exception { HttpResponse httpResponse = httpClient.execute(authHost, buildAuthRequest(consumerCredential, authUriRoot)); int statusCode = httpResponse.getStatusLine().getStatusCode(); if (statusCode == 200) { String jsonContent = IOUtils.toString(httpResponse.getEntity().getContent(), DEFAULT_CHARSET); JsonObject jsonObject = jsonParser.parse(jsonContent).getAsJsonObject(); JsonElement accessToken = jsonObject.get("access_token"); if (accessToken == null) { throw new PatentServiceException("access token is missing: " + jsonContent); } else { return accessToken.getAsString(); } } else { <START> String errMessage = "Authentication failed! HTTP status code when accessing endpoint: " + statusCode + ", full status: " + httpResponse.getStatusLine() + ", server response: " + EntityUtils.toString(httpResponse.getEntity()); <END> throw new PatentServiceException(errMessage); } }</code><technical_language>String.format here</technical_language>

Target:
private String authenticate() throws Exception { HttpResponse httpResponse = httpClient.execute(authHost, buildAuthRequest(consumerCredential, authUriRoot)); int statusCode = httpResponse.getStatusLine().getStatusCode(); if (statusCode == 200) { String jsonContent = IOUtils.toString(httpResponse.getEntity().getContent(), DEFAULT_CHARSET); JsonObject jsonObject = jsonParser.parse(jsonContent).getAsJsonObject(); JsonElement accessToken = jsonObject.get("access_token"); if (accessToken == null) { throw new PatentServiceException("access token is missing: " + jsonContent); } else { return accessToken.getAsString(); } } else { throw new PatentServiceException(String.format( "Authentication failed! HTTP status code when accessing endpoint: %d, full status: %s, server response: %s", statusCode, httpResponse.getStatusLine(), EntityUtils.toString(httpResponse.getEntity()))); } }
Source:
<code>public void testAcceptableTokenIsColon() { final NoWhitespaceBeforeCaseDefaultColonCheck check = new NoWhitespaceBeforeCaseDefaultColonCheck(); final int[] acceptableTokens = check.getAcceptableTokens(); <START> assertTrue(acceptableTokens.length == 1 && acceptableTokens[0] == TokenTypes.COLON, <END> "Acceptable token should be colon"); }</code><technical_language>assertArrayEquals</technical_language>

Target:
public void testAcceptableTokenIsColon() { final NoWhitespaceBeforeCaseDefaultColonCheck check = new NoWhitespaceBeforeCaseDefaultColonCheck(); assertArrayEquals(new int[] {TokenTypes.COLON}, check.getAcceptableTokens(), "Acceptable token should be colon"); }