auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void shouldDeliverMessageWithoutKeepAliveHeaderUsingHttp2() { int httpsPort = Ports.nextAvailable(); String httpsEndpoint = "https://localhost:" + httpsPort; Undertow http2Server = http2Server(httpsPort, exchange -> { <START> if (exchange.getRequestHeaders().contains("keep-alive")) { <END> fail("Keep-Alive header should not be present in HTTP/2 request headers"); } else { exchange.getResponseSender().send(Integer.toString(incomingCounter.incrementAndGet())); } }); http2Server.start(); Topic topic = createTopicAndSubscription(httpsEndpoint); Response response = publisher.publish(topic.getQualifiedName(), MESSAGE_BODY); assertThat(response).hasStatus(CREATED); wait.until(() -> assertThat(incomingCounter.intValue()).isPositive()); http2Server.stop(); }</code><technical_language>apply case-insensitive comparison</technical_language>

Target:
public void shouldDeliverMessageWithoutKeepAliveHeaderUsingHttp2() { int httpsPort = Ports.nextAvailable(); HttpString keepAliveHeader = new HttpString("Keep-Alive"); String httpsEndpoint = "https://localhost:" + httpsPort; Undertow http2Server = http2Server(httpsPort, exchange -> { if (!exchange.getProtocol().equals(HTTP_2_0)) { fail("Exchange protocol should be set to HTTP/2"); } if (exchange.getRequestHeaders().contains(keepAliveHeader)) { fail("Keep-Alive header should not be present in HTTP/2 request headers"); } else { exchange.getResponseSender().send(Integer.toString(incomingCounter.incrementAndGet())); } }); http2Server.start(); Topic topic = createTopicAndSubscriptionWithHttp2Enabled(httpsEndpoint); Response response = publisher.publish(topic.getQualifiedName(), MESSAGE_BODY); assertThat(response).hasStatus(CREATED); wait.until(() -> assertThat(incomingCounter.intValue()).isPositive()); http2Server.stop(); }
Source:
<code>public static boolean isValid(String acc) { boolean looksLikeSRA = false; File f = new File(acc); if (f.isFile()) { try { byte[] buffer = new byte[8]; byte[] signature1 = "NCBI.sra".getBytes(); byte[] signature2 = "NCBInenc".getBytes(); <START> InputStream is = new FileInputStream(f); <END> int numRead = is.read(buffer); is.close(); looksLikeSRA = numRead == buffer.length && (Arrays.equals(buffer, signature1) || Arrays.equals(buffer, signature2)); } catch (IOException e) { looksLikeSRA = false; } } else if (f.exists()) { looksLikeSRA = false; } else { looksLikeSRA = acc.toUpperCase().matches ( "^[SED]RR[0-9]{6,9}$" ); } if (!looksLikeSRA) return false; return isSupported() && NGS.isValid(acc); }</code><technical_language>java 8 now! this a try-with resources close done implicitly</technical_language>

Target:
public static boolean isValid(String acc) { boolean looksLikeSRA = false; File f = new File(acc); if (f.isFile()) { byte[] buffer = new byte[8]; byte[] signature1 = "NCBI.sra".getBytes(); byte[] signature2 = "NCBInenc".getBytes(); try (InputStream is = new FileInputStream(f)) { int numRead = is.read(buffer); looksLikeSRA = numRead == buffer.length && (Arrays.equals(buffer, signature1) || Arrays.equals(buffer, signature2)); } catch (IOException e) { looksLikeSRA = false; } } else if (f.exists()) { looksLikeSRA = false; } else { looksLikeSRA = acc.toUpperCase().matches ( "^[SED]RR[0-9]{6,9}$" ); } if (!looksLikeSRA) return false; return isSupported() && NGS.isValid(acc); }
Source:
<code>public void handleException(HttpServletRequest request, HttpServletResponse response, Throwable t) throws IOException, ServletException { if (response.containsHeader("Cache-Control")) { response.setHeader("Cache-Control", "no-cache"); } Throwable unwrappedException = ExceptionHelper.unwrapException(t); if (!ExceptionHelper.isSecurityError(unwrappedException) && !response.containsHeader(SSO_INITIAL_URL_REQUEST_KEY)) { super.handleException(request, response, t); return; } Principal principal = request.getUserPrincipal(); if (principal == null) { <START> LoginContext loginContext = (LoginContext) request.getAttribute("org.nuxeo.ecm.login.context"); <END> principal = (Principal) loginContext.getSubject().getPrincipals().toArray()[0]; } if (principal instanceof NuxeoPrincipal) { NuxeoPrincipal nuxeoPrincipal = (NuxeoPrincipal) principal; if (nuxeoPrincipal.isAnonymous()) { response.resetBuffer(); String urlToReach = getURLToReach(request); Cookie cookieUrlToReach = new Cookie(NXAuthConstants.SSO_INITIAL_URL_REQUEST_KEY, urlToReach); cookieUrlToReach.setPath("/"); cookieUrlToReach.setMaxAge(60); response.addCookie(cookieUrlToReach); if (!response.isCommitted()) { request.getRequestDispatcher(CAS_REDIRECTION_URL).forward(request, response); } parameters.getListener().responseComplete(); return; } } super.handleException(request, response, t); }</code><technical_language>Please NXAuthConstants.LOGINCONTEXT_KEY instead of explicit string</technical_language>

Target:
public void handleException(HttpServletRequest request, HttpServletResponse response, Throwable t) throws IOException, ServletException { if (response.containsHeader("Cache-Control")) { response.setHeader("Cache-Control", "no-cache"); } Throwable unwrappedException = ExceptionHelper.unwrapException(t); if (!ExceptionHelper.isSecurityError(unwrappedException) && !response.containsHeader(SSO_INITIAL_URL_REQUEST_KEY)) { super.handleException(request, response, t); return; } Principal principal = request.getUserPrincipal(); if (principal == null) { LoginContext loginContext = (LoginContext) request.getAttribute(LOGINCONTEXT_KEY); Subject subject = loginContext.getSubject(); if (subject != null) { Set<Principal> principals = subject.getPrincipals(); if (principals != null && !principals.isEmpty()) { principal = (Principal) principals.toArray()[0]; } } } if (principal instanceof NuxeoPrincipal) { NuxeoPrincipal nuxeoPrincipal = (NuxeoPrincipal) principal; if (nuxeoPrincipal.isAnonymous()) { response.resetBuffer(); String urlToReach = getURLToReach(request); Cookie cookieUrlToReach = new Cookie(NXAuthConstants.SSO_INITIAL_URL_REQUEST_KEY, urlToReach); cookieUrlToReach.setPath("/"); cookieUrlToReach.setMaxAge(60); response.addCookie(cookieUrlToReach); if (!response.isCommitted()) { request.getRequestDispatcher(CAS_REDIRECTION_URL).forward(request, response); } parameters.getListener().responseComplete(); return; } } super.handleException(request, response, t); }
Source:
<code>public KeyWrapResult wrapKey(KeyWrapAlgorithm algorithm, byte[] key) { <START> return client.wrapKey(algorithm, key, Context.NONE).block(); <END> }</code><technical_language>this call method L290</technical_language>

