auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> public List<MemorySegment> requestMemorySegments(int numberOfSegmentsToRequest) throws IOException { <END> synchronized (factoryLock) { if (isDestroyed) { throw new IllegalStateException("Network buffer pool has already been destroyed."); } tryRedistributeBuffers(numberOfSegmentsToRequest); } final List<MemorySegment> segments = new ArrayList<>(numberOfSegmentsToRequest); try { final Deadline deadline = Deadline.fromNow(requestSegmentsTimeout); while (true) { if (isDestroyed) { throw new IllegalStateException("Buffer pool is destroyed."); } MemorySegment segment; synchronized (availableMemorySegments) { if ((segment = internalRequestMemorySegment()) == null) { availableMemorySegments.wait(2000); } } if (segment != null) { segments.add(segment); } if (segments.size() >= numberOfSegmentsToRequest) { break; } if (!deadline.hasTimeLeft()) { throw new IOException(String.format("Timeout triggered when requesting exclusive buffers: %s, " + " or you may increase the timeout which is %dms by setting the key '%s'.", getConfigDescription(), requestSegmentsTimeout.toMillis(), NettyShuffleEnvironmentOptions.NETWORK_EXCLUSIVE_BUFFERS_REQUEST_TIMEOUT_MILLISECONDS.key())); } } } catch (Throwable e) { try { recycleMemorySegments(segments, numberOfSegmentsToRequest); } catch (IOException inner) { e.addSuppressed(inner); } ExceptionUtils.rethrowIOException(e); } return segments; }</code><technical_language>Do check passed argument more 0 in advance</technical_language>

Target:
public List<MemorySegment> requestMemorySegments(int numberOfSegmentsToRequest) throws IOException { checkArgument(numberOfSegmentsToRequest > 0, "Number of buffers to request must be larger than 0."); synchronized (factoryLock) { if (isDestroyed) { throw new IllegalStateException("Network buffer pool has already been destroyed."); } tryRedistributeBuffers(numberOfSegmentsToRequest); } final List<MemorySegment> segments = new ArrayList<>(numberOfSegmentsToRequest); try { final Deadline deadline = Deadline.fromNow(requestSegmentsTimeout); while (true) { if (isDestroyed) { throw new IllegalStateException("Buffer pool is destroyed."); } MemorySegment segment; synchronized (availableMemorySegments) { if ((segment = internalRequestMemorySegment()) == null) { availableMemorySegments.wait(2000); } } if (segment != null) { segments.add(segment); } if (segments.size() >= numberOfSegmentsToRequest) { break; } if (!deadline.hasTimeLeft()) { throw new IOException(String.format("Timeout triggered when requesting exclusive buffers: %s, " + " or you may increase the timeout which is %dms by setting the key '%s'.", getConfigDescription(), requestSegmentsTimeout.toMillis(), NettyShuffleEnvironmentOptions.NETWORK_EXCLUSIVE_BUFFERS_REQUEST_TIMEOUT_MILLISECONDS.key())); } } } catch (Throwable e) { try { recycleMemorySegments(segments, numberOfSegmentsToRequest); } catch (IOException inner) { e.addSuppressed(inner); } ExceptionUtils.rethrowIOException(e); } return segments; }
Source:
<code>public synchronized void connect(StompSessionHandler handler) { this.compositeStompSessionHandler.addHandler(handler); if (this.stompSessionListenableFuture == null) { this.stompSessionListenableFuture = doConnect(this.compositeStompSessionHandler); this.stompSessionListenableFuture.addCallback(new ListenableFutureCallback<StompSession>() { @Override public void onFailure(Throwable e) { logger.error("STOMP connect error.", e); if (applicationEventPublisher != null) { applicationEventPublisher.publishEvent( new StompExceptionEvent(AbstractStompSessionManager.this, e)); } AbstractStompSessionManager.this.stompSession = null; <START> AbstractStompSessionManager.this.stompSessionListenableFuture = null; <END> } @Override public void onSuccess(StompSession stompSession) { AbstractStompSessionManager.this.stompSession = stompSession; AbstractStompSessionManager.this.stompSession.setAutoReceipt(autoReceipt); } }); } }</code><technical_language>This a bit smelly - deal concurrent connect calls start() methods protection that</technical_language>

Target:
public void connect(StompSessionHandler handler) { this.compositeStompSessionHandler.addHandler(handler); }
Source:
<code>public static PersonalizationInfo extractPersonalizationStatusFromAlexaRequest(HandlerInput handlerInput) { if (handlerInput == null) { throw new OneBusAwayException(promptHelper.getPrompt(GENERAL_ERROR_MESSAGE)); } final String userId = handlerInput.getRequestEnvelope().getSession().getUser().getUserId(); final String principleId = SessionUtil.getSessionAttribute(handlerInput.getAttributesManager(), PRINCIPLE_ID, String.class); if (StringUtils.isNotBlank(principleId)) { return new PersonalizationInfo(principleId, userId, principleId, principleId.startsWith(PERSONID_PREFIX)); } return Optional.of(handlerInput) .map(HandlerInput::getRequestEnvelope) .map(RequestEnvelope::getContext) .map(Context::getSystem) .map(SystemState::getPerson) .map(Person::getPersonId) .filter(StringUtils::isNotBlank) .map((pid) -> { log.info("Person ID is " + pid); return new PersonalizationInfo(pid, userId, pid, true); }).orElseGet(() -> { <START> log.info("Person ID is not exist, using userId as principleId"); <END> return new PersonalizationInfo(userId, userId, StringUtils.EMPTY, false); }); }</code><technical_language>is exist -> exist</technical_language>

Target:
public static PersonalizationInfo extractPersonalizationStatusFromAlexaRequest(HandlerInput handlerInput) { if (handlerInput == null) { throw new OneBusAwayException(promptHelper.getPrompt(GENERAL_ERROR_MESSAGE)); } final String userId = handlerInput.getRequestEnvelope().getSession().getUser().getUserId(); final String principleId = SessionUtil.getSessionAttribute(handlerInput.getAttributesManager(), PRINCIPLE_ID, String.class); if (StringUtils.isNotBlank(principleId)) { return new PersonalizationInfo(principleId, userId, principleId, principleId.startsWith(PERSONID_PREFIX)); } return Optional.of(handlerInput) .map(HandlerInput::getRequestEnvelope) .map(RequestEnvelope::getContext) .map(Context::getSystem) .map(SystemState::getPerson) .map(Person::getPersonId) .filter(StringUtils::isNotBlank) .map((pid) -> { log.info("Person ID is " + pid); return new PersonalizationInfo(pid, userId, pid, true); }).orElseGet(() -> { log.info("Person ID does not exist, using userId as principleId"); return new PersonalizationInfo(userId, userId, StringUtils.EMPTY, false); }); }
Source:
<code>public String toString() { <START> return new ToStringBuilder(this) <END> .append("name", name) .append("properties", properties) .append("oneTimeExecution", oneTimeExecution) .append("immediateExecution", immediateExecution) .append("uuid", uuid) .toString(); }</code><technical_language>thinking this a lot lately. toString() methods. need vote a library generate for us, do a refactoring start more consistent</technical_language>

