auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public BWEntity(net.minecraft.entity.Entity entity) { this.entity = entity; components.add(new MCEntityTransform(entity)); components.add(new Damageable() { @Override public void damage(double amount, DamageType type) { if (type == DamageType.generic) { entity.attackEntityFrom(DamageSource.generic, (float) amount); } } }); if (entity instanceof EntityLivingBase) { if (entity instanceof EntityPlayer) { MCPlayer player = components.add(new MCPlayer(this)); player.faceDisplacement = () -> Vector3D.PLUS_J.scalarMultiply(entity.getEyeHeight()); } else { Living living = components.add(new Living()); living.faceDisplacement = () -> Vector3D.PLUS_J.scalarMultiply(entity.getEyeHeight()); } } <START> if (entity != null) { <END> WrapperEvent.BWEntityCreate event = new WrapperEvent.BWEntityCreate(this, entity); Game.events().publish(event); } }</code><technical_language>entity null break rest of code</technical_language>

Target:
public BWEntity(net.minecraft.entity.Entity entity) { this.entity = entity; components.add(new MCEntityTransform(entity)); components.add(new Damageable() { @Override public void damage(double amount, DamageType type) { if (type == DamageType.generic) { entity.attackEntityFrom(DamageSource.generic, (float) amount); } } }); if (entity instanceof EntityLivingBase) { if (entity instanceof EntityPlayer) { MCPlayer player = components.add(new MCPlayer(this)); player.faceDisplacement = () -> Vector3D.PLUS_J.scalarMultiply(entity.getEyeHeight()); } else { Living living = components.add(new Living()); living.faceDisplacement = () -> Vector3D.PLUS_J.scalarMultiply(entity.getEyeHeight()); } } WrapperEvent.BWEntityCreate event = new WrapperEvent.BWEntityCreate(this, entity); Game.events().publish(event); }
Source:
<code>private Subscription enqueue(Action0 action, long execTime) { if (innerSubscription.isUnsubscribed()) { return Subscriptions.unsubscribed(); } final TimedAction timedAction = new TimedAction(action, execTime, COUNTER_UPDATER.incrementAndGet(TrampolineScheduler.this)); synchronized (queue) { queue.add(timedAction); } if (wip.getAndIncrement() == 0) { do { synchronized (queue) { if (!queue.isEmpty()) { TimedAction polled = queue.poll(); <START> polled.action.call(); <END> } } } while (wip.decrementAndGet() > 0); return Subscriptions.unsubscribed(); } else { return Subscriptions.create(new Action0() { @Override public void call() { synchronized (queue) { queue.remove(timedAction); } } }); } }</code><technical_language>call action while holding lock. do a synchronized poll call action if a non-null value. In addition, I COUNTER_UPDATER counter moved worker ensure total order locally avoid a global serialization point</technical_language>

Target:
private Subscription enqueue(Action0 action, long execTime) { if (innerSubscription.isUnsubscribed()) { return Subscriptions.unsubscribed(); } final TimedAction timedAction = new TimedAction(action, execTime, COUNTER_UPDATER.incrementAndGet(this)); queue.add(timedAction); if (wip.getAndIncrement() == 0) { do { final TimedAction polled = queue.poll(); if (polled != null) { polled.action.call(); } } while (wip.decrementAndGet() > 0); return Subscriptions.unsubscribed(); } else { return Subscriptions.create(new Action0() { @Override public void call() { queue.remove(timedAction); } }); } }
Source:
<code>public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Version version = (Version) o; <START> return major == version.major && <END> minor == version.minor && patch == version.patch; }</code><technical_language>This work here, if time types change int Integer this do is supposed to. I favour Object.equals(major, version.major) major == version.major</technical_language>

Target:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Version version = (Version) o; return Objects.equals(major, version.major) && Objects.equals(minor, version.minor) && Objects.equals(patch, version.patch); }
Source:
<code>private static <T> T parseResponse(final Class<T> resultType, final HttpURLConnection connection) throws IOException, JsonParseException, JsonMappingException { final int responseCode = connection.getResponseCode(); if (responseCode < 200 || responseCode > 299) { final InputStream stream = connection.getErrorStream(); final String response = CharStreams.toString(new InputStreamReader(stream, URL_ENCODING)); stream.close(); logger.error("Received unexpected response from Google Cloud Storage. Response status code: {}. Response body: {}", responseCode, response); throw new IOException("Received unexpected response from Google Cloud Storage."); <START> } else { <END> final InputStream stream = connection.getInputStream(); final T response = MAPPER.readValue(stream, resultType); stream.close(); return response; } }</code><technical_language>This error handling is identical googleDelete method above. tempted to: - Extract a common method. - Flip if/else statements: top branch is happy path, error handling in else</technical_language>

Target:
private static <T> T parseResponse(final Class<T> resultType, final HttpURLConnection connection) throws IOException, JsonParseException, JsonMappingException { throwIOExceptionOnErrorResponse(connection); final InputStream stream = connection.getInputStream(); final T response = MAPPER.readValue(stream, resultType); stream.close(); return response; }
Source:
<code>public Value evaluate(DataSourceFactory dsf, Value... args) throws FunctionException { <START> if (crs == null) { <END> String epsgCode = null; if (args[1].getType() == Type.INT) { int code = args[1].getAsInt(); if (code == -1) { throw new FunctionException("-1 is an invalid SRID"); } else { epsgCode = "EPSG:" + code; } } else { epsgCode = args[1].getAsString(); } try { crs = DataSourceFactory.getCRSFactory().getCRS(epsgCode); } catch (CRSException ex) { throw new FunctionException("Cannot find an authority for " + epsgCode, ex); } } return ValueFactory.createValue(args[0].getAsGeometry(), crs); }</code><technical_language>crs is a local variable is null instantiate it. need check if null here</technical_language>

Target:
public Value evaluate(DataSourceFactory dsf, Value... args) throws FunctionException { String epsgCode = null; if (args[1].getType() == Type.INT) { int code = args[1].getAsInt(); if (code == -1) { throw new FunctionException("-1 is an invalid SRID"); } else { epsgCode = "EPSG:" + code; } } else { epsgCode = args[1].getAsString(); } try { CoordinateReferenceSystem crs = DataSourceFactory.getCRSFactory().getCRS(epsgCode); return ValueFactory.createValue(args[0].getAsGeometry(), crs); } catch (CRSException ex) { throw new FunctionException("Cannot find an authority for " + epsgCode, ex); } }
Source:
<code><START> void notifyRead(Command cmd, long blockSize) { <END> for (Listener listener : listeners) { listener.onRead(this, cmd, blockSize); } }</code><technical_language>sense measure performance impact that. <LINK_0> is enough some estimations if run a profiler</technical_language>