Target:
public KeyWrapResult wrapKey(KeyWrapAlgorithm algorithm, byte[] key) { return wrapKey(algorithm, key, Context.NONE); }
Source:
<code>public void setBeaconAdvertisingData(String uuid, Integer major, Integer minor, String companyCode, Integer txPower, boolean LELimited, boolean LEGeneral, boolean BR_EDRSupported, boolean LE_BRController, boolean LE_BRHost) { BluetoothConfigurationProcessListener bbl = new BluetoothConfigurationProcessListener(this.bbcl); String[] dataHex = toStringArray(BluetoothAdvertisingData.getData(uuid, major, minor, companyCode, txPower, LELimited, LEGeneral, BR_EDRSupported, LE_BRController, LE_BRHost)); String[] cmd = new String[3 + dataHex.length]; cmd[0] = "cmd"; cmd[1] = OGF_CONTROLLER_CMD; cmd[2] = OCF_ADVERTISING_DATA_CMD; for (int i = 0; i < dataHex.length; i++) { cmd[i + 3] = dataHex[i]; } logger.debug("Set Advertising Data : hcitool -i cmd {}", this.name, OGF_CONTROLLER_CMD, OCF_ADVERTISING_DATA_CMD, Arrays.toString(dataHex)); logger.info("Set Advertising Data on interface {}", this.name); <START> try { <END> BluetoothUtil.hcitoolCmd(this.name, cmd, bbl, this.executorService); } catch (IOException e) { logger.error("Failed to set beacon advertising data", e); } }</code><technical_language>this try/catch moved a specific method</technical_language>

Target:
public void setBeaconAdvertisingData(String uuid, Integer major, Integer minor, String companyCode, Integer txPower, boolean LELimited, boolean LEGeneral, boolean BR_EDRSupported, boolean LE_BRController, boolean LE_BRHost) { BluetoothConfigurationProcessListener bbl = new BluetoothConfigurationProcessListener(this.bbcl); String[] dataHex = toStringArray(BluetoothAdvertisingData.getData(uuid, major, minor, companyCode, txPower, LELimited, LEGeneral, BR_EDRSupported, LE_BRController, LE_BRHost)); String[] cmd = new String[3 + dataHex.length]; cmd[0] = "cmd"; cmd[1] = OGF_CONTROLLER_CMD; cmd[2] = OCF_ADVERTISING_DATA_CMD; for (int i = 0; i < dataHex.length; i++) { cmd[i + 3] = dataHex[i]; } logger.debug("Set Advertising Data : hcitool -i cmd {}", this.name, OGF_CONTROLLER_CMD, OCF_ADVERTISING_DATA_CMD, Arrays.toString(dataHex)); logger.info("Set Advertising Data on interface {}", this.name); runHcitoolCmd(bbl, cmd); }
Source:
<code>public void attachFile(EntityReference pageReference, String name, InputStream is, boolean failIfExists, UsernamePasswordCredentials credentials) throws Exception { UsernamePasswordCredentials currentCredentials = getDefaultCredentials(); EntityReference reference = new EntityReference(name, EntityType.ATTACHMENT, pageReference); try { if (credentials != null) { setDefaultCredentials(credentials); } attachFile(reference, is, failIfExists); } finally { <START> setDefaultCredentials(currentCredentials); <END> } }</code><technical_language>I call this method if credentials changed, more performant</technical_language>

Target:
public void attachFile(EntityReference pageReference, String name, InputStream is, boolean failIfExists, UsernamePasswordCredentials credentials) throws Exception { UsernamePasswordCredentials currentCredentials = getDefaultCredentials(); EntityReference reference = new EntityReference(name, EntityType.ATTACHMENT, pageReference); try { if (credentials != null) { setDefaultCredentials(credentials); } attachFile(reference, is, failIfExists); } finally { if (credentials != null) { setDefaultCredentials(currentCredentials); } } }
Source:
<code>public Ehcache(CacheConfiguration<K, V> config, Store<K, V> store, final CacheLoaderWriter<? super K, V> cacheLoaderWriter, CacheEventNotificationService<K, V> eventNotifier, ScheduledExecutorService statisticsExecutor) { this.store = store; StatisticsManager.associate(store).withParent(this); <START> System.out.println("Creating cache with " + cacheLoaderWriter); <END> new Exception().printStackTrace(System.out); this.cacheLoaderWriter = cacheLoaderWriter; if (statisticsExecutor != null) { this.cacheStatistics = new StatisticsGateway(this, statisticsExecutor, bulkMethodEntries); } else { this.cacheStatistics = new DisabledStatistics(); } if (store instanceof RecoveryCache) { this.resilienceStrategy = new LoggingRobustResilienceStrategy<K, V>(castToRecoveryCache(store)); } else { this.resilienceStrategy = new LoggingRobustResilienceStrategy<K, V>(recoveryCache(store)); } if (eventNotifier != null) { this.eventNotificationService = eventNotifier; } else { this.eventNotificationService = new DisabledCacheEventNotificationService<K, V>(); } this.runtimeConfiguration = new RuntimeConfiguration(config); this.storeListener = new StoreListener(); this.jsr107Cache = new Jsr107CacheImpl(); }</code><technical_language>forget some debugging lines added here</technical_language>

Target:
public Ehcache(CacheConfiguration<K, V> config, Store<K, V> store, final CacheLoaderWriter<? super K, V> cacheLoaderWriter, CacheEventNotificationService<K, V> eventNotifier, ScheduledExecutorService statisticsExecutor) { this.store = store; StatisticsManager.associate(store).withParent(this); this.cacheLoaderWriter = cacheLoaderWriter; if (statisticsExecutor != null) { this.cacheStatistics = new StatisticsGateway(this, statisticsExecutor, bulkMethodEntries); } else { this.cacheStatistics = new DisabledStatistics(); } if (store instanceof RecoveryCache) { this.resilienceStrategy = new LoggingRobustResilienceStrategy<K, V>(castToRecoveryCache(store)); } else { this.resilienceStrategy = new LoggingRobustResilienceStrategy<K, V>(recoveryCache(store)); } if (eventNotifier != null) { this.eventNotificationService = eventNotifier; } else { this.eventNotificationService = new DisabledCacheEventNotificationService<K, V>(); } this.runtimeConfiguration = new RuntimeConfiguration(config); this.storeListener = new StoreListener(); this.jsr107Cache = new Jsr107CacheImpl(); }
Source:
<code>public A next() { <START> if (this.hasNext()) { <END> return this.action.transform(this.iterator.next()); } else { throw new NoSuchElementException( "No more element with fits the select condition." ); } }</code><technical_language>I understand do need call hasNext() here? this.iterator.next() throw if is left</technical_language>

