auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void importMrrtReportTemplate(InputStream in) throws IOException { <START> File tmp = File.createTempFile("mrrtTemplateFile", ".html"); <END> OpenmrsUtil.copyFile(in, new FileOutputStream(tmp)); MrrtReportTemplate template = parser.parse(new FileInputStream(tmp)); File destinationFile = new File(radiologyProperties.getReportTemplateHome(), java.util.UUID.randomUUID() .toString()); template.setPath(destinationFile.getAbsolutePath()); saveMrrtReportTemplate(template); OpenmrsUtil.copyFile(new FileInputStream(tmp), new FileOutputStream(destinationFile)); in.close(); }</code><technical_language>@ivange94 random UUID</technical_language>

Target:
public void importMrrtReportTemplate(InputStream in) throws IOException { File tmp = File.createTempFile(java.util.UUID.randomUUID() .toString(), java.util.UUID.randomUUID() .toString()); OpenmrsUtil.copyFile(in, new FileOutputStream(tmp)); MrrtReportTemplate template = parser.parse(new FileInputStream(tmp)); File destinationFile = new File(radiologyProperties.getReportTemplateHome(), java.util.UUID.randomUUID() .toString()); template.setPath(destinationFile.getAbsolutePath()); saveMrrtReportTemplate(template); OpenmrsUtil.copyFile(new FileInputStream(tmp), new FileOutputStream(destinationFile)); in.close(); }
Source:
<code>protected Map<Event, Position> analyzePosition(Position position) { Object alarms = position.getAttributes().get(Position.KEY_ALARM); Map<Event, Position> eventMap = new LinkedHashMap<>(); if (alarms != null) { <START> String[] alarmList = alarms.toString().split(","); <END> for (String alarm : alarmList) { Event event = new Event(Event.TYPE_ALARM, position.getDeviceId(), position.getId()); event.set(Position.KEY_ALARM, alarm); eventMap.put(event, position); } return eventMap; } return null; }</code><technical_language>need implement support for this web app side well</technical_language>

Target:
protected Map<Event, Position> analyzePosition(Position position) { Object alarms = position.getAttributes().get(Position.KEY_ALARM); if (alarms != null) { Map<Event, Position> eventMap = new LinkedHashMap<>(); String[] alarmList = alarms.toString().split(","); for (String alarm : alarmList) { Event event = new Event(Event.TYPE_ALARM, position.getDeviceId(), position.getId()); event.set(Position.KEY_ALARM, alarm); eventMap.put(event, position); } return eventMap; } return null; }
Source:
<code>public PropertyGroupDescriptor(List<String> group) { <START> this.group = group; <END> }</code><technical_language>safer do this.groups = Collections.unmodifiableList(group) modify actual path trough getGroup() is great for a public API</technical_language>

Target:
public PropertyGroupDescriptor(List<String> group) { this.group = Collections.unmodifiableList(group); }
Source:
<code>public void testSinglePartUnknownEncoding_throwsUnsupportedEncodingException() throws Exception { MimeMessage msg = parseWithoutRecurse(toStream( "From: <adam@example.org>\r\n" + "To: <eva@example.org>\r\n" + "Subject: Testmail\r\n" + "MIME-Version: 1.0\r\n" + "Content-type: text/plain\r\n" + "Content-Transfer-Encoding: utf-8\r\n" + "\r\n" + "dGhpcyBpcyBzb21lIG1vcmUgdGVzdCB0ZXh0Lg==\r\n")); checkAddresses(msg.getFrom(), "adam@example.org"); <START> checkAddresses(msg.getRecipients(RecipientType.TO), "eva@example.org"); <END> streamToString(MimeUtility.decodeBody(msg.getBody())); }</code><technical_language>checks unrelated actual check want perform</technical_language>

Target:
public void testSinglePartUnknownEncoding_throwsUnsupportedEncodingException() throws Exception { MimeMessage msg = parseWithoutRecurse(toStream( "From: <adam@example.org>\r\n" + "To: <eva@example.org>\r\n" + "Subject: Testmail\r\n" + "MIME-Version: 1.0\r\n" + "Content-type: text/plain\r\n" + "Content-Transfer-Encoding: utf-8\r\n" + "\r\n" + "dGhpcyBpcyBzb21lIG1vcmUgdGVzdCB0ZXh0Lg==\r\n")); MimeUtility.decodeBody(msg.getBody()); }
Source:
<code>protected Evaluated<T> executeEvaluator(DefinitionEvaluator<T> evaluator, T definition, EvaluationContext context) throws EvaluationException { <START> List<Integer> ownedIdSets = Context.getService(EvaluationService.class).persistIdSetsForContext(context); <END> try { return evaluator.evaluate(definition, context); } finally { Context.getService(EvaluationService.class).deleteIdSets(ownedIdSets); } }</code><technical_language>discussed, this problems in a multi-threaded environment. more sense a service-like - service.startUsing(IdSet) - service.stopUsing(IdSet)</technical_language>

Target:
protected Evaluated<T> executeEvaluator(DefinitionEvaluator<T> evaluator, T definition, EvaluationContext context) throws EvaluationException { List<String> ownedIdSets = Context.getService(EvaluationService.class).startUsing(context); try { return evaluator.evaluate(definition, context); } finally { for (String idSetKey : ownedIdSets) { Context.getService(EvaluationService.class).stopUsing(idSetKey); } } }
Source:
<code>public TaskData createTask(PrivilegeLevel level, Map<String, String> additionalAttributeValues) throws Exception { <START> Assert.isLegal(additionalAttributeValues.containsKey(TaskAttribute.SUMMARY) <END> && additionalAttributeValues.containsKey(TaskAttribute.DESCRIPTION), "need value for Summary and Description "); ITaskMapping initializationData = new TaskMapping() { @Override public String getProduct() { return "ManualTest"; } @Override public String getComponent() { return "ManualC1"; } }; BugzillaClient client = client(level); AbstractTaskDataHandler taskDataHandler = connector().getTaskDataHandler(); TaskAttributeMapper mapper = taskDataHandler.getAttributeMapper(repository()); TaskData taskData = new TaskData(mapper, repository().getConnectorKind(), repository().getRepositoryUrl(), ""); taskDataHandler.initializeTaskData(repository(), taskData, initializationData, null); for (String attributeKey : additionalAttributeValues.keySet()) { taskData.getRoot() .createMappedAttribute(attributeKey) .setValue(additionalAttributeValues.get(attributeKey)); } RepositoryResponse response = submitTask(taskData, client); String bugId = response.getTaskId(); return getTask(bugId, client); }</code><technical_language>separate assertions work equally fine</technical_language>

