auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void recreateInMemoryData(boolean isFirstEventArrived) { if (isFirstEventArrived) { this.isFirstEventArrived = true; for (Map.Entry<TimePeriod.Duration, IncrementalExecutor> durationIncrementalExecutorEntry : this.incrementalExecutorMap.entrySet()) { durationIncrementalExecutorEntry.getValue().setProcessingExecutor(true); } } synchronized (this) { <START> this.recreateInMemoryData.recreateInMemoryData(); <END> } }</code><technical_language>adding synchronized (this) instead of synchronizing method</technical_language>

Target:
public synchronized void recreateInMemoryData(boolean isFirstEventArrived) { if (isFirstEventArrived) { this.isFirstEventArrived = true; for (Map.Entry<TimePeriod.Duration, IncrementalExecutor> durationIncrementalExecutorEntry : this.incrementalExecutorMap.entrySet()) { durationIncrementalExecutorEntry.getValue().setProcessingExecutor(true); } } this.recreateInMemoryData.recreateInMemoryData(); }
Source:
<code>public WriteInfo getPartitionWriteInfo(LocationHandle locationHandle, Optional<Partition> partition, String partitionName) { <START> Path tempPath = new Path(locationHandle.getTmpPath(), randomUUID().toString().replaceAll("/", "_")); <END> if (partition.isPresent()) { WriteMode writeMode = locationHandle.getWriteMode(); Path targetPath = new Path(partition.get().getStorage().getLocation()); Path writePath; switch (writeMode) { case STAGE_AND_MOVE_TO_TARGET_DIRECTORY: writePath = new Path(locationHandle.getWritePath(), partitionName); break; case DIRECT_TO_TARGET_EXISTING_DIRECTORY: writePath = targetPath; break; case DIRECT_TO_TARGET_NEW_DIRECTORY: default: throw new UnsupportedOperationException(format("inserting into existing partition is not supported for %s", writeMode)); } return new WriteInfo(targetPath, writePath, tempPath, writeMode); } else { return new WriteInfo( new Path(locationHandle.getTargetPath(), partitionName), new Path(locationHandle.getWritePath(), partitionName), tempPath, locationHandle.getWriteMode()); } }</code><technical_language>Question: is needed for partition tmp path</technical_language>

Target:
public WriteInfo getPartitionWriteInfo(LocationHandle locationHandle, Optional<Partition> partition, String partitionName) { Optional<Path> tempPath = locationHandle.getTempPath().map(path -> new Path(path, randomUUID().toString().replaceAll("-", "_"))); if (partition.isPresent()) { WriteMode writeMode = locationHandle.getWriteMode(); Path targetPath = new Path(partition.get().getStorage().getLocation()); Path writePath; switch (writeMode) { case STAGE_AND_MOVE_TO_TARGET_DIRECTORY: writePath = new Path(locationHandle.getWritePath(), partitionName); break; case DIRECT_TO_TARGET_EXISTING_DIRECTORY: writePath = targetPath; break; case DIRECT_TO_TARGET_NEW_DIRECTORY: default: throw new UnsupportedOperationException(format("inserting into existing partition is not supported for %s", writeMode)); } return new WriteInfo(targetPath, writePath, tempPath, writeMode); } else { return new WriteInfo( new Path(locationHandle.getTargetPath(), partitionName), new Path(locationHandle.getWritePath(), partitionName), tempPath, locationHandle.getWriteMode()); } }
Source:
<code>private String readRawString(int id) throws IOException { BufferedReader reader = null; try { reader = new BufferedReader(new InputStreamReader(getResources().openRawResource(id))); StringBuilder sb = new StringBuilder(); String s; while((s = reader.readLine()) != null) { sb.append(s).append('\n'); } return sb.toString(); } finally { if(reader != null) { try { reader.close(); } catch (IOException e) { Log.w(TAG, "readRawString() failed to close reader\n" + e.toString() + "\n" + e.getStackTrace().toString()); <START> } <END> } } }</code><technical_language>close reader for internal resource here, errors unlikely. care errors. recommend catch(IOException ignored) {}</technical_language>

Target:
private String readRawString(int id) throws IOException { BufferedReader reader = null; try { reader = new BufferedReader(new InputStreamReader(getResources().openRawResource(id))); StringBuilder sb = new StringBuilder(); String s; while((s = reader.readLine()) != null) { sb.append(s).append('\n'); } return sb.toString(); } finally { if(reader != null) { try { reader.close(); } catch (IOException e) { Log.w(TAG, "readRawString() failed to close reader", e); } } } }
Source:
<code>public SpecialCuratedContentPageObject(WebDriver driver) { super(driver); <START> PageFactory.initElements(driver, this); <END> }</code><technical_language>parent constructor is for WikiBasePageObject::WikiBasePageObject()</technical_language>

Target:
public SpecialCuratedContentPageObject(WebDriver driver) { super(driver); }
Source:
<code>public void testSwitchDeregAction(){ int tid = 10; long vswId=5; boolean before=false, after=true; PhysicalSwitch psw = new TestSwitch(1); <START> final ArrayList <String>ctlList= new ArrayList <String>(); <END> ctlList.add("tcp:127.0.0.1:6633"); OVXIPAddress ip = new OVXIPAddress("10.0.0.0", tid); psw.register(); OVXSwitch vsw = new OVXSingleSwitch(vswId, tid); try { OVXNetwork net = new OVXNetwork(tid,ctlList,ip,(short)24); net.register(); this.map.addSwitches(Collections.singletonList(psw), vsw); vsw.register(); vsw.map.addNetwork(net); vsw.register(); } catch (IndexOutOfBoundException e) { Assert.fail(); e.printStackTrace(); } before=psw.map.hasVirtualSwitch(psw, tid); Assert.assertTrue(before); psw.cleanUpTenant(tid, (short)0); vsw.tearDown(true); vsw.unregSwitch(true); after=psw.map.hasVirtualSwitch(psw, tid); Assert.assertFalse(after); }</code><technical_language>please fix indentation, file</technical_language>