Target:
public A next() { return this.action.transform(this.iterator.next()); }
Source:
<code>private void sendMetrics(final WorkerMetrics workerMetrics) { <START> LOG.log(Level.FINE, "Sending WorkerMetrics {0}", new Object[]{workerMetrics}); <END> metricsMsgSender.send(workerMetrics); }</code><technical_language>is argument, pass workerMetrics instead of object array</technical_language>

Target:
private void sendMetrics(final WorkerMetrics workerMetrics) { LOG.log(Level.FINE, "Sending WorkerMetrics {0}", workerMetrics); metricsMsgSender.send(workerMetrics); }
Source:
<code>protected void onHangup(Hangup message, ActorRef self, ActorRef sender) throws URISyntaxException, ParseException { <START> requestee = sender; <END> callDetailRecord = getCallDetailRecord(); if(callDetailRecord == null){ logger.error("could not retrieve conferenceDetailRecord"); } else { try { URI uri = new URI("/restcomm"+callDetailRecord.getUri()); uri = UriUtils.resolve(uri); if (logger.isInfoEnabled()) logger.info("call api uri is: "+uri); Header[] headers = { new BasicHeader(HttpHeaders.AUTHORIZATION, getSuperAdminAuthenticationHeader()) ,new BasicHeader("Content-type", "application/x-www-form-urlencoded") ,new BasicHeader("Accept", "application/json") }; ArrayList<NameValuePair> postParameters = new ArrayList<NameValuePair>(); postParameters.add(new BasicNameValuePair("Status", "Completed")); httpAsycClientHelper = httpAsycClientHelper(); HttpRequestDescriptor httpRequestDescriptor =new HttpRequestDescriptor(uri, "POST", postParameters, -1, headers); httpAsycClientHelper.tell(httpRequestDescriptor, self); } catch (Exception e) { logger.error("Exception while trying to terminate call via api: ", e); } } }</code><technical_language>@maria-farooq is reason this? plans CallApiClient in other places need return response, currently is of</technical_language>

Target:
protected void onHangup(Hangup message, ActorRef self, ActorRef sender) throws URISyntaxException, ParseException { requestee = sender; callDetailRecord = message.getCallDetailRecord() == null ? getCallDetailRecord() : message.getCallDetailRecord(); if(callDetailRecord == null){ logger.error("could not retrieve cdr by provided Sid"); onDownloaderResponse(new DownloaderResponse(new IllegalArgumentException("could not retrieve cdr by provided Sid")), self, sender); } else { try { URI uri = new URI("/restcomm"+callDetailRecord.getUri()); uri = UriUtils.resolve(uri); if (logger.isInfoEnabled()) logger.info("call api uri is: "+uri); Header[] headers = RestcommApiClientUtil.getBasicHeaders(message.getRequestingAccountSid(), storage); ArrayList<NameValuePair> postParameters = new ArrayList<NameValuePair>(); postParameters.add(new BasicNameValuePair("Status", "Completed")); httpAsycClientHelper = httpAsycClientHelper(); HttpRequestDescriptor httpRequestDescriptor =new HttpRequestDescriptor(uri, "POST", postParameters, -1, headers); httpAsycClientHelper.tell(httpRequestDescriptor, self); } catch (Exception e) { logger.error("Exception while trying to terminate call via api ", e); onDownloaderResponse(new DownloaderResponse(e), self, sender); } } }
Source:
<code>public void testHotCacheDataBatching() throws Exception { ReadServerResource readServerResource = bootstrapReadServer(); EurekaInterestClient eurekaClient = connectEurekaClient(readServerResource.getDiscoveryResolver()).getEurekaClient(); fillUpRegistry(writeServer.getEurekaServerRegistry(), REGISTRY_INITIAL_SIZE); ExtTestSubscriber<ChangeNotification<InstanceInfo>> testSubscriber = new ExtTestSubscriber<>(); eurekaClient.forInterest(Interests.forFullRegistry()).filter(dataOnlyFilter()).subscribe(testSubscriber); testSubscriber.takeNextOrWait(REGISTRY_INITIAL_SIZE + 2); eurekaClient.shutdown(); eurekaClient = connectEurekaClient(readServerResource.getDiscoveryResolver()).getEurekaClient(); testSubscriber = new ExtTestSubscriber<>(); eurekaClient.forInterest(Interests.forFullRegistry()).subscribe(testSubscriber); for (int i = 0; i < REGISTRY_INITIAL_SIZE + 2; i++) { testSubscriber.takeNextOrWait(); } ExtTestSubscriber<Set<InstanceInfo>> snapshotSubscriber = new ExtTestSubscriber<>(); eurekaClient.forInterest(Interests.forFullRegistry()) .compose(ChangeNotificationFunctions.<InstanceInfo>buffers()) .compose(ChangeNotificationFunctions.<InstanceInfo>snapshots()) .subscribe(snapshotSubscriber); Set<InstanceInfo> initialSet = snapshotSubscriber.takeNextOrWait(); <START> assertThat(initialSet.size(), is(greaterThan(REGISTRY_INITIAL_SIZE))); <END> }</code><technical_language>this assert equals prev client read size</technical_language>

