auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void onAdd(Entity entity) throws FalconException { Set<String> currentClusters = DeploymentUtil.getCurrentClusters(); if (entity.getEntityType() == EntityType.FEED) { Feed feed = (Feed) entity; if (feed.getLocations() != null) { for (Cluster cluster : feed.getClusters().getClusters()) { if (currentClusters.contains(cluster.getName())) { if (FeedHelper.getSLA(cluster, feed) != null) { LOG.debug("Adding feed:{} for monitoring", feed.getName()); <START> MONITORING_JDBC_STATE_STORE.putMonitoredFeed(feed.getName(), EntityType.FEED.toString()); <END> } } } } } if (entity.getEntityType() == EntityType.PROCESS){ Process process = (Process) entity; if (process.getSla() != null || checkProcessClusterSLA(process)){ for (org.apache.falcon.entity.v0.process.Cluster cluster : process.getClusters().getClusters()) { if (currentClusters.contains(cluster.getName())) { LOG.debug("Adding process:{} for monitoring", process.getName()); MONITORING_JDBC_STATE_STORE.putMonitoredFeed(process.getName(), EntityType.PROCESS.toString()); } } } } }</code><technical_language>putMonitoredEntity</technical_language>

Target:
public void onAdd(Entity entity) throws FalconException { Set<String> currentClusters = DeploymentUtil.getCurrentClusters(); if (entity.getEntityType() == EntityType.FEED) { Feed feed = (Feed) entity; if (feed.getLocations() != null || feed.getSla() != null || checkFeedClusterSLA(feed)) { for (Cluster cluster : feed.getClusters().getClusters()) { if (currentClusters.contains(cluster.getName())) { if (FeedHelper.getSLA(cluster, feed) != null) { LOG.debug("Adding feed:{} for monitoring", feed.getName()); MONITORING_JDBC_STATE_STORE.putMonitoredEntity(feed.getName(), EntityType.FEED.toString()); break; } } } } } if (entity.getEntityType() == EntityType.PROCESS){ Process process = (Process) entity; if (process.getSla() != null || checkProcessClusterSLA(process)){ for (org.apache.falcon.entity.v0.process.Cluster cluster : process.getClusters().getClusters()) { if (currentClusters.contains(cluster.getName())) { LOG.debug("Adding process:{} for monitoring", process.getName()); MONITORING_JDBC_STATE_STORE.putMonitoredEntity(process.getName(), EntityType.PROCESS.toString()); break; } } } } }
Source:
<code>public void fetchLanguages() throws IOException { final String user = "testuser4"; final Repo repo = new MkRepo( new MkStorage.InFile(), user, new Coordinates.Simple(user, "testrepo4") ); <START> MatcherAssert.assertThat(repo.languages(), Matchers.notNullValue()); <END> }</code><technical_language>please, check elements count</technical_language>