Target:
public void testSwitchDeregAction(){ int tid = 10; long vswId=5; boolean before=false, after=true; PhysicalSwitch psw = new TestSwitch(1); final ArrayList <String>ctlList= new ArrayList <String>(); ctlList.add("tcp:127.0.0.1:6633"); OVXIPAddress ip = new OVXIPAddress("10.0.0.0", tid); psw.register(); OVXSwitch vsw = new OVXSingleSwitch(vswId, tid); try { OVXNetwork net = new OVXNetwork(tid,ctlList,ip,(short)24); net.register(); this.map.addSwitches(Collections.singletonList(psw), vsw); vsw.map.addNetwork(net); vsw.register(); } catch (IndexOutOfBoundException e) { Assert.fail("Exception: IndexOutOfBound"); } before=psw.map.hasVirtualSwitch(psw, tid); Assert.assertTrue(before); psw.cleanUpTenant(tid, (short)0); vsw.tearDown(true); vsw.unregSwitch(true); after=psw.map.hasVirtualSwitch(psw, tid); Assert.assertFalse(after); }
Source:
<code>private static void assertFormValid() throws ValidationException { info("Check there are no validation errors..."); String failedFields = ""; if (Existence.existsImmediately(driver, pmPage.getRecipientErrorMessage())) { WebElement recipientError = pmPage.getRecipientErrorMessage(); failedFields += recipientError.getText(); } if (Existence.existsImmediately(driver, pmPage.getSubjectErrorMessage())) { WebElement subjectError = pmPage.getSubjectErrorMessage(); failedFields += subjectError.getText(); } if (Existence.existsImmediately(driver, pmPage.getBodyMsgErrorMessage())) { WebElement bodyMsgError = pmPage.getBodyMsgErrorMessage(); failedFields += bodyMsgError.getText(); } <START> if (!failedFields.equals("")) { <END> info("Validation failed!"); throw new ValidationException(failedFields); } info("Validation completed successfully! No errors found."); }</code><technical_language>StringUtils.isNotBlank(failedFields)</technical_language>

Target:
private static void assertFormValid() throws ValidationException { info("Check there are no validation errors..."); String failedFields = ""; if (Existence.existsImmediately(driver, pmPage.getRecipientErrorMessage())) { WebElement recipientError = pmPage.getRecipientErrorMessage(); failedFields += recipientError.getText(); } if (Existence.existsImmediately(driver, pmPage.getSubjectErrorMessage())) { WebElement subjectError = pmPage.getSubjectErrorMessage(); failedFields += subjectError.getText(); } if (Existence.existsImmediately(driver, pmPage.getBodyMsgErrorMessage())) { WebElement bodyMsgError = pmPage.getBodyMsgErrorMessage(); failedFields += bodyMsgError.getText(); } if (StringUtils.isNotBlank(failedFields)) { info("Validation failed!"); throw new ValidationException(failedFields); } info("Validation completed successfully! No errors found."); }
Source:
<code>public TransactionInfo readObject(ObjectInput input) throws IOException, ClassNotFoundException { GlobalTransaction globalTransaction = (GlobalTransaction) input.readObject(); int topologyId = input.readInt(); WriteCommand[] modifications = MarshallUtil.unmarshallArray(input, WriteCommand[]::new); <START> Set<Object> lockedKeys = (Set<Object>) MarshallUtil.unmarshallCollection(input, HashSet::new); <END> return new TransactionInfo(globalTransaction, topologyId, modifications, lockedKeys); }</code><technical_language>unneeded cast</technical_language>

Target:
public TransactionInfo readObject(ObjectInput input) throws IOException, ClassNotFoundException { GlobalTransaction globalTransaction = (GlobalTransaction) input.readObject(); int topologyId = input.readInt(); WriteCommand[] modifications = MarshallUtil.unmarshallArray(input, WriteCommand[]::new); Set<Object> lockedKeys = MarshallUtil.unmarshallCollection(input, HashSet::new); return new TransactionInfo(globalTransaction, topologyId, modifications, lockedKeys); }
Source:
<code>public PlanNodeCostEstimate visitTableScan(TableScanNode node, Void context) { <START> return cpuCost(getStats(node).getOutputSizeInBytes()); END> }</code><technical_language>re. todo: reasonable. do that</technical_language>

Target:
public PlanNodeCostEstimate visitTableScan(TableScanNode node, Void context) { return cpuCost(getStats(node).getOutputSizeInBytes(node.getOutputSymbols())); }
Source:
<code>public StageState transition(Stage stage, StageEvent stageEvent) { try { LOG.info(String.format("Stage completed - %s (total=%d, success=%d, killed=%d)", stage.getId().toString(), stage.getTotalScheduledObjectsCount(), stage.getSucceededObjectCount(), stage.killedObjectCount)); if (stage.killedObjectCount > 0 || stage.failedObjectCount > 0) { if (stage.failedObjectCount > 0) { stage.abort(StageState.FAILED); return StageState.FAILED; } else if (stage.killedObjectCount > 0) { stage.abort(StageState.KILLED); return StageState.KILLED; } else { <START> TajoInternalError error = new TajoInternalError("Invalid State " + stage.getSynchronizedState() + " State"); <END> LOG.error(error.getMessage(), error); stage.abort(StageState.ERROR, error); return StageState.ERROR; } } else { stage.complete(); return StageState.SUCCEEDED; } } catch (Throwable t) { LOG.error(t.getMessage(), t); stage.abort(StageState.ERROR, t); return StageState.ERROR; } }</code><technical_language>I this else clause executed. explain some details</technical_language>

Target:
public StageState transition(Stage stage, StageEvent stageEvent) { try { LOG.info(String.format("Stage completed - %s (total=%d, success=%d, killed=%d)", stage.getId().toString(), stage.getTotalScheduledObjectsCount(), stage.getSucceededObjectCount(), stage.killedObjectCount)); if (stage.killedObjectCount + stage.failedObjectCount > 0) { if (stage.failedObjectCount > 0) { stage.abort(StageState.FAILED); return StageState.FAILED; } else { stage.abort(StageState.KILLED); return StageState.KILLED; } } else { stage.complete(); return StageState.SUCCEEDED; } } catch (Throwable t) { LOG.error(t.getMessage(), t); stage.abort(StageState.ERROR, t); return StageState.ERROR; } }
Source:
<code>public static McMMOPlayerProfileLoadEvent callPlayerProfileLoadEvent(Player player, PlayerProfile profile){ <START> McMMOPlayerProfileLoadEvent e = new McMMOPlayerProfileLoadEvent(player, profile); <END> mcMMO.p.getServer().getPluginManager().callEvent(e); return e; }</code><technical_language>a fan of shorthand letter variable names, prefer a descriptive var name instead of a single character</technical_language>