Target:
public TaskData createTask(PrivilegeLevel level, Map<String, String> additionalAttributeValues) throws Exception { Assert.isLegal(additionalAttributeValues.containsKey(TaskAttribute.SUMMARY), "need value for Summary"); Assert.isLegal(additionalAttributeValues.containsKey(TaskAttribute.DESCRIPTION), "need value for Description"); ITaskMapping initializationData = new TaskMapping() { @Override public String getProduct() { return "ManualTest"; } @Override public String getComponent() { return "ManualC1"; } }; BugzillaClient client = client(level); AbstractTaskDataHandler taskDataHandler = connector().getTaskDataHandler(); TaskAttributeMapper mapper = taskDataHandler.getAttributeMapper(repository()); TaskData taskData = new TaskData(mapper, repository().getConnectorKind(), repository().getRepositoryUrl(), ""); taskDataHandler.initializeTaskData(repository(), taskData, initializationData, null); for (String attributeKey : additionalAttributeValues.keySet()) { taskData.getRoot() .createMappedAttribute(attributeKey) .setValue(additionalAttributeValues.get(attributeKey)); } RepositoryResponse response = submitTask(taskData, client); String bugId = response.getTaskId(); return getTask(bugId, client); }
Source:
<code>public static void setShowLogs(boolean showLogs) { Log.INITIALISED = true; <START> SHOW_LOGS = showLogs; <END> }</code><technical_language>pfft dropped prefix for this above</technical_language>

Target:
public static void setShowLogs(boolean showLogs) { Log.INITIALISED = true; Log.SHOW_LOGS = showLogs; }
Source:
<code>@Override public boolean onCreateOptionsMenu(Menu menu) { mMapView.getMap().addDoneLoadingListener(() -> { mOperationalLayers = mMapView.getMap().getOperationalLayers(); for (int i = 0; i < mOperationalLayers.size(); i++) { menu.add(Menu.NONE, i, Menu.NONE, mOperationalLayers.get(i).getName()); menu.getItem(i).setCheckable(true); menu.getItem(i).setChecked(true); } <START> menu.setGroupCheckable(0, true, false); <END> }); return super.onCreateOptionsMenu(menu); }</code><technical_language>I need this line calling setCheckable(true) for layer in line 123</technical_language>

Target:
@Override public boolean onCreateOptionsMenu(Menu menu) { mMapView.getMap().addDoneLoadingListener(() -> { mOperationalLayers = mMapView.getMap().getOperationalLayers(); for (int i = 0; i < mOperationalLayers.size(); i++) { menu.add(Menu.NONE, i, Menu.NONE, mOperationalLayers.get(i).getName()); menu.getItem(i).setCheckable(true); menu.getItem(i).setChecked(true); } }); return super.onCreateOptionsMenu(menu); }
Source:
<code>public Builder closingWithStatus( Function<HttpHeaders, WebSocketCloseStatus> webSocketCloseStatusSupplier) { this.webSocketCloseStatusSupplier = Objects.requireNonNull( <START> webSocketCloseStatusSupplier, "WebSocketCloseStatusSupplier must not be null"); <END> return this; }</code><technical_language>suggestion webSocketCloseStatusSupplier, "webSocketCloseStatusSupplier null");</technical_language>

Target:
public Builder closingWithStatus( Function<HttpHeaders, WebSocketCloseStatus> webSocketCloseStatusSupplier) { this.webSocketCloseStatusSupplier = Objects.requireNonNull( webSocketCloseStatusSupplier, "webSocketCloseStatusSupplier must not be null"); return this; }
Source:
<code>public void close() throws IOException { if(channel.isOpen()) { <START> channel.force(true); <END> channel.close(); } }</code><technical_language>for case file is thrown (abort is called commit) get calling force. (that is ATF.commit call a force method a flush, force, subsequently call close)</technical_language>

Target:
public void close() throws IOException { if(channel.isOpen()) { if (forceOnClose) { channel.force(true); } channel.close(); } }
Source:
<code>public List<String> describeDatabases() { QueryResult result = execute(this.influxDBService.query(this.username, <START> this.password, "SHOW+DATABASES")); <END> List<List<Object>> databaseNames = result.getResults().get(0).getSeries().get(0).getValues(); List<String> databases = Lists.newArrayList(); if (databaseNames != null) { for (List<Object> database : databaseNames) { databases.add(database.get(0).toString()); } } return databases; }</code><technical_language>SHOW+DATABASES? strange....</technical_language>

Target:
public List<String> describeDatabases() { QueryResult result = execute(this.influxDBService.query(this.username, this.password, SHOW_DATABASE_COMMAND_ENCODED)); List<List<Object>> databaseNames = result.getResults().get(0).getSeries().get(0).getValues(); List<String> databases = Lists.newArrayList(); if (databaseNames != null) { for (List<Object> database : databaseNames) { databases.add(database.get(0).toString()); } } return databases; }
Source:
<code>protected void onUserAction(String userActionName, Interactor interactor, Object... args) { switch (userActionName) { case UPLOAD_PORTRAIT: UserPortraitUploadInteractor userPortraitInteractor = (UserPortraitUploadInteractor) getInteractor(userActionName); Uri path = (Uri) args[0]; if (userId != 0) { userPortraitInteractor.start(new UserPortraitUploadEvent(path)); } break; case LOAD_CURRENT_USER: UserPortraitLoadInteractor userPortraitLoadInteractorCurrentUser = (UserPortraitLoadInteractor) getInteractor(userActionName); long currentUserId = SessionContext.isLoggedIn() ? SessionContext.getCurrentUser().getId() : 0; userPortraitLoadInteractorCurrentUser.start(currentUserId); break; default: UserPortraitLoadInteractor userPortraitLoadInteractor = (UserPortraitLoadInteractor) getInteractor(userActionName); if (portraitId != 0 && uuid != null) { userPortraitLoadInteractor.start(male, portraitId, uuid); } userPortraitLoadInteractor.start(userId); <START> break; <END> } }</code><technical_language>if portraitId is 0 uuid is null this start interactor twice, right</technical_language>