Target:
public void fetchLanguages() throws IOException { final String user = "testuser4"; final Repo repo = new MkRepo( new MkStorage.InFile(), user, new Coordinates.Simple(user, "testrepo4") ); final Iterable<Language> languages = repo.languages(); MatcherAssert.assertThat(languages, Matchers.notNullValue()); MatcherAssert.assertThat( Lists.newArrayList(languages), Matchers.hasSize(Tv.THREE) ); }
Source:
<code>public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) { <START> return size; <END> } size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(1, year_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(2, month_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(4, dayOfMonth_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(5, dayOfWeek_.getNumber()); } if (((bitField0_ & 0x00000010) == 0x00000010)) { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(6, hour_); } if (((bitField0_ & 0x00000020) == 0x00000020)) { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(7, minute_); } if (((bitField0_ & 0x00000040) == 0x00000040)) { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(8, second_); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; }</code><technical_language>4 spaces</technical_language>

Target:
public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(1, year_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(2, month_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(4, dayOfMonth_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(5, dayOfWeek_.getNumber()); } if (((bitField0_ & 0x00000010) == 0x00000010)) { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(6, hour_); } if (((bitField0_ & 0x00000020) == 0x00000020)) { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(7, minute_); } if (((bitField0_ & 0x00000040) == 0x00000040)) { size += com.google.protobuf.CodedOutputStream .computeUInt32Size(8, second_); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; }
Source:
<code>private static NotificationCompat.Builder getNotificationBuilder(Context context, @StringRes int title, @StringRes int content) { <START> NotificationCompat.BigTextStyle bigTextStyle = new NotificationCompat.BigTextStyle(); <END> bigTextStyle.setBigContentTitle(context.getString(title)); bigTextStyle.bigText(context.getString(content)); return new NotificationCompat.Builder(context) .setStyle(bigTextStyle) .setSmallIcon(R.drawable.ic_my_sites_24dp) .setColor(context.getResources().getColor(R.color.blue_wordpress)) .setLargeIcon(BitmapFactory.decodeResource(context.getResources(), R.mipmap.app_icon)) .setAutoCancel(true); }</code><technical_language>I need set normal notification text here, notification is collapsed a blank notification is shown: <img width="439" alt="screen shot 2017-11-17 9 10 54 pm" src="<LINK_1>"> drag bottom edge expand it, bigstyle text appears: <img width="441" alt="screen shot 2017-11-17 9 11 25 pm" src="<LINK_0>"> So, need add notificationBuilder.setContentTitle(title); notificationBuilder.setContentText(content); NotificationCompat.Builder(context) concatenation right</technical_language>

Target:
private static NotificationCompat.Builder getNotificationBuilder(Context context, @StringRes int title, @StringRes int content) { NotificationCompat.BigTextStyle bigTextStyle = new NotificationCompat.BigTextStyle(); bigTextStyle.setBigContentTitle(context.getString(title)); bigTextStyle.bigText(context.getString(content)); return new NotificationCompat.Builder(context) .setStyle(bigTextStyle) .setContentTitle(context.getString(title)) .setContentText(context.getString(content)) .setSmallIcon(R.drawable.ic_my_sites_24dp) .setColor(context.getResources().getColor(R.color.blue_wordpress)) .setAutoCancel(true); }
Source:
<code>private static String internalNameToCanonicalName(String typeName) { String canonicalName = typeName.replaceAll("\\$", "."); <START> if (canonicalName.contains("<")) { <END> canonicalName = canonicalName.substring(0, canonicalName.indexOf('<')); } return canonicalName; }</code><technical_language>right. internal name? not, this done calling this method, receives a valid internal name</technical_language>

Target:
private static String internalNameToCanonicalName(String typeName) { return typeName.replaceAll("\\$", "."); }
Source:
<code>public BitstreamResource updateBitstreamFormat(@PathVariable UUID uuid, HttpServletRequest request) throws SQLException { Context context = obtainContext(request); List<BitstreamFormat> bitstreamFormats = utils.constructBitstreamFormatList(request, context); if (bitstreamFormats.size() > 1) { throw new DSpaceBadRequestException("Only one bitstream format is allowed"); } BitstreamFormat bitstreamFormat = bitstreamFormats.stream().findFirst() <START> .orElseThrow(() -> new DSpaceBadRequestException("The bitstream format doesn't exist " + <END> "or the data cannot be resolved to a bitstream format.")); Bitstream bitstream = bitstreamService.find(context, uuid); if (bitstream == null) { throw new ResourceNotFoundException("Bitstream with id: " + uuid + " not found"); } if (bitstreamFormat.equals(bitstream.getFormat(context))) { throw new DSpaceBadRequestException("The provided bitstream format is already the bitstream format"); } bitstream.setFormat(context, bitstreamFormat); context.commit(); return (BitstreamResource) utils.getResourceRepository(BitstreamRest.CATEGORY, BitstreamRest.NAME) .wrapResource(converter.fromModel(context.reloadEntity(bitstream))); }</code><technical_language>message match condition,,, this bitstream format specified? next lines deal bitstream format scenario</technical_language>

Target:
public BitstreamResource updateBitstreamFormat(@PathVariable UUID uuid, HttpServletRequest request) throws SQLException { Context context = obtainContext(request); List<BitstreamFormat> bitstreamFormats = utils.constructBitstreamFormatList(request, context); if (bitstreamFormats.size() > 1) { throw new DSpaceBadRequestException("Only one bitstream format is allowed"); } BitstreamFormat bitstreamFormat = bitstreamFormats.stream().findFirst() .orElseThrow(() -> new DSpaceBadRequestException("No valid bitstream format was provided")); Bitstream bitstream = bitstreamService.find(context, uuid); if (bitstream == null) { throw new ResourceNotFoundException("Bitstream with id: " + uuid + " not found"); } bitstream.setFormat(context, bitstreamFormat); context.commit(); return (BitstreamResource) utils.getResourceRepository(BitstreamRest.CATEGORY, BitstreamRest.NAME) .wrapResource(converter.fromModel(context.reloadEntity(bitstream))); }
Source:
<code>public static char[] instantiateName(char[] name, InstantiationContext context, IBinding enclosingTemplate) { if (name == null || name.length == 0 || name[0] != '~') { return name; } String typename = new String(name).substring(1); ICPPTemplateParameterMap map = context.getParameterMap(); IBinding enclosing = enclosingTemplate; while (enclosing != null) { if (enclosing instanceof ICPPTemplateDefinition) { for (ICPPTemplateParameter param : ((ICPPTemplateDefinition) enclosing).getTemplateParameters()) { if (param instanceof ICPPTemplateTypeParameter) { if (param.getName().equals(typename)) { ICPPTemplateArgument arg = map.getArgument(param); if (arg instanceof CPPTemplateTypeArgument) { IType <START> argType = <END> arg.getTypeValue(); if (argType instanceof ICPPClassType) { StringBuilder result = new StringBuilder(); result.append('~'); result.append(((ICPPClassType) argType).getName()); return result.toString().toCharArray(); } } } } } } enclosing = enclosing.getOwner(); } return name; }</code><technical_language>Here, argType a CPPQualifierType, bug 511244</technical_language>

Target:
public static char[] instantiateName(char[] name, InstantiationContext context, IBinding enclosingTemplate) { if (name == null || name.length == 0 || name[0] != '~') { return name; } String typename = new String(name).substring(1); ICPPTemplateParameterMap map = context.getParameterMap(); IBinding enclosing = enclosingTemplate; while (enclosing != null) { if (enclosing instanceof ICPPTemplateDefinition) { for (ICPPTemplateParameter param : ((ICPPTemplateDefinition) enclosing).getTemplateParameters()) { if (param instanceof ICPPTemplateTypeParameter) { if (param.getName().equals(typename)) { ICPPTemplateArgument arg = map.getArgument(param); if (arg instanceof CPPTemplateTypeArgument) { IType argType = arg.getTypeValue(); argType = SemanticUtil.getNestedType(argType, CVTYPE | TDEF); if (argType instanceof ICPPClassType) { StringBuilder result = new StringBuilder(); result.append('~'); result.append(((ICPPClassType) argType).getName()); return result.toString().toCharArray(); } } } } } } enclosing = enclosing.getOwner(); } return name; }
Source:
<code>private void handleFailure(Exception exception) { root.set(null); noFilesFound.set(true); searchInProgress.set(false); <START> successfulSearch.set(false); <END> final boolean permissionProblem = exception instanceof IOException && exception.getCause() instanceof FileSystemException && exception.getCause().getMessage().endsWith("Operation not permitted"); if (permissionProblem) { dialogService.showErrorDialogAndWait(String.format(Localization.lang("JabRef does not have permission to access %s"), exception.getCause().getMessage())); } else { dialogService.showErrorDialogAndWait(exception); } }</code><technical_language>root is null onRunning() event. for noFilesFound.set(true) successfulSearch.set(false). Moreover, searchInProgress.set(false) is done in onFinished() event, is executed task is finished error if succeeds. I lines removed</technical_language>

Target:
private void handleFailure(Exception exception) { final boolean permissionProblem = exception instanceof IOException && exception.getCause() instanceof FileSystemException && exception.getCause().getMessage().endsWith("Operation not permitted"); if (permissionProblem) { dialogService.showErrorDialogAndWait(String.format(Localization.lang("JabRef does not have permission to access %s"), exception.getCause().getMessage())); } else { dialogService.showErrorDialogAndWait(exception); } }
Source:
<code>public void shutdown() { <START> listenerToRequest.clear(); <END> locationEngine.setRequest(null); }</code><technical_language>I missed this adding support for PendingIntent updates shutdown() clear intentToRequest</technical_language>

Target:
public void shutdown() { listenerToRequest.clear(); intentToRequest.clear(); locationEngine.setRequest(null); }
Source:
<code>private static void readEvalPrintLoop() { System.err.println("Welcome to Starlark (java.starlark.net)"); String line; LineReader reader = buildLineReader(); <START> try { <END> while ((line = prompt(reader)) != null) { ParserInput input = ParserInput.fromString(line, "<stdin>"); try { Object result = Starlark.execFile(input, OPTIONS, module, thread); if (result != Starlark.NONE) { System.out.println(Starlark.repr(result)); } } catch (SyntaxError.Exception ex) { for (SyntaxError error : ex.errors()) { System.err.println(error); } } catch (EvalException ex) { System.err.println(ex.getMessageWithStack()); } catch (InterruptedException ex) { System.err.println("Interrupted"); } } } finally { try { reader.getTerminal().close(); } catch (IOException unused) { } } }</code><technical_language>FWIW: want implement a poor man's version of this, is appending lines internal buffer a blank line is read, buffer parsed a non-empty StarlarkFile. means type newline input is complete, a syntax error</technical_language>

Target:
private static int readEvalPrintLoop() { System.err.println("Welcome to Starlark (java.starlark.net)"); String line; LineReader reader = buildLineReader(); if (reader == null) { return 1; } try { while ((line = prompt(reader)) != null) { ParserInput input = ParserInput.fromString(line, "<stdin>"); try { Object result = Starlark.execFile(input, OPTIONS, module, thread); if (result != Starlark.NONE) { System.out.println(Starlark.repr(result)); } } catch (SyntaxError.Exception ex) { for (SyntaxError error : ex.errors()) { System.err.println(error); } } catch (EvalException ex) { System.err.println(ex.getMessageWithStack()); } catch (InterruptedException ex) { System.err.println("Interrupted"); } } return 0; } catch (IOError e) { System.err.println("I/O error: " + e.getMessage()); return 1; } finally { try { reader.getTerminal().close(); } catch (IOException unused) { } } }
Source:
<code><START> public static void hideSubreddit(final Activity activity, String Subreddit) { <END> HiddenSubreddits.add(Subreddit.toLowerCase()); final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity); final SharedPreferences.Editor editor = prefs.edit(); editor.putString(activity.getString(R.string.pref_all_filter_key), StringUtils.join(HiddenSubreddits, ',')); editor.commit(); IsEmpty = false; }</code><technical_language>static, tempted a singleton object. a bit neater, easier implement a "hide subscribed subreddits /r/all" in future, object user-specific</technical_language>

Target:
public void hideSubreddit(final Activity activity, String Subreddit) { hiddenSubreddits.add(Subreddit.toLowerCase()); final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity); final SharedPreferences.Editor editor = prefs.edit(); editor.putString(activity.getString(R.string.pref_all_filter_key), StringUtils.join(hiddenSubreddits, ',')); editor.commit(); }
Source:
<code>public MediaItem getMediaItem() { <START> return MediaItem.fromUri(stream.getUrl()); <END> }</code><technical_language>**MediaItem** exists in source object, this return source.getMediaItem();</technical_language>

Target:
public MediaItem getMediaItem() { return source.getMediaItem(); }
Source:
<code>public AmqpBodyType getBodyType() { <START> return bodyType; <END> }</code><technical_language>body type is data, return enum creating a new field variable for for instance</technical_language>

Target:
public AmqpBodyType getBodyType() { return AmqpBodyType.DATA; }
Source:
<code><START> private Vector3f getViewPosition(Vector3f out) { <END> ClientComponent clientComponent = getClientEntity().getComponent(ClientComponent.class); if (clientComponent == null) { return out; } LocationComponent location = clientComponent.camera.getComponent(LocationComponent.class); if (location == null) { return getPosition(); } return location.getWorldPosition(out); }</code><technical_language>Another access change API violation, a below. If needed lets change :-)</technical_language>

Target:
public Vector3f getViewPosition(Vector3f out) { ClientComponent clientComponent = getClientEntity().getComponent(ClientComponent.class); if (clientComponent == null) { return out; } LocationComponent location = clientComponent.camera.getComponent(LocationComponent.class); if (location == null) { return getPosition(); } return location.getWorldPosition(out); }
Source:
<code>public static String javaVersion(final String def) { final String javaVersionProperty = SafePropertyAccessor.getProperty("java.version", def); <START> if (javaVersionProperty.equals("0")) return "1.7.0"; END> return javaVersionProperty; }</code><technical_language>longer null-safe (as before) - please swap equals comparison, in case</technical_language>

Target:
public static String javaVersion(final String def) { final String javaVersionProperty = SafePropertyAccessor.getProperty("java.version", def); if ("0".equals(javaVersionProperty)) return "1.7.0"; return javaVersionProperty; }
Source:
<code>public void afterScript(String script, WebDriver driver) { <START> waitProcessing(driver); <END> }</code><technical_language>[x] I wait page loading execute script click button. think</technical_language>

Target:
public void afterScript(String script, WebDriver driver) { if (script.contains(".click(")) waitPageLoading(driver); }
Source:
<code>public void testForOwnerTag() { List<AutoScalingGroup> asgList = createASGList(); String[] asgNames = {ASG1, ASG2}; <START> AWSClient awsMock = createMockAWSClient(asgList, asgNames); <END> List<Cluster> list = Lists.newArrayList(); for (AutoScalingGroup asg : asgList) { List<String> instances = Lists.newArrayList(); instances.add(INSTANCE_ID); com.netflix.simianarmy.conformity.AutoScalingGroup conformityAsg = new com.netflix.simianarmy.conformity.AutoScalingGroup( asg.getAutoScalingGroupName(), instances.toArray(new String[instances.size()])); Cluster cluster = new Cluster(asg.getAutoScalingGroupName(), REGION, conformityAsg); List<TagDescription> tagDescriptions = asg.getTags(); for (TagDescription tagDescription : tagDescriptions) { if ( tagDescription.getKey() != null) { if ( OWNER_TAG_KEY.equalsIgnoreCase(tagDescription.getKey()) ) { String value = tagDescription.getValue(); if (value != null) { cluster.setOwnerEmail(value); } } } } list.add(cluster); } Assert.assertNotNull(list.get(0).getOwnerEmail()); Assert.assertTrue(list.get(0).getOwnerEmail().equalsIgnoreCase(OWNER_TAG_VALUE)); Assert.assertEquals(list.get(1).getOwnerEmail(), null); }</code><technical_language>logic for this test: awsMock created setup used. appears this test if owner tags present in test list testing if AWSClusterCrawler is behaving expected</technical_language>

Target:
public void testForOwnerTag() { Properties properties = new Properties(); BasicConformityMonkeyContext ctx = new BasicConformityMonkeyContext(); List<AutoScalingGroup> asgList = createASGList(); String[] asgNames = {ASG1, ASG2}; AWSClient awsMock = createMockAWSClient(asgList, asgNames); Map<String, AWSClient> regionToAwsClient = Maps.newHashMap(); regionToAwsClient.put("us-east-1", awsMock); AWSClusterCrawler clusterCrawler = new AWSClusterCrawler(regionToAwsClient, new BasicConfiguration(properties)); List<Cluster> clusters = clusterCrawler.clusters(asgNames); Assert.assertTrue(OWNER_TAG_VALUE.equalsIgnoreCase(clusters.get(0).getOwnerEmail())); Assert.assertNull(clusters.get(1).getOwnerEmail()); }
Source:
<code>public void processChild(final ConfigurationNode config, final int index, final BlockDestroyAction.Builder builder) { final BlockDestroyAction.Entry.Builder entry = builder.entry(index); entry.apply(this.action.parse(config.getNode(BlockDestroyActionConfig.APPLY))); entry.drop(this.drop.parse(config.getNode(BlockDestroyActionConfig.DROP))); final List<ItemAcceptable> with = new ArrayList<>(this.with(config.getNode(BlockDestroyActionConfig.WITH))); <START> with.addAll(tool(config.getNode(BlockDestroyActionConfig.TOOL))); <END> entry.with(with); }</code><technical_language>this</technical_language>

Target:
public void processChild(final ConfigurationNode config, final int index, final BlockDestroyAction.Builder builder) { final BlockDestroyAction.Entry.Builder entry = builder.entry(index); entry.apply(this.action.parse(config.getNode(BlockDestroyActionConfig.APPLY))); entry.drop(this.drop.parse(config.getNode(BlockDestroyActionConfig.DROP))); final List<ItemAcceptable> with = new ArrayList<>(this.with(config.getNode(BlockDestroyActionConfig.WITH))); with.addAll(this.tool(config.getNode(BlockDestroyActionConfig.TOOL))); entry.with(with); }
Source:
<code>protected void doPublish(PatchSetPublishDetail publishDetail) { TaskAttribute comment = getTaskData().getRoot().getAttribute(TaskAttribute.COMMENT_NEW); String editorCommentText = comment != null ? comment.getValue() : ""; PublishDialog dialog = new PublishDialog(getShell(), getTask(), publishDetail, addedDrafts, editorCommentText); openOperationDialog(dialog); if (dialog.getReturnCode() == Window.OK && comment != null) { comment.clearValues(); getTaskEditorPage().doSave(new NullProgressMonitor()); try { TasksUi.getTaskDataManager().discardEdits(getTask()); } catch (CoreException e) { <START> TasksUiInternal.displayStatus("Unable to clear status for task " + getTask().getTaskId() <END> + ". Unexpected behavior may result.", e.getStatus()); } } }</code><technical_language>Needs NLS.bind() if task ID shown (generally key is user visible)</technical_language>

Target:
protected void doPublish(PatchSetPublishDetail publishDetail) { TaskAttribute comment = getTaskData().getRoot().getAttribute(TaskAttribute.COMMENT_NEW); String editorCommentText = comment != null ? comment.getValue() : ""; PublishDialog dialog = new PublishDialog(getShell(), getTask(), publishDetail, addedDrafts, editorCommentText); openOperationDialog(dialog); if (dialog.getReturnCode() == Window.OK && comment != null) { comment.clearValues(); getTaskEditorPage().doSave(new NullProgressMonitor()); try { TasksUi.getTaskDataManager().discardEdits(getTask()); } catch (CoreException e) { Status status = new Status(IStatus.ERROR, GerritUiPlugin.PLUGIN_ID, "Error while clearing task status.", e); TasksUiInternal.displayStatus("Clear outgoing task status failed", status); } } }
Source:
<code>public void onMessage(IOSMessage message) { if (message instanceof ReportSetupMessage) { ReportSetupMessage reportSetupMessage = ReportSetupMessage.class.cast(message); handle(reportSetupMessage); } else if (message instanceof ReportConnectedApplicationsMessage) { ReportConnectedApplicationsMessage reportConnectedApplicationsMessage = ReportConnectedApplicationsMessage.class .cast(message); handle(reportConnectedApplicationsMessage); } else if (message instanceof ApplicationSentListingMessage) { ApplicationSentListingMessage applicationSentListingMessage = ApplicationSentListingMessage.class.cast(message); handle(applicationSentListingMessage); } else if (message instanceof ApplicationDataMessage) { } else if (message instanceof ApplicationConnectedMessage) { ApplicationConnectedMessage applicationConnectedMessage = ApplicationConnectedMessage.class.cast(message); <START> handle(applicationConnectedMessage); <END> } }</code><technical_language>a big fan of if .. else if ... else if here. re-factor this code a bit? Fo example; 1. if condition { action; return; } more of 1. Extract method re-factor condition simply call new method in this onMessage(IOSMessage message) method. Do instancecof check in new created methods. 1. Other</technical_language>

Target:
public void onMessage(IOSMessage message) { handleReportSetupMessage(message); handleReportConnectedApplicationsMessage(message); handleApplicationSentListingMessage(message); handleApplicationDataMessage(message); handleApplicationConnectedMessage(message); }
Source:
<code>private void fetchClasses() { fWaitingForSession = false; fFetchingClasses = true; fHardwareOs.getResourceClasses(fContext, new DataRequestMonitor<IGDBHardwareAndOS2.IResourceClass[]>(fSession.getExecutor(), null) { @Override @ConfinedToDsfExecutor("fExecutor") protected void handleCompleted() { if (isSuccess()) { fResourceClasses = getData(); if (fResourceClasses.length == 0) fSupported = false; } else { fSupported = false; } fFetchingClasses = false; notifyUI(); <START> super.handleCompleted(); <END> } }); }</code><technical_language>Calling super.handleCompleted() handling of error printous below. Instead call done handling needed do already. This is of reasons rarely super.handle* called; usually, handling is done is need do else. !ENTRY org.eclipse.cdt.dsf 4 10005 2012-09-17 10:17:50.176 !MESSAGE Request for monitor: 'RequestMonitor (org.eclipse.cdt.dsf.gdb.internal.ui.osview.SessionOSData$2@1792acc): Status ERROR: org.eclipse.cdt.dsf.gdb code=10004 Failed execute MI command: -info-os Error message debugger end: fetch data now. java.lang.Exception: fetch data now.' resulted in error. !SUBENTRY 1 org.eclipse.cdt.dsf.gdb 4 10004 2012-09-17 10:17:50.176 !MESSAGE Failed execute MI command: -info-os Error message debugger end: fetch data now. !STACK 0 java.lang.Exception: fetch data now. org.eclipse.cdt.dsf.mi.service.command.AbstractMIControl$RxThread.processMIOutput(AbstractMIControl.java:925) org.eclipse.cdt.dsf.mi.service.command.AbstractMIControl$RxThread.run(AbstractMIControl.java:754)</technical_language>

Target:
private void fetchClasses() { fWaitingForSession = false; fFetchingClasses = true; fHardwareOs.getResourceClasses(fContext, new DataRequestMonitor<IGDBHardwareAndOS2.IResourceClass[]>(fSession.getExecutor(), null) { @Override @ConfinedToDsfExecutor("fExecutor") protected void handleCompleted() { if (isSuccess()) { fResourceClasses = getData(); if (fResourceClasses.length == 0) fSupported = false; } else { fSupported = false; } fFetchingClasses = false; notifyUI(); } }); }
Source:
<code>public Element createRootElement(Document doc, Jsr107Configuration configuration) { Element rootElement = doc.createElementNS(NAMESPACE.toString(), JSR_NAMESPACE_PREFIX + COLON + DEFAULT_ELEMENT_NAME); rootElement.setAttributeNS(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, "xmlns:" + JSR_NAMESPACE_PREFIX, NAMESPACE.toString()); rootElement.setAttribute(JSR_107_COMPLIANT_ATOMICS_ATTRIBUTE, String.valueOf(configuration.isJsr107CompliantAtomics())); ConfigurationElementState managementState = configuration.isEnableManagementAll(); ConfigurationElementState statisticsState = configuration.isEnableStatisticsAll(); if (ConfigurationElementState.ENABLED == managementState || ConfigurationElementState.DISABLED == managementState) { <START> rootElement.setAttribute(ENABLE_MANAGEMENT_ALL_ATTRIBUTE, String.valueOf(configuration.isEnableManagementAll() <END> .asBoolean())); } if (ConfigurationElementState.ENABLED == statisticsState || ConfigurationElementState.DISABLED == statisticsState) { rootElement.setAttribute(ENABLE_STATISTICS_ALL_ATTRIBUTE, String.valueOf(configuration.isEnableStatisticsAll() .asBoolean())); } if (configuration.getDefaultTemplate() != null) { rootElement.setAttribute(DEFAULT_TEMPLATE_ATTRIBUTE, configuration.getDefaultTemplate()); } processCaches(doc, rootElement, configuration); return rootElement; }</code><technical_language>local variable</technical_language>

Target:
protected Element createRootElement(Document doc, Jsr107Configuration configuration) { Element rootElement = doc.createElementNS(NAMESPACE.toString(), JSR_NAMESPACE_PREFIX + COLON + DEFAULT_ELEMENT_NAME); rootElement.setAttribute(JSR_107_COMPLIANT_ATOMICS_ATTRIBUTE, String.valueOf(configuration.isJsr107CompliantAtomics())); ConfigurationElementState managementState = configuration.isEnableManagementAll(); ConfigurationElementState statisticsState = configuration.isEnableStatisticsAll(); if (ConfigurationElementState.ENABLED == managementState || ConfigurationElementState.DISABLED == managementState) { rootElement.setAttribute(ENABLE_MANAGEMENT_ALL_ATTRIBUTE, String.valueOf(managementState.asBoolean())); } if (ConfigurationElementState.ENABLED == statisticsState || ConfigurationElementState.DISABLED == statisticsState) { rootElement.setAttribute(ENABLE_STATISTICS_ALL_ATTRIBUTE, String.valueOf(statisticsState.asBoolean())); } if (configuration.getDefaultTemplate() != null) { rootElement.setAttribute(DEFAULT_TEMPLATE_ATTRIBUTE, configuration.getDefaultTemplate()); } processCaches(doc, rootElement, configuration); return rootElement; }
Source:
<code>public void execute() { try { <START> launch.launch(launchMode.getIdentifier(), new NullProgressMonitor()); <END> } catch (CoreException e) { DebugUIPlugin.log(e); } }</code><technical_language>Please consider org.eclipse.debug.ui.DebugUITools.launch(final ILaunchConfiguration configuration, final String mode)</technical_language>

Target:
public void execute() { DebugUITools.launch(launch, launchMode.getIdentifier()); }
Source:
<code>public XBeeDevice(XBeeDevice localXBeeDevice, XBee64BitAddress xbee64BitAddress) { if (localXBeeDevice == null) throw new NullPointerException("Local XBee device cannot be null."); if (xbee64BitAddress == null) throw new NullPointerException("XBee 64 bit address of the remote device cannot be null."); <START> <END> this.localXBeeDevice = localXBeeDevice; this.connectionInterface = localXBeeDevice.getConnectionInterface(); this.xbee64BitAddress = xbee64BitAddress; this.logger = LoggerFactory.getLogger(XBeeDevice.class); logger.debug(toString() + "Using the connection interface {}.", connectionInterface.getClass().getSimpleName(), connectionInterface.toString()); }</code><technical_language>Check XBeeDevice is remote. If so, throw a new IllegalArgumentException: java if (localXbeeDevice.isRemote()) throw new IllegalArgumentException("The local device is remote");</technical_language>

Target:
public XBeeDevice(XBeeDevice localXBeeDevice, XBee64BitAddress xbee64BitAddress) { if (localXBeeDevice == null) throw new NullPointerException("Local XBee device cannot be null."); if (xbee64BitAddress == null) throw new NullPointerException("XBee 64 bit address of the remote device cannot be null."); if (localXBeeDevice.isRemote()) throw new IllegalArgumentException("The given local XBee device is remote."); this.localXBeeDevice = localXBeeDevice; this.connectionInterface = localXBeeDevice.getConnectionInterface(); this.xbee64BitAddress = xbee64BitAddress; this.logger = LoggerFactory.getLogger(XBeeDevice.class); logger.debug(toString() + "Using the connection interface {}.", connectionInterface.getClass().getSimpleName(), connectionInterface.toString()); }
Source:
<code>public boolean hasId(String id) throws BuildException { if (id == null) return false; <START> <END> if (applicableValuesList == null) { if (superClass != null) { return superClass.hasId(id); } else { return false; } } if (getValueType() != ENUMERATED && getValueType() != TREE) { throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); } return applicableValuesList.contains(id); }</code><technical_language>More end-of-line whitespace</technical_language>

