auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected Optional<? extends Metadata<T>> updateObject( String id, Predicate<T> predicate, Function<T, T> update, Supplier<T> init ) { return lock.synchronizedOn( id, () -> { Metadata<T> metadata = data.get( id ); if( metadata == null ) { if( init == null ) return Optional.empty(); metadata = data.computeIfAbsent( id, ( id1 ) -> { var object = init.get(); identifier.set( object, id ); checkConstraints( object ); return new Metadata<>( object ); } ); data.put( id, metadata ); <START> metadata.setUpdated(); END> } else { if( predicate.test( metadata.object ) ) { if( constraints.isEmpty() ) { metadata.update( update.apply( metadata.object ) ); } else { var newObject = update.apply( Binder.json.clone( metadata.object ) ); checkConstraints( newObject ); identifier.set( newObject, id ); metadata.update( newObject ); } } else { return Optional.empty(); } } return Optional.of( metadata ); } ); }</code><technical_language>do not:)</technical_language>

Target:
protected Optional<? extends Metadata<T>> updateObject( String id, Predicate<T> predicate, Function<T, T> update, Supplier<T> init ) { return lock.synchronizedOn( id, () -> { Metadata<T> metadata = data.get( id ); if( metadata == null ) { if( init == null ) return Optional.empty(); metadata = data.computeIfAbsent( id, ( id1 ) -> { var object = init.get(); identifier.set( object, id ); checkConstraints( object ); return new Metadata<>( object ); } ); data.put( id, metadata ); } else { if( predicate.test( metadata.object ) ) { if( constraints.isEmpty() ) { metadata.update( update.apply( metadata.object ) ); } else { var newObject = update.apply( Binder.json.clone( metadata.object ) ); checkConstraints( newObject ); identifier.set( newObject, id ); metadata.update( newObject ); } } else { return Optional.empty(); } } return Optional.of( metadata ); } ); }
Source:
<code>private void verifyExpectedArgument(long sweepTime, long totalTimeElapsed) { assertThat(RESULTS_NO_MORE_TO_SWEEP.getTimeInMillis()).isEqualTo(sweepTime); assertThat(totalTimeElapsed) .isLessThanOrEqualTo(RESULTS_NO_MORE_TO_SWEEP.getTimeElapsedSinceStartedSweeping()); assertThat(totalTimeElapsed) <START> .isGreaterThanOrEqualTo(RESULTS_NO_MORE_TO_SWEEP.getTimeElapsedSinceStartedSweeping() - 1000L); <END> }</code><technical_language>nit: equivalent assertThat(totalTimeElapsed).isBetween(RNMTS.getTimeElapsed() - 1000, RNMTS.getTimeElapsed());</technical_language>

Target:
private void verifyExpectedArgument(long sweepTime, long totalTimeElapsed) { assertThat(RESULTS_NO_MORE_TO_SWEEP.getTimeInMillis()).isEqualTo(sweepTime); assertThat(totalTimeElapsed).isBetween( RESULTS_NO_MORE_TO_SWEEP.getTimeElapsedSinceStartedSweeping() - 1000L, RESULTS_NO_MORE_TO_SWEEP.getTimeElapsedSinceStartedSweeping()); }
Source:
<code>private List<EmailLogEntry> getEmailLogs(Long endTimeToSearch, AdminEmailLogPageData data) { List<EmailLogEntry> emailLogs = new LinkedList<EmailLogEntry>(); List<String> versionToQuery = getVersionsForQuery(data.getVersions()); AdminLogQuery query = new AdminLogQuery(versionToQuery, null, endTimeToSearch); int totalLogsSearched = 0; GaeLogApi logApi = new GaeLogApi(); long startTime = query.getEndTime() - SEARCH_TIME_INCREMENT; query.setTimePeriod(startTime, query.getEndTime()); for (int i = 0; i < MAX_SEARCH_TIMES; i++) { if (emailLogs.size() >= LOGS_PER_PAGE) { break; } List<AppLogLine> searchResult = logApi.fetchLogs(query); List<EmailLogEntry> filteredLogs = filterLogsForEmailLogPage(searchResult, data); emailLogs.addAll(filteredLogs); totalLogsSearched += searchResult.size(); query.moveTimePeriodBackward(SEARCH_TIME_INCREMENT); } nextEndTimeToSearch = query.getEndTime(); String status = new StringBuilder().append("&nbsp;&nbsp;Total Logs gone through in last search: ") .append(totalLogsSearched).append("<br>") .append("<button class=\"btn-link\" id=\"button_older\" onclick=\"submitFormAjax('") .append(nextEndTimeToSearch).append("');\">Search More</button>") <START> .toString(); <END> data.setStatusForAjax(status); statusToUser.add(new StatusMessage(status, StatusMessageColor.INFO)); return emailLogs; }</code><technical_language>This done old-fashioned way, String status = ... + ... + ... well</technical_language>

Target:
private List<EmailLogEntry> getEmailLogs(Long endTimeToSearch, AdminEmailLogPageData data) { List<EmailLogEntry> emailLogs = new LinkedList<EmailLogEntry>(); List<String> versionToQuery = getVersionsForQuery(data.getVersions()); AdminLogQuery query = new AdminLogQuery(versionToQuery, null, endTimeToSearch); int totalLogsSearched = 0; GaeLogApi logApi = new GaeLogApi(); long startTime = query.getEndTime() - SEARCH_TIME_INCREMENT; query.setTimePeriod(startTime, query.getEndTime()); for (int i = 0; i < MAX_SEARCH_TIMES; i++) { if (emailLogs.size() >= LOGS_PER_PAGE) { break; } List<AppLogLine> searchResult = logApi.fetchLogs(query); List<EmailLogEntry> filteredLogs = filterLogsForEmailLogPage(searchResult, data); emailLogs.addAll(filteredLogs); totalLogsSearched += searchResult.size(); query.moveTimePeriodBackward(SEARCH_TIME_INCREMENT); } Long nextEndTimeToSearch = query.getEndTime(); String status = "&nbsp;&nbsp;Total Logs gone through in last search: " + totalLogsSearched + "<br>" + "<button class=\"btn-link\" id=\"button_older\" onclick=\"submitFormAjax('" + nextEndTimeToSearch + "');\">Search More</button>"; data.setStatusForAjax(status); statusToUser.add(new StatusMessage(status, StatusMessageColor.INFO)); return emailLogs; }
Source:
<code>public void fallsBack() throws IOException { final String err = "message"; <START> final String format = "something went wrong: %s"; <END> MatcherAssert.assertThat( new RsPrint( new TkFallback( new Take() { @Override public Response act() { throw new UnsupportedOperationException(err); } }, new Fallback() { @Override public Take take(final RqFallback req) { return new TkText( String.format( format, req.throwable().getMessage() ) ); } }, new RqFake("GET") ).act() ).printBody(), Matchers.equalTo(String.format(format, err)) ); }</code><technical_language>format is a noise, simple message assertion</technical_language>