Target:
protected void onUserAction(String userActionName, Interactor interactor, Object... args) { switch (userActionName) { case UPLOAD_PORTRAIT: UserPortraitUploadInteractor userPortraitInteractor = (UserPortraitUploadInteractor) getInteractor(userActionName); Uri path = (Uri) args[0]; if (userId != 0) { userPortraitInteractor.start(new UserPortraitUploadEvent(path)); } break; case LOAD_CURRENT_USER: UserPortraitLoadInteractor userPortraitLoadInteractorCurrentUser = (UserPortraitLoadInteractor) getInteractor(userActionName); long currentUserId = SessionContext.isLoggedIn() ? SessionContext.getCurrentUser().getId() : 0; userPortraitLoadInteractorCurrentUser.start(currentUserId); break; default: UserPortraitLoadInteractor userPortraitLoadInteractor = (UserPortraitLoadInteractor) getInteractor(userActionName); if (portraitId != 0 && uuid != null) { userPortraitLoadInteractor.start(male, portraitId, uuid); } else { userPortraitLoadInteractor.start(userId); } break; } }
Source:
<code>private static void validateUpsertConfig(TableConfig tableConfig, Schema schema) { if (tableConfig.getUpsertMode() == UpsertConfig.Mode.NONE) { return; } <START> if (schema.getPrimaryKeyColumns() == null || schema.getPrimaryKeyColumns().isEmpty()) { throw new IllegalStateException("Upsert table must have primary key columns in the schema."); } <END> if (tableConfig.getRoutingConfig() == null || !tableConfig.getRoutingConfig().getInstanceSelectorType() .equalsIgnoreCase(RoutingConfig.REPLICA_GROUP_INSTANCE_SELECTOR_TYPE)) { throw new IllegalStateException("Upsert table must use replicaGroup as the routing config."); } if (tableConfig.getIndexingConfig() != null && tableConfig.getIndexingConfig().getStreamConfigs() != null) { StreamConfig streamConfig = new StreamConfig(tableConfig.getTableName(), tableConfig.getIndexingConfig().getStreamConfigs()); if (streamConfig.getConsumerTypes().size() != 1 || streamConfig.getConsumerTypes().get(0) != StreamConfig.ConsumerType.LOWLEVEL) { throw new IllegalStateException("Upsert table must use low-level streaming consumer type."); } } if (tableConfig.getTableType() != TableType.REALTIME) { throw new IllegalStateException("Upsert table is for realtime table only."); } }</code><technical_language>suggestion Preconditions.checkState(CollectionUtils.isNotEmpty(schema.getPrimaryKeyColumns()), "Upsert table primary key columns in schema");</technical_language>

Target:
protected static void validateUpsertConfig(TableConfig tableConfig, Schema schema) { if (tableConfig.getUpsertMode() == UpsertConfig.Mode.NONE) { return; } Preconditions .checkState(tableConfig.getTableType() == TableType.REALTIME, "Upsert table is for realtime table only."); Preconditions.checkState(CollectionUtils.isNotEmpty(schema.getPrimaryKeyColumns()), "Upsert table must have primary key columns in the schema"); Preconditions.checkState( tableConfig.getIndexingConfig() != null && tableConfig.getIndexingConfig().getStreamConfigs() != null, "streamConfig must exist in the table config"); StreamConfig streamConfig = new StreamConfig(tableConfig.getTableName(), tableConfig.getIndexingConfig().getStreamConfigs()); Preconditions.checkState(streamConfig.hasLowLevelConsumerType() && !streamConfig.hasHighLevelConsumerType(), "Upsert table must use low-level streaming consumer type"); Preconditions.checkState( tableConfig.getRoutingConfig() != null && RoutingConfig.REPLICA_GROUP_INSTANCE_SELECTOR_TYPE .equalsIgnoreCase(tableConfig.getRoutingConfig().getInstanceSelectorType()), "Upsert table must use replica-group (i.e. replicaGroup) based routing"); }
Source:
<code>public long getRetryDelayMsFor( int dataType, long loadDurationMs, IOException exception, int errorCount) { <START> int retryDelay = sharedPrefs.getInt("settings_retry_delay", 100);; <END> if (!Utils.hasAnyConnection(context)) { resumeWhenNetworkConnected(); retryDelay = 1000 * sharedPrefs.getInt("settings_resume_within", 60); } if (BuildConfig.DEBUG) { Log.d(TAG, "Providing retry delay of " + retryDelay + "ms for: data type " + dataType + ", load duration: " + loadDurationMs + "ms, error count: " + errorCount + ", exception: " + exception.getClass() + ", message: " + exception.getMessage()); } return retryDelay; }</code><technical_language>I this field in seconds, ms, I wrong</technical_language>

Target:
public long getRetryDelayMsFor( int dataType, long loadDurationMs, IOException exception, int errorCount) { int retryDelay = getSanitizedRetryDelaySettingsMs(); if (exception instanceof HttpDataSource.InvalidContentTypeException) { stateListener.onPlayerError(R.string.error_play_stream); return C.TIME_UNSET; } if (!Utils.hasAnyConnection(context)) { int resumeWithinS = sharedPrefs.getInt("settings_resume_within", 60); if (resumeWithinS > 0) { resumeWhenNetworkConnected(); retryDelay = 1000 * resumeWithinS + retryDelay; } } if (BuildConfig.DEBUG) { Log.d(TAG, "Providing retry delay of " + retryDelay + "ms " + "for: data type " + dataType + ", " + "load duration: " + loadDurationMs + "ms, " + "error count: " + errorCount + ", " + "exception " + exception.getClass() + ", " + "message: " + exception.getMessage()); } return retryDelay; }
Source:
<code>public void setUp() { objectMapper = new ObjectMapper(); LocalValidatorFactoryBean validatorFactoryBean = new LocalValidatorFactoryBean(); validatorFactoryBean.setValidationMessageSource(messageSource); given(messageSource.getMessage(anyString(), any(Object[].class), any(Locale.class))) .willAnswer(i -> i.getArgumentAt(0, String.class)); mockMvc = MockMvcBuilders.standaloneSetup(controllersUnderTest()) .setViewResolvers(viewResolver()) .setControllerAdvice(controllerAdvice()) .setHandlerExceptionResolvers(uncheckedExceptionResolver()) <START> .setValidator(validatorFactoryBean) <END> .build(); }</code><technical_language>Validator setup AbstractControllerTest class, reused controller tests</technical_language>