Target:
public boolean hasId(String id) throws BuildException { if (id == null) return false; if (applicableValuesList == null) { if (superClass != null) { return superClass.hasId(id); } else { return false; } } checkEnumOrTree(); return applicableValuesList.contains(id); }
Source:
<code>public NewVnicProfileModel(EntityModel sourceModel, Version dcCompatibilityVersion, boolean customPropertiesVisible, <START> Guid dcId) { <END> super(sourceModel, dcCompatibilityVersion, customPropertiesVisible); setTitle(ConstantsManager.getInstance().getConstants().vnicProfileTitle()); setHashName("new_vnic_profile"); this.dcId = dcId; if (dcId != null) { initNetworkQoSList(dcId, null); } getPortMirroring().setEntity(false); }</code><technical_language>Please move dcId vnicProfleModel ctor</technical_language>

Target:
public NewVnicProfileModel(EntityModel sourceModel, Version dcCompatibilityVersion, boolean customPropertiesVisible, Guid dcId) { super(sourceModel, dcCompatibilityVersion, customPropertiesVisible, dcId); setTitle(ConstantsManager.getInstance().getConstants().vnicProfileTitle()); setHashName("new_vnic_profile"); initNetworkQoSList(null); getPortMirroring().setEntity(false); }
Source:
<code>public static String sanitizeDefaultPort(String url) { String scheme = url.substring(0, url.indexOf("://")); <START> int portIndex = url.indexOf(':', scheme.length() + 3); <END> if(portIndex >= 0) { int port = Integer.parseInt(url.substring(portIndex + 1)); if(isDefaultPort(port, scheme)) { return url.substring(0, portIndex); } } return url; }</code><technical_language>This account for IPv6 addresses in URLs</technical_language>