Target:
public static McMMOPlayerProfileLoadEvent callPlayerProfileLoadEvent(Player player, PlayerProfile profile){ McMMOPlayerProfileLoadEvent event = new McMMOPlayerProfileLoadEvent(player, profile); mcMMO.p.getServer().getPluginManager().callEvent(event); return event; }
Source:
<code>private void preProcessModule(Module module) { if (this.plugins != null) { for (Plugin plugin : this.plugins.values()) { <START> if (plugin.supports(module.getType())) { <END> plugin.preProcessModule(module); } } } }</code><technical_language>supports() depend type I guess</technical_language>

Target:
private void preProcessModule(Module module) { for (Plugin plugin : this.getSupportedPlugins(module)) { plugin.preProcessModule(module); } }
Source:
<code>public boolean initGlusterHost(VDS vds) { VDSReturnValue returnValue = runVdsCommand(VDSCommandType.GetGlusterHostUUID, new VdsIdVDSCommandParametersBase(vds.getId())); if (returnValue.getSucceeded() && returnValue.getReturnValue() != null) { Guid addedServerUuid = Guid.createGuidFromString((String) returnValue.getReturnValue()); if (hostUuidExists(vds, addedServerUuid)) { setNonOperational(vds, NonOperationalReason.GLUSTER_HOST_UUID_ALREADY_EXISTS, null); return false; } saveGlusterHostUuid(vds, addedServerUuid); } else { setNonOperational(vds, NonOperationalReason.GLUSTER_HOST_UUID_NOT_FOUND, null); return false; } refreshGlusterStorageDevices(vds); boolean ret = initGlusterPeerProcess(vds); glusterServerDao.updatePeerStatus(vds.getId(), ret ? PeerStatus.CONNECTED : PeerStatus.DISCONNECTED); <START> addGlusterWebhook(vds); <END> return ret; }</code><technical_language>calling addGlusterWebhook(vds) method if eventing is supported</technical_language>

Target:
public boolean initGlusterHost(VDS vds) { VDSReturnValue returnValue = runVdsCommand(VDSCommandType.GetGlusterHostUUID, new VdsIdVDSCommandParametersBase(vds.getId())); if (returnValue.getSucceeded() && returnValue.getReturnValue() != null) { Guid addedServerUuid = Guid.createGuidFromString((String) returnValue.getReturnValue()); if (hostUuidExists(vds, addedServerUuid)) { setNonOperational(vds, NonOperationalReason.GLUSTER_HOST_UUID_ALREADY_EXISTS, null); return false; } saveGlusterHostUuid(vds, addedServerUuid); } else { setNonOperational(vds, NonOperationalReason.GLUSTER_HOST_UUID_NOT_FOUND, null); return false; } refreshGlusterStorageDevices(vds); boolean ret = initGlusterPeerProcess(vds); glusterServerDao.updatePeerStatus(vds.getId(), ret ? PeerStatus.CONNECTED : PeerStatus.DISCONNECTED); if (ret) { addGlusterWebhook(vds); } return ret; }
Source:
<code>public void run() { <START> try ( Socket socket = new Socket( "127.0.0.1", port ) ) <END> { socket.getOutputStream().write( sessionId.getBytes( US_ASCII ) ); byte[] data = new byte[128]; int readLength = socket.getInputStream().read( data ); String token = new String( data, 0, readLength, US_ASCII ); assertThat( token ).isEqualTo( ":maven-surefire-command:noop:" ); socket.getOutputStream().write( ":maven-surefire-event:bye:".getBytes( US_ASCII ) ); } catch ( IOException e ) { hasError.set( true ); e.printStackTrace(); throw new IllegalStateException( e ); } catch ( RuntimeException e ) { hasError.set( true ); e.printStackTrace(); throw e; } }</code><technical_language>IP address here</technical_language>

Target:
public void run() { try ( Socket socket = new Socket( InetAddress.getLocalHost().getHostAddress(), port ) ) { socket.getOutputStream().write( sessionId.getBytes( US_ASCII ) ); byte[] data = new byte[128]; int readLength = socket.getInputStream().read( data ); String token = new String( data, 0, readLength, US_ASCII ); assertThat( token ).isEqualTo( ":maven-surefire-command:noop:" ); socket.getOutputStream().write( ":maven-surefire-event:bye:".getBytes( US_ASCII ) ); } catch ( IOException e ) { hasError.set( true ); e.printStackTrace(); throw new IllegalStateException( e ); } catch ( RuntimeException e ) { hasError.set( true ); e.printStackTrace(); throw e; } }
Source:
<code>private static ProfileCredentialsService getProfileCredentialService() { <START> if (STS_SERVICE_CONSTRUCTOR == null) { <END> try { STS_SERVICE_CONSTRUCTOR = (Constructor<ProfileCredentialsService>) Class.forName(CLASS_NAME).getConstructor(); } catch (ClassNotFoundException ex) { throw new AmazonClientException("To use assume role profiles the aws-java-sdk-sts module must be on the class path.", ex); } catch (NoSuchMethodException ex) { throw new AmazonClientException("Failed to instantiate " + CLASS_NAME, ex); } } try { return STS_SERVICE_CONSTRUCTOR.newInstance(); } catch (InstantiationException ex) { throw new AmazonClientException("Failed to instantiate " + CLASS_NAME, ex); } catch (IllegalAccessException ex) { throw new AmazonClientException("Failed to instantiate " + CLASS_NAME, ex); } catch (InvocationTargetException ex) { throw new AmazonClientException("Failed to instantiate " + CLASS_NAME, ex); } }</code><technical_language>this more motiviation in making Loader a singleton. reflection more once. lazily instantiate ProfileCredentialsService cache in singleton reference</technical_language>

Target:
private static ProfileCredentialsService getProfileCredentialService() { if (STS_CREDENTIALS_SERVICE == null) { try { STS_CREDENTIALS_SERVICE = (ProfileCredentialsService) Class.forName(CLASS_NAME).newInstance(); } catch (ClassNotFoundException ex) { throw new AmazonClientException("To use assume role profiles the aws-java-sdk-sts module must be on the class path.", ex); } catch (InstantiationException ex) { throw new AmazonClientException("Failed to instantiate " + CLASS_NAME, ex); } catch (IllegalAccessException ex) { throw new AmazonClientException("Failed to instantiate " + CLASS_NAME, ex); } } return STS_CREDENTIALS_SERVICE; }
Source:
<code>@Override RemoteViewsTarget getTarget() { <START> return new RemoteViewsTarget(remoteViews, viewId); <END> }</code><technical_language>Cache this instance in a field? is called once</technical_language>