Target:
public void setUp() { super.setUp(); given(messageSource.getMessage(anyString(), any(Object[].class), any(Locale.class))) .willAnswer(i -> i.getArgumentAt(0, String.class)); baseCandidateDto = CandidateDTO.builder().name(correctName).email(correctEmail).build(); correctCandidateDto = CandidateDTO.builder().name(correctName).email(correctEmail).phone(correctPhone) .referer(correctReferer).languageSkill(correctLanguageSkill) .description(correctDescription).build(); }
Source:
<code>public void start(BundleContext context) throws Exception { super.start(context); fPlugin = this; try { fCommandLine = CliParserManager.getInstance().parse(Platform.getCommandLineArgs()); } catch (CliParserException e) { logError("Error parsing command line arguments", e); <START> throw e; <END> } }</code><technical_language>throw exception. a lot of exception stack traces printed screen stored in .log file. easy for user miss usage message is printed well. I suggest, find a exit application. call CliParserManager.getInstance().parse(Platform.getCommandLineArgs()); in Application.java exit if needed? I reason done in activator class</technical_language>

Target:
public void start(BundleContext context) throws Exception { super.start(context); fPlugin = this; }
Source:
<code>private Shape createRing(final int layer, final double degreeStart, final double degreeEnd, final Point2D center, final double scale) { Path result = new Path(); result.setFill(createColor(degreeStart, layer)); result.setFillRule(FillRule.EVEN_ODD); double arcSize = AbstractSunburstNode.calculateAngle(degreeStart, degreeEnd); <START> boolean largeArc = arcSize > (AbstractSunburstNode.CIRCLEDEGREES / 2); <END> double innerRadius = scale * (CENTER_RADIUS + (layer * RING_WIDTH)); double outerRadius = innerRadius + scale * RING_WIDTH; double angleAlpha = Math.toRadians(degreeStart); double angleAlphaNext = Math.toRadians(degreeEnd); double startX = center.getX() + innerRadius * Math.sin(angleAlpha); double startY = center.getY() - innerRadius * Math.cos(angleAlpha); MoveTo move1 = new MoveTo(startX, startY); LineTo line1To2 = createLine(outerRadius, center, angleAlpha); ArcTo arc2To3 = createArc(outerRadius, center, angleAlphaNext, true, largeArc); LineTo line3To4 = createLine(innerRadius, center, angleAlphaNext); ArcTo arc4To1 = createArc(innerRadius, center, angleAlpha, false, largeArc); result.getElements() .addAll(move1, line1To2, arc2To3, line3To4, arc4To1); return result; }</code><technical_language>redundant parentheses</technical_language>

Target:
private Shape createRing(final int layer, final double degreeStart, final double degreeEnd, final Point2D center, final double scale) { Path result = new Path(); result.setFill(createColor(degreeStart, layer)); result.setFillRule(FillRule.EVEN_ODD); double arcSize = AbstractSunburstNode.calculateAngle(degreeStart, degreeEnd); boolean largeArc = arcSize > AbstractSunburstNode.CIRCLEDEGREES / 2; double innerRadius = scale * (CENTER_RADIUS + (layer * RING_WIDTH)); double outerRadius = innerRadius + scale * RING_WIDTH; double angleAlpha = Math.toRadians(degreeStart); double angleAlphaNext = Math.toRadians(degreeEnd); double startX = center.getX() + innerRadius * Math.sin(angleAlpha); double startY = center.getY() - innerRadius * Math.cos(angleAlpha); MoveTo move1 = new MoveTo(startX, startY); LineTo line1To2 = createLine(outerRadius, center, angleAlpha); ArcTo arc2To3 = createArc(outerRadius, center, angleAlphaNext, true, largeArc); LineTo line3To4 = createLine(innerRadius, center, angleAlphaNext); ArcTo arc4To1 = createArc(innerRadius, center, angleAlpha, false, largeArc); result.getElements() .addAll(move1, line1To2, arc2To3, line3To4, arc4To1); return result; }
Source:
<code>public void componentThemeIsApplied_childThemeTextColorIsApplied() { open(); TestBenchElement myField = $(TestBenchElement.class).id(MY_POLYMER_ID); TestBenchElement input = myField.$(TestBenchElement.class) .id("vaadin-text-field-input-0"); Assert.assertEquals("Polymer text field should have red background", "rgba(255, 0, 0, 1)", input.getCssValue("background-color")); <START> Assert.assertEquals("Polymer text field should have red background", <END> "rgba(0, 128, 0, 1)", input.getCssValue("color")); }</code><technical_language>Nit: this is background ..</technical_language>

Target:
public void componentThemeIsApplied_childThemeTextColorIsApplied() { open(); TestBenchElement myField = $(TestBenchElement.class).id(MY_POLYMER_ID); TestBenchElement input = myField.$(TestBenchElement.class) .id("vaadin-text-field-input-0"); Assert.assertEquals("Polymer text field should have red background", "rgba(255, 0, 0, 1)", input.getCssValue("background-color")); Assert.assertEquals("Text field should have color as green", "rgba(0, 128, 0, 1)", input.getCssValue("color")); }
Source:
<code>public void saveOrUpdateShouldBeUnsuccessfulWhenChannelIdIsNotANumber() throws Exception { given(this.messageKeyResolver.resolveMessageOrDefault(COMMON_INVALID_INPUT_MESSAGE_KEY)).willReturn(COMMON_INVALID_INPUT_MESSAGE); given(this.messageKeyResolver.resolveMessageOrDefault(CHANNEL_NOT_FOUND_ERROR_MESSAGE_KEY)).willReturn(CHANNEL_NOT_FOUND_ERROR_MESSAGE); <START> <END> this.mockMvc.perform(post(REQUEST_URL_POST) .param("candidateId", STRING_VALUE_ONE) .param("position.id", STRING_VALUE_ONE).param("position.name", POSITION_NAME_DEVELOPER) .param("channel.id", TEXT).param("channel.name", CHANNEL_NAME_FACEBOOK) .param("description", DESCRIPTION)) .andExpect(status().is3xxRedirection()) .andExpect(redirectedUrl(REDIRECT_URL_FIELD_ERROR)) .andExpect(flash().attribute("channelErrorMessage", CHANNEL_NOT_FOUND_ERROR_MESSAGE)); verifyZeroInteractions(applicationsService); then(this.candidateService).should().getCandidate(1L); then(this.positionService).should().getPositionDtoById(1L); then(this.channelService).should().getChannelDtoById(null); }</code><technical_language>is initialization for candidateService, positionService channelService</technical_language>