Target:
public static String sanitizeDefaultPort(String url) { int afterSchemeIndex = url.indexOf("://"); if(afterSchemeIndex < 0) { return url; } String scheme = url.substring(0, afterSchemeIndex); int fromIndex = scheme.length() + 3; int ipv6StartIndex = url.indexOf('[', fromIndex); if (ipv6StartIndex > 0) { fromIndex = url.indexOf(']', ipv6StartIndex); } int portIndex = url.indexOf(':', fromIndex); if(portIndex >= 0) { int port = Integer.parseInt(url.substring(portIndex + 1)); if(isDefaultPort(port, scheme)) { return url.substring(0, portIndex); } } return url; }
Source:
<code>public DatalakeDrStatusResponse getBackupStatusByBackupId(String datalakeName, String backupId, String actorCrn) { checkNotNull(datalakeName); checkNotNull(actorCrn); checkNotNull(backupId); <START> actorCrn = "crn:altus:iam:us-west-1:9d74eee4-1cad-45d7-b645-7ccf9edbb73d:user:8d1e890c-8a2e-4cf9-96bd-d50478bc027e"; <END> datalakeName = "biglauer-az-dr-4-dl"; try (ManagedChannelWrapper channelWrapper = makeWrapper()) { BackupDatalakeStatusRequest.Builder builder = BackupDatalakeStatusRequest.newBuilder() .setDatalakeName(datalakeName); return statusConverter.convert( newStub(channelWrapper.getChannel(), UUID.randomUUID().toString(), actorCrn) .backupDatalakeStatus(builder.build()) ); } }</code><technical_language>I guess removed</technical_language>