Target:
public void fallsBack() throws IOException { final String err = "message"; MatcherAssert.assertThat( new RsPrint( new TkFallback( new Take() { @Override public Response act() throws IOException { throw new IOException(err); } }, new Fallback() { @Override public Take take(final RqFallback req) { return new TkText( req.throwable().getMessage() ); } }, new RqFake("GET") ).act() ).printBody(), Matchers.equalTo(err) ); }
Source:
<code>default String toOneLineString() { StringBuilder st = new StringBuilder(256); st.append("Model[").append(getModelName()).append("], "); st.append(String.format("%d Solutions, ", getSolutionCount())); if (hasObjective()) { st.append(getBoundsManager()).append(", "); } <START> st.append(String.format("Resolution time %.3fs, Time to first/best solution %.3fs, %d Nodes (%,.1f n/s), %d Backtracks, %d Backjumps, %d Fails, %d Restarts", <END> getTimeCount(), getTimeToBestSolution(), getNodeCount(), getNodeCount() / getTimeCount(), getBackTrackCount(), getBackjumpCount(), getFailCount(), getRestartCount())); return st.toString(); }</code><technical_language>Now, I it, I why, in satisfaction, time of solution is recorded. simply ignore this in sat</technical_language>

Target:
default String toOneLineString() { StringBuilder st = new StringBuilder(256); st.append("Model[").append(getModelName()).append("], "); st.append(String.format("%d Solutions, ", getSolutionCount())); if (hasObjective()) { st.append(getBoundsManager()).append(", "); } st.append( String.format( "Resolution time %.3fs, " + (hasObjective() ? String.format("Time to best solution %.3fs, ", getTimeToBestSolution()) : "") + "%d Nodes (%,.1f n/s), %d Backtracks, %d Backjumps, %d Fails, %d Restarts", getTimeCount(), getNodeCount(), getNodeCount() / getTimeCount(), getBackTrackCount(), getBackjumpCount(), getFailCount(), getRestartCount() ) ); return st.toString(); }
Source:
<code>public void testNegativeEndCoordinateInRenormalization() throws IllegalArgumentException { exception.expect(IllegalArgumentException.class); <START> exception.expectMessage(CoreMatchers.equalTo("Variant end coordinate cannot be negative")); <END> Variant variant = new Variant("1", 1, 1, "C", "T"); variant.renormalize(1, -1, "A", "T"); }</code><technical_language>@jmmut checks variant object constructed? I remember some weird situation code executed checks</technical_language>

Target:
public void testNegativeEndCoordinateInRenormalization() throws IllegalArgumentException { Variant variant = new Variant("1", 1, 1, "C", "T"); exception.expect(IllegalArgumentException.class); exception.expectMessage(CoreMatchers.equalTo(AbstractVariant.VARIANT_END_COORDINATE_CANNOT_BE_NEGATIVE)); variant.renormalize(1, -1, "A", "T"); }
Source:
<code>public Object compute(final Map<String, Object> combinedAggregators) { final ArrayOfDoublesSketch sketch = (ArrayOfDoublesSketch) getField().compute(combinedAggregators); final UpdateDoublesSketch qs = UpdateDoublesSketch.builder().setK(k).build(); final ArrayOfDoublesSketchIterator it = sketch.iterator(); while (it.next()) { <START> qs.update(it.getValues()[column - 1]); <END> } return qs; }</code><technical_language>1</technical_language>

Target:
public DoublesSketch compute(final Map<String, Object> combinedAggregators) { final ArrayOfDoublesSketch sketch = (ArrayOfDoublesSketch) getField().compute(combinedAggregators); final UpdateDoublesSketch qs = UpdateDoublesSketch.builder().setK(k).build(); final ArrayOfDoublesSketchIterator it = sketch.iterator(); while (it.next()) { qs.update(it.getValues()[column - 1]); } return qs; }
Source:
<code>public static Optional<InsightCard> getInsights(final Long accountId) { <START> final String categoryName = "Goal Go Outside"; <END> return Optional.of(new InsightCard(accountId, GoalMsgEN.GOAL_GO_OUTSIDE_MARKETING_TITLE, GoalMsgEN.GOAL_GO_OUTSIDE_MARKETING_MSG, InsightCard.Category.GOAL_GO_OUTSIDE, InsightCard.TimePeriod.NONE, DateTime.now(DateTimeZone.UTC), categoryName, InsightCard.InsightType.BASIC)); }</code><technical_language>this here. text in place please</technical_language>

Target:
public static Optional<InsightCard> getInsights(final Long accountId) { return Optional.of(new InsightCard(accountId, GoalMsgEN.GOAL_GO_OUTSIDE_TITLE, GoalMsgEN.GOAL_GO_OUTSIDE_MSG, InsightCard.Category.GOAL_GO_OUTSIDE, InsightCard.TimePeriod.NONE, DateTime.now(DateTimeZone.UTC), GoalMsgEN.GOAL_WEEKLONG_CATEGORY_NAME, InsightCard.InsightType.BASIC)); }
Source:
<code>public void shouldEditAnAutoGenerationOptionByAnyNumberOFArguments() throws Exception { boolean automaticGenerationEnabled = false; boolean manualEntryEnabled = false; SimpleObject autoGenerationOption = new SimpleObject(); autoGenerationOption.add("manualEntryEnabled", manualEntryEnabled); <START> autoGenerationOption.add("automaticGenerationEnabled", automaticGenerationEnabled); <END> String json = new ObjectMapper().writeValueAsString(autoGenerationOption); MockHttpServletRequest req = request(RequestMethod.POST, getURI() + "/" + getUuid()); req.setContent(json.getBytes()); handle(req); assertFalse( identifierSourceService.getAutoGenerationOption(Integer.parseInt(getUuid())).isAutomaticGenerationEnabled()); assertFalse(identifierSourceService.getAutoGenerationOption(Integer.parseInt(getUuid())).isManualEntryEnabled()); }</code><technical_language>values false, rest call</technical_language>