Target:
void notifyRead(Command cmd, long blockSize) { for (Listener listener : listeners) { try { listener.onRead(this, cmd, blockSize); } catch (Throwable x) { logger.log(Level.WARNING, null, x); } } }
Source:
<code>private ManagedExecutorServiceResourceDefinition() { super(new SimpleResourceDefinition.Parameters(PathElement.pathElement(EESubsystemModel.MANAGED_EXECUTOR_SERVICE), EeExtension.getResourceDescriptionResolver(EESubsystemModel.MANAGED_EXECUTOR_SERVICE)) .setAddHandler(ManagedExecutorServiceAdd.INSTANCE) <START> .setRemoveHandler(ManagedExecutorServiceRemove.INSTANCE) <END> .addCapabilities(CAPABILITY)); }</code><technical_language>setRemoveHandler(new ServiceRemoveStepHandler(ContextServiceAdd.INSTANCE))</technical_language>

Target:
private ManagedExecutorServiceResourceDefinition() { super(new SimpleResourceDefinition.Parameters(PathElement.pathElement(EESubsystemModel.MANAGED_EXECUTOR_SERVICE), EeExtension.getResourceDescriptionResolver(EESubsystemModel.MANAGED_EXECUTOR_SERVICE)) .setAddHandler(ManagedExecutorServiceAdd.INSTANCE) .setRemoveHandler(new ServiceRemoveStepHandler(ManagedExecutorServiceAdd.INSTANCE)) .addCapabilities(CAPABILITY)); }
Source:
<code>protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { Query post = RemoteAccess.evaluate(request); if (post.isDoS_blackout()) { response.sendError(503, "your request frequency is too high"); return; } String url = post.get("url", ""); URL feedUrl = null; try { feedUrl = new URL(url); } catch (Exception e) { e.printStackTrace(); } SyndFeedInput input = new SyndFeedInput(); SyndFeed feed = null; try { feed = input.build(new XmlReader(feedUrl)); } catch (Exception e) { e.printStackTrace(); } @SuppressWarnings("unused") int totalEntries = 0; int i = 0; JSONArray jsonArray = new JSONArray(); for (SyndEntry entry : (List<SyndEntry>) feed.getEntries()) { JSONObject jsonObject = new JSONObject(); jsonObject.put("RSS Feed", url); jsonObject.put("Title", entry.getTitle().toString()); jsonObject.put("Link", entry.getLink().toString()); jsonObject.put("URI", entry.getUri().toString()); jsonObject.put("Hash-Code", Integer.toString(entry.hashCode())); jsonObject.put("Published-Date", entry.getPublishedDate().toString()); jsonObject.put("Updated-Date", (entry.getUpdatedDate() == null) ? ("null") : (entry.getUpdatedDate().toString())); jsonObject.put("Description", entry.getDescription().toString()); jsonArray.put(i, jsonObject); i++; } totalEntries = i; JSONObject rssFeed = new JSONObject(); rssFeed.put("Hackernews RSS Feed", jsonArray); response.setCharacterEncoding("UTF-8"); PrintWriter sos = response.getWriter(); sos.print(rssFeed.toString(2)); <START> sos.println(); <END> }</code><technical_language>@jig08 form object print, register servlet</technical_language>

Target:
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { Query post = RemoteAccess.evaluate(request); if (post.isDoS_blackout()) { response.sendError(503, "your request frequency is too high"); return; } String url = post.get("url", ""); URL feedUrl = null; try { feedUrl = new URL(url); } catch (Exception e) { e.printStackTrace(); } SyndFeedInput input = new SyndFeedInput(); SyndFeed feed = null; try { feed = input.build(new XmlReader(feedUrl)); } catch (Exception e) { e.printStackTrace(); } @SuppressWarnings("unused") int totalEntries = 0; int i = 0; JSONArray jsonArray = new JSONArray(); for (SyndEntry entry : (List<SyndEntry>) feed.getEntries()) { JSONObject jsonObject = new JSONObject(); jsonObject.put("RSS Feed", url); jsonObject.put("Title", entry.getTitle().toString()); jsonObject.put("Link", entry.getLink().toString()); jsonObject.put("URI", entry.getUri().toString()); jsonObject.put("Hash-Code", Integer.toString(entry.hashCode())); jsonObject.put("Published-Date", entry.getPublishedDate().toString()); jsonObject.put("Updated-Date", (entry.getUpdatedDate() == null) ? ("null") : (entry.getUpdatedDate().toString())); jsonObject.put("Description", entry.getDescription().toString()); jsonArray.put(i, jsonObject); i++; } totalEntries = i; JSONObject rssFeed = new JSONObject(); rssFeed.put("RSS Feed", jsonArray); response.setCharacterEncoding("UTF-8"); PrintWriter sos = response.getWriter(); sos.print(rssFeed.toString(2)); sos.println(); }
Source:
<code>public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.pref_general); <START> bindPreferenceSummaryToValue(findPreference("competition_season")); <END> bindPreferenceSummaryToValue(findPreference("data_source")); bindPreferenceSummaryToValue(findPreference("show_field_monitor")); }</code><technical_language>This code familiar (but I in wrong app). fragment based preference layout is updated want, (this is shown large screen devices)</technical_language>

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.pref_general); }
Source:
<code>public void consumeLine( String line ) { if ( line.startsWith( START_PARSING_INDICATOR ) ) { this.startParsing = true; return; } if ( this.startParsing ) { String[] tokens = StringUtils.split( line, "=", 2 ); if ( tokens.length == 2 ) { envs.put( tokens[0], tokens[1] ); } else { if ( line.trim().endsWith("=") ) { <START> String trimmed = line.trim(); <END> envs.put( trimmed.substring( 0, ( trimmed.length() - 1 ) ), null ); } else { unparsed.add( line ); } } } else { System.out.println( line ); } }</code><technical_language>move this condition trim applied once</technical_language>