Target:
public void testHotCacheDataBatching() throws Exception { ReadServerResource readServerResource = bootstrapReadServer(); EurekaInterestClient eurekaClient = connectEurekaClient(readServerResource.getDiscoveryResolver()).getEurekaClient(); fillUpRegistry(writeServer.getEurekaServerRegistry(), REGISTRY_INITIAL_SIZE); ExtTestSubscriber<ChangeNotification<InstanceInfo>> testSubscriber = new ExtTestSubscriber<>(); eurekaClient.forInterest(Interests.forFullRegistry()).filter(dataOnlyFilter()).subscribe(testSubscriber); testSubscriber.takeNextOrWait(REGISTRY_INITIAL_SIZE + 2); eurekaClient.shutdown(); eurekaClient = connectEurekaClient(readServerResource.getDiscoveryResolver()).getEurekaClient(); testSubscriber = new ExtTestSubscriber<>(); eurekaClient.forInterest(Interests.forFullRegistry()).subscribe(testSubscriber); for (int i = 0; i < REGISTRY_INITIAL_SIZE + 2; i++) { testSubscriber.takeNextOrWait(); } ExtTestSubscriber<Set<InstanceInfo>> snapshotSubscriber = new ExtTestSubscriber<>(); eurekaClient.forInterest(Interests.forFullRegistry()) .compose(ChangeNotificationFunctions.<InstanceInfo>buffers()) .compose(ChangeNotificationFunctions.<InstanceInfo>snapshots()) .subscribe(snapshotSubscriber); Set<InstanceInfo> initialSet = snapshotSubscriber.takeNextOrWait(); assertThat(initialSet.size(), is(equalTo(REGISTRY_INITIAL_SIZE + 2))); }
Source:
<code>public String parseEventSubject(String eventSubject, Map<String, Object> eventParameters) { String configName = (String) eventParameters.get("configName"); if (eventSubject.equals(FORMS_EVENT)) { String xmlns = (String) ((Map) eventParameters.get(ATTRIBUTES)).get("xmlns"); String appId = (String) ((Map) eventParameters.get(ATTRIBUTES)).get("app_id"); if (appId != null) { return eventSubject.concat(".").concat(configName).concat(".").concat(xmlns).concat(appId); } else { return eventSubject.concat(".").concat(configName).concat(".").concat(xmlns); <START> } <END> } return eventSubject.concat(".").concat(configName); }</code><technical_language>return statement, please simplify this code. Additionally add warning app_id is null</technical_language>

Target:
public String parseEventSubject(String eventSubject, Map<String, Object> eventParameters) { String configName = (String) eventParameters.get("configName"); if (eventSubject.equals(FORMS_EVENT)) { String xmlns = (String) ((Map) eventParameters.get(ATTRIBUTES)).get("xmlns"); String appId = (String) ((Map) eventParameters.get(ATTRIBUTES)).get("app_id"); if (appId == null) { appId = ""; LOGGER.warn("AppId for form is null. XMLNS: {}", xmlns); } return eventSubject.concat(".").concat(configName).concat(".").concat(xmlns).concat(appId); } return eventSubject.concat(".").concat(configName); }
Source:
<code>public String toString() { return toStringHelper(this) .add("cpu", cpuCost) <START> .add("memory", peakMemoryCost) <END> .add("network", networkCost) .toString(); }</code><technical_language>Change toString method include</technical_language>

Target:
public String toString() { return toStringHelper(this) .add("cpu", cpuCost) .add("memory", memoryCost) .add("network", networkCost) .toString(); }
Source:
<code>protected void initChannel(SocketChannel ch) throws Exception { final ChannelPipeline pipeline = ch.pipeline(); pipeline.addLast(TIMEOUT, new IdleStateHandler(0, 0, Configuration.configuration.getTIMEOUTCON(), TimeUnit.MILLISECONDS)); pipeline.addLast(LIMITGLOBAL, Configuration.configuration.getGlobalTrafficShapingHandler()); pipeline.addLast(LIMITCHANNEL, new ChannelTrafficShapingHandler( Configuration.configuration.getServerChannelWriteLimit(), Configuration.configuration.getServerChannelReadLimit(), Configuration.configuration.getDelayLimit())); <START> pipeline.addLast("codec", new NetworkPacketCodec()); <END> pipeline.addLast(Configuration.configuration.getHandlerGroup(), "handler", new NetworkServerHandler(this.server)); }</code><technical_language>here: codec set previously traffic shaping... this is right place</technical_language>

Target:
protected void initChannel(SocketChannel ch) throws Exception { final ChannelPipeline pipeline = ch.pipeline(); pipeline.addLast(TIMEOUT, new IdleStateHandler(0, 0, Configuration.configuration.getTIMEOUTCON(), TimeUnit.MILLISECONDS)); GlobalTrafficShapingHandler handler = Configuration.configuration.getGlobalTrafficShapingHandler(); if (handler == null) { throw new OpenR66ProtocolNetworkException( "Error at pipeline initialization," + " GlobalTrafficShapingHandler configured."); } pipeline.addLast(LIMITGLOBAL, handler); pipeline.addLast(LIMITCHANNEL, new ChannelTrafficShapingHandler( Configuration.configuration.getServerChannelWriteLimit(), Configuration.configuration.getServerChannelReadLimit(), Configuration.configuration.getDelayLimit())); pipeline.addLast("codec", new NetworkPacketCodec()); pipeline.addLast(Configuration.configuration.getHandlerGroup(), "handler", new NetworkServerHandler(this.server)); }
Source:
<code>public WiresCanvas.View addShape( final ShapeView<?> shapeView ) { <START> if ( org.kie.workbench.common.stunner.client.lienzo.canvas.wires.WiresUtils.isWiresShape( shapeView ) ) { <END> WiresShape wiresShape = ( WiresShape ) shapeView; wiresManager.register( wiresShape ); wiresManager.getMagnetManager().createMagnets( wiresShape ); wiresShape.getContainer().setUserData( WiresCanvas.WIRES_CANVAS_GROUP_ID ); } else if ( org.kie.workbench.common.stunner.client.lienzo.canvas.wires.WiresUtils.isWiresConnector( shapeView ) ) { WiresConnector wiresConnector = ( WiresConnector ) shapeView; final WiresConnectorControl connectorControl = wiresManager.register( wiresConnector ); if ( shapeView instanceof AbstractConnectorView ) { ( ( AbstractConnectorView ) shapeView ).setControl( connectorControl ); } wiresConnector.getGroup().setUserData( WiresCanvas.WIRES_CANVAS_GROUP_ID ); } else { super.addShape( shapeView ); } return this; }</code><technical_language>import WiresUtils</technical_language>