Target:
public void shouldEditAnAutoGenerationOptionByAnyNumberOFArguments() throws Exception { assertTrue( identifierSourceService.getAutoGenerationOption(Integer.parseInt(getUuid())).isAutomaticGenerationEnabled()); assertTrue(identifierSourceService.getAutoGenerationOption(Integer.parseInt(getUuid())).isManualEntryEnabled()); SimpleObject autoGenerationOption = new SimpleObject(); autoGenerationOption.add("manualEntryEnabled", false); autoGenerationOption.add("automaticGenerationEnabled", false); String json = new ObjectMapper().writeValueAsString(autoGenerationOption); MockHttpServletRequest req = request(RequestMethod.POST, getURI() + "/" + getUuid()); req.setContent(json.getBytes()); handle(req); assertFalse( identifierSourceService.getAutoGenerationOption(Integer.parseInt(getUuid())).isAutomaticGenerationEnabled()); assertFalse(identifierSourceService.getAutoGenerationOption(Integer.parseInt(getUuid())).isManualEntryEnabled()); }
Source:
<code>public Map<Change, PatchSet> getChanges(GerritQueryHandler gerritQueryHandler) { if (changes == null) { <START> changes = new HashMap<Change, PatchSet>(); <END> try { List<JSONObject> jsonList = gerritQueryHandler.queryCurrentPatchSets("topic:{" + name + "}"); for (JSONObject json : jsonList) { if (json.has("type") && "stats".equalsIgnoreCase(json.getString("type"))) { continue; } if (json.has("currentPatchSet")) { JSONObject currentPatchSet = json.getJSONObject("currentPatchSet"); changes.put(new Change(json), new PatchSet(currentPatchSet)); } } } catch (IOException e) { logger.error("IOException occured. ", e); } catch (GerritQueryException e) { logger.error("Bad query. ", e); } } return changes; }</code><technical_language>If fails below, end empty change list in this topic "forever" able retrieve a try</technical_language>

Target:
public Map<Change, PatchSet> getChanges(GerritQueryHandler gerritQueryHandler) { if (changes == null) { Map<Change, PatchSet> temp = new HashMap<Change, PatchSet>(); try { List<JSONObject> jsonList = gerritQueryHandler.queryCurrentPatchSets("topic:{" + name + "}"); for (JSONObject json : jsonList) { if (json.has("type") && "stats".equalsIgnoreCase(json.getString("type"))) { continue; } if (json.has("currentPatchSet")) { JSONObject currentPatchSet = json.getJSONObject("currentPatchSet"); temp.put(new Change(json), new PatchSet(currentPatchSet)); } } changes = temp; } catch (IOException e) { logger.error("IOException occured. ", e); } catch (GerritQueryException e) { logger.error("Bad query. ", e); } } return changes; }
Source:
<code>public void onTick(TickEvent.ClientTickEvent event) { if(statKey.isKeyDown() && !statKeyPressed) { GuiPlayerStats.openGui(false); } else if(editKey.isKeyDown() && !editKeyPressed) { if(Minecraft.getMinecraft().currentScreen == null) ClientEditHandler.onKeyPressed(); } else if(captchaKey.isPressed()) { if(Minecraft.getMinecraft().currentScreen == null && Minecraft.getMinecraft().player.getHeldItemMainhand() != null) MinestuckChannelHandler.sendToServer(MinestuckPacket.makePacket(MinestuckPacket.Type.CAPTCHA, CaptchaDeckPacket.CAPTCHALOUGE)); } else if(Keyboard.isKeyDown(captchaKey.getKeyCode()) && !captchaKeyPressed) { if(Minecraft.getMinecraft().currentScreen instanceof GuiContainer && ((GuiContainer)Minecraft.getMinecraft().currentScreen).getSlotUnderMouse().getHasStack()) MinestuckChannelHandler.sendToServer(MinestuckPacket.makePacket(MinestuckPacket.Type.CAPTCHA, CaptchaDeckPacket.CAPTCHALOUGE_INV)); } statKeyPressed = statKey.isKeyDown(); editKeyPressed = editKey.isKeyDown(); <START> captchaKeyPressed = Keyboard.isKeyDown(captchaKey.getKeyCode()); <END> }</code><technical_language>is this function lines above</technical_language>

Target:
public void onTick(TickEvent.ClientTickEvent event) { if(statKey.isKeyDown() && !statKeyPressed) { GuiPlayerStats.openGui(false); } else if(editKey.isKeyDown() && !editKeyPressed) { if(Minecraft.getMinecraft().currentScreen == null) ClientEditHandler.onKeyPressed(); } else if(captchaKey.isPressed()) { if(Minecraft.getMinecraft().currentScreen == null && Minecraft.getMinecraft().player.getHeldItemMainhand() != null) MinestuckChannelHandler.sendToServer(MinestuckPacket.makePacket(MinestuckPacket.Type.CAPTCHA, CaptchaDeckPacket.CAPTCHALOUGE)); } else if(Keyboard.isKeyDown(captchaKey.getKeyCode()) && !captchaKeyPressed) { if (Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative && Minecraft.getMinecraft().player.openContainer instanceof GuiContainerCreative.ContainerCreative && ((GuiContainer)Minecraft.getMinecraft().currentScreen).getSlotUnderMouse() != null && ((GuiContainer)Minecraft.getMinecraft().currentScreen).getSlotUnderMouse().getHasStack()) MinestuckChannelHandler.sendToServer(MinestuckPacket.makePacket(MinestuckPacket.Type.CAPTCHA, CaptchaDeckPacket.CAPTCHALOUGE_INV, ((GuiContainer)Minecraft.getMinecraft().currentScreen).getSlotUnderMouse().getSlotIndex())); else if(Minecraft.getMinecraft().currentScreen instanceof GuiContainer && ((GuiContainer)Minecraft.getMinecraft().currentScreen).getSlotUnderMouse() != null && ((GuiContainer)Minecraft.getMinecraft().currentScreen).getSlotUnderMouse().getHasStack()) MinestuckChannelHandler.sendToServer(MinestuckPacket.makePacket(MinestuckPacket.Type.CAPTCHA, CaptchaDeckPacket.CAPTCHALOUGE_INV, ((GuiContainer)Minecraft.getMinecraft().currentScreen).getSlotUnderMouse().slotNumber)); } statKeyPressed = statKey.isKeyDown(); editKeyPressed = editKey.isKeyDown(); captchaKeyPressed = Keyboard.isKeyDown(captchaKey.getKeyCode()); }
Source:
<code>public void testValues() { assertQuery("VALUES 1, 2, 3, 4"); assertQuery("VALUES 1, 3, 2, 4 ORDER BY 1", "SELECT * FROM (VALUES 1, 3, 2, 4) ORDER BY 1"); assertQuery("VALUES (1.1, 2, 'foo'), (sin(3.3), 2+2, 'bar')"); assertQuery("VALUES (1.1, 2), (sin(3.3), 2+2) ORDER BY 1", "VALUES (sin(3.3), 2+2), (1.1, 2)"); assertQuery("VALUES (1.1, 2), (sin(3.3), 2+2) LIMIT 1", "VALUES (1.1, 2)"); assertQuery("SELECT * FROM (VALUES (1.1, 2), (sin(3.3), 2+2))"); assertQuery( "SELECT * FROM (VALUES (1.1, 2), (sin(3.3), 2+2)) x (a, b) LEFT JOIN (VALUES (1.1, 2), (1.1, 2+2)) y (a, b) USING (a)", <START> "VALUES (1.1, 2, 4), (1.1, 2, 2), (sin(3.3), 4, NULL)"); <END> assertQuery("SELECT 1.1 in (VALUES (1.1), (2.2))", "VALUES (TRUE)"); assertQuery("" + "WITH a AS (VALUES (1.1, 2), (sin(3.3), 2+2)) " + "SELECT * FROM a", "VALUES (1.1, 2), (sin(3.3), 2+2)"); assertQuery("VALUES 1, 2.2, 3, 4.4"); assertQuery("VALUES (1, 2), (3.3, 4.4)"); assertQuery("VALUES true, 1.0 in (1, 2, 3)"); }</code><technical_language>If queries covered TestJoinUsing, remove here</technical_language>