Target:
public void consumeLine( String line ) { if ( line.startsWith( START_PARSING_INDICATOR ) ) { this.startParsing = true; return; } if ( this.startParsing ) { String[] tokens = StringUtils.split( line, "=", 2 ); if ( tokens.length == 2 ) { envs.put( tokens[0], tokens[1] ); } else { String trimmedLine = line.trim(); if ( trimmedLine.endsWith("=") ) { envs.put( trimmedLine.substring( 0, ( trimmedLine.length() - 1 ) ), null ); } else { unparsed.add( line ); } } } else { System.out.println( line ); } }
Source:
<code>private static InetSocketAddress tryLocalHostOrLoopback(int port) { try { <START> logger.log(Level.FINE, "Could not find an appropriate address by searching falling back to local host"); <END> return new InetSocketAddress(InetAddress.getLocalHost(), port); } catch (UnknownHostException ex) { logger.log(Level.FINE, "Could not find local host, falling back to loop back address"); return new InetSocketAddress(InetAddress.getLoopbackAddress(), port); } }</code><technical_language>Slight wording change - "by searching" bit is unnecessary irks searching suggestion logger.log(Level.FINE, "Could find address, falling local host");</technical_language>

Target:
private static InetSocketAddress tryLocalHostOrLoopback(int port) { try { logger.log(Level.FINE, "Could not find an appropriate address, falling back to local host"); return new InetSocketAddress(InetAddress.getLocalHost(), port); } catch (UnknownHostException ex) { logger.log(Level.FINE, "Could not find local host, falling back to loop back address"); return new InetSocketAddress(InetAddress.getLoopbackAddress(), port); } }
Source:
<code>protected final void startZoomThread(long startTime, long endTime) { long clampedStartTime = Math.max(startTime, fStartTime); <START> long clampedEndTime = Math.min(endTime, fEndTime); <END> fDirty.incrementAndGet(); boolean restart = false; if (fZoomThread != null) { fZoomThread.cancel(); if (fZoomThread.fZoomStartTime == clampedStartTime && fZoomThread.fZoomEndTime == clampedEndTime) { restart = true; } } long resolution = Math.max(1, (clampedEndTime - clampedStartTime) / fDisplayWidth); fZoomThread = createZoomThread(clampedStartTime, clampedEndTime, resolution, restart); if (fZoomThread != null) { fZoomThread.start(); } else { fDirty.decrementAndGet(); } }</code><technical_language>I worry case fStartTime/fEndTime SWT.DEFAULT, startTime/endTime aren't. line 1436 send unclamped range, changed viewer's time0 time1 calling setStartFinishTime() (they clamped). account for a subclass calling this method wrong values. in end, safer clamp time limits min(max(start, t), end))</technical_language>

Target:
protected final void startZoomThread(long startTime, long endTime) { long clampedStartTime = Math.min(Math.max(startTime, fStartTime), fEndTime); long clampedEndTime = Math.max(Math.min(endTime, fEndTime), fStartTime); fDirty.incrementAndGet(); boolean restart = false; if (fZoomThread != null) { fZoomThread.cancel(); if (fZoomThread.fZoomStartTime == clampedStartTime && fZoomThread.fZoomEndTime == clampedEndTime) { restart = true; } } long resolution = Math.max(1, (clampedEndTime - clampedStartTime) / fDisplayWidth); fZoomThread = createZoomThread(clampedStartTime, clampedEndTime, resolution, restart); if (fZoomThread != null) { fZoomThread.start(); } else { fDirty.decrementAndGet(); } }
Source:
<code>public void removeInstancesFromTargetPool(List<String> instancesIdsList, String targetPoolName) { log.info("Removing instances from target pool: " + targetPoolName); if (instancesIdsList.isEmpty()) { log.warn("Cannot remove instances to target pool. Because instancesNamesList is empty."); return; } List<InstanceReference> instanceReferenceList = new ArrayList<InstanceReference>(); for (String instanceId : instancesIdsList) { String instanceUrl = createInstanceSelfLink(instanceId); instanceReferenceList.add(new InstanceReference(). setInstance(instanceUrl)); } TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequest = new TargetPoolsRemoveInstanceRequest(); if (instanceReferenceList.isEmpty()) { log.warn("Could not remove instances from target pool " + targetPoolName + " because instance reference list is null"); return; } targetPoolsRemoveInstanceRequest.setInstances(instanceReferenceList); try { Operation operation = compute.targetPools().removeInstance(PROJECT_ID, REGION_NAME, targetPoolName, targetPoolsRemoveInstanceRequest).execute(); waitForRegionOperationCompletion(operation.getName()); <START> log.info("Instances are removed from target pool: " + targetPoolName); <END> } catch (Exception e) { log.error("Could not remove instances from target pool " + targetPoolName, e); } }</code><technical_language>Modify log show instances removed target pool</technical_language>

Target:
public void removeInstancesFromTargetPool(List<String> instancesIdsList, String targetPoolName) { log.info("Removing instances from target pool: " + targetPoolName); if (instancesIdsList.isEmpty()) { log.warn("Cannot remove instances to target pool. Because instancesNamesList is empty."); return; } List<InstanceReference> instanceReferenceList = new ArrayList<InstanceReference>(); for (String instanceId : instancesIdsList) { String instanceUrl = createInstanceSelfLink(instanceId); instanceReferenceList.add(new InstanceReference(). setInstance(instanceUrl)); if (log.isDebugEnabled()) { log.debug("Instance " + instanceId + " was added to instance reference list"); } } TargetPoolsRemoveInstanceRequest targetPoolsRemoveInstanceRequest = new TargetPoolsRemoveInstanceRequest(); if (instanceReferenceList.isEmpty()) { log.warn("Could not remove instances from target pool " + targetPoolName + " because instance reference " + "list is null"); return; } targetPoolsRemoveInstanceRequest.setInstances(instanceReferenceList); try { Operation operation = compute.targetPools().removeInstance(PROJECT_ID, REGION_NAME, targetPoolName, targetPoolsRemoveInstanceRequest).execute(); waitForRegionOperationCompletion(operation.getName()); log.info("Instances are removed from target pool: " + targetPoolName); } catch (Exception e) { log.error("Could not remove instances from target pool " + targetPoolName, e); } }
Source:
<code>public Response deactivate(Action action) { <START> HotPlugUnplugVmNicParameters params = new HotPlugUnplugVmNicParameters(Guid.createGuidFromString(id), <END> PlugAction.UNPLUG); params.setVmId(((BackendNicsResource) collection).parentId); return performAction(VdcActionType.HotPlugUnplugVmNic, params); }</code><technical_language>again, 'guid'</technical_language>