Target:
public WiresCanvas.View addShape( final ShapeView<?> shapeView ) { if ( WiresUtils.isWiresShape( shapeView ) ) { WiresShape wiresShape = ( WiresShape ) shapeView; wiresManager.register( wiresShape ); wiresManager.getMagnetManager().createMagnets( wiresShape ); wiresShape.getContainer().setUserData( WiresCanvas.WIRES_CANVAS_GROUP_ID ); } else if ( WiresUtils.isWiresConnector( shapeView ) ) { WiresConnector wiresConnector = ( WiresConnector ) shapeView; final WiresConnectorControl connectorControl = wiresManager.register( wiresConnector ); if ( shapeView instanceof AbstractConnectorView ) { ( ( AbstractConnectorView ) shapeView ).setControl( connectorControl ); } wiresConnector.getGroup().setUserData( WiresCanvas.WIRES_CANVAS_GROUP_ID ); } else { super.addShape( shapeView ); } return this; }
Source:
<code>private void init() { ThreadRenamingRunnable.setThreadNameDeterminer(ThreadNameDeterminer.CURRENT); timer = new HashedWheelTimer(new NamedThreadFactory("PG-JDBC Timer")); Executor bossExecutorService = Executors.newCachedThreadPool(new NamedThreadFactory("PG-JDBC Boss")); Executor workerExecutorService = Executors.newCachedThreadPool(new NamedThreadFactory("PG-JDBC Worker")); <START> int workerCount = Math.max(10, getRuntime().availableProcessors()); <END> ChannelFactory channelFactory = new NioClientSocketChannelFactory(bossExecutorService, 1, new NioWorkerPool(workerExecutorService, workerCount), timer); bootstrap = new ClientBootstrap(channelFactory); bootstrap.setPipelineFactory(new ChannelPipelineFactory() { @Override public ChannelPipeline getPipeline() throws Exception { return Channels.pipeline(new MessageDecoder(), new MessageHandler()); } }); }</code><technical_language>Please remove this change. If this max a connection setting</technical_language>

Target:
private void init() { ThreadRenamingRunnable.setThreadNameDeterminer(ThreadNameDeterminer.CURRENT); timer = new HashedWheelTimer(new NamedThreadFactory("PG-JDBC Timer")); Executor bossExecutorService = Executors.newCachedThreadPool(new NamedThreadFactory("PG-JDBC Boss")); Executor workerExecutorService = Executors.newCachedThreadPool(new NamedThreadFactory("PG-JDBC Worker")); int workerCount = getRuntime().availableProcessors(); ChannelFactory channelFactory = new NioClientSocketChannelFactory(bossExecutorService, 1, new NioWorkerPool(workerExecutorService, workerCount), timer); bootstrap = new ClientBootstrap(channelFactory); bootstrap.setPipelineFactory(new ChannelPipelineFactory() { @Override public ChannelPipeline getPipeline() throws Exception { return Channels.pipeline(new MessageDecoder(), new MessageHandler()); } }); }
Source:
<code>public void run() { <START> if (resource.get() == DisposableHelper.DISPOSED) { <END> long r = get(); if (r != 0L) { actual.onNext(count++); if (r != Long.MAX_VALUE) { decrementAndGet(); } } else { try { actual.onError(new MissingBackpressureException("Can't deliver value " + count + " due to lack of requests")); } finally { DisposableHelper.dispose(resource); } } } }</code><technical_language>!=</technical_language>

Target:
public void run() { if (resource.get() != DisposableHelper.DISPOSED) { long r = get(); if (r != 0L) { actual.onNext(count++); if (r != Long.MAX_VALUE) { decrementAndGet(); } } else { try { actual.onError(new MissingBackpressureException("Can't deliver value " + count + " due to lack of requests")); } finally { DisposableHelper.dispose(resource); } } } }
Source:
<code>public void cwlNoInput() throws IOException{ File file = new File(ResourceHelpers.resourceFilePath("noInput.cwl")); File json = new File(ResourceHelpers.resourceFilePath("1st-workflow-job.json")); ArrayList<String> args = new ArrayList<String>() {{ add("--entry"); add(file.getAbsolutePath()); add("--local-entry"); add("--json"); add(json.getAbsolutePath()); }}; WorkflowsApi api = mock(WorkflowsApi.class); UsersApi usersApi = mock(UsersApi.class); Client client = new Client(); client.setConfigFile(ResourceHelpers.resourceFilePath("config")); exit.expectSystemExit(); WorkflowClient workflowClient = new WorkflowClient(api, usersApi, client); workflowClient.checkEntryFile(file.getAbsolutePath(), args, null); <START> Assert.assertTrue("output should include a successful cromwell run",systemOutRule.getLog().contains("Missing 'inputs' in CWL file.")); <END> }</code><technical_language>Error message match checking (same previous tests)</technical_language>

Target:
public void cwlNoInput() throws IOException{ File file = new File(ResourceHelpers.resourceFilePath("noInput.cwl")); File json = new File(ResourceHelpers.resourceFilePath("1st-workflow-job.json")); ArrayList<String> args = new ArrayList<String>() {{ add("--entry"); add(file.getAbsolutePath()); add("--local-entry"); add("--json"); add(json.getAbsolutePath()); }}; WorkflowsApi api = mock(WorkflowsApi.class); UsersApi usersApi = mock(UsersApi.class); Client client = new Client(); client.setConfigFile(ResourceHelpers.resourceFilePath("config")); exit.expectSystemExit(); WorkflowClient workflowClient = new WorkflowClient(api, usersApi, client); workflowClient.checkEntryFile(file.getAbsolutePath(), args, null); Assert.assertTrue("output should include an error message and exit",systemOutRule.getLog().contains("Required fields that are missing from CWL file : 'inputs'")); }
Source:
<code>private List<Migration.FileMetadata> extractFileMetadataFrom(String batchId, Batch.Builder newBatchBuilder) { <START> Cursor downloadsCursor = database.rawQuery(DOWNLOADS_QUERY, batchId); <END> List<Migration.FileMetadata> fileMetadataList = new ArrayList<>(); while (downloadsCursor.moveToNext()) { String originalNetworkAddress = downloadsCursor.getString(NETWORK_ADDRESS_COLUMN); String originalFileLocation = downloadsCursor.getString(FILE_LOCATION_COLUMN); newBatchBuilder.addFile(originalNetworkAddress); long rawFileSize = downloadsCursor.getLong(FILE_SIZE_COLUMN); FileSize fileSize = new LiteFileSize(rawFileSize, rawFileSize); Migration.FileMetadata fileMetadata = new Migration.FileMetadata(originalFileLocation, fileSize, originalNetworkAddress); fileMetadataList.add(fileMetadata); } downloadsCursor.close(); return fileMetadataList; }</code><technical_language>this return null</technical_language>