Target:
@Override RemoteViewsTarget getTarget() { if (target == null) { target = new RemoteViewsTarget(remoteViews, viewId); } return target; }
Source:
<code>public void testUnmarshallSubprocessLevelEventEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_START_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); StartEscalationEvent emptySubprocess = getStartNodeById(diagram, EMPTY_SUBPROCESS_LEVEL_EVENT_ID, StartEscalationEvent.class); assertGeneralSet(emptySubprocess.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); <START> assertEscalationEventExecutionSet(emptySubprocess.getExecutionSet(), EMPTY_VALUE, NON_INTERRUPTING, ""); <END> assertDataIOSet(emptySubprocess.getDataIOSet(), EMPTY_VALUE); }</code><technical_language>suggestion assertEscalationEventExecutionSet(emptySubprocess.getExecutionSet(), EMPTY_VALUE, NON_INTERRUPTING, EMPTY_VALUE);</technical_language>

Target:
public void testUnmarshallSubprocessLevelEventEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_START_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); StartEscalationEvent emptySubprocess = getStartNodeById(diagram, EMPTY_SUBPROCESS_LEVEL_EVENT_ID, StartEscalationEvent.class); assertGeneralSet(emptySubprocess.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertEscalationEventExecutionSet(emptySubprocess.getExecutionSet(), EMPTY_VALUE, NON_INTERRUPTING, EMPTY_VALUE); assertDataIOSet(emptySubprocess.getDataIOSet(), EMPTY_VALUE); }
Source:
<code>public String createCsrfToken(HttpServletRequest request, HttpServletResponse response) { CsrfToken csrfToken = this.csrfTokenRepository.loadToken(request); <START> final boolean missingToken = csrfToken == null; <END> if (missingToken) { csrfToken = this.csrfTokenRepository.generateToken(request); this.csrfTokenRepository.saveToken(csrfToken, request, response); } return csrfToken.getToken(); }</code><technical_language>This line unnecessary. not: if (csrfToken == null) { ..</technical_language>

Target:
public String createCsrfToken(HttpServletRequest request, HttpServletResponse response) { CsrfToken csrfToken = this.csrfTokenRepository.loadToken(request); if (csrfToken == null) { csrfToken = this.csrfTokenRepository.generateToken(request); this.csrfTokenRepository.saveToken(csrfToken, request, response); } return csrfToken.getToken(); }
Source:
<code>private AuthenticationResult postMessage(String requestMessage) throws Exception { URL authority = null; AuthenticationResult result = null; try { <START> authority = new URL(getTokenEndpoint()); <END> } catch (MalformedURLException e1) { Logger.e(TAG, e1.getMessage(), "", ADALError.DEVELOPER_AUTHORITY_IS_NOT_VALID_URL, e1); throw e1; } HashMap<String, String> headers = getRequestHeaders(); try { mWebRequestHandler.setRequestCorrelationId(mRequest.getCorrelationId()); HttpWebResponse response = mWebRequestHandler.sendPost(authority, headers, requestMessage.getBytes(AuthenticationConstants.ENCODING_UTF8), "application/x-www-form-urlencoded"); if (response.getResponseException() == null) { Logger.v(TAG, "Token request does not have exception"); result = processTokenResponse(response); } } catch (IllegalArgumentException e) { Logger.e(TAG, e.getMessage(), "", ADALError.ARGUMENT_EXCEPTION, e); throw e; } catch (UnsupportedEncodingException e) { Logger.e(TAG, e.getMessage(), "", ADALError.ENCODING_IS_NOT_SUPPORTED, e); throw e; } catch (IOException e) { Logger.e(TAG, e.getMessage(), "", ADALError.IO_EXCEPTION, e); throw e; } catch (Exception e) { Logger.e(TAG, e.getMessage(), "", ADALError.SERVER_ERROR, e); throw e; } return result; }</code><technical_language>Consider adding a helper class/method deal URL validations. This pattern present in files</technical_language>

Target:
private AuthenticationResult postMessage(String requestMessage) throws Exception { URL authority = null; AuthenticationResult result = null; authority = StringExtensions.getUrl(getTokenEndpoint()); if (authority == null) { throw new AuthenticationException(ADALError.DEVELOPER_AUTHORITY_IS_NOT_VALID_URL); } HashMap<String, String> headers = getRequestHeaders(); try { mWebRequestHandler.setRequestCorrelationId(mRequest.getCorrelationId()); HttpWebResponse response = mWebRequestHandler.sendPost(authority, headers, requestMessage.getBytes(AuthenticationConstants.ENCODING_UTF8), "application/x-www-form-urlencoded"); if (response.getResponseException() == null) { Logger.v(TAG, "Token request does not have exception"); result = processTokenResponse(response); } } catch (IllegalArgumentException e) { Logger.e(TAG, e.getMessage(), "", ADALError.ARGUMENT_EXCEPTION, e); throw e; } catch (UnsupportedEncodingException e) { Logger.e(TAG, e.getMessage(), "", ADALError.ENCODING_IS_NOT_SUPPORTED, e); throw e; } catch (IOException e) { Logger.e(TAG, e.getMessage(), "", ADALError.IO_EXCEPTION, e); throw e; } catch (Exception e) { Logger.e(TAG, e.getMessage(), "", ADALError.SERVER_ERROR, e); throw e; } return result; }
Source:
<code>public boolean equals(Object o) { <START> if (this == o) <END> return true; if (o == null || getClass() != o.getClass()) return false; RMEvent rmEvent = (RMEvent) o; return counter == rmEvent.counter; }</code><technical_language>I add brackets if in this method</technical_language>

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } RMEvent rmEvent = (RMEvent) o; return counter == rmEvent.counter; }
Source:
<code>protected Image retrieveAndStoreImage(String descriptorId) { NavigatorContentDescriptor contentDescriptor = getContentDescriptor(descriptorId); Image image = null; if (contentDescriptor != null) { String iconPath = contentDescriptor.getIcon(); if (iconPath != null) { String prefix = contentDescriptor.getId() == null ? "" : contentDescriptor.getId(); String iconKey = prefix + "::" + iconPath; ImageRegistry registry = getImageRegistry(); image = registry.get(iconKey); if (image == null || image.isDisposed()) { String pluginId = contentDescriptor.getContribution().getPluginId(); ResourceLocator.imageDescriptorFromBundle(pluginId, iconPath) <START> .ifPresent(d -> registry.put(iconKey, d.createImage())); <END> } } } return image; }</code><technical_language>createImage return null handled in original code</technical_language>