Target:
public Response deactivate(Action action) { HotPlugUnplugVmNicParameters params = new HotPlugUnplugVmNicParameters(guid, PlugAction.UNPLUG); params.setVmId(((BackendNicsResource) collection).parentId); return performAction(VdcActionType.HotPlugUnplugVmNic, params); }
Source:
<code>public void apply(OnlineCommandContext ctx) throws Exception { Operations ops = new Operations(ctx.client); Address loggerAddress = Address.subsystem("logging").and("logger", category); if (replaceExisting) { try { ops.removeIfExists(loggerAddress); } catch (OperationException e) { throw new CommandFailedException("Failed to remove existing logger " + category, e); } } if (handlers != null && handlers.size() > 0) { Values handlersValues = Values.empty(); for (String handler : handlers) { handlersValues.andOptional("handler", handler); } } Values values = Values.empty() .and("category", category) .andOptional("level", level == null ? null : level.value()) .andOptional("filter-spec", filter) .andOptional("use-parent-handlers", useParentHandler) .andListOptional(String.class, "handlers", handlers); Batch batch = new Batch(); batch.add(loggerAddress, values); <START> ops.batch(batch); <END> }</code><technical_language>Again, a batch a single operation? If want, batch do replaceExisting in a transactional fashion, right now, batch is useless</technical_language>

Target:
public void apply(OnlineCommandContext ctx) throws Exception { Operations ops = new Operations(ctx.client); Address loggerAddress = Address.subsystem("logging").and("logger", category); if (replaceExisting) { try { ops.removeIfExists(loggerAddress); } catch (OperationException e) { throw new CommandFailedException("Failed to remove existing logger " + category, e); } } Values values = Values.empty() .and("category", category) .andOptional("level", level == null ? null : level.value()) .andOptional("filter-spec", filter) .andOptional("use-parent-handlers", useParentHandler) .andListOptional(String.class, "handlers", handlers); ops.add(loggerAddress, values); }
Source:
<code><START> protected void removeVmRelatedEntitiesFromDb() { <END> RemoveVmUsers(); RemoveVmNetwork(); new SnapshotsManager().removeSnapshots(getVmId()); removeVmImages(); RemoveVmStatic(); }</code><technical_language>copy & paste instead of calling super.remove in end (after images remove)</technical_language>

Target:
protected void removeVmRelatedEntitiesFromDb() { removeVmImages(); super.removeVmRelatedEntitiesFromDb(); }
Source:
<code>public void testExpiryTime() { Session sessionCookie1 = getNewSession(); sessionCookie1.init(context); sessionCookie1.put("a", "2"); <START> <END> sessionCookie1.setExpiryTime(10 * 1000L); assertThat(sessionCookie1.get("a"), CoreMatchers.equalTo("2")); sessionCookie1.save(context, result); Session sessionCookie2 = roundTrip(sessionCookie1); assertThat(sessionCookie2.get("a"), CoreMatchers.equalTo("2")); when(clock.currentTimeMillis()).thenReturn(System.currentTimeMillis() + 11 * 1000L); Session sessionCookie3 = roundTrip(sessionCookie2); assertNull(sessionCookie3.get("a")); }</code><technical_language>empty lines... Please compact code a bit.. Thanks</technical_language>

Target:
public void testExpiryTime() { Session sessionCookie1 = createNewSession(); sessionCookie1.init(context); sessionCookie1.put("a", "2"); sessionCookie1.setExpiryTime(10 * 1000L); assertThat(sessionCookie1.get("a"), CoreMatchers.equalTo("2")); sessionCookie1.save(context, result); Session sessionCookie2 = roundTrip(sessionCookie1); assertThat(sessionCookie2.get("a"), CoreMatchers.equalTo("2")); when(clock.currentTimeMillis()).thenReturn(System.currentTimeMillis() + 11 * 1000L); Session sessionCookie3 = roundTrip(sessionCookie2); assertNull(sessionCookie3.get("a")); }
Source:
<code>public static void unescapePartitionSpec(SqlNodeList partSpec) { if (partSpec != null) { <START> for (int i = 0; i < partSpec.size(); i++) { <END> SqlNode node = partSpec.get(i); if (node instanceof SqlProperty) { SqlProperty property = (SqlProperty) node; Comparable comparable = SqlLiteral.value(property.getValue()); if (comparable instanceof NlsString) { String val = StringEscapeUtils.unescapeJava(((NlsString) comparable).getValue()); property = new SqlProperty( property.getKey(), SqlLiteral.createCharString(val, property.getValue().getParserPosition()), property.getParserPosition()); partSpec.set(i, property); } } } } }</code><technical_language>try SqlShuttle</technical_language>

Target:
public static void unescapePartitionSpec(SqlNodeList partSpec) { if (partSpec != null) { partSpec.accept(UNESCAPE_SHUTTLE); } }
Source:
<code>public String getExpressionWithAbsoluteStartAndEndTimeStamps(NotificationContext context) { String expression = context.getAlert().getExpression().replaceAll("[\\s\\t\\r\\n\\f]*",""); String regexMatcher = "(?i)(\\(\\-[0-9]+(d|m|h|s)|:\\-[0-9]+(d|m|h|s)|,\\-[0-9]+(d|m|h|s)|#\\-[0-9]+(d|h|m|s))"; Matcher m = Pattern.compile(regexMatcher).matcher(expression); <START> Long relativeTo = context.getTriggerFiredTime(); <END> while (m.find()) { String timeStr = m.group(); Long absoluteTime = MetricReader.getTime(context.getTriggerFiredTime(), timeStr.substring(1)); expression = expression.replace(timeStr, (""+timeStr.charAt(0)) + absoluteTime); } return expression; }</code><technical_language>this is trigger fired time, alert enqueue time. Check AlertWithTimestamp object in DefaultAlertService for this param</technical_language>