Target:
private List<Migration.FileMetadata> extractFileMetadataFrom(String batchId, Batch.Builder newBatchBuilder) { Cursor downloadsCursor = database.rawQuery(DOWNLOADS_QUERY, batchId); if (downloadsCursor == null) { return Collections.emptyList(); } try { List<Migration.FileMetadata> fileMetadataList = new ArrayList<>(); while (downloadsCursor.moveToNext()) { String originalNetworkAddress = downloadsCursor.getString(NETWORK_ADDRESS_COLUMN); String originalFileLocation = downloadsCursor.getString(FILE_LOCATION_COLUMN); newBatchBuilder.addFile(originalNetworkAddress); long rawFileSize = downloadsCursor.getLong(FILE_SIZE_COLUMN); FileSize fileSize = new LiteFileSize(rawFileSize, rawFileSize); Migration.FileMetadata fileMetadata = new Migration.FileMetadata(originalFileLocation, fileSize, originalNetworkAddress); fileMetadataList.add(fileMetadata); } return fileMetadataList; } finally { downloadsCursor.close(); } }
Source:
<code>private ValidationResult validateForMacsInUse(List<VmNetworkInterface> vnics, MacPool macPool) { final Optional<String> macInUse = vnics .stream() .map(VmNetworkInterface::getMacAddress) .filter(Objects::nonNull) .filter(macPool::isMacInUse) .findFirst(); <START> return macInUse.isPresent() ? new ValidationResult( EngineMessage.NETWORK_MAC_ADDRESS_IN_USE, ReplacementUtils.createSetVariableString("MAC", macInUse.get())) : ValidationResult.VALID; <END> }</code><technical_language>2 small things: a) ValidationResult.failWith().when(); well, remove need of ternary extra specification of VALID. b) this report failure. nothing, optimal solution fingers: instead of findFirst collect results list. if list is empty, org.ovirt.engine.core.utils.ReplacementUtils#getListVariableAssignmentString create replacements create ValidationResult invalid macs. EngineMessage em = EngineMessage.NETWORK_MAC_ADDRESS_IN_USE; failWith(new ValidationResult(em, ReplacementUtils#getListVariableAssignmentString(em, macs))).when(!macs.isEmpty()); notes: a) in this case if-then empty check perform b) this syntax for ValidationResult optimal, manage get CR</technical_language>

Target:
private ValidationResult validateForMacsInUse(List<VmNetworkInterface> vnics, MacPool macPool) { final List<String> macsInUse = vnics .stream() .map(VmNetworkInterface::getMacAddress) .filter(Objects::nonNull) .filter(macPool::isMacInUse) .collect(Collectors.toList()); final EngineMessage msg = EngineMessage.NETWORK_MAC_ADDRESS_IN_USE; return ValidationResult .failWith(msg, ReplacementUtils.getListVariableAssignmentString(msg, macsInUse)) .unless(macsInUse.isEmpty()); }
Source:
<code>public boolean isMyType(final Document document) { <START> return rootElementMatches(document); <END> }</code><technical_language>This work long RSS 2.0 parser is RSS parser checked. I this is depending order in rome.properties. I propose check version matches (like before) version is null</technical_language>

Target:
public boolean isMyType(final Document document) { return rootElementMatches(document) && (versionMatches(document) || versionAbsent(document)); }
Source:
<code><START> public static XRYFileParser get(String reportType) { <END> if (reportType == null) { throw new IllegalArgumentException("Report type cannot be null"); } switch (reportType.toLowerCase()) { case "calls": return new XRYCallsFileParser(); case "contacts/contacts": return new XRYContactsFileParser(); case "device/general information": return new XRYDeviceGenInfoFileParser(); case "messages/sms": return new XRYMessagesFileParser(); case "web/bookmarks": return new XRYWebBookmarksFileParser(); default: throw new IllegalArgumentException(reportType + " not recognized."); } }</code><technical_language>Public methods package access classes a strange me</technical_language>

Target:
static XRYFileParser get(String reportType) { if (reportType == null) { throw new IllegalArgumentException("Report type cannot be null"); } switch (reportType.trim().toLowerCase()) { case "calls": return new XRYCallsFileParser(); case "contacts/contacts": return new XRYContactsFileParser(); case "device/general information": return new XRYDeviceGenInfoFileParser(); case "messages/sms": return new XRYMessagesFileParser(); case "web/bookmarks": return new XRYWebBookmarksFileParser(); default: throw new IllegalArgumentException(reportType + " not recognized."); } }
Source:
<code>public static <T> T parse(final Path path, final Class<T> tClass) { <START> try(final InputStream inputStream = Files.newInputStream(path)) { <END> return parse(inputStream, tClass); }catch (Exception e){ throw new DotRuntimeException(e); } }</code><technical_language>Buffered</technical_language>

Target:
public static <T> T parse(final Path path, final Class<T> tClass) { try(final InputStream inputStream = Files.newInputStream(path)) { return parse(inputStream, tClass); }catch (Exception e){ Logger.error(YamlUtil.class,e.getMessage(),e); throw new DotRuntimeException(e); } }
Source:
<code>private static Map<String, Object> readStackFrame(JsonReader reader) throws IOException { Map<String, Object> map = new HashMap<>(); reader.beginObject(); while (reader.hasNext()) { String key = reader.nextName(); Object val = null; switch (reader.peek()) { case STRING: val = reader.nextString(); break; case NUMBER: <START> val = reader.nextInt(); <END> break; default: reader.skipValue(); break; } if (val != null) { map.put(key, val); } } reader.endObject(); return map; }</code><technical_language>exception possibly thrown caught - cases of non-integer values JsonToken.NUMBER is guaranteed integer. minimum handling send report, maximal handling create internal report for it</technical_language>

Target:
private static Map<String, Object> readStackFrame(JsonReader reader) throws IOException { Map<String, Object> map = new HashMap<>(); reader.beginObject(); try { while (reader.hasNext()) { String key = reader.nextName(); switch (reader.peek()) { case STRING: map.put(key, reader.nextString()); break; case NUMBER: map.put(key, reader.nextLong()); break; default: reader.skipValue(); break; } } } catch (IllegalStateException exc) { Logger.warn("Failed to read stackframe", exc); } reader.endObject(); return map; }
Source:
<code><START> public int toBytes(Object object, byte[] bytes, int offset) { <END> return 0; }</code><technical_language>remove this</technical_language>

Target:
public int toBytes(Object object, byte[] bytes, int offset) { if(byteSize == null) { return 0; } return byteSize; }
Source:
<code>void addReferencesToBlobs(PortAndAssignment pna, BlobChangingCallback cb) throws IOException, KeyNotFoundException, AuthorizationException { List<LocalResource> localResourceList = getLocalResources(pna); if (!localResourceList.isEmpty()) { getBlobs(localResourceList, pna, cb); } <START> pna.complete(); <END> }</code><technical_language>more nit: put this of this method method addReferencesToBlobs complete</technical_language>