Target:
public DatalakeDrStatusResponse getBackupStatusByBackupId(String datalakeName, String backupId, String actorCrn) { if (!datalakeDrConfig.isConfigured()) { return missingConnectorResponse(); } checkNotNull(datalakeName); checkNotNull(actorCrn); checkNotNull(backupId); try (ManagedChannelWrapper channelWrapper = makeWrapper()) { BackupDatalakeStatusRequest.Builder builder = BackupDatalakeStatusRequest.newBuilder() .setDatalakeName(datalakeName) .setBackupId(backupId); return statusConverter.convert( newStub(channelWrapper.getChannel(), UUID.randomUUID().toString(), actorCrn) .backupDatalakeStatus(builder.build()) ); } }
Source:
<code><START> private static TreeSet<Integer> parseCpuPinningNumbers(final String text) { <END> try { TreeSet<Integer> include = new TreeSet<Integer>(); TreeSet<Integer> exclude = new TreeSet<Integer>(); String[] splitText = text.split(","); for (String section : splitText) { if (section.startsWith("^")) { exclude.add(Integer.parseInt(section.substring(1))); } else if (section.contains("-")) { String[] numbers = section.split("-"); int start = Integer.parseInt(numbers[0]); int end = Integer.parseInt(numbers[1]); for (int i = start; i <= end; i++) { include.add(i); } } else { include.add(Integer.parseInt(section)); } } include.removeAll(exclude); return include; } catch (NumberFormatException ex) { return null; } }</code><technical_language>weird identation this method</technical_language>