Target:
public String getExpressionWithAbsoluteStartAndEndTimeStamps(NotificationContext context) { String expression = context.getAlert().getExpression().replaceAll("[\\s\\t\\r\\n\\f]*",""); String regexMatcher = "(?i)(\\(\\-[0-9]+(d|m|h|s)|:\\-[0-9]+(d|m|h|s)|,\\-[0-9]+(d|m|h|s)|#\\-[0-9]+(d|h|m|s))"; Matcher m = Pattern.compile(regexMatcher).matcher(expression); Long relativeTo = context.getAlertEnqueueTimestamp(); while (m.find()) { String timeStr = m.group(); Long absoluteTime = MetricReader.getTime(relativeTo, timeStr.substring(1)); expression = expression.replace(timeStr, (""+timeStr.charAt(0)) + absoluteTime); } return expression; }
Source:
<code>public Map<String, Map<String, String>> getSystemProperties() { <START> return Collections.EMPTY_MAP; <END> }</code><technical_language>log warning option is supported SNMP</technical_language>

Target:
public Map<String, Map<String, String>> getSystemProperties() { log.warn("System properties a not available for SNMP"); return Collections.EMPTY_MAP; }
Source:
<code>public void copyTo(TemplateOptions to) { super.copyTo(to); if (to instanceof AzureTemplateOptions) { AzureTemplateOptions eTo = AzureTemplateOptions.class.cast(to); eTo.virtualNetworkName(virtualNetworkName); eTo.subnetId(subnetId); eTo.blob(blob); eTo.availabilitySet(availabilitySet); eTo.availabilitySet(availabilitySetName); <START> if (!dataDisks.isEmpty()) { <END> eTo.dataDisks(dataDisks); } } }</code><technical_language>Redundant check. allow passing empty list</technical_language>

Target:
public void copyTo(TemplateOptions to) { super.copyTo(to); if (to instanceof AzureTemplateOptions) { AzureTemplateOptions eTo = AzureTemplateOptions.class.cast(to); eTo.virtualNetworkName(virtualNetworkName); eTo.subnetId(subnetId); eTo.blob(blob); eTo.availabilitySet(availabilitySet); eTo.availabilitySet(availabilitySetName); eTo.dataDisks(dataDisks); } }
Source:
<code>protected void executeCommand() { ((EventQueue) EjbUtils.findBean(BeanType.EVENTQUEUE_MANAGER, BeanProxyType.LOCAL)).submitEventSync(new Event(getParameters().getStoragePoolId(), _newMasterStorageDomainId, getVds().getId(), EventType.RECOVERY), new Callable<EventResult>() { @Override public EventResult call() { try { if (StorageHelperDirector.getInstance().getItem(getStorageDomain().getstorage_type()) .connectStorageToDomainByVdsId(getNewMaster(false), getVds().getId())) { StoragePoolIsoMap domainPoolMap = new StoragePoolIsoMap(getParameters() .getNewMasterDomainId(), getParameters().getStoragePoolId(), StorageDomainStatus.Active); DbFacade.getInstance() .getStoragePoolIsoMapDao() .save(domainPoolMap); getParameters().setVdsId(getVds().getId()); getParameters().setStorageDomainId(getStorageDomainId().getValue()); try { executeReconstruct(); } finally { <START> if (!reconstructOpSucceeded) { <END> getStoragePoolIsoMapDAO().remove(domainPoolMap.getId()); } } } else { getReturnValue().setFault(new VdcFault(new VdcBLLException(VdcBllErrors.StorageServerConnectionError, "Failed to connect storage"), VdcBllErrors.StorageServerConnectionError)); } } catch (VdcBLLException e) { getReturnValue().setFault(new VdcFault(e)); } return new EventResult(getSucceeded(), EventType.RECONSTRUCT); } }); }</code><technical_language>removed explicit set of StoragePoolStatus in case reconstruct succeed. necessarily this is wrong, in this case, sets it? in status left</technical_language>

Target:
protected void executeCommand() { ((EventQueue) EjbUtils.findBean(BeanType.EVENTQUEUE_MANAGER, BeanProxyType.LOCAL)).submitEventSync(new Event(getParameters().getStoragePoolId(), _newMasterStorageDomainId, getVds().getId(), EventType.RECOVERY), new Callable<EventResult>() { @Override public EventResult call() { try { if (StorageHelperDirector.getInstance().getItem(getStorageDomain().getstorage_type()) .connectStorageToDomainByVdsId(getNewMaster(false), getVds().getId())) { StoragePoolIsoMap domainPoolMap = new StoragePoolIsoMap(getParameters() .getNewMasterDomainId(), getParameters().getStoragePoolId(), StorageDomainStatus.Active); DbFacade.getInstance() .getStoragePoolIsoMapDao() .save(domainPoolMap); getParameters().setVdsId(getVds().getId()); getParameters().setStorageDomainId(getStorageDomainId().getValue()); getStoragePoolDAO().updateStatus(getStoragePool().getId(), StoragePoolStatus.Problematic); try { executeReconstruct(); } finally { if (!reconstructOpSucceeded) { getStoragePoolIsoMapDAO().remove(domainPoolMap.getId()); } } } else { getReturnValue().setFault(new VdcFault(new VdcBLLException(VdcBllErrors.StorageServerConnectionError, "Failed to connect storage"), VdcBllErrors.StorageServerConnectionError)); } } catch (VdcBLLException e) { getReturnValue().setFault(new VdcFault(e)); } return new EventResult(getSucceeded(), EventType.RECONSTRUCT); } }); }
Source:
<code>protected void createToolItems(ToolBarManager toolBarManager) { <START> IContributionItem[] items = toolBarManager.getItems(); <END> for (IContributionItem iContributionItem : items) { if (iContributionItem instanceof ActionContributionItem) { IAction action = ((ActionContributionItem)iContributionItem).getAction(); String id = action.getActionDefinitionId(); if ("org.eclipse.compare.copyAllLeftToRight".equals(id)) { toolBarManager.remove(iContributionItem); } else if ("org.eclipse.compare.copyAllRightToLeft".equals(id)) { toolBarManager.remove(iContributionItem); } } } }</code><technical_language>need call super</technical_language>