Target:
void addReferencesToBlobs(PortAndAssignment pna, BlobChangingCallback cb) throws IOException, KeyNotFoundException, AuthorizationException { List<LocalResource> localResourceList = getLocalResources(pna); if (!localResourceList.isEmpty()) { getBlobs(localResourceList, pna, cb); } }
Source:
<code>protected TreeItem getRootItem(DiskImage disk) { HorizontalPanel panel = new HorizontalPanel(); panel.setSpacing(1); panel.setWidth("100%"); addItemToPanel(panel, new Image(resources.diskImage()), "25px"); addTextBoxToPanel(panel, new TextBoxLabel(), disk.getDiskAlias(), ""); <START> addItemToPanel(panel, disk.getReadOnly() ? new Image(resources.readOnlyDiskIcon()) :new Image(), "60px"); END> addValueLabelToPanel(panel, new DiskSizeLabel<Long>(), disk.getSizeInGigabytes(), "120px"); addValueLabelToPanel(panel, new DiskSizeLabel<Long>(SizeConverter.SizeUnit.BYTES), disk.getActualSizeInBytes(), "120px"); addValueLabelToPanel(panel, new EnumLabel<ImageStatus>(), disk.getImageStatus(), "120px"); addValueLabelToPanel(panel, new EnumLabel<VolumeType>(), disk.getVolumeType(), "120px"); addValueLabelToPanel(panel, new EnumLabel<DiskInterface>(), disk.getDiskInterface(), "120px"); addValueLabelToPanel(panel, new DateLabel(), disk.getCreationDate(), "90px"); TreeItem treeItem = new TreeItem(panel); treeItem.setUserObject(disk.getId()); return treeItem; }</code><technical_language>formatter</technical_language>

Target:
protected TreeItem getRootItem(DiskImage disk) { HorizontalPanel panel = new HorizontalPanel(); panel.setSpacing(1); panel.setWidth("100%"); addItemToPanel(panel, new Image(resources.diskImage()), "25px"); addTextBoxToPanel(panel, new TextBoxLabel(), disk.getDiskAlias(), ""); addItemToPanel(panel, disk.getReadOnly() ? new Image(resources.readOnlyDiskIcon()) : new Image(), "60px"); addValueLabelToPanel(panel, new DiskSizeLabel<Long>(), disk.getSizeInGigabytes(), "120px"); addValueLabelToPanel(panel, new DiskSizeLabel<Long>(SizeConverter.SizeUnit.BYTES), disk.getActualSizeInBytes(), "120px"); addValueLabelToPanel(panel, new EnumLabel<ImageStatus>(), disk.getImageStatus(), "120px"); addValueLabelToPanel(panel, new EnumLabel<VolumeType>(), disk.getVolumeType(), "120px"); addValueLabelToPanel(panel, new EnumLabel<DiskInterface>(), disk.getDiskInterface(), "120px"); addValueLabelToPanel(panel, new DateLabel(), disk.getCreationDate(), "90px"); TreeItem treeItem = new TreeItem(panel); treeItem.setUserObject(disk.getId()); return treeItem;llls }
Source:
<code>public void createContentStructure(DocumentModel eventDoc) { initSession(eventDoc); <START> boolean initRootAcl = true; for (TemplateItemDescriptor item : template) { if (!shouldCreateDocument(eventDoc.getId(), item.getId(), item.getTypeName())) { initRootAcl = false; <END> continue; } String itemPath = eventDoc.getPathAsString(); if (item.getPath() != null) { itemPath += "/" + item.getPath(); } DocumentModel newChild = session.createDocumentModel(itemPath, item.getId(), item.getTypeName()); newChild.setProperty("dublincore", "title", item.getTitle()); newChild.setProperty("dublincore", "description", item.getDescription()); setProperties(item.getProperties(), newChild); newChild = session.createDocument(newChild); setAcl(item.getAcl(), newChild.getRef()); session.save(); } if (initRootAcl) { setAcl(acl, eventDoc.getRef()); } }</code><technical_language>opposite? Start false if create set true</technical_language>

Target:
public void createContentStructure(DocumentModel eventDoc) { initSession(eventDoc); boolean initRootAcl = shouldInitAcl(eventDoc); for (TemplateItemDescriptor item : template) { if (!shouldCreateDocument(eventDoc.getId(), item.getId(), item.getTypeName())) { continue; } String itemPath = eventDoc.getPathAsString(); if (item.getPath() != null) { itemPath += "/" + item.getPath(); } DocumentModel newChild = session.createDocumentModel(itemPath, item.getId(), item.getTypeName()); newChild.setProperty("dublincore", "title", item.getTitle()); newChild.setProperty("dublincore", "description", item.getDescription()); setProperties(item.getProperties(), newChild); newChild = session.createDocument(newChild); setAcl(item.getAcl(), newChild.getRef()); session.save(); } if (initRootAcl) { setAcl(acl, eventDoc.getRef()); } }
Source:
<code>public String generateHtml(FormEntryContext context) { if (mss == null) { mss = Context.getMessageSourceService(); } initializeExistingCondition(context); StringBuilder ret = new StringBuilder(); <START> ret.append("<div id=\"htmlformentry-condition\">"); <END> ret.append(htmlForConditionSearchWidget(context)); ret.append(htmlForConditionStatusesWidgets(context)); ret.append(htmlForConditionDatesWidget(context)); ret.append("</div>"); return ret.toString(); }</code><technical_language>In this id, happen condition tags in form</technical_language>

Target:
public String generateHtml(FormEntryContext context) { wrapperDivId = "htmlformentry-condition-" + formFieldName; endDatePickerWrapperId = "condition-end-date-" + formFieldName; if (mss == null) { mss = Context.getMessageSourceService(); } initializeExistingCondition(context); StringBuilder ret = new StringBuilder(); ret.append("<div id=\"" + wrapperDivId + "\">"); ret.append(htmlForConditionSearchWidget(context)); ret.append(htmlForConditionStatusesWidgets(context)); ret.append(htmlForConditionDatesWidget(context)); ret.append("</div>"); return ret.toString(); }
Source:
<code>private void applyConnectionParams(final HttpMethod method) throws IOException { int timeout = 0; Object param = method.getParams().getParameter(HttpMethodParams.SO_TIMEOUT); if (param == null) { param = this.conn.getParams().getParameter(HttpConnectionParams.SO_TIMEOUT); } if (param != null) { <START> timeout = (Integer) param; <END> } this.conn.setSocketTimeout(timeout); }</code><technical_language>mind reverting this change? (Be good changes forked classes a minimum necessary for cases.)</technical_language>