Target:
public void testValues() { assertQuery("VALUES 1, 2, 3, 4"); assertQuery("VALUES 1, 3, 2, 4 ORDER BY 1", "SELECT * FROM (VALUES 1, 3, 2, 4) ORDER BY 1"); assertQuery("VALUES (1.1, 2, 'foo'), (sin(3.3), 2+2, 'bar')"); assertQuery("VALUES (1.1, 2), (sin(3.3), 2+2) ORDER BY 1", "VALUES (sin(3.3), 2+2), (1.1, 2)"); assertQuery("VALUES (1.1, 2), (sin(3.3), 2+2) LIMIT 1", "VALUES (1.1, 2)"); assertQuery("SELECT * FROM (VALUES (1.1, 2), (sin(3.3), 2+2))"); assertQuery("SELECT 1.1 in (VALUES (1.1), (2.2))", "VALUES (TRUE)"); assertQuery("" + "WITH a AS (VALUES (1.1, 2), (sin(3.3), 2+2)) " + "SELECT * FROM a", "VALUES (1.1, 2), (sin(3.3), 2+2)"); assertQuery("VALUES 1, 2.2, 3, 4.4"); assertQuery("VALUES (1, 2), (3.3, 4.4)"); assertQuery("VALUES true, 1.0 in (1, 2, 3)"); }
Source:
<code>protected void initializeImageSizeAndRegion() { sizes = sortedSizes().sortedCopy(api.getSizesApi().list()); regions = api.getRegionApi().list(); images = newArrayList(filter(api.getImageApi().list(), new Predicate<Image>() { @Override public boolean apply(Image input) { return input.isPublicImage(); } })); assertTrue(sizes.size() > 1, "There must be at least two sizes"); assertTrue(regions.size() > 1, "There must be at least two regions"); <START> assertTrue(images.size() > 0, "Image list should not be empty"); <END> defaultSize = sizes.get(0); defaultRegion = regions.get(0); defaultImage = images.get(0); }</code><technical_language>!images.isEmpty()</technical_language>

Target:
protected void initializeImageSizeAndRegion() { sizes = sortedSizes().sortedCopy(api.getSizesApi().list()); regions = api.getRegionApi().list(); images = newArrayList(filter(api.getImageApi().list(), new Predicate<Image>() { @Override public boolean apply(Image input) { return input.isPublicImage(); } })); assertTrue(sizes.size() > 1, "There must be at least two sizes"); assertTrue(regions.size() > 1, "There must be at least two regions"); assertFalse(images.isEmpty(), "Image list should not be empty"); defaultSize = sizes.get(0); defaultRegion = regions.get(0); defaultImage = images.get(0); }
Source:
<code>public void processBindingConfiguration(String context, Item item, String bindingConfig) throws BindingConfigParseException { super.processBindingConfiguration(context, item, bindingConfig); String[] configParts = bindingConfig.split(";"); String type = ""; List<String> params = new ArrayList<String>(); for (int i = 0; i < configParts.length; i++) { String paramName = configParts[i].split("=")[0].toLowerCase(); if (paramName.equals("type")) { type = configParts[i].split("=")[1]; } else { params.add(configParts[i]); } } <START> if (type.equals("")) { <END> throw new BindingConfigParseException("'type' is missing in configuration!"); } IntertechnoAddressParser parser = AddressParserFactory.getParser(type); parser.parseConfig(params); String commandOn = parser.getCommandON(); String commandOff = parser.getCommandOFF(); IntertechnoBindingConfig config = new IntertechnoBindingConfig(commandOn, commandOff); addBindingConfig(item, config); }</code><technical_language>StringUtils.isBlank() here</technical_language>