Target:
protected Image retrieveAndStoreImage(String descriptorId) { NavigatorContentDescriptor contentDescriptor = getContentDescriptor(descriptorId); Image image = null; if (contentDescriptor != null) { String iconPath = contentDescriptor.getIcon(); if (iconPath != null) { String prefix = contentDescriptor.getId() == null ? "" : contentDescriptor.getId(); String iconKey = prefix + "::" + iconPath; ImageRegistry registry = getImageRegistry(); image = registry.get(iconKey); if (image == null || image.isDisposed()) { String pluginId = contentDescriptor.getContribution().getPluginId(); ResourceLocator.imageDescriptorFromBundle(pluginId, iconPath).ifPresent(d -> { Image created = d.createImage(); if (created != null) { registry.put(iconKey, created); } }); } } } return image; }
Source:
<code><START> public XWikiAttachmentList getAttachmentList() <END> { return this.attachmentList; }</code><technical_language>This breaks API. XWikiAttachmentList remain internal, is important for world is implements List<XWikiAttachment>. pretty this change produce a build error. is need getAttachmentList() internally, simply this.attachmentList</technical_language>

Target:
public List<XWikiAttachment> getAttachmentList() { return this.attachmentList; }
Source:
<code>public List<Container> getContainers() throws UnrecoverableKeyException, CertificateEncodingException, NoSuchAlgorithmException, KeyStoreException, IOException { <START> KubernetesSlave slave = getNode(); <END> if(slave == null) { return new ArrayList<>(); } KubernetesCloud cloud = slave.getKubernetesCloud(); KubernetesClient client = cloud.connect(); String namespace = StringUtils.defaultIfBlank(slave.getNamespace(), client.getNamespace()); Pod pod = client.pods().inNamespace(namespace).withName(getName()).get(); return pod.getSpec().getContainers(); }</code><technical_language>permission checks missing, if READ permission enough access data</technical_language>

Target:
public List<Container> getContainers() throws UnrecoverableKeyException, CertificateEncodingException, NoSuchAlgorithmException, KeyStoreException, IOException { Jenkins.get().checkPermission(Jenkins.ADMINISTER); KubernetesSlave slave = getNode(); if(slave == null) { return new ArrayList<>(); } KubernetesCloud cloud = slave.getKubernetesCloud(); KubernetesClient client = cloud.connect(); String namespace = StringUtils.defaultIfBlank(slave.getNamespace(), client.getNamespace()); Pod pod = client.pods().inNamespace(namespace).withName(getName()).get(); return pod.getSpec().getContainers(); }
Source:
<code>public final <R> Observable<R> concatMapEager(Function<? super T, ? extends ObservableSource<? extends R>> mapper, int maxConcurrency, int prefetch) { ObjectHelper.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(maxConcurrency, "maxConcurrency"); <START> return RxJavaPlugins.onAssembly(new ObservableConcatMapEager<T, R>(this, mapper, ErrorMode.IMMEDIATE, maxConcurrency, prefetch)); <END> }</code><technical_language>No, validations right, call non-positive value</technical_language>

Target:
public final <R> Observable<R> concatMapEager(Function<? super T, ? extends ObservableSource<? extends R>> mapper, int maxConcurrency, int prefetch) { ObjectHelper.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(maxConcurrency, "maxConcurrency"); ObjectHelper.verifyPositive(prefetch, "prefetch"); return RxJavaPlugins.onAssembly(new ObservableConcatMapEager<T, R>(this, mapper, ErrorMode.IMMEDIATE, maxConcurrency, prefetch)); }
Source:
<code>private void createIndexes() { mongoOperations.getCollection(collection).createIndex( new BasicDBObject(VariantToDBObjectConverter.CHROMOSOME_FIELD, 1) .append(VariantToDBObjectConverter.START_FIELD, 1).append(VariantToDBObjectConverter.END_FIELD, 1), new BasicDBObject(MongoDBHelper.BACKGROUND_INDEX, true)); mongoOperations.getCollection(collection).createIndex( new BasicDBObject(VariantToDBObjectConverter.IDS_FIELD, 1), new BasicDBObject(MongoDBHelper.BACKGROUND_INDEX, true)); String filesStudyIdField = String.format("%s.%s", VariantToDBObjectConverter.FILES_FIELD, VariantSourceEntryToDBObjectConverter.STUDYID_FIELD); String filesFileIdField = String.format("%s.%s", VariantToDBObjectConverter.FILES_FIELD, VariantSourceEntryToDBObjectConverter.FILEID_FIELD); mongoOperations.getCollection(collection).createIndex( new BasicDBObject(filesStudyIdField, 1).append(filesFileIdField, 1), new BasicDBObject(MongoDBHelper.BACKGROUND_INDEX, true)); mongoOperations.getCollection(collection).createIndex( new BasicDBObject(VARIANT_ANNOTATION_SO_FIELD, 1), new BasicDBObject(MongoDBHelper.BACKGROUND_INDEX, true)); <START> } <END></code><technical_language>need equivalent index in variants collection</technical_language>

Target:
private void createIndexes() { mongoOperations.getCollection(collection).createIndex( new BasicDBObject(VariantToDBObjectConverter.CHROMOSOME_FIELD, 1) .append(VariantToDBObjectConverter.START_FIELD, 1).append(VariantToDBObjectConverter.END_FIELD, 1), new BasicDBObject(MongoDBHelper.BACKGROUND_INDEX, true)); mongoOperations.getCollection(collection).createIndex( new BasicDBObject(VariantToDBObjectConverter.IDS_FIELD, 1), new BasicDBObject(MongoDBHelper.BACKGROUND_INDEX, true)); String filesStudyIdField = String.format("%s.%s", VariantToDBObjectConverter.FILES_FIELD, VariantSourceEntryToDBObjectConverter.STUDYID_FIELD); String filesFileIdField = String.format("%s.%s", VariantToDBObjectConverter.FILES_FIELD, VariantSourceEntryToDBObjectConverter.FILEID_FIELD); mongoOperations.getCollection(collection).createIndex( new BasicDBObject(filesStudyIdField, 1).append(filesFileIdField, 1), new BasicDBObject(MongoDBHelper.BACKGROUND_INDEX, true)); mongoOperations.getCollection(collection).createIndex( new BasicDBObject(ANNOTATION_FIELD+"."+XREFS_FIELD, 1), new BasicDBObject(MongoDBHelper.BACKGROUND_INDEX, true)); mongoOperations.getCollection(collection).createIndex( new BasicDBObject(ANNOTATION_FIELD+"."+ SO_ACCESSION_FIELD, 1), new BasicDBObject(MongoDBHelper.BACKGROUND_INDEX, true)); }
Source:
<code>public R get() { if (_countDownLatch != null) { try { boolean finished = false; int iteration = 0; while (!finished) { iteration++; finished = _countDownLatch.await(2, TimeUnit.MINUTES); if (!finished) { <START> logger.info("Awaited completion for " + (iteration * 2) + " minutes..."); <END> } } } catch (InterruptedException e) { throw new IllegalStateException("Awaiting completion of AnalyzerResultFuture was interrupted!", e); } } if (_error != null) { throw _error; } return _result; }</code><technical_language>add a constant for minute count. want adjust some point, easy miss values in sync</technical_language>