Target:
public void saveOrUpdateShouldBeUnsuccessfulWhenChannelIdIsNotANumber() throws Exception { given(this.candidateService.getCandidate(1L)).willReturn(new CandidateDTO()); given(this.positionService.getPositionDtoById(1L)).willReturn(positionDTO); given(this.channelService.getChannelDtoById(null)).willThrow(new AssertionError()); given(this.messageKeyResolver.resolveMessageOrDefault(COMMON_INVALID_INPUT_MESSAGE_KEY)).willReturn(COMMON_INVALID_INPUT_MESSAGE); given(this.messageKeyResolver.resolveMessageOrDefault(CHANNEL_NOT_FOUND_ERROR_MESSAGE_KEY)).willReturn(CHANNEL_NOT_FOUND_ERROR_MESSAGE); this.mockMvc.perform(post(REQUEST_URL_POST) .param("candidateId", STRING_VALUE_ONE) .param("position.id", STRING_VALUE_ONE).param("position.name", POSITION_NAME_DEVELOPER) .param("channel.id", TEXT).param("channel.name", CHANNEL_NAME_FACEBOOK) .param("description", DESCRIPTION)) .andExpect(status().is3xxRedirection()) .andExpect(redirectedUrl(REDIRECT_URL_FIELD_ERROR)) .andExpect(flash().attributeCount(2)) .andExpect(flash().attribute("channelErrorMessage", CHANNEL_NOT_FOUND_ERROR_MESSAGE)); verifyZeroInteractions(applicationsService); then(this.candidateService).should().getCandidate(1L); then(this.positionService).should().getPositionDtoById(1L); then(this.channelService).should().getChannelDtoById(null); }
Source:
<code>private void initAccessor() { RegionShortcut shortcut = getRegionShortCut(); if (shortcut.isPersistent()) { if (shortcut == RegionShortcut.PARTITION_PERSISTENT) { shortcut = RegionShortcut.PARTITION; } else if (shortcut == RegionShortcut.PARTITION_PERSISTENT_OVERFLOW) { shortcut = RegionShortcut.PARTITION_OVERFLOW; } else if (shortcut == RegionShortcut.PARTITION_REDUNDANT_PERSISTENT) { shortcut = RegionShortcut.PARTITION_REDUNDANT; } else if (shortcut == RegionShortcut.PARTITION_REDUNDANT_PERSISTENT_OVERFLOW) { shortcut = RegionShortcut.PARTITION_REDUNDANT_OVERFLOW; } else { <START> fail("Wrong region type:" + shortcut); <END> } } getCache().createRegionFactory(shortcut) .setPartitionAttributes( new PartitionAttributesFactory().setTotalNumBuckets(10).setLocalMaxMemory(0).create()) .addCacheListener(new CountingCacheListener()) .create(REGION_NAME); }</code><technical_language>throw exception instead of fail method?</technical_language>

Target:
private void initAccessor() { RegionShortcut shortcut = getRegionShortCut(); if (shortcut.isPersistent()) { if (shortcut == RegionShortcut.PARTITION_PERSISTENT) { shortcut = RegionShortcut.PARTITION; } else if (shortcut == RegionShortcut.PARTITION_PERSISTENT_OVERFLOW) { shortcut = RegionShortcut.PARTITION_OVERFLOW; } else if (shortcut == RegionShortcut.PARTITION_REDUNDANT_PERSISTENT) { shortcut = RegionShortcut.PARTITION_REDUNDANT; } else if (shortcut == RegionShortcut.PARTITION_REDUNDANT_PERSISTENT_OVERFLOW) { shortcut = RegionShortcut.PARTITION_REDUNDANT_OVERFLOW; } } getCache().createRegionFactory(shortcut) .setPartitionAttributes( new PartitionAttributesFactory().setTotalNumBuckets(10).setLocalMaxMemory(0).create()) .addCacheListener(new CountingCacheListener()) .create(REGION_NAME); }
Source:
<code>private void publishUpdate(){ <START> posePub.publish(new GPSPoseMessage(new Date(), buggyFrameGpsY, buggyFrameGpsX, buggyFrameRotZ)); <END> }</code><technical_language>I name bFGLat bFGLon, end accidentally switching (bFG = buggyFrameGPS)</technical_language>

Target:
private void publishUpdate(){ posePub.publish(new GPSPoseMessage(new Date(), buggyFrameGpsLat, buggyFrameGpsLon, buggyFrameRotZ)); }
Source:
<code>public void handleEvent(ZWaveBindingProvider provider, String itemName, ZWaveCommandClassValueEvent event) { ZWaveBindingConfig bindingConfiguration = provider.getZwaveBindingConfig(itemName); Item item = provider.getItem(itemName); String commandClassName = bindingConfiguration.getArguments().get("command"); boolean respondToBasic = "true".equalsIgnoreCase(bindingConfiguration.getArguments().get("respond_to_basic")); logger.trace("Getting converter for item = {}, command class = {}, item command class = {}", itemName, event.getCommandClass().getLabel(), commandClassName); if (item == null) { return; } if (commandClassName != null && !commandClassName.equalsIgnoreCase(event.getCommandClass().getLabel().toLowerCase()) && !(respondToBasic && event.getCommandClass() == CommandClass.BASIC)) { <START> logger.warn("Not matching command class for item = {}, command class = {}, item command class = {}, ignoring event.", <END> itemName, event.getCommandClass().getLabel(), commandClassName); if (event.getCommandClass() == CommandClass.BASIC && !respondToBasic) { logger.debug("Command class is BASIC, maybe you want to define respond_to_basic=true ?"); } return; } ZWaveCommandClassConverter<?> converter = this.getConverter(event.getCommandClass()); if (converter == null) { logger.warn("No converter found for command class = {}, ignoring event.", event.getCommandClass().toString()); return; } converter.handleEvent(event, item, bindingConfiguration.getArguments()); }</code><technical_language>Please update log entries standard NODE number</technical_language>