Target:
public void processBindingConfiguration(String context, Item item, String bindingConfig) throws BindingConfigParseException { super.processBindingConfiguration(context, item, bindingConfig); String[] configParts = bindingConfig.split(";"); String type = ""; List<String> params = new ArrayList<String>(); for (int i = 0; i < configParts.length; i++) { String paramName = configParts[i].split("=")[0].toLowerCase(); if (paramName.equals("type")) { type = configParts[i].split("=")[1]; } else { params.add(configParts[i]); } } if (StringUtils.isBlank(type)) { throw new BindingConfigParseException("'type' is missing in configuration!"); } IntertechnoAddressParser parser = AddressParserFactory.getParser(type); parser.parseConfig(params); String commandOn = parser.getCommandON(); String commandOff = parser.getCommandOFF(); IntertechnoBindingConfig config = new IntertechnoBindingConfig(commandOn, commandOff); addBindingConfig(item, config); }
Source:
<code>public boolean isSameType(IType type) { if (type == this) return true; if (type instanceof ITypedef || type instanceof IIndexBinding) return type.isSameType(this); <START> if ( fDeferredInstance != null && type instanceof ICPPDeferredClassInstance) { <END> return type.isSameType(fDeferredInstance); } return false; }</code><technical_language>Extraneous space (</technical_language>

Target:
public boolean isSameType(IType type) { if (type == this) return true; if (type instanceof ITypedef || type instanceof IIndexBinding) return type.isSameType(this); return false; }
Source:
<code>protected void testAccessControl() throws Exception { <START> dataBundle = getTypicalDataBundle(); <END> String[] submissionParams = new String[]{}; verifyOnlyAdminsCanAccess(submissionParams); }</code><technical_language>Do update places typicalBundle, instead of again</technical_language>

Target:
protected void testAccessControl() throws Exception { String[] submissionParams = new String[]{}; verifyOnlyAdminsCanAccess(submissionParams); }
Source:
<code>protected boolean putFileToImpl(String fileName, String serviceUrl) { boolean result; resetResponse(); String url = getUrl(serviceUrl); String filePath = getFilePathFromWikiUrl(fileName); File file = new File(filePath); if (!file.exists()) { throw new StopTestException(false, "File " + filePath + " not found."); } try { response.setRequest(fileName); <START> storeLastCall("PUT_FILE", serviceUrl); <END> getEnvironment().doHttpFilePut(url, response, headerValues, file); } catch (Throwable t) { throw new StopTestException("Unable to get response from PUT to: " + url, t); } result = postProcessResponse(); return result; }</code><technical_language>Please update repeatLastCall() support PUT_FILE</technical_language>

Target:
protected boolean putFileToImpl(String fileName, String serviceUrl) { return sendFileImpl(fileName, serviceUrl, "PUT"); }
Source:
<code>public boolean add(final Task task) { giant.lock(); try { Preconditions.checkState(active, "Queue is not active!"); <START> taskStorage.insert(task, TaskStatus.running(task.getId())); <END> queue.add(task); workMayBeAvailable.signalAll(); return true; } finally { giant.unlock(); } }</code><technical_language>Do need a new exception type? If try/catch blocks isolate cases, yes</technical_language>

Target:
public boolean add(final Task task) { giant.lock(); try { Preconditions.checkState(active, "Queue is not active!"); try { taskStorage.insert(task, TaskStatus.running(task.getId())); } catch(TaskExistsException e) { log.warn("Attempt to add task twice: %s", task.getId()); throw Throwables.propagate(e); } queue.add(task); workMayBeAvailable.signalAll(); tryLock(task); return true; } finally { giant.unlock(); } }
Source:
<code>public static String getHostName() throws IOException { Process p = Runtime.getRuntime().exec("hostname"); BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream())); String result = reader.readLine(); try { int exitCode = p.waitFor(); if (exitCode != 0) { throw new IOException("Non-zero return from hostname process: " + result); } } catch (InterruptedException e) { throw new IOException(e); } finally { <START> reader.close(); <END> } return result; }</code><technical_language>Is reader AutoCloseable</technical_language>

Target:
public static String getHostName() throws IOException { Process p = Runtime.getRuntime().exec("hostname"); try (BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()))) { String result = reader.readLine(); int exitCode = p.waitFor(); if (exitCode != 0) { throw new IOException("Non-zero return from hostname process: " + result); } return result; } catch (InterruptedException e) { throw new IOException(e); } }
Source:
<code>private static void execute(String command) { try { LOGGER.info("Executing command: " + command); Process process = Runtime.getRuntime().exec(command); int exitStatus = process.waitFor(); if (exitStatus != 0) { throw new RuntimeException(String.format("Command '%s' exited with no zero status '%d'", command, exitStatus)); } } catch (InterruptedException | IOException e) { throw new RuntimeException(e); } <START> } <END></code><technical_language>I need read stdout stderr of command here. exit</technical_language>

Target:
private static void execute(String command) { try { LOGGER.info("Executing command: " + command); File devNull = new File("/dev/null"); int exitStatus = new ProcessBuilder(Splitter.on(" ").splitToList(command)) .redirectError(devNull) .redirectOutput(devNull) .redirectInput(devNull) .start() .waitFor(); if (exitStatus != 0) { throw new RuntimeException(String.format("Command '%s' exited with no zero status '%d'", command, exitStatus)); } } catch (InterruptedException | IOException e) { throw new RuntimeException(e); } }
Source:
<code>public void addCompleter(CommandLineCompleter completer) { completions.add((Completion) (CompleteOperation co) -> { List<String> candidates = new ArrayList<>(); <START> CliLogger.ROOT_LOGGER.completingBuffer(co.getBuffer()); <END> int offset = completer.complete(cmdCtx, co.getBuffer(), co.getCursor(), candidates); co.setOffset(offset); co.addCompletionCandidates(candidates); String buffer = cmdCtx.getArgumentsString() == null ? co.getBuffer() : cmdCtx.getArgumentsString() + co.getBuffer(); if (co.getCompletionCandidates().size() == 1 && co.getCompletionCandidates().get(0). getCharacters().startsWith(buffer)) { co.doAppendSeparator(true); } else { co.doAppendSeparator(false); } CliLogger.ROOT_LOGGER.completitionCandidates(co.getCompletionCandidates()); }); }</code><technical_language>This check if trace is enabled. guessing co.getBuffer() expensive</technical_language>

Target:
public void addCompleter(CommandLineCompleter completer) { completions.add((Completion) (CompleteOperation co) -> { List<String> candidates = new ArrayList<>(); if (CliLogger.ROOT_LOGGER.isTraceEnabled()) { CliLogger.ROOT_LOGGER.tracef("Completing %s", co.getBuffer()); } int offset = completer.complete(cmdCtx, co.getBuffer(), co.getCursor(), candidates); co.setOffset(offset); co.addCompletionCandidates(candidates); String buffer = cmdCtx.getArgumentsString() == null ? co.getBuffer() : cmdCtx.getArgumentsString() + co.getBuffer(); if (co.getCompletionCandidates().size() == 1 && co.getCompletionCandidates().get(0). getCharacters().startsWith(buffer)) { co.doAppendSeparator(true); } else { co.doAppendSeparator(false); } if (CliLogger.ROOT_LOGGER.isTraceEnabled()) { CliLogger.ROOT_LOGGER.tracef("Completion candidates %s", co.getCompletionCandidates()); } }); }
Source:
<code>protected BoxFolder getCurrentFolder() { Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.box_browsesdk_fragment_container); <START> BoxFolder curFolder = fragment instanceof BoxBrowseFolderFragment ? <END> ((BoxBrowseFolderFragment) fragment).getFolder() : (BoxFolder) mItem; JsonObject jsonObject = curFolder.toJsonObject(); JsonValue obj = jsonObject.get(BoxFolder.FIELD_ITEM_COLLECTION); if (obj != null && !obj.isNull()) { obj.asObject().set(BoxIterator.FIELD_ENTRIES, new JsonArray()); } return new BoxFolder(jsonObject); }</code><technical_language>Create new folder if serialize it. folder items</technical_language>