Target:
public String toString() { final StringBuilder sb = new StringBuilder("CronTaskConfiguration{"); sb.append("name='").append(name).append('\''); sb.append(", properties=").append(properties); sb.append(", oneTimeExecution=").append(oneTimeExecution); sb.append(", immediateExecution=").append(immediateExecution); sb.append(", uuid='").append(uuid).append('\''); sb.append('}'); return sb.toString(); }
Source:
<code>public void addBackgroundPage(final ScenarioGridWidget scenarioGridWidget) { addPage(new PageImpl(scenarioGridWidget, ScenarioSimulationEditorConstants.INSTANCE.backgroundTabTitle()) { @Override public void onFocus() { scenarioSimulationEditorPresenter.setFocusedContext(scenarioGridWidget.getScenarioSimulationContext()); <START> scenarioSimulationEditorPresenter.setItemMenuForMainGridEnabled(false); <END> } }); }</code><technical_language>### issue 1 I place this else, inconsistent behavior. If user Click Model -> Overview -> Data Objects -> Background, buttons allowed Background is clicked. If user chooose order Model -> Background -> Overview -> Data Objects. buttons disabled immediately click</technical_language>

Target:
public void addBackgroundPage(final ScenarioGridWidget scenarioGridWidget) { addPage(new PageImpl(scenarioGridWidget, ScenarioSimulationEditorConstants.INSTANCE.backgroundTabTitle()) { @Override public void onFocus() { super.onFocus(); enableBackgroundTab(); } }); }
Source:
<code>public static WebArchive getDeployment() { return AbstractTestCase.getDeployment() .addClasses(LoggingParticipant.class, AbstractTestCase.class, TestSuiteEnvironment.class) <START> .addAsWebInfResource(InboundBridgeTestCase.class.getClassLoader().getResource("web.xml"),"web.xml") <END> .addAsManifestResource(new StringAsset(DEPENDENCIES), "MANIFEST.MF") .addAsManifestResource(PermissionUtils.createPermissionsXmlAsset( new PropertyPermission("management.address", "read"), new PropertyPermission("node0", "read"), new PropertyPermission("jboss.http.port", "read"), new PropertyPermission("arquillian.debug", "read"), new ReflectPermission("suppressAccessChecks"), new RuntimePermission("accessDeclaredMembers"), new SocketPermission(SERVER_HOST_PORT, "connect,resolve") ), "permissions.xml"); }</code><technical_language>ParticipantTestCase.class copy&paste InboundBridgeTestCase.java</technical_language>

Target:
public static WebArchive getDeployment() { return AbstractTestCase.getDeployment() .addClasses(LoggingParticipant.class, AbstractTestCase.class, TestSuiteEnvironment.class) .addAsWebInfResource(ParticipantTestCase.class.getClassLoader().getResource("web.xml"),"web.xml") .addAsManifestResource(new StringAsset(DEPENDENCIES), "MANIFEST.MF") .addAsManifestResource(PermissionUtils.createPermissionsXmlAsset( new PropertyPermission("management.address", "read"), new PropertyPermission("node0", "read"), new PropertyPermission("jboss.http.port", "read"), new PropertyPermission("arquillian.debug", "read"), new ReflectPermission("suppressAccessChecks"), new RuntimePermission("accessDeclaredMembers"), new SocketPermission(SERVER_HOST_PORT, "connect,resolve") ), "permissions.xml"); }
Source:
<code>public Status doGet() { return new Status( <START> getVersion("/druid-server.version"), <END> getVersion("/druid-api.version"), getExtensionVersions(), new Memory(Runtime.getRuntime()) ); }</code><technical_language>do need a file get this</technical_language>

Target:
public Status doGet() { return getStatus(); }
Source:
<code><START> public LockWatchStateUpdate getWatchState(OptionalLong lastKnownVersion) { <END> return lockWatchingService.getWatchState(lastKnownVersion); }</code><technical_language>Another optimisation potentially, if expect this return empty state of time, benefit returning Optional.empty, sends bytes for a body a body a response represents empty state</technical_language>

Target:
public LockWatchStateUpdate getWatchState(OptionalLong lastKnownVersion) { return lockWatchingService.getWatchStateUpdate(lastKnownVersion); }
Source:
<code>RevCommit next() throws MissingObjectException, IncorrectObjectTypeException, IOException { for (;;) { final RevCommit c = pending.next(); if (c == null) return null; if (c.inDegree > 0) { continue; } if ((c.flags & <START> TOPO_PRODUCED) != <END> 0) { continue; } for (RevCommit p : c.parents) { if (--p.inDegree == 0) { pending.unpop(p); } if (firstParent) { break; } } c.flags |= TOPO_PRODUCED; return c; } }</code><technical_language>is this case triggered? If a commit is produced other commits referencing emitted... reached again? Is this some interaction other generators</technical_language>

Target:
RevCommit next() throws MissingObjectException, IncorrectObjectTypeException, IOException { for (;;) { final RevCommit c = pending.next(); if (c == null) return null; if (c.inDegree > 0) { continue; } for (RevCommit p : c.parents) { if (--p.inDegree == 0 && (p.flags & TOPO_QUEUED) != 0) { pending.unpop(p); } if (firstParent) { break; } } if ((c.flags & TOPO_QUEUED) == 0) { continue; } c.flags &= ~TOPO_QUEUED; return c; } }
Source:
<code>public static LogFileInformation getLogFileInformation() { if (shouldFetchLogFileInformation()) { File logFile = new File(rootFileAppender.getFile()); LogFileInformation logFileInfo = new LogFileInformation(rootFileAppender.getFile(), logFile.length()); return logFileInfo; } <START> return new LogFileInformation(null, 0); <END> }</code><technical_language>return null</technical_language>