Target:
public void handleEvent(ZWaveBindingProvider provider, String itemName, ZWaveCommandClassValueEvent event) { ZWaveBindingConfig bindingConfiguration = provider.getZwaveBindingConfig(itemName); Item item = provider.getItem(itemName); String commandClassName = bindingConfiguration.getArguments().get("command"); boolean respondToBasic = "true".equalsIgnoreCase(bindingConfiguration.getArguments().get("respond_to_basic")); logger.trace("Getting converter for item = {}, command class = {}, item command class = {}", itemName, event.getCommandClass().getLabel(), commandClassName); if (item == null) { return; } if (commandClassName != null && !commandClassName.equalsIgnoreCase(event.getCommandClass().getLabel().toLowerCase()) && !(respondToBasic && event.getCommandClass() == CommandClass.BASIC)) { return; } ZWaveCommandClassConverter<?> converter = this.getConverter(event.getCommandClass()); if (converter == null) { logger.warn("No converter found for command class = {}, ignoring event.", event.getCommandClass().toString()); return; } converter.handleEvent(event, item, bindingConfiguration.getArguments()); }
Source:
<code>private void scrollToSeeFMR(String slotName, AdsBaseObject page) { page.triggerComments(); <START> page.scrollToPosition("#ArticleMidSection.mw-headline"); <END> page.waitForSlotExpanded(page.wait.forElementVisible(By.id(slotName))); }</code><technical_language>constant, extract please :)</technical_language>

Target:
private void scrollToSeeFMR(String slotName, AdsBaseObject page) { page.triggerComments(); page.scrollToPosition(ARTICLE_MIDDLE_SECTION_SELECTOR); page.waitForSlotExpanded(page.wait.forElementVisible(By.id(slotName))); }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (!getIntent().getBooleanExtra("forceMainMenu", false)) { String lastRoom = SharedPrefsHelper.getSharedPrefs(this) .getString("lastRoom", "hi, jeff"); <START> if (!lastRoom.equals("hi, jeff")) { <END> Intent intent = new Intent(this, MachineActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); } } setContentView(R.layout.activity_location); ButterKnife.bind(this); initRecyclerView(); initToolbar(); }</code><technical_language>alternative null do this check</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (!getIntent().getBooleanExtra("forceMainMenu", false)) { String lastRoom = SharedPrefsHelper.getSharedPrefs(this) .getString("lastRoom", null); if (!(lastRoom == null)) { Intent intent = new Intent(this, MachineActivity.class); startActivity(intent); } } setContentView(R.layout.activity_location); ButterKnife.bind(this); initRecyclerView(); initToolbar(); }
Source:
<code><START> private XML(String identifier) { <END> this.identifier = identifier; }</code><technical_language>Modifier 'private' is redundant for Enum constructor - needs removed</technical_language>

Target:
XML(String identifier) { this.identifier = identifier; }
Source:
<code><START> public Filter(@JsonProperty("expression") final String expression) { <END> this.expression = expression; }</code><technical_language>is this class created user</technical_language>

Target:
public Filter(@JsonProperty("expression") final String expression) { this.expression = notEmpty(expression, "expression"); }
Source:
<code>public void testWebAppUserStoreOperations() throws Exception { UserManagementClient userMgtClient = new UserManagementClient(backendURL, sessionCookie); userMgtClient.addUser(user1, "passWord1@", null, "default"); <START> userMgtClient.addUser(user2, "passWord2@", null, "default"); <END> userMgtClient.addRole("umRole1", new String[]{user1, user2}, new String[]{"login"}, false); userMgtClient.addRole("umRole2", new String[]{user1}, new String[]{"login"}, false); log.info("Users and Roles Added Successfully "); String webAppContext = "/TenantServlet?user=UserStoreTestUser1"; String finalURL = webAppUrl + webAppContext; URL url = new URL(finalURL); URLConnection connection = url.openConnection(); connection.setDoOutput(true); BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream())); char[] buffer = new char[Integer.parseInt(connection.getHeaderField("Content-Length"))]; int count = buffer.length; String value = null; while ((count = br.read(buffer)) > 0) { value = new String(buffer, 0, count); } JSONArray arr = new JSONArray(new String(value)); ArrayList<String> stringArray = new ArrayList<String>(); for (int i = 0; i < arr.length(); i++) { stringArray.add(arr.getString(i)); } assertFalse(stringArray.contains("Java Security Manager Exception"), "User Store Operations Cannot be Invoked with Java Security Manager"); }</code><technical_language>move strings constants</technical_language>

Target:
public void testWebAppUserStoreOperations() throws Exception { UserManagementClient userMgtClient = new UserManagementClient(backendURL, sessionCookie); RemoteAuthorizationManagerServiceClient authorizationClient = new RemoteAuthorizationManagerServiceClient (backendURL, sessionCookie); userMgtClient.addUser(user1, user1Password, null, defaultProfileName); userMgtClient.addUser(user2, user2Password, null, defaultProfileName); userMgtClient.addRole(role1, new String[]{user1, user2}, new String[]{loginPermission}, false); userMgtClient.addRole(role2, new String[]{user1}, new String[]{loginPermission}, false); log.info("Users and Roles Added Successfully "); assertTrue(authorizationClient.isUserAuthorized(user1, loginPermission, "ui.execute"),"Security Enabled " + "Authorization Failed"); String webAppContext = "/TenantServlet?user=UserStoreTestUser1"; String finalURL = webAppUrl + webAppContext; URL url = new URL(finalURL); URLConnection connection = url.openConnection(); connection.setDoOutput(true); BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream())); char[] buffer = new char[Integer.parseInt(connection.getHeaderField("Content-Length"))]; int count = buffer.length; String value = null; while ((count = br.read(buffer)) > 0) { value = new String(buffer, 0, count); } JSONArray arr = new JSONArray(new String(value)); List<String> stringArray = new ArrayList<String>(); for (int i = 0; i < arr.length(); i++) { stringArray.add(arr.getString(i)); } assertFalse(stringArray.contains("Java Security Manager Exception"), "User Store Operations Cannot be Invoked with Java Security Manager"); }
Source:
<code>public ModelAndView activityCenter(@PathVariable long activityId){ ModelAndView modelAndView = new ModelAndView("/activity-center-edit"); <START> ActivityModel activityModel = activityService.findById(activityId); <END> ActivityDto activityDto = new ActivityDto(activityModel); modelAndView.addObject("sources", Lists.newArrayList(Source.values())); modelAndView.addObject("dto",activityDto); return modelAndView; }</code><technical_language>return dto</technical_language>

Target:
public ModelAndView activityCenter(@PathVariable long activityId){ ModelAndView modelAndView = new ModelAndView("/activity-center-edit"); ActivityDto activityDto = activityService.findActivityDtoById(activityId); modelAndView.addObject("sources", Lists.newArrayList(Source.values())); modelAndView.addObject("dto",activityDto); return modelAndView; }
Source:
<code>protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception { TikaConfiguration tikaConfiguration = new TikaConfiguration(); setProperties(tikaConfiguration, parameters); TikaConfig config = resolveAndRemoveReferenceParameter(parameters, TIKA_CONFIG, TikaConfig.class); if (config != null) { tikaConfiguration.setTikaConfig(config); } <START> tikaConfiguration.setOperation(new URI(uri).getHost()); <END> return createEndpoint(uri, tikaConfiguration); }</code><technical_language>I realized setProperties done endpoint configuration in order avoid reflection, is correct @oscerd</technical_language>