Target:
protected BoxFolder getCurrentFolder() { Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.box_browsesdk_fragment_container); BoxFolder curFolder = fragment instanceof BoxBrowseFolderFragment ? ((BoxBrowseFolderFragment) fragment).getFolder() : null; return curFolder; }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_compress_image); initView(); Button size=(Button)findViewById(R.id.size); Button dimension=(Button)findViewById(R.id.bypixel); ImageButton cancel=(ImageButton)findViewById(R.id.edit_cancel); size.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { compressbysize(); } }); <START> dimension.setOnClickListener(new View.OnClickListener() { <END> @Override public void onClick(View v) { compressbydim(); } }); cancel.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { finish(); } }); }</code><technical_language>Camel case</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_compress_image); initView(); Button size=(Button)findViewById(R.id.size); Button dimension=(Button)findViewById(R.id.bypixel); ImageButton cancel=(ImageButton)findViewById(R.id.edit_cancel); size.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { compressSize(); } }); dimension.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { compressDim(); } }); cancel.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { finish(); } }); }
Source:
<code>public static String getExpandedUrl(String url) { <START> EnvVars globalConfiguredEnvVars = Jenkins.getInstance().getGlobalNodeProperties().get(EnvironmentVariablesNodeProperty.class).getEnvVars(); <END> return globalConfiguredEnvVars.expand(url); }</code><technical_language>throw NPE if undefined</technical_language>

Target:
public static String getExpandedUrl(String url) { EnvironmentVariablesNodeProperty evnp = Jenkins.getInstance().getGlobalNodeProperties().get(EnvironmentVariablesNodeProperty.class); if(evnp == null){ return url; } EnvVars globalConfiguredEnvVars = evnp.getEnvVars(); return globalConfiguredEnvVars.expand(url); }
Source:
<code>public static void main(String[] args) { TextAnalyticsAsyncClient client = new TextAnalyticsClientBuilder() .credential(new AzureKeyCredential("{key}")) .endpoint("{endpoint}") .buildAsyncClient(); String document = "Satya Nadella is the CEO of Microsoft"; client.recognizeEntities(document).subscribe( <START> entityCollection -> entityCollection.forEach(entity -> System.out.printf( <END> "Recognized categorized entity: %s, entity category: %s, entity subcategory: %s, score: %f.%n", entity.getText(), entity.getCategory(), entity.getSubcategory(), entity.getConfidenceScore())), error -> System.err.println("There was an error recognizing entities of the text." + error), () -> System.out.println("Entities recognized.") ); try { TimeUnit.SECONDS.sleep(5); } catch (InterruptedException ignored) { } }</code><technical_language>u understand need do a foreach entity, do do a foreach entityCollection</technical_language>

Target:
public static void main(String[] args) { TextAnalyticsAsyncClient client = new TextAnalyticsClientBuilder() .credential(new AzureKeyCredential("{key}")) .endpoint("{endpoint}") .buildAsyncClient(); String document = "Satya Nadella is the CEO of Microsoft"; client.recognizeEntities(document).subscribe( entityCollection -> entityCollection.forEach(entity -> System.out.printf( "Recognized categorized entity: %s, entity category: %s, entity subcategory: %s," + " confidence score: %f.%n", entity.getText(), entity.getCategory(), entity.getSubcategory(), entity.getConfidenceScore())), error -> System.err.println("There was an error recognizing entities of the text." + error), () -> System.out.println("Entities recognized.") ); try { TimeUnit.SECONDS.sleep(5); } catch (InterruptedException ignored) { } }
Source:
<code>private void createSelectionGroup() { Composite group = new Composite(fDialogComposite, SWT.BORDER); group.setLayout(new GridLayout(2, true)); group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fLocalButton = new Button(group, SWT.RADIO); fLocalButton.setText(Messages.TraceControl_LocalButtonText); fLocalButton.setLayoutData(new GridData(GridData.FILL_BOTH)); fLocalButton.setSelection(true); fRemoteButton = new Button(group, SWT.RADIO); fRemoteButton.setText(Messages.TraceControl_RemoteButtonText); fRemoteButton.setLayoutData(new GridData(GridData.FILL_BOTH)); <START> <END> fLocalButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { if (fLocalButton.getSelection()) { disposeRemoteComposite(); createLocalComposite(); fRemoteFiles = null; fDialogComposite.layout(); } } }); fRemoteButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { if (fRemoteButton.getSelection()) { disposeLocalComposite(); createRemoteComposite(); fLocalFiles = null; fDialogComposite.layout(); } } }); }</code><technical_language>extra blank line</technical_language>

Target:
private void createSelectionGroup() { Composite group = new Composite(fDialogComposite, SWT.BORDER); group.setLayout(new GridLayout(2, true)); group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fLocalButton = new Button(group, SWT.RADIO); fLocalButton.setText(Messages.TraceControl_LocalButtonText); fLocalButton.setLayoutData(new GridData(GridData.FILL_BOTH)); fLocalButton.setSelection(true); fRemoteButton = new Button(group, SWT.RADIO); fRemoteButton.setText(Messages.TraceControl_RemoteButtonText); fRemoteButton.setLayoutData(new GridData(GridData.FILL_BOTH)); fLocalButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { if (fLocalButton.getSelection()) { disposeRemoteComposite(); createLocalComposite(); fRemoteFiles = null; fDialogComposite.layout(); enableLocalButtons(); } } }); fRemoteButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { if (fRemoteButton.getSelection()) { disposeLocalComposite(); createRemoteComposite(); fLocalFiles = null; fDialogComposite.layout(); enableRemoteButtons(); } } }); }
Source:
<code>public void testUnmarshallSubprocessLevelEventEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_START_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); StartSignalEvent emptySubprocess = getStartNodeById(diagram, EMPTY_SUBPROCESS_LEVEL_EVENT_ID, StartSignalEvent.class); assertGeneralSet(emptySubprocess.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); <START> assertSignalEventExecutionSet(emptySubprocess.getExecutionSet(), EMPTY_VALUE, NON_INTERRUPTING, ""); <END> assertDataIOSet(emptySubprocess.getDataIOSet(), EMPTY_VALUE); }</code><technical_language>suggestion assertSignalEventExecutionSet(emptySubprocess.getExecutionSet(), EMPTY_VALUE, NON_INTERRUPTING, EMPTY_VALUE);</technical_language>