Target:
public static LogFileInformation getLogFileInformation() { if (shouldFetchLogFileInfo) { File logFile = new File(fileAppender.getFile()); LogFileInformation logFileInfo = new LogFileInformation(fileAppender.getFile(), logFile.length()); return logFileInfo; } return null; }
Source:
<code>public void outputTest(){ DataSet data = new DataSet(Nd4j.zeros(10, 10), Nd4j.zeros(10, 10)); SameDiff sd = SameDiff.create(); SDVariable in = sd.placeHolder("input", DataType.FLOAT, 10, 10); SDVariable out = in.add("out", 2); TrainingConfig conf = new TrainingConfig.Builder() .l2(1e-4) .updater(new Sgd(3e-1)) .dataSetFeatureMapping("input") .dataSetLabelMapping() .build(); sd.setTrainingConfig(conf); INDArray output = sd.output(data, "out").get("out"); <START> assertTrue(output.toString().equals(Nd4j.zeros(10, 10).add(2).toString())); <END> }</code><technical_language>reason equal toString is datatypes. design cast equals. recommend datatypes INDArrays, of them. Tests default double; comparing a float [10,10] double [10,10] failure</technical_language>

Target:
public void outputTest(){ DataSet data = new DataSet(Nd4j.zeros(10, 10), Nd4j.zeros(10, 10)); SameDiff sd = SameDiff.create(); SDVariable in = sd.placeHolder("input", DataType.FLOAT, 10, 10); SDVariable out = in.add("out", 2); TrainingConfig conf = new TrainingConfig.Builder() .l2(1e-4) .updater(new Sgd(3e-1)) .dataSetFeatureMapping("input") .dataSetLabelMapping() .build(); sd.setTrainingConfig(conf); INDArray output = sd.output(data, "out").get("out"); assertTrue("output != input + 2", output.equalsWithEps( Nd4j.zeros(10, 10).add(2).castTo(DataType.FLOAT), 0.0001)); }
Source:
<code>public void testTopologyValidator() throws Exception { putValid(DEFAULT_CACHE_NAME); remove(DEFAULT_CACHE_NAME); putInvalid(CACHE_NAME_1); removeInvalid(CACHE_NAME_1); putInvalid(CACHE_NAME_2); removeInvalid(CACHE_NAME_2); startGrid(1); putValid(DEFAULT_CACHE_NAME); remove(DEFAULT_CACHE_NAME); putValid(CACHE_NAME_1); putValid(CACHE_NAME_2); remove(CACHE_NAME_2); startGrid(2); putValid(DEFAULT_CACHE_NAME); remove(DEFAULT_CACHE_NAME); getInvalid(CACHE_NAME_1); putInvalid(CACHE_NAME_1); removeInvalid(CACHE_NAME_1); putValid(CACHE_NAME_2); remove(CACHE_NAME_2); <START> client = true; <END> startClientGrid(3); putValid(DEFAULT_CACHE_NAME); remove(DEFAULT_CACHE_NAME); getInvalid(CACHE_NAME_1); putInvalid(CACHE_NAME_1); removeInvalid(CACHE_NAME_1); putValid(CACHE_NAME_2); remove(CACHE_NAME_2); }</code><technical_language>If I correct, 'client' field removed all, private appears in this place. So, change condition in 'getConfiguration' method from: if (!client) { to: if (!cfg.isClientMode()) {</technical_language>

Target:
public void testTopologyValidator() throws Exception { putValid(DEFAULT_CACHE_NAME); remove(DEFAULT_CACHE_NAME); putInvalid(CACHE_NAME_1); removeInvalid(CACHE_NAME_1); putInvalid(CACHE_NAME_2); removeInvalid(CACHE_NAME_2); startGrid(1); putValid(DEFAULT_CACHE_NAME); remove(DEFAULT_CACHE_NAME); putValid(CACHE_NAME_1); putValid(CACHE_NAME_2); remove(CACHE_NAME_2); startGrid(2); putValid(DEFAULT_CACHE_NAME); remove(DEFAULT_CACHE_NAME); getInvalid(CACHE_NAME_1); putInvalid(CACHE_NAME_1); removeInvalid(CACHE_NAME_1); putValid(CACHE_NAME_2); remove(CACHE_NAME_2); startClientGrid(3); putValid(DEFAULT_CACHE_NAME); remove(DEFAULT_CACHE_NAME); getInvalid(CACHE_NAME_1); putInvalid(CACHE_NAME_1); removeInvalid(CACHE_NAME_1); putValid(CACHE_NAME_2); remove(CACHE_NAME_2); }
Source:
<code>private String calculateUptime() { <START> <END> long different = System.currentTimeMillis() - startTimestamp; long secondsInMilli = 1000; long minutesInMilli = secondsInMilli * 60; long hoursInMilli = minutesInMilli * 60; long daysInMilli = hoursInMilli * 24; long elapsedDays = different / daysInMilli; different = different % daysInMilli; long elapsedHours = different / hoursInMilli; different = different % hoursInMilli; long elapsedMinutes = different / minutesInMilli; different = different % minutesInMilli; long elapsedSeconds = different / secondsInMilli; return String.format("%d days, %d hours, %d minutes, %d seconds", elapsedDays, elapsedHours, elapsedMinutes, elapsedSeconds); }</code><technical_language>consider java.time.Duration for calculations</technical_language>

Target:
private String calculateUptime() { long different = System.currentTimeMillis() - startTimestamp; return DurationFormatUtils.formatDurationWords(different, false, false); }
Source:
<code>public void postDrawEvent(ITimeEvent event, Rectangle bounds, GC gc) { XmlEntry entry = (XmlEntry) event.getEntry(); if (!entry.showText()) { return; } if (fAverageCharacterWidth == null) { fAverageCharacterWidth = gc.getFontMetrics().getAverageCharWidth(); } if (bounds.width <= fAverageCharacterWidth) { return; } String eventName = getEventName(event); if (eventName == null) { return; } <START> gc.setForeground(gc.getDevice().getSystemColor(SWT.COLOR_WHITE)); <END> Utils.drawText(gc, eventName, bounds.x, bounds.y, bounds.width, bounds.height, true, true); }</code><technical_language>a newly added utility get color based state color avoid "white yellow": Color stateColor = gc.getBackground(); gc.setForeground(Utils.getDistinctColor(stateColor.getRGB()));</technical_language>

Target:
public void postDrawEvent(ITimeEvent event, Rectangle bounds, GC gc) { XmlEntry entry = (XmlEntry) event.getEntry(); if (!entry.showText()) { return; } if (fAverageCharacterWidth == null) { fAverageCharacterWidth = gc.getFontMetrics().getAverageCharWidth(); } if (bounds.width <= fAverageCharacterWidth) { return; } String eventName = getEventName(event); if (eventName == null) { return; } Color stateColor = gc.getBackground(); gc.setForeground(Utils.getDistinctColor(stateColor.getRGB())); Utils.drawText(gc, eventName, bounds.x, bounds.y, bounds.width, bounds.height, true, true); }
Source:
<code>public void execute(FunctionContext context) { String memberName = context.getMemberName(); try { Object[] arguments; Boolean stop = getStopFromArguments(context.getArguments()); if (stop == null) { context.getResultSender().lastResult(new CliFunctionResult("", false, "Wrong arguments passed")); return; } String senderId = getSenderIdFromArguments(context.getArguments()); if (senderId == null) { context.getResultSender().lastResult(new CliFunctionResult("", false, "Wrong arguments passed")); return; } Cache cache = context.getCache(); GatewaySender sender = cache.getGatewaySender(senderId); if (sender == null) { context.getResultSender().lastResult(new CliFunctionResult(memberName, false, String.format("Sender '%s' does not exist", senderId))); return; } sender.setMustQueueDroppedEvents(!stop); <START> XmlEntity xmlEntity = new XmlEntity(CacheXml.GATEWAY_SENDER, "name", senderId); <END> context.getResultSender().lastResult(new CliFunctionResult(memberName, xmlEntity, String.format("Set mustQueueTempDroppedEvents to '%b', for Sender '%s'", !stop, senderId))); } catch (IllegalStateException ex) { context.getResultSender() .lastResult(new CliFunctionResult(memberName, false, ex.getMessage())); } catch (Exception ex) { LogService.getLogger().error(ex.getMessage(), ex); context.getResultSender().lastResult(new CliFunctionResult(memberName, ex, ex.getMessage())); } }</code><technical_language>I need modify cache xml for this flag, is need send this command. this function is turn on/off this flag report sucess/failure command</technical_language>

Target:
public void execute(FunctionContext context) { String memberName = context.getMemberName(); try { Object[] arguments = (Object[]) context.getArguments(); String senderId = (String) arguments[0]; Boolean stop = (Boolean) arguments[1]; Cache cache = context.getCache(); GatewaySender sender = cache.getGatewaySender(senderId); if (sender == null) { context.getResultSender() .lastResult( new CliFunctionResult(memberName, false, "sender " + senderId + " not found ")); return; } sender.setAllInstancesStopped(stop); context.getResultSender().lastResult(new CliFunctionResult(memberName, String.format("Set allInstancesStopped to '%b', for Sender '%s'", stop, senderId))); } catch (IllegalStateException ex) { context.getResultSender() .lastResult(new CliFunctionResult(memberName, false, ex.getMessage())); } catch (Exception ex) { LogService.getLogger().error(ex.getMessage(), ex); context.getResultSender().lastResult(new CliFunctionResult(memberName, ex, ex.getMessage())); } }
Source:
<code>public ViewActionSetActivated(View view) { <START> this.view = view; <END> }</code><technical_language>want consider creating a ViewAction1<T> abstract class reference WeakReference<View> avoid a Field for view in Action1 implementations</technical_language>

Target:
public ViewActionSetActivated(View view) { super(view); }
Source:
<code>public static void copyRsdl(String outputDirectory) throws IOException { <START> copy(loadAsStream(RSDL_FILE_NAME), new FileWriter(new File(outputDirectory + RSDL_FILE_NAME))); <END> copy(loadAsStream(GLUSTER_RSDL_FILE_NAME), new FileWriter(new File(outputDirectory + GLUSTER_RSDL_FILE_NAME))); }</code><technical_language>good create File object concatenating directory file name, operating system \ instead of / separate paths. constructor of File takes arguments: File rsdlOutputFile = new File(outputDirectory, RSDL_FILE_NAME);</technical_language>

Target:
public static void copyRsdl(String outputDirectory) throws IOException { copy(loadAsStream(RSDL_FILE_NAME), new FileWriter(new File(outputDirectory + RSDL_FILE_NAME))); copy(loadAsStream(GLUSTER_RSDL_FILE_NAME), new FileWriter(new File(outputDirectory + GLUSTER_RSDL_FILE_NAME))); copy(loadAsStream(SCHEMA_FILE_NAME), new FileWriter(new File(outputDirectory + SCHEMA_FILE_NAME))); }
Source:
<code>public void deregisterCacheEntryListener(CacheEntryListenerConfiguration<K, V> listenerCfg) { notifier.removeListener(listenerCfg, cache); <START> configuration.getCacheEntryListenerConfigurations().remove(listenerCfg); <END> }</code><technical_language>Kinda nitpicking if addCacheEntryListenerConfiguration add removeCacheEntryListenerConfiguration nice symmetric..</technical_language>

Target:
public void deregisterCacheEntryListener(CacheEntryListenerConfiguration<K, V> listenerCfg) { notifier.removeListener(listenerCfg, cache); removeCacheEntryListenerConfiguration(listenerCfg); }
Source:
<code>public PostgreSQLWeekDiffFunction() { <START> super("(select sign(i1) * floor(abs(i1)) from (values (extract('day' from (?1::timestamp - ?2::timestamp)) / -7)) as temp(i1))"); <END> }</code><technical_language>a cast int enough</technical_language>

Target:
public PostgreSQLWeekDiffFunction() { super("-cast(trunc(date_part('day', (?1)::timestamp - (?2)::timestamp) / 7) as integer)"); }
Source:
<code>public void testMergeLocalChangesPerFeature_Bug3() throws Exception { CDOSession session = openSession(); CDOTransaction transaction1 = session.openTransaction(); transaction1.options().addConflictResolver(createConflictResolver()); EList<EObject> contents1 = transaction1.getOrCreateResource(getResourcePath("/res1")).getContents(); contents1.add(getModel1Factory().createAddress()); CDOTransaction transaction2 = session.openTransaction(); transaction2.options().addConflictResolver(createConflictResolver()); EList<EObject> contents2 = transaction2.getOrCreateResource(getResourcePath("/res1")).getContents(); CDOTransaction transaction3 = session.openTransaction(); transaction3.options().addConflictResolver(createConflictResolver()); EList<EObject> contents3 = <START> transaction2.getOrCreateResource(getResourcePath("/res1")).getContents(); <END> contents1.add(getModel1Factory().createAddress()); Address address2 = getModel1Factory().createAddress(); contents2.add(address2); contents3.add(getModel1Factory().createAddress()); contents2.remove(address2); contents3.add(getModel1Factory().createAddress()); commitAndSync(transaction3, transaction2, transaction1); commitAndSync(transaction2, transaction1, transaction3); commitAndSync(transaction1, transaction2, transaction3); }</code><technical_language>this "transaction3" ?</technical_language>

Target:
public void testMergeLocalChangesPerFeature_Bug3() throws Exception { CDOSession session = openSession(); CDOTransaction transaction1 = session.openTransaction(); transaction1.options().addConflictResolver(createConflictResolver()); CDOResource resource1 = transaction1.getOrCreateResource(getResourcePath("/res1")); EList<EObject> contents1 = resource1.getContents(); contents1.add(getModel1Factory().createAddress()); contents1.add(getModel1Factory().createAddress()); CDOTransaction transaction2 = session.openTransaction(); transaction2.options().addConflictResolver(createConflictResolver()); CDOResource resource2 = transaction2.getOrCreateResource(getResourcePath("/res1")); EList<EObject> contents2 = resource2.getContents(); contents2.add(getModel1Factory().createAddress()); contents2.remove(0); CDOTransaction transaction3 = session.openTransaction(); transaction3.options().addConflictResolver(createConflictResolver()); CDOResource resource3 = transaction3.getOrCreateResource(getResourcePath("/res1")); EList<EObject> contents3 = resource3.getContents(); contents3.add(getModel1Factory().createAddress()); contents3.add(getModel1Factory().createAddress()); commitAndSync(transaction3, transaction2, transaction1); commitAndSync(transaction2, transaction1, transaction3); commitAndSync(transaction1, transaction2, transaction3); }
Source:
<code>public static Level parseLevel(String levelName) { <START> if ("ALL".equalsIgnoreCase(levelName)) { <END> return Level.ALL; } else if ("FINEST".equalsIgnoreCase(levelName)) { return Level.FINEST; } else if ("TRACE".equalsIgnoreCase(levelName) || "FINER".equalsIgnoreCase(levelName)) { return Level.FINER; } else if ("DEBUG".equalsIgnoreCase(levelName) || "FINE".equalsIgnoreCase(levelName)) { return Level.FINE; } else if ("CONFIG".equalsIgnoreCase(levelName)) { return Level.CONFIG; } else if ("INFO".equalsIgnoreCase(levelName)) { return Level.INFO; } else if ("WARN".equalsIgnoreCase(levelName) || "WARNING".equalsIgnoreCase(levelName)) { return Level.WARNING; } else if ("ERROR".equalsIgnoreCase(levelName) || "FATAL".equalsIgnoreCase(levelName) || "SEVERE".equalsIgnoreCase(levelName)) { return Level.SEVERE; } else if ("OFF".equalsIgnoreCase(levelName)) { return Level.OFF; } throw new IllegalArgumentException(String.format("Invalid log level value: '%s'", levelName)); }</code><technical_language>this in properties file resource data element in code. map.level = alias is need ignore case over, convert arguments case once</technical_language>

Target:
public static Level parseLevel(String levelName) { if (levelName == null) { throw new IllegalArgumentException(String.format("Invalid log level value: '%s'", levelName)); } return Level.parse(levelName.toUpperCase()); }
Source:
<code>private static void check(CheckArguments param) throws CommandFormatException, IOException { if (param.isSearchTypeStatus() && UNKNOWN.equals(param.getExpectedState())) { throw new IllegalStateException("Could not verify deployment state " + UNKNOWN + "!"); } if (!param.isOutputEmpty()) { for (String row : param.getRows()) { if (row.contains(param.getName())) { if (param.isSearchTypeMissing()) { fail("Found non wanted application deployment " + "" + param.getName() + " in \n" + param.getResult()); } else if (param.isSearchTypeExist()) { log.info("Check existence application deployment '" + param.getName() + "' Success"); doubleCheck(param); return; } else if (param.isSearchTypeStatus()) { assertThat("", row, containsString(param.getExpectedState().getTitle())); <START> log.info("Check application deployment in right state '" + param.getName() + "'->'" <END> + param.getExpectedState().getTitle() + " by command '" + param.getResult().getCommand() + " Success"); doubleCheck(param); return; } fail(param.getName() + " not in right state" + param.getResult().getServerGroupInfo() + "! Expected '" + param.getExpectedState().getTitle() + "' but is\n" + row); } } } if (param.isSearchTypeMissing()) { log.info("Check non-existence application deployment '" + param.getName() + "' Success"); doubleCheck(param); return; } throw new CommandFormatException("No result for " + param.getName() + " in \n" + param.getResult()); }</code><technical_language>same, debug trace</technical_language>

Target:
private static void check(CheckArguments param) throws CommandFormatException, IOException { if (param.isSearchTypeStatus() && UNKNOWN.equals(param.getExpectedState())) { throw new IllegalStateException("Could not verify deployment state " + UNKNOWN + "!"); } if (!param.isOutputEmpty()) { for (String row : param.getRows()) { if (row.contains(param.getName())) { if (param.isSearchTypeMissing()) { fail("Found non wanted application deployment " + "" + param.getName() + " in \n" + param.getResult()); } else if (param.isSearchTypeExist()) { log.trace("Check existence application deployment '" + param.getName() + "' Success"); doubleCheck(param); return; } else if (param.isSearchTypeStatus()) { assertThat("", row, containsString(param.getExpectedState().getTitle())); log.trace("Check application deployment in right state '" + param.getName() + "'->'" + param.getExpectedState().getTitle() + " by command '" + param.getResult().getCommand() + " Success"); doubleCheck(param); return; } fail(param.getName() + " not in right state" + param.getResult().getServerGroupInfo() + "! Expected '" + param.getExpectedState().getTitle() + "' but is\n" + row); } } } if (param.isSearchTypeMissing()) { log.trace("Check non-existence application deployment '" + param.getName() + "' Success"); doubleCheck(param); return; } throw new CommandFormatException("No result for " + param.getName() + " in \n" + param.getResult()); }
Source:
<code>boolean needsCompaction() { if (!isCompactionPossible()) return false; if (this.unrecoveredRegionCount.get() > 0) return false; if (parent.getCompactionThreshold() == 100) return true; if (parent.getCompactionThreshold() == 0) return false; long rvHWMtmp = this.totalCount.get(); if (rvHWMtmp > 0) { long tlc = this.totalLiveCount.get(); if (tlc < 0) { tlc = 0; } double rv = tlc; if (((rv / (double) rvHWMtmp) * 100) <= parent.getCompactionThreshold()) { return true; } <START> } <END> return false; }</code><technical_language>This fix is incorrect. caused empty oplog (created offline compaction) is deleted recovery's auto compaction. I modified dunit test a bit proved it. Unfortunately, flag status show a compaction is finished. want empty oplog created offline compaction, need careful arrange logic. as: change needsCompaction return int. 1: need compact, -1: need compact, 0: empty file, need delete it. ideas</technical_language>

Target:
boolean needsCompaction() { if (!isCompactionPossible()) return false; if (this.unrecoveredRegionCount.get() > 0) return false; if (parent.getCompactionThreshold() == 100) return true; if (parent.getCompactionThreshold() == 0) return false; long rvHWMtmp = this.totalCount.get(); if (rvHWMtmp > 0) { long tlc = this.totalLiveCount.get(); if (tlc < 0) { tlc = 0; } double rv = tlc; if (((rv / (double) rvHWMtmp) * 100) <= parent.getCompactionThreshold()) { return true; } } else { return true; } return false; }
Source:
<code>private static List<String> getErlangModulePathsDefault(@NotNull ErlangTarget target, boolean isTests) { <START> LOG.warn("Erlang module" + target.getModule().getName() + "will be fully rebuilt."); <END> CommonProcessors.CollectProcessor<File> erlFilesCollector = new CommonProcessors.CollectProcessor<File>() { @Override protected boolean accept(@NotNull File file) { return !file.isDirectory() && FileUtilRt.extensionEquals(file.getName(), "erl"); } }; List<JpsModuleSourceRoot> sourceRoots = ContainerUtil.newArrayList(); JpsModule module = target.getModule(); ContainerUtil.addAll(sourceRoots, module.getSourceRoots(JavaSourceRootType.SOURCE)); if (isTests) { ContainerUtil.addAll(sourceRoots, module.getSourceRoots(JavaSourceRootType.TEST_SOURCE)); } for (JpsModuleSourceRoot root : sourceRoots) { FileUtil.processFilesRecursively(root.getFile(), erlFilesCollector); } return ContainerUtil.map(erlFilesCollector.getResults(), new Function<File, String>() { @NotNull @Override public String fun(@NotNull File file) { return file.getAbsolutePath(); } }); }</code><technical_language>is space module name</technical_language>

Target:
private static List<String> getErlangModulePathsDefault(@NotNull ErlangTarget target, boolean isTests) { CommonProcessors.CollectProcessor<File> erlFilesCollector = new CommonProcessors.CollectProcessor<File>() { @Override protected boolean accept(@NotNull File file) { return !file.isDirectory() && isSource(file.getName()); } }; List<JpsModuleSourceRoot> sourceRoots = ContainerUtil.newArrayList(); JpsModule module = target.getModule(); ContainerUtil.addAll(sourceRoots, module.getSourceRoots(JavaSourceRootType.SOURCE)); if (isTests) { ContainerUtil.addAll(sourceRoots, module.getSourceRoots(JavaSourceRootType.TEST_SOURCE)); } for (JpsModuleSourceRoot root : sourceRoots) { FileUtil.processFilesRecursively(root.getFile(), erlFilesCollector); } return ContainerUtil.map(erlFilesCollector.getResults(), new Function<File, String>() { @NotNull @Override public String fun(@NotNull File file) { return file.getAbsolutePath(); } }); }
Source:
<code>public DataSet<V> windows(WindowContext windowContext, OperationContext context, boolean pushScope, String scopeDetail) { pushScopeIfNeeded(context, pushScope, scopeDetail); try { Dataset<Row> dataset = toSparkRow(this,context); for(WindowAggregator aggregator : windowContext.getWindowFunctions()) { DataType resultDataType = dataset.schema().fields()[aggregator.getResultColumnId()-1].dataType(); Column col = SparkWindow.partitionBy(aggregator.getPartitions()) .function(aggregator.getType()) .inputs(aggregator.getInputColumnIds()) .orderBy(aggregator.getOrderings()) .frameBoundary(aggregator.getFrameDefinition()) .specificArgs(aggregator.getFunctionSpecificArgs()) <START> .specificArgs(aggregator.getFunctionSpecificArgs()) <END> .resultColumn(aggregator.getResultColumnId()) .resultDataType(resultDataType) .toColumn(); dataset = dataset.withColumn(String.valueOf(aggregator.getResultColumnId()-1),col); } return toSpliceLocatedRow(dataset, context); } catch (Exception se){ throw new RuntimeException(se); }finally { if (pushScope) context.popScope(); } }</code><technical_language>redundant invocation of specificArgs</technical_language>

Target:
public DataSet<V> windows(WindowContext windowContext, OperationContext context, boolean pushScope, String scopeDetail) { pushScopeIfNeeded(context, pushScope, scopeDetail); try { Dataset<Row> dataset = toSparkRow(this,context); for(WindowAggregator aggregator : windowContext.getWindowFunctions()) { DataType resultDataType = dataset.schema().fields()[aggregator.getResultColumnId()-1].dataType(); Column col = SparkWindow.partitionBy(aggregator.getPartitions()) .function(aggregator.getType()) .inputs(aggregator.getInputColumnIds()) .orderBy(aggregator.getOrderings()) .frameBoundary(aggregator.getFrameDefinition()) .specificArgs(aggregator.getFunctionSpecificArgs()) .resultColumn(aggregator.getResultColumnId()) .resultDataType(resultDataType) .toColumn(); dataset = dataset.withColumn(String.valueOf(aggregator.getResultColumnId()-1),col); } return toSpliceLocatedRow(dataset, context); } catch (Exception se){ throw new RuntimeException(se); }finally { if (pushScope) context.popScope(); } }
Source:
<code>public int getEnd() { <START> return 0; <END> }</code><technical_language>returning mAlignmentStart / mAlignmentEnd</technical_language>

Target:
public int getEnd() { return getAlignmentEnd(); }
Source:
<code>CryptographyAsyncClient(JsonWebKey jsonWebKey, HttpPipeline pipeline, CryptographyServiceVersion version) { Objects.requireNonNull(jsonWebKey, "The Json web key is required."); if (!jsonWebKey.isValid()) { throw new IllegalArgumentException("Json Web Key is not valid"); } if (jsonWebKey.getId() == null) { <START> throw new IllegalArgumentException("Json Web Key's id property is not configured"); <END> } if (jsonWebKey.getKeyOps() == null) { throw new IllegalArgumentException("Json Web Key's key operations property is not configured"); } if (jsonWebKey.getKeyType() == null) { throw new IllegalArgumentException("Json Web Key's key type property is not configured"); } this.key = jsonWebKey; this.keyId = key.getId(); service = pipeline != null ? RestProxy.create(CryptographyService.class, pipeline) : null; if (!Strings.isNullOrEmpty(key.getId()) && version != null && service != null) { unpackAndValidateId(key.getId()); cryptographyServiceClient = new CryptographyServiceClient(key.getId(), service, version); } else { cryptographyServiceClient = null; } initializeCryptoClients(); }</code><technical_language>Adding check here, means LocalCryptographyClient required provide id too. This a requirement for LocalKeyEncryptionKeyClient / LocalKeyEncryptionKeyAsyncClient</technical_language>

Target:
CryptographyAsyncClient(JsonWebKey jsonWebKey, HttpPipeline pipeline, CryptographyServiceVersion version) { Objects.requireNonNull(jsonWebKey, "The Json web key is required."); if (!jsonWebKey.isValid()) { throw new IllegalArgumentException("Json Web Key is not valid"); } if (jsonWebKey.getKeyOps() == null) { throw new IllegalArgumentException("Json Web Key's key operations property is not configured"); } if (jsonWebKey.getKeyType() == null) { throw new IllegalArgumentException("Json Web Key's key type property is not configured"); } this.key = jsonWebKey; this.keyId = key.getId(); service = pipeline != null ? RestProxy.create(CryptographyService.class, pipeline) : null; if (!Strings.isNullOrEmpty(key.getId()) && version != null && service != null) { unpackAndValidateId(key.getId()); cryptographyServiceClient = new CryptographyServiceClient(key.getId(), service, version); } else { cryptographyServiceClient = null; } initializeCryptoClients(); }
Source:
<code>private void updateSheetTable(CTTable ctTable, String title, int index) { CTTableColumns tableColumnList = ctTable.getTableColumns(); CTTableColumn column = null; int columnCount = tableColumnList.getTableColumnList().size()-1; for( int i = columnCount; columnCount < index; i++) { column = tableColumnList.addNewTableColumn(); column.setId(i); ++columnCount; <START> } <END> column = tableColumnList.getTableColumnArray(index); column.setName(title); }</code><technical_language>this? for (int i = columnCount; i < index; i++) { column = tableColumnList.addNewTableColumn(); column.setId(i); }</technical_language>

Target:
private void updateSheetTable(CTTable ctTable, String title, int index) { CTTableColumns tableColumnList = ctTable.getTableColumns(); CTTableColumn column = null; int columnCount = tableColumnList.getTableColumnList().size()-1; for( int i = columnCount; i < index; i++) { column = tableColumnList.addNewTableColumn(); column.setId(i); } column = tableColumnList.getTableColumnArray(index); column.setName(title); }
Source:
<code>public DefaultKieCompilationResponseOffProcess(KieCompilationResponse res) { this.kieModuleMetaInfo = res.getKieModuleMetaInfo().get(); this.kieModule = res.getKieModule().get(); this.successful = res.isSuccessful(); this.requestUUID = ((DefaultKieCompilationResponse) res).getRequestUUID(); if(res.getProjectClassLoaderStore() != null) { this.projectClassLoaderStore = res.getProjectClassLoaderStore(); }else{ this.projectClassLoaderStore = Collections.emptyMap(); } if(res.getEventTypeClasses() != null) { this.eventsTypeClasses = res.getEventTypeClasses(); }else{ this.eventsTypeClasses = Collections.emptySet(); } if(res.getMavenOutput() != null) { this.mavenOutput = res.getMavenOutput(); }else{ this.mavenOutput = Collections.emptyList(); } <START> if(res.getWorkingDir().isPresent()) { <END> this.workingDir = res.getWorkingDir().get().toString(); }else { this.workingDir = ""; } if(res.getDependencies()!= null) { this.projectDependencies = res.getDependencies(); }else { this.projectDependencies = Collections.emptyList(); } if(res.getTargetContent()!= null) { this.targetContent = res.getTargetContent(); }else{ this.targetContent = Collections.emptyList(); } }</code><technical_language>this.workingDir = res.getWorkingDir().orElse("");</technical_language>

Target:
public DefaultKieCompilationResponseOffProcess(KieCompilationResponse res) { this.kieModuleMetaInfo = res.getKieModuleMetaInfo().orElse(null); this.kieModule = res.getKieModule().orElse(null); this.successful = res.isSuccessful(); this.requestUUID = ((DefaultKieCompilationResponse) res).getRequestUUID(); this.projectClassLoaderStore = Optional.ofNullable(res.getProjectClassLoaderStore()).orElse(Collections.emptyMap()); this.eventsTypeClasses = Optional.ofNullable(res.getEventTypeClasses()).orElse(Collections.emptySet()); this.mavenOutput = Optional.ofNullable(res.getMavenOutput()).orElse(Collections.emptyList()); this.projectDependencies = Optional.ofNullable(res.getDependencies()).orElse(Collections.emptyList()); this.targetContent = Optional.ofNullable(res.getTargetContent()).orElse(Collections.emptyList()); this.workingDir = res.getWorkingDir().map(Object::toString).orElse(""); }
Source:
<code>public Mono<Void> send(Iterable<ServiceBusMessage> messages) { Objects.requireNonNull(messages, "'messages' cannot be null."); return createBatch().flatMap(messageBatch -> { messages.forEach(serviceBusMessage -> messageBatch.tryAdd(serviceBusMessage)); return send(messageBatch); <START> }).then(); <END> }</code><technical_language>chaining.then()? send operation returns a mono void</technical_language>

Target:
public Mono<Void> send(Iterable<ServiceBusMessage> messages) { if (Objects.isNull(messages)) { return monoError(logger, new NullPointerException("'messages' cannot be null.")); } return createBatch().flatMap(messageBatch -> { messages.forEach(message -> messageBatch.tryAdd(message)); return send(messageBatch); }); }
Source:
<code>@Override public Long call() { Channel c = Channel.current(); if (c == null) { <START> return (long) -1; <END> } return resource ? c.resourceLoadingTime.get() : c.classLoadingTime.get(); }</code><technical_language>1L</technical_language>

Target:
@Override public Long call() { Channel c = Channel.current(); if (c == null) { return -1L; } return resource ? c.resourceLoadingTime.get() : c.classLoadingTime.get(); }
Source:
<code>private void createAndTestJob(Connection conn) throws SQLException, IOException, InterruptedException, ClassNotFoundException { String stockTableName = generateUniqueName(); String stockStatsTableName = generateUniqueName(); <START> conn.createStatement().execute(String.format(CREATE_STOCK_TABLE, stockTableName)); <END> conn.createStatement().execute(String.format(CREATE_STOCK_STATS_TABLE, stockStatsTableName)); conn.commit(); final Configuration conf = ((PhoenixConnection) conn).getQueryServices().getConfiguration(); Job job = Job.getInstance(conf); PhoenixMapReduceUtil.setInput(job, MapReduceIT.StockWritable.class, PhoenixTestingInputFormat.class, stockTableName, null, STOCK_NAME, RECORDING_YEAR, "0." + RECORDINGS_QUARTER); testJob(conn, job, stockTableName, stockStatsTableName); }</code><technical_language>ditto try-with-resources</technical_language>

Target:
private Job createAndTestJob(Connection conn) throws SQLException, IOException, InterruptedException, ClassNotFoundException { String stockTableName = generateUniqueName(); String stockStatsTableName = generateUniqueName(); conn.createStatement().execute(String.format(CREATE_STOCK_TABLE, stockTableName)); conn.createStatement().execute(String.format(CREATE_STOCK_STATS_TABLE, stockStatsTableName)); conn.commit(); final Configuration conf = ((PhoenixConnection) conn).getQueryServices().getConfiguration(); Job job = Job.getInstance(conf); PhoenixMapReduceUtil.setInput(job, MapReduceIT.StockWritable.class, PhoenixTestingInputFormat.class, stockTableName, null, STOCK_NAME, RECORDING_YEAR, "0." + RECORDINGS_QUARTER); testJob(conn, job, stockTableName, stockStatsTableName); return job; }
Source:
<code>public HeaderView(ApplicationConstants constants, ApplicationDynamicMessages dynamicMessages) { this.configureLink = new Anchor(constants.configureLinkLabel()); this.logoutLink = new Anchor(constants.logoutLinkLabel()); this.aboutLink = new Anchor(constants.aboutLinkLabel()); this.guideLink = new Anchor(constants.guideLinkLabel()); initWidget(ViewUiBinder.uiBinder.createAndBindUi(this)); ViewIdHandler.idHandler.generateAndSetIds(this); mainTabBarPanel.getElement().getStyle().setZIndex(1); setMainTabBarOffset(mainTabBarInitialOffset); localize(dynamicMessages); feedbackImage.setVisible(false); <START> feedbackImage.addClickHandler(new ClickHandler() { <END> @Override public void onClick(ClickEvent event) { if (feedbackLink != null && feedbackLink.length() > 0) { Window.open(feedbackLink, "_blank", null); } } }); }</code><technical_language>add click handler in view, add in presenter I described. This helps views 'dumb' logic in presenter</technical_language>

Target:
public HeaderView(ApplicationConstants constants, ApplicationDynamicMessages dynamicMessages) { this.configureLink = new Anchor(constants.configureLinkLabel()); this.logoutLink = new Anchor(constants.logoutLinkLabel()); this.aboutLink = new Anchor(constants.aboutLinkLabel()); this.guideLink = new Anchor(constants.guideLinkLabel()); initWidget(ViewUiBinder.uiBinder.createAndBindUi(this)); ViewIdHandler.idHandler.generateAndSetIds(this); mainTabBarPanel.getElement().getStyle().setZIndex(1); setMainTabBarOffset(mainTabBarInitialOffset); localize(dynamicMessages); feedbackImage.setVisible(false); }
Source:
<code>private void setGroovyScriptName(final Expression scriptExpression, final BusinessObjectData data, final ContractInput contractInput, final boolean isOnPool) { if (isOnPool) { <START> scriptExpression.setName("init" + data.getName().substring(0, 1).toUpperCase() + data.getName().substring(1) + "()"); <END> } else { scriptExpression.setName(Joiner.on(".").join(toAncestorNameList().apply(contractInput))); } }</code><technical_language>extract a variable for data.getName</technical_language>

Target:
private void setGroovyScriptName(final Expression scriptExpression, final BusinessObjectData data, final ContractInput contractInput, final boolean isOnPool) { if (isOnPool) { final String dataName = data.getName(); final String nameToUpperCase = dataName.length() > 1 ? dataName.substring(0, 1).toUpperCase() + dataName.substring(1) : dataName.toUpperCase(); scriptExpression.setName("init" + nameToUpperCase + "()"); } else { scriptExpression.setName(Joiner.on(".").join(toAncestorNameList().apply(contractInput))); } }
Source:
<code>public void run() { TmfTraceManager.getInstance().updateTraceContext(fTrace, builder -> builder.setData(CriticalPathModule.PARAM_WORKER, new OsWorker(fHostThread, String.valueOf(fThreadName), 0))); try { <START> PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(CRITICALPATHVIEW_ID); <END> } catch (PartInitException e) { Activator.getDefault().logError("Failed to open Critical Path View", e); } fView.broadcast(new TmfGraphPathSignal(fView, fHostThread.getHost())); super.run(); }</code><technical_language>I some specific of this, hey! feature is there</technical_language>

Target:
public void run() { TmfTraceManager.getInstance().updateTraceContext(fTrace, builder -> builder.setData(CriticalPathModule.PARAM_WORKER, new OsWorker(fHostThread, String.valueOf(fThreadName), 0))); try { PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(CRITICALPATHVIEW_ID); } catch (PartInitException e) { Activator.getDefault().logError("Failed to open Critical Path View", e); } fView.broadcast(new TmfCriticalPathSignal(fView, fHostThread.getHost())); super.run(); }