Target:
protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception { TikaConfiguration tikaConfiguration = new TikaConfiguration(); TikaConfig config = resolveAndRemoveReferenceParameter(parameters, TIKA_CONFIG, TikaConfig.class); if (config != null) { tikaConfiguration.setTikaConfig(config); } tikaConfiguration.setOperation(new URI(uri).getHost()); TikaEndpoint endpoint = createEndpoint(uri, tikaConfiguration); setProperties(endpoint, parameters); return endpoint; }
Source:
<code>public TenantProfileServiceHandler() { this.tenantProfileRepository = new TenantProfileRepository(Gateway.class, GatewayEntity.class); try { logger.debug("Initializing TenantProfileServiceHandler"); GenericObjectPool.Config poolConfig = new GenericObjectPool.Config(); poolConfig.maxActive = 100; poolConfig.minIdle = 5; poolConfig.whenExhaustedAction = GenericObjectPool.WHEN_EXHAUSTED_BLOCK; poolConfig.testOnBorrow = true; poolConfig.testWhileIdle = true; poolConfig.numTestsPerEvictionRun = 10; poolConfig.maxWait = 3000; csClientPool = new ThriftClientPool<>( tProtocol -> new CredentialStoreService.Client(tProtocol), poolConfig, ServerSettings.getCredentialStoreServerHost(), Integer.parseInt(ServerSettings.getCredentialStoreServerPort())); <START> }catch (ApplicationSettingsException e) { <END> logger.error("Error occured while reading airavata-server properties..", e); } }</code><technical_language>space }</technical_language>

Target:
public TenantProfileServiceHandler() throws Exception { this.tenantProfileRepository = new TenantProfileRepository(Gateway.class, GatewayEntity.class); try { logger.debug("Initializing TenantProfileServiceHandler"); GenericObjectPool.Config poolConfig = new GenericObjectPool.Config(); poolConfig.maxActive = 100; poolConfig.minIdle = 5; poolConfig.whenExhaustedAction = GenericObjectPool.WHEN_EXHAUSTED_BLOCK; poolConfig.testOnBorrow = true; poolConfig.testWhileIdle = true; poolConfig.numTestsPerEvictionRun = 10; poolConfig.maxWait = 3000; csClientPool = new ThriftClientPool<>( tProtocol -> new CredentialStoreService.Client(tProtocol), poolConfig, ServerSettings.getCredentialStoreServerHost(), Integer.parseInt(ServerSettings.getCredentialStoreServerPort())); } catch (ApplicationSettingsException e) { logger.error("Error occured while reading airavata-server properties..", e); throw new Exception(e); } }
Source:
<code>protected boolean verifyChildrenSpecific(N parent, int index, N child) { return <START> (parent.getChildStart(index) != child.getNodeStart() && parent.getChildEnd(index) != child.getNodeEnd()); <END> }</code><technical_language>OOPS</technical_language>

Target:
protected boolean verifyChildrenSpecific(N parent, int index, N child) { return (parent.getChildStart(index) == child.getNodeStart() && parent.getChildEnd(index) == child.getNodeEnd()); }
Source:
<code>private boolean doTruncateInvalidTxBefore(long time) throws InvalidTruncateTimeException { LOG.info("Removing tx ids before from invalid list", time); <START> long truncateWp = TimeUnit.SECONDS.toMillis(time) * TxConstants.MAX_TX_PER_MS; <END> if (inProgress.lowerKey(truncateWp) != null) { throw new InvalidTruncateTimeException("Transactions started earlier than " + time + " are in-progress"); } Set<Long> toTruncate = Sets.newHashSet(); for (long wp : invalid) { if (wp >= truncateWp) { break; } toTruncate.add(wp); } return doTruncateInvalidTx(toTruncate); }</code><technical_language>decide seconds unit for this argument, instead of milliseconds? if this, want clear. milliseconds more intuitive in this case, is standard of referencing a timestamp in java</technical_language>

Target:
private boolean doTruncateInvalidTxBefore(long time) throws InvalidTruncateTimeException { LOG.info("Removing tx ids before from invalid list", time); long truncateWp = time * TxConstants.MAX_TX_PER_MS; if (inProgress.lowerKey(truncateWp) != null) { throw new InvalidTruncateTimeException("Transactions started earlier than " + time + " are in-progress"); } Set<Long> toTruncate = Sets.newHashSet(); for (long wp : invalid) { if (wp >= truncateWp) { break; } toTruncate.add(wp); } return doTruncateInvalidTx(toTruncate); }
Source:
<code>private void startApp(String appName, String appLocation) { try { <START> if (StringUtils.isNotEmpty(appLocation)) { <END> appService.addApplication(new URI(appLocation)); } executeAsSystem( () -> { appService.startApplication(appName); return true; }); } catch (ApplicationServiceException ase) { LOGGER.warn("Could not start " + appName, ase); } catch (URISyntaxException use) { LOGGER.warn("Could not install application, location is not a valid URI " + appLocation, use); } }</code><technical_language>I appLocation null if a NullPointerException calling appLocation.isEmpty() good enough</technical_language>

Target:
private void startApp(String appName, String appLocation) { try { if (!appLocation.isEmpty()) { appService.addApplication(new URI(appLocation)); } executeAsSystem( () -> { appService.startApplication(appName); return true; }); } catch (ApplicationServiceException ase) { LOGGER.warn("Could not start {}", appName, ase); } catch (URISyntaxException use) { LOGGER.warn( "Could not install application, location is not a valid URI {}", appLocation, use); } }
Source:
<code>private static void from12(ChainedTransformationDescriptionBuilder chainedBuilder) { ResourceTransformationDescriptionBuilder builder = chainedBuilder.createBuilder(ELYTRON_12_0_0, ELYTRON_11_0_0); builder.addChildResource(PathElement.pathElement(ElytronDescriptionConstants.SERVER_SSL_CONTEXT)) .getAttributeBuilder() <START> .addRejectCheck(new RejectAttributeChecker.SimpleAcceptListAttributeChecker(new ModelNode(ElytronDescriptionConstants.SSL_V2HELLO)), ElytronDescriptionConstants.PROTOCOLS) <END> .end(); builder.addChildResource(PathElement.pathElement(ElytronDescriptionConstants.CLIENT_SSL_CONTEXT)) .getAttributeBuilder() .addRejectCheck(new RejectAttributeChecker.SimpleAcceptListAttributeChecker(new ModelNode(ElytronDescriptionConstants.SSL_V2HELLO)), ElytronDescriptionConstants.PROTOCOLS) .end(); }</code><technical_language>ListRejectAttributeChecker instead</technical_language>