Target:
public void testUnmarshallSubprocessLevelEventEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_START_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); StartSignalEvent emptySubprocess = getStartNodeById(diagram, EMPTY_SUBPROCESS_LEVEL_EVENT_ID, StartSignalEvent.class); assertGeneralSet(emptySubprocess.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertSignalEventExecutionSet(emptySubprocess.getExecutionSet(), EMPTY_VALUE, NON_INTERRUPTING, EMPTY_VALUE); assertDataIOSet(emptySubprocess.getDataIOSet(), EMPTY_VALUE); }
Source:
<code>public void find(String token, List<SearchItem> result) { boolean caseInsensitive = UserSearchProperty.isCaseInsensitive(); for (SearchItem i : items){ String name = i.getSearchName(); if(caseInsensitive){ token=token.toLowerCase(); name=name.toLowerCase(); } <START> if(token.equals(name)) <END> result.add(i); } }</code><technical_language>deserves a separate JIRA ticket if is important enough</technical_language>

Target:
public void find(String token, List<SearchItem> result) { boolean caseInsensitive = UserSearchProperty.isCaseInsensitive(); for (SearchItem i : items) { String name = i.getSearchName(); if (name.equals(token) || (caseInsensitive && name.equalsIgnoreCase(token))) { result.add(i); } } }
Source:
<code>public double valuationCompositionFactor() { LocalDate currentFixing = nextFixing; LocalDate currentPublication = index.calculatePublicationFromFixing(currentFixing); if (env.getValuationDate().equals(currentPublication)) { OptionalDouble fixedRate = indexFixingDateSeries.get(currentFixing); if (fixedRate.isPresent()) { nextFixing = fixingCalendar.next(nextFixing); LocalDate effectiveDate = index.calculateEffectiveFromFixing(currentFixing); LocalDate maturityDate = index.calculateMaturityFromEffective(effectiveDate); double accrualFactor = index.getDayCount().yearFraction(effectiveDate, maturityDate); if (currentFixing.isBefore(lastFixingNonCutoff)) { return 1.0d + accrualFactor * fixedRate.getAsDouble(); } if (currentFixing.equals(lastFixingNonCutoff)) { double compositionFactor = 1.0d + accrualFactor * fixedRate.getAsDouble(); for (int i = 0; i < cutoffOffset - 1; i++) { compositionFactor *= 1.0d + accrualFactorCutoff[i] * fixedRate.getAsDouble(); } return compositionFactor; } } <START> else { <END> return 1.0d; } } return 1.0d; }</code><technical_language>Remove else - hit final return instead</technical_language>

Target:
private double valuationCompositionFactor() { LocalDate currentFixing = nextFixing; LocalDate currentPublication = index.calculatePublicationFromFixing(currentFixing); if (env.getValuationDate().equals(currentPublication) && !(currentFixing.isAfter(lastFixingNonCutoff))) { OptionalDouble fixedRate = indexFixingDateSeries.get(currentFixing); if (fixedRate.isPresent()) { nextFixing = fixingCalendar.next(nextFixing); LocalDate effectiveDate = index.calculateEffectiveFromFixing(currentFixing); LocalDate maturityDate = index.calculateMaturityFromEffective(effectiveDate); double accrualFactor = index.getDayCount().yearFraction(effectiveDate, maturityDate); if (currentFixing.isBefore(lastFixingNonCutoff)) { return 1.0d + accrualFactor * fixedRate.getAsDouble(); } double compositionFactor = 1.0d + accrualFactor * fixedRate.getAsDouble(); for (int i = 0; i < cutoffOffset - 1; i++) { compositionFactor *= 1.0d + accrualFactorCutoff[i] * fixedRate.getAsDouble(); } return compositionFactor; } } return 1.0d; }
Source:
<code>public static String truncateWithoutWordSplit(String source, int length) { if (source.length() <= length) { return source; } BreakIterator atWordInstance = BreakIterator.getWordInstance(); atWordInstance.setText(source); <START> return source.substring(0, atWordInstance.preceding(length)).trim(); <END> }</code><technical_language>wondering: if a long string white characters truncated some point? I preserving word boundaries is kind of orthogonal simple cut position if predefined threshold applying BreakIterator (either X percent of X positions) change truncation logic a simple do cut threshold index worrying preserving word boundaries. This guarantee introduce outlier significant impact processing performance stages</technical_language>

Target:
public static String truncateWithoutWordSplit(String source, int length) { if (source.length() <= length) { return source; } BreakIterator atWordInstance = BreakIterator.getWordInstance(); atWordInstance.setText(source); return source.substring(0, atWordInstance.following(length)).trim(); }
Source:
<code>public String process(String query) { _logger.info("Processing query: {}", query); try { URI uri = new URI(query); String path = getPath(query, _logger); if (path != null && path.equalsIgnoreCase(DiagnosticsRequestType.DATASTREAM_STATE.toString())) { String response = processDatastreamStateRequest(uri); _logger.trace("Query: returns response: {}", query, response); return response; } else if (path != null && path.equalsIgnoreCase(DiagnosticsRequestType.POSITION.toString())) { final Map<PositionKey, PositionValue> positionData = PositionDataStore.getInstance() .getOrDefault(_connectorName, new ConcurrentHashMap<>()); final String response = JsonUtils.toJson(positionData); _logger.trace("Query: returns response: {}", query, response); return response; } else { _logger.warn("Could not process query with path {}", query, path); } } catch (Exception e) { <START> _logger.warn("Failed to process query {}", query); <END> _logger.debug("Failed to process query {}", query, e); } return null; }</code><technical_language>want propagate user</technical_language>