Target:
public R get() { if (_countDownLatch != null) { try { boolean finished = false; int iteration = 0; final int minutesToWaitPerIteration = 2; while (!finished) { iteration++; finished = _countDownLatch.await(minutesToWaitPerIteration, TimeUnit.MINUTES); if (!finished) { logger.info("Awaited completion for " + (iteration * minutesToWaitPerIteration) + " minutes..."); } } } catch (InterruptedException e) { throw new IllegalStateException("Awaiting completion of AnalyzerResultFuture was interrupted!", e); } } if (_error != null) { throw _error; } return _result; }
Source:
<code>public void execute(MinecraftServer server, ICommandSender sender, String... args) throws CommandException { if (args.length == 0) { sender.sendMessage(new TextComponentTranslation("commands.blooodmagic.ritual.create.noRitual")); return; <START> } else if (args.length == 2 && (args[1].equals("-h") || args[1].equals("?"))) { <END> sender.sendMessage(new TextComponentTranslation(BloodMagic.RITUAL_MANAGER.getRitual(args[0]).getUnlocalizedName() + ".info")); return; } EntityPlayerMP player = args.length < 3 ? getCommandSenderAsPlayer(sender) : getPlayer(server, sender, args[1]); boolean safe = false; if (args.length > 1 && args.length < 4) { int k = args.length - 1; if (args[k].equals("true") || args[k].equals("false")) { safe = Boolean.parseBoolean(args[k]); } else if (args[1].equals("safe")) safe = true; else player = getPlayer(server, sender, args[1]); } BlockPos pos = player.getPosition().down(); World world = player.getEntityWorld(); EnumFacing direction = EnumFacing.NORTH; if (RitualHelper.createRitual(world, pos, direction, BloodMagic.RITUAL_MANAGER.getRitual(args[0]), safe)) sender.sendMessage(new TextComponentTranslation("commands.bloodmagic.success")); else if (!safe) sender.sendMessage(new TextComponentTranslation("commands.bloodmagic.ritual.create.error.outOfWorldBoundaries")); else sender.sendMessage(new TextComponentTranslation("commands.bloodmagic.ritaul.create.error.unsafe")); }</code><technical_language>h -></technical_language>

Target:
public void execute(MinecraftServer server, ICommandSender sender, String... args) throws CommandException { if (args.length == 0) { sender.sendMessage(new TextComponentTranslation("commands.blooodmagic.ritual.create.noRitual")); return; } else if (args.length == 2 && (args[1].equals("help") || args[1].equals("?"))) { sender.sendMessage(new TextComponentTranslation(BloodMagic.RITUAL_MANAGER.getRitual(args[0]).getUnlocalizedName() + ".info")); return; } EntityPlayerMP player = args.length < 3 ? getCommandSenderAsPlayer(sender) : getPlayer(server, sender, args[1]); boolean safe = false; if (args.length > 1 && args.length < 4) { int k = args.length - 1; if (args[k].equals("true") || args[k].equals("false")) { safe = Boolean.parseBoolean(args[k]); } else if (args[1].equals("safe")) safe = true; else player = getPlayer(server, sender, args[1]); } BlockPos pos = player.getPosition().down(); World world = player.getEntityWorld(); EnumFacing direction = player.getHorizontalFacing(); if (RitualHelper.createRitual(world, pos, direction, BloodMagic.RITUAL_MANAGER.getRitual(args[0]), safe)) sender.sendMessage(new TextComponentTranslation("commands.bloodmagic.success")); else if (!safe) sender.sendMessage(new TextComponentTranslation("commands.bloodmagic.ritual.create.error.outOfWorldBoundaries")); else sender.sendMessage(new TextComponentTranslation("commands.bloodmagic.ritaul.create.error.unsafe")); }
Source:
<code>public BasicQueryInfo(QueryInfo queryInfo) { this(queryInfo.getQueryId(), queryInfo.getSession(), queryInfo.getState(), queryInfo.getMemoryPool(), queryInfo.isScheduled(), queryInfo.getSelf(), <START> queryInfo.getQueryAbridged(), <END> new BasicQueryStats(queryInfo.getQueryStats()), queryInfo.getErrorType(), queryInfo.getErrorCode()); }</code><technical_language>BasicQueryInfo#query is expected abridged</technical_language>

Target:
public BasicQueryInfo(QueryInfo queryInfo) { this(queryInfo.getQueryId(), queryInfo.getSession(), queryInfo.getState(), queryInfo.getMemoryPool(), queryInfo.isScheduled(), queryInfo.getSelf(), queryInfo.getQuery(), new BasicQueryStats(queryInfo.getQueryStats()), queryInfo.getErrorType(), queryInfo.getErrorCode()); }
Source:
<code>public void serialize(T value, JsonGenerator generator, SerializerProvider provider) throws IOException { if (value == null) { provider.defaultSerializeNull(generator); return; } try { Class<?> type = value.getClass(); JsonSerializer<T> serializer = serializerCache.get(type, () -> createSerializer(provider, type)); serializer.serializeWithType(value, generator, provider, typeSerializer); } catch (ExecutionException e) { Throwable cause = e.getCause(); if (cause != null) { throwIfInstanceOf(cause, IOException.class); } <START> throw Throwables.propagate(cause); <END> } }</code><technical_language>new RuntimeException(e)</technical_language>