Target:
private static void from12(ChainedTransformationDescriptionBuilder chainedBuilder) { ResourceTransformationDescriptionBuilder builder = chainedBuilder.createBuilder(ELYTRON_12_0_0, ELYTRON_11_0_0); builder.addChildResource(PathElement.pathElement(ElytronDescriptionConstants.KEY_MANAGER)) .getAttributeBuilder() .addRejectCheck(RejectAttributeChecker.DEFINED, ElytronDescriptionConstants.GENERATE_SELF_SIGNED_CERTIFICATE_HOST) .setDiscard(DiscardAttributeChecker.UNDEFINED, SSLDefinitions.GENERATE_SELF_SIGNED_CERTIFICATE_HOST) .end(); builder.rejectChildResource(PathElement.pathElement(ElytronDescriptionConstants.CASE_PRINCIPAL_TRANSFORMER)); }
Source:
<code>private SqlTask newSqlTask() { TaskId taskId = new TaskId("query", 0, idGeneator.incrementAndGet()); URI location = URI.create("fake://task/" + taskId); return new SqlTask( taskId, location, "fake", new DefaultQueryContext(new QueryId("query"), new DataSize(1, MEGABYTE), new DataSize(2, MEGABYTE), memoryPool, new TestingGcMonitor(), executor, scheduledExecutor, new DataSize(1, GIGABYTE), spillSpaceTracker), sqlTaskExecutionFactory, executor, Functions.identity(), new DataSize(32, MEGABYTE), <START> failedTasks); <END> }</code><technical_language>new CounterStat() here, need create a field for that</technical_language>

Target:
private SqlTask newSqlTask() { TaskId taskId = new TaskId("query", 0, idGeneator.incrementAndGet()); URI location = URI.create("fake://task/" + taskId); return new SqlTask( taskId, location, "fake", new DefaultQueryContext(new QueryId("query"), new DataSize(1, MEGABYTE), new DataSize(2, MEGABYTE), memoryPool, new TestingGcMonitor(), executor, scheduledExecutor, new DataSize(1, GIGABYTE), spillSpaceTracker), sqlTaskExecutionFactory, executor, Functions.identity(), new DataSize(32, MEGABYTE), new CounterStat()); }
Source:
<code>protected String formatCommand(Command command, String format, ValueFormatter valueFormatter, String... keys) { String result = String.format(format, (Object[]) keys); <START> Set<String> missingKeys = new HashSet<>(Arrays.asList(keys)); <END> result = result.replaceAll("\\{" + Command.KEY_UNIQUE_ID + "}", getUniqueId(command.getDeviceId())); for (Map.Entry<String, Object> entry : command.getAttributes().entrySet()) { String value = null; if (valueFormatter != null) { value = valueFormatter.formatValue(entry.getKey(), entry.getValue()); } if (value == null) { value = entry.getValue().toString(); } result = result.replaceAll("\\{" + entry.getKey() + "}", value); missingKeys.remove(entry.getKey()); } for (String key : missingKeys) { result = result.replaceAll("\\{" + key + "}", ""); } return result; }</code><technical_language>This feel kind of hacky. refactor do String.format values. For input "LZ,,%s", Command.KEY_TIMEZONE instead of formatting keys first, convert keys do a single String.format values. This require removing encoders, feel solution</technical_language>

Target:
protected String formatCommand(Command command, String format, ValueFormatter valueFormatter, String... keys) { Object[] values = new String[keys.length]; for (int i = 0; i < keys.length; i++) { String value = null; if (keys[i].equals(Command.KEY_UNIQUE_ID)) { value = getUniqueId(command.getDeviceId()); } else { Object object = command.getAttributes().get(keys[i]); if (valueFormatter != null) { value = valueFormatter.formatValue(keys[i], object); } if (value == null && object != null) { value = object.toString(); } if (value == null) { value = ""; } } values[i] = value; } return String.format(format, values); }
Source:
<code>private void printErrorStatus(CommandInterpreter interpreter, IStatus status) { interpreter.print("--Error status "); interpreter.print("message=" + status.getMessage()); interpreter.print(",code=" + status.getCode()); String severityString = null; switch (status.getSeverity()) { case IStatus.INFO: severityString = "INFO"; break; case IStatus.CANCEL: severityString = "CANCEL"; break; case IStatus.WARNING: severityString = "WARNING"; break; case IStatus.ERROR: severityString = "ERROR"; break; } interpreter.print(",severity=" + severityString); interpreter.print(",bundle=" + status.getPlugin()); interpreter.println("--"); Throwable t = status.getException(); if (t != null) interpreter.printStackTrace(t); IStatus[] children = status.getChildren(); if (children != null && children.length > 0) { interpreter.println("Error status children:"); for (IStatus <START> children1 : <END> children) { printErrorStatus(interpreter, children1); } } interpreter.println("--End Error Status--"); }</code><technical_language>child is proper name</technical_language>

Target:
private void printErrorStatus(CommandInterpreter interpreter, IStatus status) { interpreter.print("--Error status "); interpreter.print("message=" + status.getMessage()); interpreter.print(",code=" + status.getCode()); String severityString = null; switch (status.getSeverity()) { case IStatus.INFO: severityString = "INFO"; break; case IStatus.CANCEL: severityString = "CANCEL"; break; case IStatus.WARNING: severityString = "WARNING"; break; case IStatus.ERROR: severityString = "ERROR"; break; } interpreter.print(",severity=" + severityString); interpreter.print(",bundle=" + status.getPlugin()); interpreter.println("--"); Throwable t = status.getException(); if (t != null) interpreter.printStackTrace(t); IStatus[] children = status.getChildren(); if (children != null && children.length > 0) { interpreter.println("Error status children:"); for (IStatus child : children) { printErrorStatus(interpreter, child); } } interpreter.println("--End Error Status--"); }