Target:
public String process(String query) { _logger.info("Processing query: {}", query); try { URI uri = new URI(query); String path = getPath(query, _logger); if (path != null && path.equalsIgnoreCase(DiagnosticsRequestType.DATASTREAM_STATE.toString())) { String response = processDatastreamStateRequest(uri); _logger.trace("Query: returns response: {}", query, response); return response; } else if (path != null && path.equalsIgnoreCase(DiagnosticsRequestType.POSITION.toString())) { final String response = processPositionRequest(); _logger.trace("Query: returns response: {}", query, response); return response; } else { _logger.warn("Could not process query with path {}", query, path); } } catch (Exception e) { _logger.warn("Failed to process query {}", query); _logger.debug("Failed to process query {}", query, e); throw new DatastreamRuntimeException(e); } return null; }
Source:
<code>private static String remoteUrl(final Context context) { String customURL = context.get(Download.INSTANCE); if(customURL != null && !customURL.isEmpty()) { <START> return context.get(Download.INSTANCE); <END> } else { return DEFAULT_REMOTE_URL; } }</code><technical_language>try sticking current style add final return</technical_language>

Target:
private static String remoteUrl(final Context context) { final String customURL = context.get(Download.INSTANCE); if(customURL != null && !customURL.isEmpty()) { return customURL; } else { return DEFAULT_REMOTE_URL; } }
Source:
<code>public static void create(TaggedMetricRegistry taggedMetricRegistry, Supplier<String> versionSupplier, String serviceName) { UUID nodeId = UUID.randomUUID(); ScheduledExecutorService scheduledExecutorService = <START> Executors.newScheduledThreadPool(5); <END> scheduledExecutorService.scheduleWithFixedDelay((Runnable) () -> { ConjureTimelockServiceBlockingMetrics conjureTimelockServiceBlockingMetrics = ConjureTimelockServiceBlockingMetrics.of(taggedMetricRegistry); ImmutableMap.of( "perc99", conjureTimelockServiceBlockingMetrics.startTransactions().getSnapshot().get99thPercentile(), "Rate", conjureTimelockServiceBlockingMetrics.startTransactions().getOneMinuteRate(), "atlasVersion", versionSupplier.get(), "nodeId", nodeId, "serviceName", serviceName); }, 30, 30, TimeUnit.SECONDS); }</code><technical_language>This is broadly correct, some notes: - Do need 5 threads? I a PtExecutors.singleThreadScheduledExecutor() enough - in fact I more 1 thread - Background threads names indicating do - noted need shut TM closes. background task needs closeable</technical_language>

Target:
public static TimeLockFeedbackBackgroundTask create(TaggedMetricRegistry taggedMetricRegistry, Supplier<String> versionSupplier, String serviceName) { TimeLockFeedbackBackgroundTask task = new TimeLockFeedbackBackgroundTask(taggedMetricRegistry, versionSupplier, serviceName); task.scheduleWithFixedDelay(); return task; }
Source:
<code>public Metadata getMetadata(UIContext context) { return Metadata.from(super.getMetadata(context), getClass()) .name("Constraint: New Annotation") .description("Create a Bean Validation constraint annotation") <START> .category(super.getMetadata(context).getCategory()); <END> }</code><technical_language>remove this line. Metadata.from reuses category super.getMetadata</technical_language>

Target:
public Metadata getMetadata(UIContext context) { return Metadata.from(super.getMetadata(context), getClass()) .name("Constraint: New Annotation") .description("Create a Bean Validation constraint annotation"); }
Source:
<code>private void setComposite(Composite parent) { container = new Composite(parent, SWT.NONE); Label lblSelectPattern = new Label(container, SWT.NONE); lblSelectPattern.setBounds(10, 20, 76, 15); lblSelectPattern.setText("Select Pattern"); combo = new Combo(container, SWT.READ_ONLY); combo.setBounds(88, 17, 199, 23); addPatternToCombo(combo); combo.addListener(SWT.Selection, new Listener() { @Override public void handleEvent(Event event) { setPageComplete(getComboSelect()); canvas = new Canvas(container, SWT.NONE); canvas.setBounds(240, 130, 200, 160); ImageDescriptor image = AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.sirius.editor.diagram", comboSelection.getImagePath()); Image img = new Image(container.getDisplay(), image.getImageData()); canvas.setBackgroundImage(img); lblParagra = new Label(container, SWT.WRAP); <START> lblParagra.setBounds(10, 132, 220, 170); <END> lblParagra.setText(comboSelection.getDescription()); ((ClassDiagramPatternConfigurationPage) getNextPage()).setSelectedPattern(getComboSelection()); getContainer().updateButtons(); } }); lblDescription = new Label(container, SWT.NONE); lblDescription.setBounds(10, 90, 76, 15); lblDescription.setText("Description:"); }</code><technical_language>bounds adapt controls of wizard page, try some layout data elements. For exemple control.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); for examples in Sirius code base (property section, wizard, dialogs)</technical_language>

Target:
private void setComposite(Composite parent) { container = new Composite(parent, SWT.NONE); container.setLayout(new GridLayout()); container.setLayoutData(new GridData(GridData.FILL_VERTICAL)); Label lblSelectPattern = new Label(container, SWT.NONE); lblSelectPattern.setBounds(10, 20, 76, 15); lblSelectPattern.setText("Select Pattern"); combo = new Combo(container, SWT.READ_ONLY); combo.setBounds(88, 17, 199, 23); addPatternToCombo(combo); combo.addListener(SWT.Selection, new Listener() { @Override public void handleEvent(Event event) { setPageComplete(getComboSelect()); canvas = new Canvas(container, SWT.NONE); canvas.setBounds(240, 130, 200, 160); ImageDescriptor image = AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.sirius.editor.diagram", comboSelection.getImagePath()); Image img = new Image(container.getDisplay(), image.getImageData()); canvas.setBackgroundImage(img); lblParagra = new Label(container, SWT.WRAP); lblParagra.setBounds(10, 132, 220, 170); lblParagra.setText(comboSelection.getDescription()); if (getComboSelection() instanceof ClassDiagramPattern) ((ClassDiagramPatternConfigurationPage) getNextPage()).setSelectedPattern((ClassDiagramPattern) getComboSelection()); getContainer().updateButtons(); } }); lblDescription = new Label(container, SWT.NONE); lblDescription.setBounds(10, 90, 76, 15); lblDescription.setText("Description:"); }