Target:
protected void createToolItems(ToolBarManager toolBarManager) { super.createToolItems(toolBarManager); IContributionItem[] items = toolBarManager.getItems(); for (IContributionItem iContributionItem : items) { if (iContributionItem instanceof ActionContributionItem) { IAction action = ((ActionContributionItem)iContributionItem).getAction(); String id = action.getActionDefinitionId(); if ("org.eclipse.compare.copyAllLeftToRight".equals(id)) { toolBarManager.remove(iContributionItem); } else if ("org.eclipse.compare.copyAllRightToLeft".equals(id)) { toolBarManager.remove(iContributionItem); } } } }
Source:
<code>private void setupMultiExecutorMode() { String filters = azkProps.getString(AZKABAN_EXECUTOR_SELECTOR_FILTERS, ""); if (filters != null) { filterList = Arrays.asList(StringUtils.split(filters, ",")); } Map<String, String> compListStrings = azkProps.getMapByPrefix(AZKABAN_EXECUTOR_SELECTOR_COMPARATOR_PREFIX); <START> if (compListStrings != null) { <END> comparatorWeightsMap = new TreeMap<String, Integer>(); for (Map.Entry<String, String> entry : compListStrings.entrySet()) { comparatorWeightsMap.put(entry.getKey(), Integer.valueOf(entry.getValue())); } } queueProcessor = new QueueProcessorThread(azkProps.getBoolean( AZKABAN_QUEUEPROCESSING_ENABLED, true), azkProps.getLong( AZKABAN_ACTIVE_EXECUTOR_REFRESHINTERVAL_IN_MS, 1000), azkProps.getInt( AZKABAN_ACTIVE_EXECUTOR_REFRESHINTERVAL_IN_FLOW, 1000)); queueProcessor.start(); }</code><technical_language>If selector comparator prefixes else works</technical_language>

Target:
private void setupMultiExecutorMode() { String filters = azkProps.getString(AZKABAN_EXECUTOR_SELECTOR_FILTERS, ""); if (filters != null) { filterList = Arrays.asList(StringUtils.split(filters, ",")); } Map<String, String> compListStrings = azkProps.getMapByPrefix(AZKABAN_EXECUTOR_SELECTOR_COMPARATOR_PREFIX); if (compListStrings != null) { comparatorWeightsMap = new TreeMap<String, Integer>(); for (Map.Entry<String, String> entry : compListStrings.entrySet()) { comparatorWeightsMap.put(entry.getKey(), Integer.valueOf(entry.getValue())); } } executorInforRefresherService = Executors.newFixedThreadPool(azkProps.getInt( AZKABAN_EXECUTORINFO_REFRESH_MAX_THREADS, 5)); queueProcessor = new QueueProcessorThread(azkProps.getBoolean( AZKABAN_QUEUEPROCESSING_ENABLED, true), azkProps.getLong( AZKABAN_ACTIVE_EXECUTOR_REFRESHINTERVAL_IN_MS, 1000), azkProps.getInt( AZKABAN_ACTIVE_EXECUTOR_REFRESHINTERVAL_IN_NUM_FLOW, 1000)); queueProcessor.start(); }
Source:
<code>private void printBundleDiags(Collection<Bundle> toPrint) { StringBuilder sb = new StringBuilder(); toPrint.forEach(bundle -> appendBundleDiag(bundle, sb)); <START> LOGGER.info("Printing unsatisfied bundle requirements: {}", sb); <END> }</code><technical_language>this WARN ERROR more visible administrator wrong</technical_language>

Target:
private void printBundleDiags(Collection<Bundle> toPrint) { StringBuilder sb = new StringBuilder(); toPrint.forEach(bundle -> appendBundleDiag(bundle, sb)); LOGGER.error("Printing unsatisfied bundle requirements: {}", sb); }
Source:
<code>public static JoinDistributionType getJoinDistributionType(Session session) { <START> if (!session.getSystemProperty(DISTRIBUTED_JOIN, Boolean.class)) { <END> return JoinDistributionType.BROADCAST; } return session.getSystemProperty(JOIN_DISTRIBUTION_TYPE, JoinDistributionType.class); }</code><technical_language>I follow. if set distributed_Join=false broadcast. this code is saying</technical_language>

Target:
public static JoinDistributionType getJoinDistributionType(Session session) { Boolean distributedJoin = session.getSystemProperty(DISTRIBUTED_JOIN, Boolean.class); if (distributedJoin != null) { if (!distributedJoin) { return BROADCAST; } return REPARTITIONED; } return session.getSystemProperty(JOIN_DISTRIBUTION_TYPE, JoinDistributionType.class); }
Source:
<code>public void testQueuedJobRunsAfterShutdown() throws InterruptedException { BlockingQueue<Runnable> queue = new LinkedBlockingQueue<Runnable>(); ExecutorService service = Executors.newSingleThreadExecutor(); try { PartitionedUnorderedExecutor executor = new PartitionedUnorderedExecutor(queue, service, 1); final Semaphore jobSemaphore = new Semaphore(0); final Semaphore testSemaphore = new Semaphore(0); <START> executor.submit((Callable<Void>) () -> { <END> testSemaphore.release(); jobSemaphore.acquireUninterruptibly(); return null; }); executor.submit((Callable<Void>) () -> { jobSemaphore.acquireUninterruptibly(); return null; }); testSemaphore.acquireUninterruptibly(); executor.shutdown(); assertThat(executor.awaitTermination(100, MILLISECONDS), is(false)); assertThat(executor.isShutdown(), is(true)); assertThat(executor.isTerminated(), is(false)); jobSemaphore.release(); assertThat(executor.awaitTermination(100, MILLISECONDS), is(false)); assertThat(executor.isShutdown(), is(true)); assertThat(executor.isTerminated(), is(false)); jobSemaphore.release(); assertThat(executor.awaitTermination(2, MINUTES), is(true)); assertThat(executor.isShutdown(), is(true)); assertThat(executor.isTerminated(), is(true)); assertThat(jobSemaphore.availablePermits(), is(0)); } finally { service.shutdown(); } }</code><technical_language>Runnable</technical_language>