Target:
public void serialize(T value, JsonGenerator generator, SerializerProvider provider) throws IOException { if (value == null) { provider.defaultSerializeNull(generator); return; } try { Class<?> type = value.getClass(); JsonSerializer<T> serializer = serializerCache.get(type, () -> createSerializer(provider, type)); serializer.serializeWithType(value, generator, provider, typeSerializer); } catch (ExecutionException e) { Throwable cause = e.getCause(); if (cause != null) { throwIfInstanceOf(cause, IOException.class); } throw new RuntimeException(e); } }
Source:
<code>private Map<String, String> getMessageMap(final String prefix, final Locale locale) { List<BrandingTheme> messageThemes = getBrandingThemes(); Map<String, String> keyValues = new HashMap<String, String>(); <START> for (BrandingTheme theme : messageThemes) { <END> ResourceBundle messagesBundle = theme.getMessagesBundle(locale); for (String key : messagesBundle.keySet()) { if (key.startsWith(BRAND_PREFIX + "." + prefix) || key.startsWith(COMMON_PREFIX)) { keyValues.put(key.replaceFirst(BRAND_PREFIX + "\\." + prefix + "\\.", "") .replaceFirst(COMMON_PREFIX + "\\.", ""), messagesBundle.getString(key)); } } } return keyValues; }</code><technical_language>removed fix in purpose? surviving messageThemes == null</technical_language>

Target:
private Map<String, String> getMessageMap(final String prefix, final Locale locale) { List<BrandingTheme> messageThemes = getBrandingThemes(); Map<String, String> keyValues = new HashMap<String, String>(); if (messageThemes != null) { for (BrandingTheme theme : messageThemes) { ResourceBundle messagesBundle = theme.getMessagesBundle(locale); for (String key : messagesBundle.keySet()) { if (key.startsWith(BRAND_PREFIX + "." + prefix) || key.startsWith(COMMON_PREFIX)) { keyValues.put(key.replaceFirst(BRAND_PREFIX + "\\." + prefix + "\\.", "") .replaceFirst(COMMON_PREFIX + "\\.", ""), messagesBundle.getString(key)); } } } } return keyValues; }
Source:
<code>ReflectionClass(Class<?> clazz) { this.clazz = clazz; if (clazz.isEnum()) { enumConstants = new LinkedHashMap<>(); for (Field f : clazz.getDeclaredFields()) { if (f.isEnumConstant()) { Enum<?> e; try { f.setAccessible(true); e = (Enum<?>) f.get(clazz); <START> } catch (IllegalArgumentException | IllegalAccessException ex) { <END> throw new IllegalStateException("Failed to access enum constant field", ex); } enumConstants.put(f, new ReflectionEnumConstant(this, e, f)); } } } else { enumConstants = null; } }</code><technical_language>handle IllegalArgumentException other exceptions here, explode. IllegalAccessException is a runtime exception</technical_language>

Target:
ReflectionClass(Class<?> clazz) { this.clazz = clazz; if (clazz.isEnum()) { enumConstants = new LinkedHashMap<>(); for (Field f : clazz.getDeclaredFields()) { if (f.isEnumConstant()) { Enum<?> e; try { f.setAccessible(true); e = (Enum<?>) f.get(clazz); } catch (IllegalAccessException iae) { throw new IllegalStateException("Failed to access enum constant field", iae); } enumConstants.put(f, new ReflectionEnumConstant(this, e, f)); } } } else { enumConstants = null; } }
Source:
<code>public void createTableWithTableNameLengthLimit() throws AccumuloException, AccumuloSecurityException, TableExistsException { StringBuilder tableNameBuilder = new StringBuilder(); <START> for (int i = 0; i < 1026; i++) { <END> tableNameBuilder.append('a'); } String tableName = tableNameBuilder.toString(); accumuloClient.tableOperations().create(tableName); assertTrue(!accumuloClient.tableOperations().exists(tableName)); }</code><technical_language>If constant, 1026 replaced constant + 2</technical_language>

Target:
public void createTableWithTableNameLengthLimit() throws AccumuloException, AccumuloSecurityException, TableExistsException { StringBuilder tableNameBuilder = new StringBuilder(); for (int i = 0; i <= MAX_TABLE_NAME_LEN; i++) { tableNameBuilder.append('a'); } String tableName = tableNameBuilder.toString(); assertThrows(IllegalArgumentException.class, () -> accumuloClient.tableOperations().create(tableName)); assertFalse(accumuloClient.tableOperations().exists(tableName)); }
Source:
<code>public TimestampRange handOut(long numberToHandOut) { checkValidTimestampRangeRequest(numberToHandOut); synchronized (this) { long targetTimestamp = lastHandedOut() + numberToHandOut; DebugLogger.logger.trace("Handing out timestamps, taking us to {}.", numberToHandOut, targetTimestamp); <START> return handOutTimestamp(targetTimestamp); <END> } }</code><technical_language>matter relative other more expensive operations, pull logging out of synchronized block if this minimized possible</technical_language>