Target:
private TreeSet<Integer> parseCpuPinningNumbers(final String text) { try { TreeSet<Integer> include = new TreeSet<Integer>(); TreeSet<Integer> exclude = new TreeSet<Integer>(); String[] splitText = text.split(","); for (String section : splitText) { if (section.startsWith("^")) { exclude.add(Integer.parseInt(section.substring(1))); } else if (section.contains("-")) { String[] numbers = section.split("-"); int start = Integer.parseInt(numbers[0]); int end = Integer.parseInt(numbers[1]); for (int i = start; i <= end; i++) { include.add(i); } } else { include.add(Integer.parseInt(section)); } } include.removeAll(exclude); return include; } catch (NumberFormatException ex) { return null; } }
Source:
<code>public CliCommandBuilder setController(final String protocol, final String hostname, final int port) { <START> setController(String.format("%s://%s:%d", protocol, hostname, port)); <END> return this; }</code><technical_language>This is a bit weak IPv6 addresses, assumes "hostname" is properly enclosed in [ ]</technical_language>

Target:
public CliCommandBuilder setController(final String protocol, final String hostname, final int port) { setController(formatAddress(protocol, hostname, port)); return this; }
Source:
<code>public void call(final Subscriber<? super Account> subscriber) { <START> if (Thread.currentThread() == handler.getLooper().getThread()) <END> subscribe(subscriber); else handler.post(new Runnable() { @Override public void run() { subscribe(subscriber); } }); }</code><technical_language>{ } multi-line conditional blocks</technical_language>