Target:
public void testQueuedJobRunsAfterShutdown() throws InterruptedException { BlockingQueue<Runnable> queue = new LinkedBlockingQueue<Runnable>(); ExecutorService service = Executors.newSingleThreadExecutor(); try { PartitionedUnorderedExecutor executor = new PartitionedUnorderedExecutor(queue, service, 1); final Semaphore jobSemaphore = new Semaphore(0); final Semaphore testSemaphore = new Semaphore(0); executor.submit(() -> { testSemaphore.release(); jobSemaphore.acquireUninterruptibly(); }); executor.submit(() -> jobSemaphore.acquireUninterruptibly()); testSemaphore.acquireUninterruptibly(); executor.shutdown(); assertThat(executor.awaitTermination(100, MILLISECONDS), is(false)); assertThat(executor.isShutdown(), is(true)); assertThat(executor.isTerminated(), is(false)); jobSemaphore.release(); assertThat(executor.awaitTermination(100, MILLISECONDS), is(false)); assertThat(executor.isShutdown(), is(true)); assertThat(executor.isTerminated(), is(false)); jobSemaphore.release(); assertThat(executor.awaitTermination(2, MINUTES), is(true)); assertThat(executor.isShutdown(), is(true)); assertThat(executor.isTerminated(), is(true)); assertThat(jobSemaphore.availablePermits(), is(0)); } finally { service.shutdown(); } }
Source:
<code>static protected Integer getOffset(final long time, final TreeMap<Long,Integer> offsetMap) { final Long higher = offsetMap.higherKey(time); final Long lower = offsetMap.lowerKey(time); if (lower == null && higher == null) { <START> throw new AlgorithmException(String.format("unable to map offset from t=%s in map of size %d",new DateTime(time).toString(),offsetMap.size())); <END> } if (lower == null) { return offsetMap.get(higher); } else { return offsetMap.get(lower); } }</code><technical_language>log here? if key=value please adding info helps troubleshooting nice</technical_language>

Target:
static protected Integer getOffset(final long time, final TreeMap<Long,Integer> offsetMap) { final Long higher = offsetMap.higherKey(time); final Long lower = offsetMap.lowerKey(time); if (lower == null && higher == null) { LOGGER.error("action=exception_due_to_empty_offset_map map_size={} t={}",offsetMap.size(),time); throw new AlgorithmException(String.format("unable to map offset from t=%s in map of size %d",new DateTime(time).toString(),offsetMap.size())); } if (lower == null) { return offsetMap.get(higher); } return offsetMap.get(lower); }
Source:
<code>private String getFilterByDataSourceClause() { <START> if (datasourceObjId > 0) { <END> return " AND blackboard_artifacts.data_source_obj_id = " + datasourceObjId + " "; } return " "; }</code><technical_language>change CasePreferences unused imports (Objects is import in this class)</technical_language>

Target:
private String getFilterByDataSourceClause() { if (filteringDSObjId > 0) { return " AND blackboard_artifacts.data_source_obj_id = " + filteringDSObjId + " "; } return " "; }
Source:
<code>public int run() throws IOException { Preconditions.checkArgument(files != null && files.size() >= 1, "A Parquet file is required."); Preconditions.checkArgument(files.size() == 1, "Cannot process multiple Parquet files."); InputFile in = HadoopInputFile.fromPath(new Path(files.get(0)), new Configuration()); if (!showColumnIndex && !showOffsetIndex) { <START> showColumnIndex = showOffsetIndex = true; <END> } try (ParquetFileReader reader = ParquetFileReader.open(in)) { boolean firstBlock = true; for (Entry<Integer, BlockMetaData> entry : getBlocks(reader.getFooter())) { if (!firstBlock) { console.info(""); } firstBlock = false; console.info("row group {}:", entry.getKey()); for (ColumnChunkMetaData column : getColumns(entry.getValue())) { String path = column.getPath().toDotString(); if (showColumnIndex) { console.info("column index for column {}:", path); ColumnIndex columnIndex = reader.readColumnIndex(column); if (columnIndex == null) { console.info("NONE"); } else { console.info(columnIndex.toString()); } } if (showOffsetIndex) { console.info("offset index for column {}:", path); OffsetIndex offsetIndex = reader.readOffsetIndex(column); if (offsetIndex == null) { console.info("NONE"); } else { console.info(offsetIndex.toString()); } } } } } return 0; }</code><technical_language>Nit: is more clear separate assignment this is character assigning of a boolean test</technical_language>

Target:
public int run() throws IOException { Preconditions.checkArgument(files != null && files.size() >= 1, "A Parquet file is required."); Preconditions.checkArgument(files.size() == 1, "Cannot process multiple Parquet files."); InputFile in = HadoopInputFile.fromPath(qualifiedPath(files.get(0)), getConf()); if (!showColumnIndex && !showOffsetIndex) { showColumnIndex = true; showOffsetIndex = true; } Set<String> rowGroupIndexSet = new HashSet<>(); if (rowGroupIndexes != null) { rowGroupIndexSet.addAll(rowGroupIndexes); } try (ParquetFileReader reader = ParquetFileReader.open(in)) { boolean firstBlock = true; int rowGroupIndex = 0; for (BlockMetaData block : reader.getFooter().getBlocks()) { if (!rowGroupIndexSet.isEmpty() && !rowGroupIndexSet.contains(Integer.toString(rowGroupIndex))) { ++rowGroupIndex; continue; } if (!firstBlock) { console.info(""); } firstBlock = false; console.info("row-group {}:", rowGroupIndex); for (ColumnChunkMetaData column : getColumns(block)) { String path = column.getPath().toDotString(); if (showColumnIndex) { console.info("column index for column {}:", path); ColumnIndex columnIndex = reader.readColumnIndex(column); if (columnIndex == null) { console.info("NONE"); } else { console.info(columnIndex.toString()); } } if (showOffsetIndex) { console.info("offset index for column {}:", path); OffsetIndex offsetIndex = reader.readOffsetIndex(column); if (offsetIndex == null) { console.info("NONE"); } else { console.info(offsetIndex.toString()); } } } ++rowGroupIndex; } } return 0; }
Source:
<code>boolean containsValue(Object value) { for <START> (Iterator<DelegateCache> <END> it = delegateCaches.values().iterator(); it .hasNext();) { DelegateCache cache = it.next(); if (cache.containsValue(value)) return true; } return false; }</code><technical_language>Better: DelegateCache cache : delegateCache.values()</technical_language>

Target:
boolean containsValue(Object value) { for (DelegateCache cache : delegateCaches.values()) { if (cache.containsValue(value)) return true; } return false; }
Source:
<code>public void saveRevisionData(Session session, Object revisionData) { session.save( revisionInfoEntityName, revisionData ); if ( revisionInfoNumberReader != null ) { <START> if ( revisionInfoNumberReader.getRevisionNumber( revisionData ).longValue() < 0 ) { <END> throw new AuditException( "Negative revision numbers are not allowed" ); } } sessionCacheCleaner.scheduleAuditDataRemoval( session, revisionData ); }</code><technical_language>&& is more in line existing coding pattern, minor</technical_language>