Target:
private void applyConnectionParams(final HttpMethod method) throws IOException { int timeout = 0; Object param = method.getParams().getParameter(HttpMethodParams.SO_TIMEOUT); if (param == null) { param = this.conn.getParams().getParameter(HttpConnectionParams.SO_TIMEOUT); } if (param != null) { timeout = ((Integer)param).intValue(); } this.conn.setSocketTimeout(timeout); }
Source:
<code>public void onPositiveAction() { <START> ReadingListSyncAdapter.setSyncEnabledWithSetup(); maybeShowOnboarding(); <END> }</code><technical_language>show dialog of merging articles lists</technical_language>

Target:
public void onPositiveAction() { Prefs.shouldShowReadingListSyncMergePrompt(true); ReadingListSyncAdapter.setSyncEnabledWithSetup(); maybeShowOnboarding(); }
Source:
<code>public List<GlusterVolumeEntity> getVolumesSupportedAsStorageDomain() { List<GlusterVolumeEntity> volumes = getCallsHandler().executeReadList("GetGlusterVolumesSupportedAsStorageDomain", volumeRowMapper, getCustomMapSqlParameterSource() <START> .addValue("replica_count", 3)); <END> fetchRelatedEntities(volumes); return volumes; }</code><technical_language>pass replica count a parameter in getVolumesSupportedAsStorageDomain, remove stored procedure instead</technical_language>

Target:
public List<GlusterVolumeEntity> getVolumesSupportedAsStorageDomain() { List<GlusterVolumeEntity> volumes = getCallsHandler().executeReadList("GetGlusterVolumesSupportedAsStorageDomain", volumeRowMapper, null); fetchRelatedEntities(volumes); return volumes; }
Source:
<code>public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { <START> return new ViewHolder(LayoutInflater.from(parent.getContext()) <END> .inflate(R.layout.list_item_customer, parent, false)); }</code><technical_language>Cache LayoutInflater</technical_language>

Target:
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { View itemView = layoutInflater.inflate(R.layout.list_item_customer, parent, false); return new ViewHolder(itemView); }
Source:
<code>public synchronized void flush() throws IOException { <START> if (!somethingWritten.get()) { <END> return; } somethingWritten.set(false); flushOrCheckpoint(false); }</code><technical_language>a compareAndSet here. Do need synchronization flush method all</technical_language>

Target:
public synchronized void flush() throws IOException { if (!somethingWritten.compareAndSet(true, false)) { return; } flushOrCheckpoint(false); }
Source:
<code>public void shouldStartInstallationJob() throws Exception { String componentCode = "test_widget"; ResultActions result = createAuthRequest(get(BASE_URL + "/{exchange}/install/{component}", DE_1_ID, componentCode)).execute(); result.andExpect(jsonPath("$.errors").isEmpty()) .andExpect(jsonPath("$.metaData").isEmpty()) .andExpect(jsonPath("$.payload").isString()); String jsonResponse = result.andReturn().getResponse().getContentAsString(); SimpleRestResponse<String> response = new ObjectMapper() .readValue(jsonResponse, new TypeReference<SimpleRestResponse<String>>() { }); String jobId = response.getPayload(); assertThat(jobId).hasSize(20); InstallationStatus status = InstallationStatus.CREATED; int attempts = 0; while (status != InstallationStatus.COMPLETED && attempts < 10) { status = checkJobStatus(jobId); assertThat(status).isNotEqualTo(InstallationStatus.ERROR); attempts++; try { Thread.sleep(500); <START> } catch (InterruptedException ex) { <END> } } assertThat(status).isEqualTo(InstallationStatus.COMPLETED); SystemInstallationReport report = initializerManager.getCurrentReport(); assertThat(report.getComponentReport(componentCode, false)) .isNotNull() .matches(cr -> cr.getStatus() == SystemInstallationReport.Status.OK); assertThat(widgetService.getWidget(componentCode)) .isNotNull(); widgetService.removeWidget(componentCode); }</code><technical_language>rename "ex" parameter "ignored" clear block left empty purpose</technical_language>

Target:
public void shouldStartInstallationJob() throws Exception { String componentCode = "test_widget"; ResultActions result = createAuthRequest(get(BASE_URL + "/{exchange}/install/{component}", DE_1_ID, componentCode)).execute(); result.andExpect(jsonPath("$.errors").isEmpty()) .andExpect(jsonPath("$.metaData").isEmpty()) .andExpect(jsonPath("$.payload").isString()); String jsonResponse = result.andReturn().getResponse().getContentAsString(); SimpleRestResponse<String> response = new ObjectMapper() .readValue(jsonResponse, new TypeReference<SimpleRestResponse<String>>() { }); String jobId = response.getPayload(); assertThat(jobId).hasSize(20); InstallationStatus status = InstallationStatus.CREATED; int attempts = 0; while (status != InstallationStatus.COMPLETED && attempts < 10) { status = checkJobStatus(jobId); assertThat(status).isNotEqualTo(InstallationStatus.ERROR); attempts++; try { Thread.sleep(500); } catch (InterruptedException ignored) { } } assertThat(status).isEqualTo(InstallationStatus.COMPLETED); SystemInstallationReport report = initializerManager.getCurrentReport(); assertThat(report.getComponentReport(componentCode, false)) .isNotNull() .matches(cr -> cr.getStatus() == SystemInstallationReport.Status.OK); assertThat(widgetService.getWidget(componentCode)) .isNotNull(); widgetService.removeWidget(componentCode); }
Source:
<code>public void createReadJobWithNameOption() throws IOException, SignatureException, XmlProcessingException, URISyntaxException, InterruptedException { final Ds3ClientHelpers.Job readJob = HELPERS.startReadJob(BUCKET_NAME, Lists.newArrayList( <START> new Ds3Object("beowulf.txt", 10)) ); <END> final GetJobSpectraS3Response jobSpectraS3Response = client .getJobSpectraS3(new GetJobSpectraS3Request(readJob.getJobId())); assertThat(jobSpectraS3Response.getMasterObjectListResult().getName(), is("test_job")); }</code><technical_language>If add name property job options</technical_language>

Target:
public void createReadJobWithNameOption() throws IOException, SignatureException, XmlProcessingException, URISyntaxException, InterruptedException { final Ds3ClientHelpers.Job readJob = HELPERS.startReadJob(BUCKET_NAME, Lists.newArrayList( new Ds3Object("beowulf.txt", 10)), ReadJobOptions.create().withName("test_job")); final GetJobSpectraS3Response jobSpectraS3Response = client .getJobSpectraS3(new GetJobSpectraS3Request(readJob.getJobId())); assertThat(jobSpectraS3Response.getMasterObjectListResult().getName(), is("test_job")); }