Target:
public void call(final Subscriber<? super Account> subscriber) { if (Thread.currentThread() == handler.getLooper().getThread()) { subscribe(subscriber); } else { handler.post(new Runnable() { @Override public void run() { subscribe(subscriber); } }); } }
Source:
<code>public void testDeserializeEnvelope() { <START> assertEquals(deserializeEnvelope(geometryFromText("MULTIPOINT (20 20, 25 25)")), new Envelope(20, 20, 25, 25)); <END> assertEquals(deserializeEnvelope(geometryFromText("MULTILINESTRING ((1 1, 5 1), (2 4, 4 4))")), new Envelope(1, 1, 5, 4)); assertEquals(deserializeEnvelope(geometryFromText("POLYGON ((0 0, 0 4, 4 0))")), new Envelope(0, 0, 4, 4)); assertEquals(deserializeEnvelope(geometryFromText("MULTIPOLYGON (((0 0 , 0 2, 2 2, 2 0)), ((2 2, 2 4, 4 4, 4 2)))")), new Envelope(0, 0, 4, 4)); assertEquals(deserializeEnvelope(geometryFromText("GEOMETRYCOLLECTION (POINT (3 7), LINESTRING (4 6, 7 10))")), new Envelope(3, 6, 7, 10)); assertEquals(deserializeEnvelope(geometryFromText("POLYGON EMPTY")), null); assertEquals(deserializeEnvelope(geometryFromText("POINT (1 2)")), new Envelope(1, 2, 1, 2)); assertEquals(deserializeEnvelope(geometryFromText("POINT EMPTY")), null); assertEquals(deserializeEnvelope(geometryFromText("GEOMETRYCOLLECTION (GEOMETRYCOLLECTION (POINT (2 7), LINESTRING (4 6, 7 10)), POINT (3 7), LINESTRING (4 6, 7 10))")), new Envelope(2, 6, 7, 10)); }</code><technical_language>define a method assertDeserializeEnvelope() simplify this method. do assertEquals(deserializeEnvelope(...), expectedEnvelope)</technical_language>

Target:
public void testDeserializeEnvelope() { assertDeserializeEnvelope("MULTIPOINT (20 20, 25 25)", new Envelope(20, 20, 25, 25)); assertDeserializeEnvelope("MULTILINESTRING ((1 1, 5 1), (2 4, 4 4))", new Envelope(1, 1, 5, 4)); assertDeserializeEnvelope("POLYGON ((0 0, 0 4, 4 0))", new Envelope(0, 0, 4, 4)); assertDeserializeEnvelope("MULTIPOLYGON (((0 0 , 0 2, 2 2, 2 0)), ((2 2, 2 4, 4 4, 4 2)))", new Envelope(0, 0, 4, 4)); assertDeserializeEnvelope("GEOMETRYCOLLECTION (POINT (3 7), LINESTRING (4 6, 7 10))", new Envelope(3, 6, 7, 10)); assertDeserializeEnvelope("POLYGON EMPTY", null); assertDeserializeEnvelope("POINT (1 2)", new Envelope(1, 2, 1, 2)); assertDeserializeEnvelope("POINT EMPTY", null); assertDeserializeEnvelope("GEOMETRYCOLLECTION (GEOMETRYCOLLECTION (POINT (2 7), LINESTRING (4 6, 7 10)), POINT (3 7), LINESTRING (4 6, 7 10))", new Envelope(2, 6, 7, 10)); }
Source:
<code>private RelNode possiblyWrapRootWithOuterLimitFromContext( RelRoot root ) { Object outerLimitObj = plannerContext.getQueryContext().get(PlannerContext.CTX_SQL_OUTER_LIMIT); Long outerLimit = DimensionHandlerUtils.convertObjectToLong(outerLimitObj, true); if (outerLimit == null) { return root.rel; } if (root.rel instanceof Sort) { Sort innerSort = (Sort) root.rel; final int offset = Calcites.getOffset(innerSort); final int innerLimit = Calcites.getFetch(innerSort); final int fetch = Calcites.collapseFetch( innerLimit, Ints.checkedCast(outerLimit), 0 ); if (fetch == innerLimit) { return root.rel; } <START> root.rel.getCluster().getPlanner().setImportance(innerSort, 0.0); <END> return LogicalSort.create( innerSort.getInput(), innerSort.collation, offset > 0 ? makeBigIntLiteral(offset) : null, makeBigIntLiteral(fetch) ); } return LogicalSort.create( root.rel, root.collation, null, makeBigIntLiteral(outerLimit) ); }</code><technical_language>Setting importance of a rel 0 is a planner waste time considering rel: i.e., confident new rel is better</technical_language>