Target:
public TimestampRange handOut(long numberToHandOut) { checkValidTimestampRangeRequest(numberToHandOut); long targetTimestamp; TimestampRange timestampRange; synchronized (this) { targetTimestamp = lastHandedOut() + numberToHandOut; timestampRange = handOutTimestamp(targetTimestamp); } DebugLogger.logger.trace("Handing out timestamps, taking us to {}.", numberToHandOut, targetTimestamp); return timestampRange; }
Source:
<code>public boolean validate(String path) { boolean valid = false; if (fTrace != null) { valid = standardValidate(path); } else if (TmfTraceType.isCustomTraceId(getCanonicalName())) { <START> valid = customValidate(path); <END> } return valid; }</code><technical_language>I need this anymore. (we able kill customValidate(String bla) also. woooooooooooOOOOOOOOOOOOOoooooooooooooOOOOOOOOOOoooooooOOOOOOOOOoooooOOOOOOOOoooooOOOOOOoooooOOOOOoooooo</technical_language>

Target:
public boolean validate(String path) { boolean valid = false; if (fTrace != null) { valid = standardValidate(path); } return valid; }
Source:
<code>public void addingTheSameTopicRepeatedlyDoesntLock() throws InterruptedException { this.controller.start(); <START> String topic1 = "topic1"; <END> for(int i = 0; i < 10; i++){ this.controller.addTopic(topic1); } assertTrue(true); }</code><technical_language>MInor: final</technical_language>

Target:
public void addingTheSameTopicRepeatedlyDoesntLock() throws InterruptedException { ExecutorService executor = Executors.newSingleThreadExecutor(); this.controller.start(); String topic1 = "topic1"; AtomicInteger timesAdded = new AtomicInteger(0); int timesToAdd = 10; for (int i = 0; i < timesToAdd; i++) { executor.execute(() -> { try { this.controller.addTopic(topic1); timesAdded.incrementAndGet(); } catch (InterruptedException ignored) { } }); } executor.shutdown(); executor.awaitTermination(500, TimeUnit.MILLISECONDS); assertEquals(timesToAdd, timesAdded.get()); }
Source:
<code>public void <START> testHandleSchemesForOneScheme() <END> { RegistrationWindows registrationWindows = new RegistrationWindows(registryWriter); SchemeInformation schemeInformation = new SchemeInformation("schemeToTest", "ThisSchemeisJustForTesting", System.getProperty("eclipse.launcher")); registrationWindows.handleSchemes(Arrays.asList(schemeInformation), Arrays.asList(schemeInformation)); assertEquals(null, registryWriter.getRegisteredHandlerPath("schemeToTest")); }</code><technical_language>this method add remove scheme. name of method reflect this</technical_language>

Target:
public void testHandleSchemesForOneScheme() { SchemeInformation schemeInformation = new SchemeInformation("schemeToTest", "ThisSchemeisJustForTesting", System.getProperty("eclipse.launcher")); registrationWindows.handleSchemes(Arrays.asList(schemeInformation), Arrays.asList(schemeInformation)); assertEquals(null, registryWriter.getRegisteredHandlerPath("schemeToTest")); }
Source:
<code><START> public boolean hasChildren(Object element) { <END> Predicate<Object> predicate = Stream.of(fViewer.getFilters()) .map(filter -> predicateFor(filter, element)) .reduce(t -> true, Predicate::and); return Stream.of(getChildren(element)) .filter(predicate) .findAny() .isPresent(); }</code><technical_language>This is necessary, simply call setExpandPreCheckFilters(true) viewer</technical_language>

Target:
public boolean hasChildren(Object element) { return getChildren(element).length > 0; }
Source:
<code>private Map<String, Object> toQueryMap (Object value) { if (value instanceof Map) { return (Map<String, Object>)value; } try { <START> return ObjectParamMetadata.getMetadata(value.getClass()).toQueryMap(value); <END> } catch (IllegalAccessException e) { throw new IllegalStateException(e); } }</code><technical_language>ObjectParamMetadata some helper of some sort... forces callers do in a order (you call getMetadata(object) ask turn a query map. a lot of separation of concerns problems here. If objective of ObjectParamMetadata is get metadata, this class generates queryParams. If ObjectParamMetadata is a helper, return queryParams (without forcing users of internal implementation/how-to cal/which order). Finally - static methods tough test. In this case, I guess do get covered wider tests written - specific tests for ObjectParamMetadata helper</technical_language>

Target:
private Map<String, Object> toQueryMap (Object value) { if (value instanceof Map) { return (Map<String, Object>)value; } try { return queryMapEncoder.encode(value); } catch (EncodeException e) { throw new IllegalStateException(e); } }
Source:
<code>protected void buildEntryList(@NonNull ITmfTrace trace, @NonNull ITmfTrace parentTrace, @NonNull IProgressMonitor monitor) { if (monitor.isCanceled()) { return; } long start = trace.getStartTime().toNanos(); long end = start; TraceEntry traceEntry = new TraceEntry(trace); addToEntryList(parentTrace, Collections.singletonList(traceEntry)); Iterable<@NonNull ITmfAnalysisModuleWithStateSystems> modules = Iterables. filter(trace.getAnalysisModules(), ITmfAnalysisModuleWithStateSystems.class); modules.forEach(m -> waitForInitialization(trace, m)); boolean complete = false; while <START> (!complete) { if (monitor.isCanceled()) { return; } <END> complete = true; for (ITmfAnalysisModuleWithStateSystems module : modules) { if (monitor.isCanceled()) { return; } ModuleEntry moduleEntry = getOrCreateModuleEntry(traceEntry, module); for (ITmfStateSystem ss : module.getStateSystems()) { complete &= ss.waitUntilBuilt(0); end = Long.max(end, ss.getCurrentEndTime()); getOrCreateStateSystemEntry(moduleEntry, ss); } } traceEntry.updateEndTime(end); long resolution = Long.max(1, (end - start) / getDisplayWidth()); zoomEntries(Utils.flatten(traceEntry), start, end, resolution, monitor); if (parentTrace == getTrace()) { synchronized (this) { setStartTime(Long.min(getStartTime(), start)); setEndTime(Long.max(getEndTime(), end)); } refresh(); } if (!complete) { try { Thread.sleep(ITERATION_WAIT); } catch (InterruptedException e) { Activator.getDefault().logError("Failed to wait", e); } } } }</code><technical_language>while !complete && !monitor.isCanceled()</technical_language>

Target:
protected void buildEntryList(@NonNull ITmfTrace trace, @NonNull ITmfTrace parentTrace, @NonNull IProgressMonitor monitor) { if (monitor.isCanceled()) { return; } long start = trace.getStartTime().toNanos(); long end = start; TraceEntry traceEntry = new TraceEntry(trace); addToEntryList(parentTrace, Collections.singletonList(traceEntry)); Iterable<@NonNull ITmfAnalysisModuleWithStateSystems> modules = Iterables. filter(trace.getAnalysisModules(), ITmfAnalysisModuleWithStateSystems.class); modules.forEach(m -> waitForInitialization(trace, m)); boolean complete = false; while (!complete && !monitor.isCanceled()) { complete = true; for (ITmfAnalysisModuleWithStateSystems module : modules) { if (monitor.isCanceled()) { return; } ModuleEntry moduleEntry = getOrCreateModuleEntry(traceEntry, module); for (ITmfStateSystem ss : module.getStateSystems()) { complete &= ss.waitUntilBuilt(0); end = Long.max(end, ss.getCurrentEndTime()); getOrCreateStateSystemEntry(moduleEntry, ss); } } traceEntry.updateEndTime(end); long resolution = Long.max(1, (end - start) / getDisplayWidth()); zoomEntries(Utils.flatten(traceEntry), start, end, resolution, monitor); if (monitor.isCanceled()) { return; } if (parentTrace == getTrace()) { synchronized (this) { setStartTime(Long.min(getStartTime(), start)); setEndTime(Long.max(getEndTime(), end)); } refresh(); } if (monitor.isCanceled()) { return; } if (!complete) { try { Thread.sleep(ITERATION_WAIT); } catch (InterruptedException e) { Activator.getDefault().logError("Failed to wait", e); } } } }