Target:
public void saveRevisionData(Session session, Object revisionData) { session.save( revisionInfoEntityName, revisionData ); if ( revisionInfoNumberReader != null && revisionInfoNumberReader.getRevisionNumber( revisionData ).longValue() < 0 ) { throw new AuditException( "Negative revision numbers are not allowed" ); } sessionCacheCleaner.scheduleAuditDataRemoval( session, revisionData ); }
Source:
<code>public ForgeDirection getOpenOrientation() { int connectionsNum = 0; ForgeDirection targetOrientation = ForgeDirection.UNKNOWN; for (ForgeDirection o : ForgeDirection.VALID_DIRECTIONS) { <START> if (container.pipeConnectionsBuffer[o.ordinal()]) { <END> connectionsNum++; if (connectionsNum == 1) { targetOrientation = o; } } } if (connectionsNum > 1 || connectionsNum == 0) { return ForgeDirection.UNKNOWN; } return targetOrientation.getOpposite(); }</code><technical_language>is this change needed? related goal of this modification</technical_language>

Target:
public ForgeDirection getOpenOrientation() { int connectionsNum = 0; ForgeDirection targetOrientation = ForgeDirection.UNKNOWN; for (ForgeDirection o : ForgeDirection.VALID_DIRECTIONS) { if (container.isPipeConnected(o)) { connectionsNum++; if (connectionsNum == 1) { targetOrientation = o; } } } if (connectionsNum > 1 || connectionsNum == 0) { return ForgeDirection.UNKNOWN; } return targetOrientation.getOpposite(); }
Source:
<code>public void writeTo(final OutputStream outStream) throws IOException { final long startTime = PerformanceUtils.getCurrentTime(); final long totalBytes = IOUtils.copy(this.getContent(), outStream, bufferSize); final long endTime = PerformanceUtils.getCurrentTime(); <START> if (this.getContentLength() != -1 && totalBytes != this.getContentLength()) { <END> throw new ContentLengthNotMatchException(String.format("The Content length (%d) not match the number of byte read (%d)", this.getContentLength(), totalBytes)); } PerformanceUtils.logMbps(startTime, endTime, totalBytes, path, true); }</code><technical_language>confirmed Apache HTTP client return -1 content length is set</technical_language>

Target:
public void writeTo(final OutputStream outStream) throws IOException { final long startTime = PerformanceUtils.getCurrentTime(); final long totalBytes = IOUtils.copy(this.getContent(), outStream, bufferSize); final long endTime = PerformanceUtils.getCurrentTime(); if (this.getContentLength() != -1 && totalBytes != this.getContentLength()) { throw new ContentLengthNotMatchException(path, this.getContentLength(), totalBytes); } PerformanceUtils.logMbps(startTime, endTime, totalBytes, path, true); }
Source:
<code>private long getInstallationSize() { long totalSize = 0; Iterator<Pack> iter = idata.selectedPacks.iterator(); while( iter.hasNext() ) { Pack p = (Pack) iter.next(); totalSize += p.nbytes; } <START> String addFeatureSizes = idata.getVariable("INSTALL_ADDITIONAL_SIZES"); <END> if (addFeatureSizes != null && !addFeatureSizes.isEmpty()) { String[] afs = addFeatureSizes.split(","); for (int i = 0; i < afs.length; i++) totalSize += Long.parseLong(afs[i]); } String runtimeSizes = idata.getVariable("INSTALL_RT_SIZES"); if (runtimeSizes != null && !runtimeSizes.isEmpty()) { String[] rts = runtimeSizes.split(","); for (int i = 0; i < rts.length; i++) totalSize += Long.parseLong(rts[i]); } return totalSize; }</code><technical_language>blocks alike. good ether concatenate sizes do in cycle create static method for cycle</technical_language>

Target:
private long getInstallationSize() { long totalSize = 0; Iterator<Pack> iter = idata.selectedPacks.iterator(); while( iter.hasNext() ) { Pack p = (Pack) iter.next(); totalSize += p.nbytes; } totalSize += calculateAggregateSize(idata.getVariable("INSTALL_ADDITIONAL_SIZES")); totalSize += calculateAggregateSize(idata.getVariable("INSTALL_RT_SIZES")); return totalSize; }
Source:
<code>public JAXBElement<?> get() { JAXBElement<?> reduced = super.get(); <START> notNull(distance); <END> if (!DistanceBufferType.class.equals(reduced.getDeclaredType()) || !(reduced.getValue() instanceof DistanceBufferType)) { throw new FilterProcessingException( "Incorrect use of DistanceBufferSupplier for given type " + reduced.toString()); } DistanceBufferType value = (DistanceBufferType) reduced.getValue(); value.setDistance(new MeasureType().withUom("m").withValue(distance)); return reduced; }</code><technical_language>version of this allows a message <LINK_0>,%20java.lang.String,%20java.lang.Object...)</technical_language>

Target:
public JAXBElement<?> get() { JAXBElement<?> reduced = super.get(); notNull(distance, "The Distance element cannot be created without a distance value"); if (!DistanceBufferType.class.equals(reduced.getDeclaredType()) || !(reduced.getValue() instanceof DistanceBufferType)) { throw new FilterProcessingException( "Incorrect use of DistanceBufferSupplier for given type " + reduced.toString()); } DistanceBufferType value = (DistanceBufferType) reduced.getValue(); value.setDistance(new MeasureType().withUom(UOM_METERS).withValue(distance)); return reduced; }
Source:
<code>protected void clearContent() { <START> setStartTime(0); <END> setEndTime(0); getSwtChart().getAxisSet().getXAxis(0).getTick().setFormat(null); super.clearContent(); }</code><technical_language>problem I is this clearContent called setStartTime is called in TmfTimeViewer.loadTrace. In other words, setStartTime is called real start time (not 0) zeroed out in clearContent. semantics of clearContent not...clear. /** * Clears view content. */ is "content"? start/end time, selection range, window range (everything set in loadtrace) considered content. Otherwise, sense call loadtrace clearContent right after, TmfXYChartViewer.loadTrace. I suggest remove setStartTime setEndTime work. I push this if OK it</technical_language>

Target:
protected void clearContent() { getSwtChart().getAxisSet().getXAxis(0).getTick().setFormat(null); super.clearContent(); }