Target:
private RelNode possiblyWrapRootWithOuterLimitFromContext( RelRoot root ) { Object outerLimitObj = plannerContext.getQueryContext().get(PlannerContext.CTX_SQL_OUTER_LIMIT); Long outerLimit = DimensionHandlerUtils.convertObjectToLong(outerLimitObj, true); if (outerLimit == null) { return root.rel; } if (root.rel instanceof Sort) { Sort innerSort = (Sort) root.rel; final int offset = Calcites.getOffset(innerSort); final int innerLimit = Calcites.getFetch(innerSort); final int fetch = Calcites.collapseFetch( innerLimit, Ints.checkedCast(outerLimit), 0 ); if (fetch == innerLimit) { return root.rel; } return LogicalSort.create( innerSort.getInput(), innerSort.collation, offset > 0 ? makeBigIntLiteral(offset) : null, makeBigIntLiteral(fetch) ); } return LogicalSort.create( root.rel, root.collation, null, makeBigIntLiteral(outerLimit) ); }
Source:
<code>public void initialize(Context context) { context.registerSyntaxNodeConsumer(Tree.Kind.FILE_INPUT, ctx -> { previousTokenLine = -1; pattern = Pattern.compile(legalCommentPattern); <START> ignoreList = new ArrayList<>(); <END> }); context.registerSyntaxNodeConsumer(Tree.Kind.TOKEN, ctx -> { PyToken pyToken = (PyToken) ctx.syntaxNode(); if (ignoreList.contains(pyToken.token())) { return; } ignoreList.add(pyToken.token()); for (Trivia trivia : pyToken.trivia()) { if (trivia.getToken().getLine() == previousTokenLine) { String comment = trivia.getToken().getValue(); if (!pattern.matcher(comment).matches()) { ctx.addIssue(new PyTokenImpl(trivia.getToken()), MESSAGE); } } } previousTokenLine = pyToken.line(); }); }</code><technical_language>is ignore list required ? if visiting token multiple times issue visit of tokens</technical_language>

Target:
public void initialize(Context context) { Pattern pattern = Pattern.compile(legalCommentPattern); context.registerSyntaxNodeConsumer(Tree.Kind.FILE_INPUT, ctx -> previousTokenLine = -1); context.registerSyntaxNodeConsumer(Tree.Kind.TOKEN, ctx -> { Token pyToken = (Token) ctx.syntaxNode(); for (Trivia trivia : pyToken.trivia()) { if (previousTokenLine == trivia.getToken().getLine()) { String comment = trivia.getToken().getValue(); if (!pattern.matcher(comment).matches()) { ctx.addIssue(new TokenImpl(trivia.getToken()), MESSAGE); } } } previousTokenLine = pyToken.line(); }); }
Source:
<code>public void dateIsGood() throws Exception { metadata.setMetadata(setValidUntil(THE_FUTURE, ISO_ZERO_SECONDS, entityXml)); <START> assertThat("Expected metadata to be valid", not(metadata.isMetadataValid())); <END> }</code><technical_language>If this test run other tests, a result</technical_language>

Target:
public void dateIsGood() { metadata.setMetadata(setValidUntil(THE_FUTURE, ISO_ZERO_SECONDS, entityXml)); initializeMetadata(); assertThat("Expected metadata to be valid", not(metadata.isMetadataValid())); }
Source:
<code>public String getFromHttpSession(String key) { HttpServletRequest request = this.getThreadLocalRequest(); HttpSession session = request.getSession(); Object value = session.getAttribute(key); <START> assert value instanceof String : "Retrieving non string value from session"; END> return (String)value; }</code><technical_language>prefer log.error() message instead of assert here. This is AFAIK need explicitly enable assertions in JBoss in traditional Java (EE) server-side code, asserts yield AssertionError suitable for client input validation. (Java Error subclasses serious problems a reasonable application try catch.)</technical_language>

Target:
public String getFromHttpSession(String key) { HttpServletRequest request = this.getThreadLocalRequest(); HttpSession session = request.getSession(); Object value = session.getAttribute(UI_PREFIX + key); String result = null; if (value instanceof String) { result = (String)value; } else { log.error("Retrieving non string value from session"); } return result; }
Source:
<code>private void createTooltipShell(Shell parent) { final Display display = parent.getDisplay(); if (fTipShell != null && !fTipShell.isDisposed()) { fTipShell.dispose(); } fTipShell = new Shell(parent, SWT.ON_TOP | SWT.TOOL); fTipShell.addDisposeListener(e -> <START> Display.getDefault().removeFilter(SWT.MouseMove, <END> fListener)); GridLayout gridLayout = new GridLayout(); gridLayout.numColumns = 2; gridLayout.marginWidth = 2; gridLayout.marginHeight = 2; fTipShell.setLayout(gridLayout); fTipShell.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND)); fTipComposite = new Composite(fTipShell, SWT.NONE); fTipComposite.setLayout(new GridLayout(3, false)); setupControl(fTipComposite); }</code><technical_language>e.display</technical_language>

Target:
private void createTooltipShell(Shell parent) { final Display display = parent.getDisplay(); if (fTipShell != null && !fTipShell.isDisposed()) { fTipShell.dispose(); } fTipShell = new Shell(parent, SWT.ON_TOP | SWT.TOOL); fTipShell.addDisposeListener(e -> e.display.removeFilter(SWT.MouseMove, fListener)); fTipShell.addDisposeListener(e -> e.display.removeFilter(SWT.FocusOut, fListener)); GridLayout gridLayout = new GridLayout(); gridLayout.numColumns = 2; gridLayout.marginWidth = 2; gridLayout.marginHeight = 2; fTipShell.setLayout(gridLayout); fTipShell.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND)); fTipComposite = new Composite(fTipShell, SWT.NONE); fTipComposite.setLayout(new GridLayout(3, false)); setupControl(fTipComposite); }