auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected String buildAccountingFieldsKeyForAtmCashAdvance(ConcurStandardAccountingExtractDetailLine detailLine) { <START> return String.format(ACCOUNTING_FIELDS_KEY_FORMAT, <END> collectorHelper.getPrepaidOffsetChartCode(), collectorHelper.getPrepaidOffsetAccountNumber(), collectorHelper.getDashOnlyPropertyValue(KFSPropertyConstants.SUB_ACCOUNT_NUMBER), collectorHelper.getPrepaidOffsetObjectCode(), collectorHelper.getDashOnlyPropertyValue(KFSPropertyConstants.SUB_OBJECT_CODE), defaultToDashesIfBlank(detailLine.getReportProjectCode(), KFSPropertyConstants.PROJECT_CODE), StringUtils.defaultIfBlank(detailLine.getReportOrgRefId(), StringUtils.EMPTY)); }</code><technical_language>a number of building accounting field key functions similar logic. I this refactored function do string format, others call it</technical_language>

Target:
protected String buildAccountingFieldsKeyForAtmCashAdvance(ConcurStandardAccountingExtractDetailLine detailLine) { return buildAccountingFieldsKey( collectorHelper.getPrepaidOffsetChartCode(), collectorHelper.getPrepaidOffsetAccountNumber(), collectorHelper.getDashOnlyPropertyValue(KFSPropertyConstants.SUB_ACCOUNT_NUMBER), collectorHelper.getPrepaidOffsetObjectCode(), collectorHelper.getDashOnlyPropertyValue(KFSPropertyConstants.SUB_OBJECT_CODE), defaultToDashesIfBlank(detailLine.getReportProjectCode(), KFSPropertyConstants.PROJECT_CODE), StringUtils.defaultIfBlank(detailLine.getReportOrgRefId(), StringUtils.EMPTY)); }
Source:
<code>public Collection<ClassDiagramPattern> getPatternsList() { Collection<ClassDiagramPattern> newPatternList = new ArrayList<ClassDiagramPattern>(); <START> newPatternList.add(new ClassDiagramPattern("pattern.class.diagram", "ClassDiagramPatternProvider", "this is a ClassDiagramPatternProvider", "images/classDiagramPattern.png")); <END> return newPatternList; }</code><technical_language>elements specific class dagram pattern, put constant in pattern class set in default constructor. call new ClassDiagramPattern</technical_language>

Target:
public Collection<IPatternProvider> getPatternsList() { Collection<IPatternProvider> newPatternList = new ArrayList<IPatternProvider>(); ClassDiagramPattern pattern = new ClassDiagramPattern(); pattern.setPatternCommand(new InitializerCommand(resourceSet, selection)); newPatternList.add(pattern); return newPatternList; }
Source:
<code>public void customExpanderListParam() throws Exception { server.enqueue(new MockResponse()); TestInterface api = new TestInterfaceBuilder().target("http://localhost:" + server.getPort()); <START> api.expandList(Arrays.asList(new Date(1234l))); <END> assertThat(server.takeRequest()) .hasPath("/?date=1234"); }</code><technical_language>if folks interested in this change, test multiple values skipping of null. way, key behaviors locked understood (even if debatable)</technical_language>

Target:
public void customExpanderListParam() throws Exception { server.enqueue(new MockResponse()); TestInterface api = new TestInterfaceBuilder().target("http://localhost:" + server.getPort()); api.expandList(Arrays.asList(new Date(1234l), new Date(12345l))); assertThat(server.takeRequest()) .hasPath("/?date=1234&date=12345"); }
Source:
<code>private void stopRunningThread(long endTime) { if (!shtThread.isAlive()) { return; } try { HTInterval[] pill = new HTInterval[] { new HTInterval(-1, endTime, -1, TmfStateValue.nullValue()) }; <START> if (index != STORAGE_SIZE) { <END> intervalQueue.put(temp); } intervalQueue.put(pill); shtThread.join(); } catch (TimeRangeException e) { Activator.getDefault().logError("Error closing state system", e); } catch (InterruptedException e) { Activator.getDefault().logError("State system interrupted", e); } }</code><technical_language>this happen? Above, reset index 0 hit max. assuming accessed a single-thread. If want support reentrancy, need a bunch of locks 'n stuff</technical_language>

Target:
private void stopRunningThread(long endTime) { if (!shtThread.isAlive()) { return; } try { Collection<HTInterval> pill = Collections.singletonList(new HTInterval(-1, endTime, -1, TmfStateValue.nullValue())); if (!fInterval.isEmpty()) { intervalQueue.put(fInterval); } intervalQueue.put(pill); shtThread.join(); } catch (TimeRangeException e) { Activator.getDefault().logError("Error closing state system", e); } catch (InterruptedException e) { Activator.getDefault().logError("State system interrupted", e); } }
Source:
<code>public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { switch (oldVersion) { case DB_VERSION_PRE_EVENT_SERVER: db.execSQL("ALTER TABLE " + Tables.HOSTS + " ADD COLUMN " + MediaContract.HostsColumns.USE_EVENT_SERVER + " INTEGER DEFAULT 1;"); db.execSQL("ALTER TABLE " + Tables.HOSTS + " ADD COLUMN " + MediaContract.HostsColumns.EVENT_SERVER_PORT + " INTEGER DEFAULT " + HostInfo.DEFAULT_EVENT_SERVER_PORT + ";"); case DB_VERSION_PRE_SONGS_NO_ALBUM: db.execSQL("ALTER TABLE " + Tables.SONGS + " ADD COLUMN "+ MediaContract.SongsColumns.ARTISTID + <START> " INTEGER DEFAULT 0;"); <END> } }</code><technical_language>Default albumartistid column better</technical_language>

Target:
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { switch (oldVersion) { case DB_VERSION_PRE_EVENT_SERVER: db.execSQL("ALTER TABLE " + Tables.HOSTS + " ADD COLUMN " + MediaContract.HostsColumns.USE_EVENT_SERVER + " INTEGER DEFAULT 1;"); db.execSQL("ALTER TABLE " + Tables.HOSTS + " ADD COLUMN " + MediaContract.HostsColumns.EVENT_SERVER_PORT + " INTEGER DEFAULT " + HostInfo.DEFAULT_EVENT_SERVER_PORT + ";"); case DB_VERSION_PRE_SONG_ARTISTS: createSongArtistsTable(db); } }
Source:
<code>public String toString() { StringBuilder sb = new StringBuilder(); <START> sb.append("AdapterFactoryProxy [contributor: "); END> sb.append(element.isValid() ? element.getContributor() : "<unknown>"); sb.append(", adaptableType: "); sb.append(element.isValid() ? element.getAttribute("adaptableType") : "<unknown>"); if (factory != null) { sb.append(", factory: "); sb.append(factory); } sb.append("]"); return sb.toString(); }</code><technical_language>do included other internal fields ownerId internalOwnerID? I especially ownerId useful</technical_language>

Target:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append("AdapterFactoryProxy [contributor: "); sb.append(contributorName); sb.append(", adaptableType: "); sb.append(adaptableType); if (factory != null) { sb.append(", factory: "); sb.append(factory); } sb.append("]"); return sb.toString(); }
Source:
<code>private static PRPAMT201306UV02LivingSubjectName createName(String firstName, String lastName) { org.hl7.v3.ObjectFactory factory = new org.hl7.v3.ObjectFactory(); ENExplicit name = factory.createENExplicit(); if (lastName != null && lastName.length() > 0) { EnExplicitFamily familyName = new EnExplicitFamily(); <START> familyName.setPartType("FAM"); <END> familyName.setContent(lastName); name.getContent().add(factory.createENExplicitFamily(familyName)); } if (firstName != null && firstName.length() > 0) { EnExplicitGiven givenName = new EnExplicitGiven(); givenName.setPartType("GIV"); givenName.setContent(firstName); name.getContent().add(factory.createENExplicitGiven(givenName)); } PRPAMT201306UV02LivingSubjectName subjectName = new PRPAMT201306UV02LivingSubjectName(); subjectName.getValue().add(name); return subjectName; }</code><technical_language>I understand some of other data in-line literals (e.g., "Allen Wanderson" test patient info), PartTypes constants else</technical_language>

Target:
private static PRPAMT201306UV02LivingSubjectName createName(String firstName, String lastName) { org.hl7.v3.ObjectFactory factory = new org.hl7.v3.ObjectFactory(); ENExplicit name = factory.createENExplicit(); if (lastName != null && lastName.length() > 0) { EnExplicitFamily familyName = new EnExplicitFamily(); familyName.setPartType(FAMILY_NAME_CODE); familyName.setContent(lastName); name.getContent().add(factory.createENExplicitFamily(familyName)); } if (firstName != null && firstName.length() > 0) { EnExplicitGiven givenName = new EnExplicitGiven(); givenName.setPartType(GIVEN_NAME_CODE); givenName.setContent(firstName); name.getContent().add(factory.createENExplicitGiven(givenName)); } PRPAMT201306UV02LivingSubjectName subjectName = new PRPAMT201306UV02LivingSubjectName(); subjectName.getValue().add(name); return subjectName; }
Source:
<code><START> public Set<String> getDataTypes() { <END> if (!initialized.get()) { return new HashSet<>(); } else { return Collections.unmodifiableSet(typeToRanges.keySet()); } }</code><technical_language>I removed getAll() avoid problem of users able modify Set<LongRange>s. if is choice. Returning a copy is another option, is SubMemoryStore is right now, bad due performance issues. removing getAll(). For get(dataType), return Iterable instead of a Set. do similar getAll getDataTypes</technical_language>

Target:
public Set<String> getDataTypes() { if (!initialized.get()) { return Collections.emptySet(); } else { return Collections.unmodifiableSet(typeToRanges.keySet()); } }
Source:
<code>public Map<String, Object> createSampleList(final SampleListDto sampleListDto) { Preconditions.checkArgument(sampleListDto.getInstanceIds() != null, "The Instance List must not be null"); Preconditions.checkArgument(!sampleListDto.getInstanceIds().isEmpty(), "The Instance List must not be empty"); Preconditions.checkNotNull(sampleListDto.getSelectionVariableId(), "The Selection Variable Id must not be empty"); Preconditions.checkNotNull(sampleListDto.getStudyId(), "The Study Id must not be empty"); final HashMap<String, Object> mapResponse = new HashMap<>(); mapResponse.put("id", String.valueOf(0)); try { <START> final SampleListDTO sampleListdto = translateToSampleListDto(sampleListDto); <END> final Integer newSampleId = this.service.createOrUpdateSampleList(sampleListdto); if (newSampleId != null) { mapResponse.put("id", String.valueOf(newSampleId)); } else { mapResponse.put("ERROR", "Error on SampleListService.createOrUpdateSampleList"); } } catch (MiddlewareQueryException | ParseException e) { mapResponse.put("ERROR", "Error on SampleListService.createOrUpdateSampleList " + e.getMessage()); } return mapResponse; }</code><technical_language>change variable name improve readability</technical_language>

Target:
public Map<String, Object> createSampleList(final SampleListDto sampleListDto) { Preconditions.checkArgument(sampleListDto.getInstanceIds() != null, "The Instance List must not be null"); Preconditions.checkArgument(!sampleListDto.getInstanceIds().isEmpty(), "The Instance List must not be empty"); Preconditions.checkNotNull(sampleListDto.getSelectionVariableId(), "The Selection Variable Id must not be empty"); Preconditions.checkNotNull(sampleListDto.getStudyId(), "The Study Id must not be empty"); final HashMap<String, Object> mapResponse = new HashMap<>(); mapResponse.put("id", String.valueOf(0)); try { final SampleListDTO sampleListDtoMW = this.translateToSampleListDto(sampleListDto); final Integer newSampleId = this.sampleListServiceMW.createOrUpdateSampleList(sampleListDtoMW); mapResponse.put("id", String.valueOf(newSampleId)); } catch (MiddlewareQueryException | ParseException e) { mapResponse.put("ERROR", "Error on SampleListService.createOrUpdateSampleList " + e.getMessage()); } return mapResponse; }
Source:
<code><START> static Map<String, Map<String, String>> getNextAssignment(Map<String, Map<String, String>> currentAssignment, <END> Map<String, Map<String, String>> targetAssignment, int minAvailableReplicas, boolean enableStrictReplicaGroup) { Map<String, Map<String, String>> nextAssignment = new TreeMap<>(); if (enableStrictReplicaGroup) { Map<Set<String>, Set<String>> availableInstancesMap = new HashMap<>(); for (Map.Entry<String, Map<String, String>> entry : currentAssignment.entrySet()) { String segmentName = entry.getKey(); Map<String, String> currentInstanceStateMap = entry.getValue(); Map<String, String> targetInstanceStateMap = targetAssignment.get(segmentName); SingleSegmentAssignment assignment = getNextAssignment(currentInstanceStateMap, targetInstanceStateMap, minAvailableReplicas); Set<String> assignedInstances = assignment._instanceStateMap.keySet(); Set<String> availableInstances = assignment._availableInstances; Set<String> currentAvailableInstances = availableInstancesMap.get(assignedInstances); if (currentAvailableInstances == null) { nextAssignment.put(segmentName, assignment._instanceStateMap); availableInstancesMap.put(assignedInstances, availableInstances); } else { availableInstances.retainAll(currentAvailableInstances); if (availableInstances.size() >= minAvailableReplicas) { nextAssignment.put(segmentName, assignment._instanceStateMap); availableInstancesMap.put(assignedInstances, availableInstances); } else { nextAssignment.put(segmentName, currentInstanceStateMap); } } } } else { for (Map.Entry<String, Map<String, String>> entry : currentAssignment.entrySet()) { String segmentName = entry.getKey(); nextAssignment.put(segmentName, getNextAssignment(entry.getValue(), targetAssignment.get(segmentName), minAvailableReplicas)._instanceStateMap); } } return nextAssignment; }</code><technical_language>nit: split this methods, for enableStrictReplicaGroup other for not. usually, function polymorphism return type this returns a type other</technical_language>

Target:
static Map<String, Map<String, String>> getNextAssignment(Map<String, Map<String, String>> currentAssignment, Map<String, Map<String, String>> targetAssignment, int minAvailableReplicas, boolean enableStrictReplicaGroup) { return enableStrictReplicaGroup ? getNextStrictReplicaGroupAssignment(currentAssignment, targetAssignment, minAvailableReplicas) : getNextNonStrictReplicaGroupAssignment(currentAssignment, targetAssignment, minAvailableReplicas); }
Source:
<code>public CourseEditInstructorPanel(int instructorToShowIndex, int instructorIndex, InstructorAttributes instructor, List<String> sectionNames, List<String> feedbackNames) { if (instructorToShowIndex == -1) { index = instructorIndex; isAccessControlDisplayed = false; } else { index = instructorToShowIndex; isAccessControlDisplayed = true; } this.instructor = instructor; sectionRows = createSectionRows(instructorIndex, sectionNames, feedbackNames); permissionInputGroup1 = createPermissionInputGroup1ForInstructorPanel(); permissionInputGroup2 = createPermissionInputGroup2ForInstructorPanel(); permissionInputGroup3 = createPermissionInputGroup3ForInstructorPanel(); if (instructor != null) { String style = null; if (instructor.privileges.numberOfSectionsSpecial() >= sectionNames.size()) { style = "display: none;"; } String content = "Give different permissions for a specific section"; Map<String, String> attributes = new HashMap<>(); attributes.put("class", "small addSectionLevelForInstructor"); <START> attributes.put("id", "addSectionLevelForInstructor" + index); <END> attributes.put("href", "javascript:;"); attributes.put("style", style); attributes.put("data-index", Integer.toString(index)); attributes.put("data-first-blank-section-row-index", Integer.toString(firstBlankSectionRowIndex)); addSectionLevelForInstructorButton = createButton(content, attributes); } }</code><technical_language>ID class like-this instead of likeThis. I understand ID likeThis choose retain for consistency, class follow this-convention</technical_language>

Target:
public CourseEditInstructorPanel(int instructorToShowIndex, int instructorIndex, InstructorAttributes instructor, List<String> sectionNames, List<String> feedbackNames) { if (instructorToShowIndex == -1) { index = instructorIndex; isAccessControlDisplayed = false; } else { index = instructorToShowIndex; isAccessControlDisplayed = true; } this.instructor = instructor; sectionRows = createSectionRows(instructorIndex, sectionNames, feedbackNames); permissionInputGroup1 = createPermissionInputGroup1ForInstructorPanel(); permissionInputGroup2 = createPermissionInputGroup2ForInstructorPanel(); permissionInputGroup3 = createPermissionInputGroup3ForInstructorPanel(); }
Source:
<code>public double getMeanJobExecutionTime() { return executeReadOnlyTransaction(session -> { Query query = session.getNamedQuery("getMeanJobExecutionTime"); Double result = (Double) query.uniqueResult(); <START> return result == null ? 0 : result; <END> }); }</code><technical_language>0d</technical_language>

Target:
public double getMeanJobExecutionTime() { return executeReadOnlyTransaction(session -> { Query query = session.getNamedQuery("getMeanJobExecutionTime"); Double result = (Double) query.uniqueResult(); return result == null ? 0.0d : result; }); }
Source:
<code>public void addSubmitRecords(ChangeAttribute ca, List<SubmitRecord> submitRecords) { ca.submitRecords = new ArrayList<SubmitRecordAttribute>(); for (SubmitRecord submitRecord : submitRecords) { SubmitRecordAttribute sa = new SubmitRecordAttribute(); switch (submitRecord.status) { case OK: sa.status = "OK"; <START> break; <END> case NOT_READY: sa.status = "NOT_READY"; if (!submitRecord.labels.isEmpty()) { sa.labels = new ArrayList<SubmitLabelAttribute>(); for (SubmitRecord.Label lbl : submitRecord.labels) { SubmitLabelAttribute la = new SubmitLabelAttribute(); la.label = lbl.label; switch (lbl.status) { case OK: la.status = "OK"; break; case REJECT: la.status = "REJECT"; break; case NEED: la.status = "NEED"; break; case MAY: la.status = "MAY"; break; case IMPOSSIBLE: la.status = "IMPOSSIBLE"; break; default: throw new IllegalArgumentException( "Unsupported SubmitRecord.Label.status (" + lbl.status + ")"); } sa.labels.add(la); } } break; case CLOSED: sa.status = "CLOSED"; break; case RULE_ERROR: sa.status = "RULE_ERROR"; break; default: throw new IllegalStateException( "Unsupported SubmitRecord.status + (" + submitRecord.status + ")"); } ca.submitRecords.add(sa); } if (ca.submitRecords.isEmpty()) { ca.submitRecords = null; } }</code><technical_language>Please include label attributes for OK status</technical_language>

Target:
public void addSubmitRecords(ChangeAttribute ca, List<SubmitRecord> submitRecords) { ca.submitRecords = new ArrayList<SubmitRecordAttribute>(); for (SubmitRecord submitRecord : submitRecords) { SubmitRecordAttribute sa = new SubmitRecordAttribute(); switch (submitRecord.status) { case OK: sa.status = "OK"; addSubmitRecordLabels(submitRecord, sa); break; case NOT_READY: sa.status = "NOT_READY"; addSubmitRecordLabels(submitRecord, sa); break; case RULE_ERROR: sa.status = "RULE_ERROR"; break; default: throw new IllegalStateException( "Unsupported SubmitRecord.status + (" + submitRecord.status + ")"); } ca.submitRecords.add(sa); } if (ca.submitRecords.isEmpty()) { ca.submitRecords = null; } }
Source:
<code>protected VdcActionType getImagesActionType() { if (getParameters().getOperation() == ImageOperation.Move) { return VdcActionType.MoveImageGroup; } <START> return VdcActionType.MoveOrCopyImageGroup; <END> }</code><technical_language>This command separated commands - done in a separate patch</technical_language>

Target:
protected VdcActionType getImagesActionType() { if (getParameters().getOperation() == ImageOperation.Move) { return VdcActionType.MoveImageGroup; } return VdcActionType.CopyImageGroup; }
Source:
<code>protected Settings.Builder initializeSettingsBuilder(ElasticSearchRemoteConfig config) { String shieldAdminName = Framework.getProperty(ES_SHIELD_ADMIN_USERNAME, "Administrator"); <START> String shieldAdminPasswd = Framework.getProperty(ES_SHIELD_ADMIN_PASSWORD, "Administrator"); <END> Settings.Builder builder = super.initializeSettingsBuilder(config); builder.put("shield.user", shieldAdminName + ":" + shieldAdminPasswd); return builder; }</code><technical_language>I missed this in 9.1 version... This a Configuration property (ConfigurationService extension point), a Framework property. configure a descriptor ESClientInitializationDescriptor, this possible</technical_language>

Target:
protected Settings.Builder initializeSettingsBuilder(ElasticSearchRemoteConfig config) { Settings.Builder builder = super.initializeSettingsBuilder(config); builder.put("shield.user", getUsername() + ":" + getPassword()); return builder; }
Source:
<code>private static double getUnnormalizedLogProbabilityLaplaceApproximation(final double readCount, final double mu, final double psi) { final double variance = psi + 1.0 / readCount; final double logReadCount = FastMath.log(readCount); return - logReadCount - 0.5 * (LOG_2PI + FastMath.log(variance) + <START> FastMath.pow(logReadCount - mu, 2) / variance); <END> }</code><technical_language>MathUtils.square instead of pow(___, 2)</technical_language>

Target:
private static double getUnnormalizedLogProbabilityLaplaceApproximation(final double readCount, final double mu, final double psi) { final double variance = psi + 1.0 / readCount; final double logReadCount = FastMath.log(readCount); return - logReadCount - 0.5 * (LOG_2PI + FastMath.log(variance) + MathUtils.square(logReadCount - mu) / variance); }
Source:
<code><START> public Attributes(Map<String, Type> types, Map<String, Value> data) <END> throws UndeclaredAttributeException { for (Map.Entry<String, Type> entry: types.entrySet()) { String attrName = entry.getKey(); if (!data.containsKey(attrName)) { throw new UndeclaredAttributeException(attrName); } } for (String attrName: data.keySet()) { if (!types.containsKey(attrName)) { throw new UndeclaredAttributeException(attrName); } } this.data = ImmutableMap.copyOf(data); }</code><technical_language>Do eventually need a class encapsulate AttributeTypes (ie Map<String, Type> types) above? (This a new PR)</technical_language>

Target:
public Attributes(Map<String, Type> types, Map<String, Value> data) throws UndeclaredAttributeException, InvalidAttributeException { for (Map.Entry<String, Type> entry : types.entrySet()) { String attrName = entry.getKey(); if (!data.containsKey(attrName)) { throw new UndeclaredAttributeException(attrName); } } for (String attrName : data.keySet()) { if (!types.containsKey(attrName)) { throw new InvalidAttributeException(attrName); } } this.data = ImmutableMap.copyOf(data); }
Source:
<code>public TaskLock lock(final Task task, final Interval interval) throws InterruptedException { long startTime = System.currentTimeMillis(); giant.lock(); try { Optional<TaskLock> taskLock; while (!(taskLock = tryLock(task, interval)).isPresent()) { <START> lockReleaseCondition.await(lockTimeoutMillis, TimeUnit.MILLISECONDS); <END> if (System.currentTimeMillis() - startTime > lockTimeoutMillis) { throw new InterruptedException(String.format( "Task [%s] can not acquire lock for interval [%s] within [%s] ms", task.getId(), interval, lockTimeoutMillis )); } } return taskLock.get(); } finally { giant.unlock(); } }</code><technical_language>lockTimeoutMillis updated if this line returns early</technical_language>

Target:
public TaskLock lock(final Task task, final Interval interval) throws InterruptedException { long timeout = lockTimeoutMillis; giant.lock(); try { Optional<TaskLock> taskLock; while (!(taskLock = tryLock(task, interval)).isPresent()) { long startTime = System.currentTimeMillis(); lockReleaseCondition.await(timeout, TimeUnit.MILLISECONDS); long timeDelta = System.currentTimeMillis() - startTime; if (timeDelta >= timeout) { log.error( "Task [%s] can not acquire lock for interval [%s] within [%s] ms", task.getId(), interval, lockTimeoutMillis ); throw new InterruptedException(String.format( "Task [%s] can not acquire lock for interval [%s] within [%s] ms", task.getId(), interval, lockTimeoutMillis )); } else { timeout -= timeDelta; } } return taskLock.get(); } finally { giant.unlock(); } }
Source:
<code>public void testDontOverwriteDirtyFile() throws IOException { setupCase(mk("foo"), mk("other"), mk("foo")); writeTrashFile("foo", "different"); try { checkout(); fail("Didn't got the expected conflict"); } catch (CheckoutConflictException e) { assertIndex(mk("foo")); assertWorkDir(mkmap("foo", "different")); <START> assertTrue(getConflicts().containsKey("foo")); <END> assertTrue(new File(trash, "foo").isFile()); } }</code><technical_language>why</technical_language>

Target:
public void testDontOverwriteDirtyFile() throws IOException { setupCase(mk("foo"), mk("other"), mk("foo")); writeTrashFile("foo", "different"); try { checkout(); fail("Didn't got the expected conflict"); } catch (CheckoutConflictException e) { assertIndex(mk("foo")); assertWorkDir(mkmap("foo", "different")); assertEquals(Arrays.asList("foo"), getConflicts()); assertTrue(getConflicts().containsKey("foo")); assertTrue(new File(trash, "foo").isFile()); } }
Source:
<code>StreamsProducer threadProducer() { <START> if (eosBetaStreamsProducer == null) { <END> throw new IllegalStateException("Exactly-once beta is not enabled."); } return eosBetaStreamsProducer; }</code><technical_language>nit: check taskProducers is empty if this is called</technical_language>

Target:
StreamsProducer threadProducer() { if (processingMode != StreamThread.ProcessingMode.EXACTLY_ONCE_BETA) { throw new IllegalStateException("Exactly-once beta is not enabled."); } return threadProducer; }
Source:
<code>public Object createEventSubscription() { String subscriptionId = subscriptions.createSubscription(this); if (subscriptionId == null) { <START> return JSONResponse.createResponse(Status.FORBIDDEN, null, "Max number of subscriptions is reached."); <END> } final EventOutput eventOutput = new SitemapEventOutput(subscriptions, subscriptionId); broadcaster.add(eventOutput); eventOutputs.put(subscriptionId, eventOutput); URI uri = uriInfo.getBaseUriBuilder().path(PATH_SITEMAPS).path(SEGMENT_EVENTS).path(subscriptionId).build(); return Response.created(uri); }</code><technical_language>agree FORBIDDEN is correct return status. I consider a client error (4xx) all, a server error (5xx). I vote for "503 SERVICE UNAVAILABLE: server is currently unable handle request due a temporary overload"</technical_language>

Target:
public Object createEventSubscription() { String subscriptionId = subscriptions.createSubscription(this); if (subscriptionId == null) { return JSONResponse.createResponse(Status.SERVICE_UNAVAILABLE, null, "Max number of subscriptions is reached."); } final EventOutput eventOutput = new SitemapEventOutput(subscriptions, subscriptionId); broadcaster.add(eventOutput); eventOutputs.put(subscriptionId, eventOutput); URI uri = uriInfo.getBaseUriBuilder().path(PATH_SITEMAPS).path(SEGMENT_EVENTS).path(subscriptionId).build(); return Response.created(uri); }
Source:
<code><START> private boolean setVolumeLegalityInStorage(boolean legal) { <END> SetVolumeLegalityVDSCommandParameters parameters = new SetVolumeLegalityVDSCommandParameters(getStoragePool().getId(), getStorageDomainId(), getImage().getImage().getDiskId(), getImage().getImageId(), legal); try { getBackend().getResourceManager().runVdsCommand(VDSCommandType.SetVolumeLegality, parameters); } catch (RuntimeException e) { log.error("Failed to set image's volume's legality: {}", e); return false; } return true; }</code><technical_language>Suggestion: Consider add a constant in command increase readability constant false true for legal. Currently passing true false is readable sending LEGAL_IMAGE ILLEGAL_IMAGE</technical_language>

Target:
private boolean setVolumeLegalityInStorage(boolean legal) { SetVolumeLegalityVDSCommandParameters parameters = new SetVolumeLegalityVDSCommandParameters(getStoragePool().getId(), getStorageDomainId(), getImage().getImage().getDiskId(), getImage().getImageId(), legal); try { runVdsCommand(VDSCommandType.SetVolumeLegality, parameters); } catch (EngineException e) { log.error("Failed to set image's volume's legality to for image and volume {}: {}", legal, getImage().getImage().getDiskId(), getImage().getImageId(), e); return false; } return true; }
Source:
<code>public String loadInitialGermplasmTreeTable(final Model model) { try { final List<TreeTableNode> rootNodes = new ArrayList<>(); final TreeTableNode localNode = new TreeTableNode(GermplasmTreeController.LISTS, AppConstants.LISTS.getString(), null, null, null, null, "1"); rootNodes.add(localNode); model.addAttribute(GermplasmTreeController.GERMPLASM_LIST_ROOT_NODES, rootNodes); } catch (final Exception e) { <START> GermplasmTreeController.LOG.error(e.getMessage(), e); <END> } return super.showAjaxPage(model, GermplasmTreeController.GERMPLASM_LIST_TABLE_PAGE); }</code><technical_language>Cleanup: This is swallowing exception</technical_language>

Target:
public String loadInitialGermplasmTreeTable(final Model model) { final List<TreeTableNode> rootNodes = new ArrayList<>(); final TreeTableNode localNode = new TreeTableNode(GermplasmTreeController.LISTS, AppConstants.LISTS.getString(), null, null, null, null, "1"); rootNodes.add(localNode); model.addAttribute(GermplasmTreeController.GERMPLASM_LIST_ROOT_NODES, rootNodes); return super.showAjaxPage(model, GermplasmTreeController.GERMPLASM_LIST_TABLE_PAGE); }
Source:
<code>protected static ColumnMessage defaultBytesProto(final Column<?> column) { final BlobColumnMessage.Builder inner = BlobColumnMessage.newBuilder(); int bblen = 0; int startP = 0, endP = 0; for (int i = 0; i < column.size(); i++) { bblen = bblen + column.getBlob(i).array().length; } ByteBuffer bb = ByteBuffer.allocate(bblen); int offset = bb.position(); for (int i = 0; i < column.size(); i++) { int len = column.getBlob(i).array().length; endP = startP + len; inner.addStartIndices(startP); inner.addEndIndices(endP); bb.put(column.getBlob(i).array(), offset, len); startP = endP; offset = bb.position(); <START> len = 0; <END> } bb.flip(); inner.setData(ByteString.copyFrom(bb)); return ColumnMessage.newBuilder().setType(ColumnMessage.Type.BLOB).setBlobColumn(inner).build(); }</code><technical_language>need set zero</technical_language>

Target:
protected static ColumnMessage defaultBytesProto(final Column<?> column) { final BlobColumnMessage.Builder inner = BlobColumnMessage.newBuilder(); int bblen = 0; for (int i = 0; i < column.size(); i++) { bblen = bblen + column.getBlob(i).array().length; } ByteBuffer bb = ByteBuffer.allocate(bblen); int startP = 0, endP = 0; for (int i = 0; i < column.size(); i++) { int len = column.getBlob(i).array().length; endP = startP + len; inner.addStartIndices(startP); inner.addEndIndices(endP); bb.put(column.getBlob(i).array(), bb.position(), len); startP = endP; } bb.flip(); inner.setData(ByteString.copyFrom(bb)); return ColumnMessage.newBuilder().setType(ColumnMessage.Type.BLOB).setBlobColumn(inner).build(); }
Source:
<code>public void createFromInspection(String json) { JSONObject request; try { request = new JSONObject(json); } catch (JSONException e) { SoapUI.logError(e); return; } Analytics.trackAction(EXPLORE_API_CLICK_SAVE_REQUEST, <START> "HTTPMethod", HttpMethod.valueOf(extractMethod(request)).toString(), <END> "Endpoint", extractUrl(request)); String url = extractUrl(request); if (StringUtils.isNullOrEmpty(url)) { return; } HttpMethod method = HttpMethod.valueOf(extractMethod(request)); RequestInspectionData inspectionData = new RequestInspectionData(extractHeaders(request), extractPayload(request)); SwingUtilities.invokeLater(new Runnable() { @Override public void run() { HashMap<String, Object> context = new HashMap<>(); context.put("URLs", Arrays.asList(url)); context.put("Methods", Arrays.asList(method)); context.put("InspectionData", Arrays.asList(inspectionData)); SaveRequestAction saveRequestAction = new SaveRequestAction(context); saveRequestAction.showNewRestRequestDialog(); } }); }</code><technical_language>extractMethod(request) return method in String format already</technical_language>

Target:
public void createFromInspection(String json) { JSONObject request; try { request = new JSONObject(json); } catch (JSONException e) { SoapUI.logError(e); return; } Analytics.trackAction(EXPLORE_API_CLICK_SAVE_REQUEST, "HTTPMethod", extractMethod(request), "Endpoint", extractUrl(request)); String url = extractUrl(request); if (StringUtils.isNullOrEmpty(url)) { return; } HttpMethod method = HttpMethod.valueOf(extractMethod(request)); RequestInspectionData inspectionData = new RequestInspectionData(extractHeaders(request), extractPayload(request)); SwingUtilities.invokeLater(new Runnable() { @Override public void run() { HashMap<String, Object> context = new HashMap<>(); context.put("URLs", Arrays.asList(url)); context.put("Methods", Arrays.asList(method)); context.put("InspectionData", Arrays.asList(inspectionData)); SaveRequestAction saveRequestAction = new SaveRequestAction(context); saveRequestAction.showNewRestRequestDialog(); } }); }
Source:
<code>public AmazonPubsubSubscription( String name, String topicARN, String queueARN, String templatePath, MessageFormat messageFormat, boolean idInMessageAttributes, Long dedupeRetentionMillis ) { this.name = name; this.topicARN = topicARN; this.queueARN = queueARN; this.templatePath = templatePath; this.messageFormat = messageFormat; this.idInMessageAttributes = idInMessageAttributes; <START> if (dedupeRetentionMillis != null && dedupeRetentionMillis >= 0) { <END> this.dedupeRetentionMillis = dedupeRetentionMillis; } }</code><technical_language>I if constraint checking, throw exception, minimum log configuration is invalid, silently dropping invalid config</technical_language>

Target:
public AmazonPubsubSubscription( String name, String topicARN, String queueARN, String templatePath, MessageFormat messageFormat, boolean idInMessageAttributes, Long dedupeRetentionMillis ) { this.name = name; this.topicARN = topicARN; this.queueARN = queueARN; this.templatePath = templatePath; this.messageFormat = messageFormat; this.idInMessageAttributes = idInMessageAttributes; if (dedupeRetentionMillis != null && dedupeRetentionMillis >= 0) { this.dedupeRetentionMillis = dedupeRetentionMillis; } else { if (dedupeRetentionMillis != null) { log.warn("Ignoring dedupeRetentionMillis invalid value of " + dedupeRetentionMillis); } } }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); copyFileFromAssetsToCache(getString(R.string.bristol_model)); copyFileFromAssetsToCache(getString(R.string.bristol_skin)); setupToolbar(); mSceneView = findViewById(R.id.sceneView); ArcGISScene scene = new ArcGISScene(Basemap.createImagery()); mSceneView.setScene(scene); Surface surface = new Surface(); ArcGISTiledElevationSource elevationSource = new ArcGISTiledElevationSource( getString(R.string.world_elevation_service_url)); surface.getElevationSources().add(elevationSource); scene.setBaseSurface(surface); mSceneOverlay = new GraphicsOverlay(); mSceneOverlay.getSceneProperties().setSurfacePlacement(LayerSceneProperties.SurfacePlacement.ABSOLUTE); mSceneView.getGraphicsOverlays().add(mSceneOverlay); Camera camera = new Camera(38.459291, -109.937576, 5500, 150.0, 20.0, 0.0); mSceneView.setViewpointCamera(camera); Point locationPoint = new Point(-109.929589, 38.437304, 1700, SpatialReferences.getWgs84()); mOrbitLocationCameraController = new OrbitLocationCameraController(locationPoint, 5000); mOrbitLocationCameraController.setCameraPitchOffset(3); mOrbitLocationCameraController.setCameraHeadingOffset(150); loadModel().addDoneLoadingListener(() -> { mOrbitAeroplaneCameraController = new OrbitGeoElementCameraController(mPlane3D, <START> 100.0); <END> mOrbitAeroplaneCameraController.setCameraPitchOffset(30); mOrbitAeroplaneCameraController.setCameraHeadingOffset(150); }); }</code><technical_language>this move line</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); copyFileFromAssetsToCache(getString(R.string.bristol_model)); copyFileFromAssetsToCache(getString(R.string.bristol_skin)); setupToolbar(); mSceneView = findViewById(R.id.sceneView); ArcGISScene scene = new ArcGISScene(Basemap.createImagery()); mSceneView.setScene(scene); Surface surface = new Surface(); ArcGISTiledElevationSource elevationSource = new ArcGISTiledElevationSource( getString(R.string.world_elevation_service_url)); surface.getElevationSources().add(elevationSource); scene.setBaseSurface(surface); mSceneOverlay = new GraphicsOverlay(); mSceneOverlay.getSceneProperties().setSurfacePlacement(LayerSceneProperties.SurfacePlacement.ABSOLUTE); mSceneView.getGraphicsOverlays().add(mSceneOverlay); Camera camera = new Camera(38.459291, -109.937576, 5500, 150.0, 20.0, 0.0); mSceneView.setViewpointCamera(camera); Point locationPoint = new Point(-109.929589, 38.437304, 1700, SpatialReferences.getWgs84()); mOrbitLocationCameraController = new OrbitLocationCameraController(locationPoint, 5000); mOrbitLocationCameraController.setCameraPitchOffset(3); mOrbitLocationCameraController.setCameraHeadingOffset(150); loadModel().addDoneLoadingListener(() -> { mOrbitPlaneCameraController = new OrbitGeoElementCameraController(mPlane3D, 100.0); mOrbitPlaneCameraController.setCameraPitchOffset(30); mOrbitPlaneCameraController.setCameraHeadingOffset(150); }); }
Source:
<code>void startWorkspaceAsync(final UsersWorkspaceImpl usersWorkspace, final String envName) throws ConflictException { <START> try { <END> final RuntimeWorkspaceImpl runtime = workspaceRegistry.get(usersWorkspace.getId()); throw new ConflictException(format("Could not start workspace '%s' because its status is '%s'", runtime.getName(), runtime.getStatus())); } catch (NotFoundException ignored) { } executor.execute(ThreadLocalPropagateContext.wrap(new Runnable() { @Override public void run() { startWorkspaceSync(usersWorkspace, envName); } })); }</code><technical_language>If move this check in methods call startWorkspaceAsync prevent calling workspaceDao.get(workspaceName, owner). WDYT</technical_language>

Target:
UsersWorkspaceImpl startWorkspaceAsync(final UsersWorkspaceImpl usersWorkspace, final String envName) { executor.execute(ThreadLocalPropagateContext.wrap(() -> { try { startWorkspaceSync(usersWorkspace, envName); } catch (BadRequestException | ServerException | NotFoundException | ConflictException e) { LOG.error(e.getLocalizedMessage(), e); } })); addChannels(usersWorkspace); return usersWorkspace; }
Source:
<code>public Serializable execute(TaskResult... results) throws IOException { List<String> filesRelativePathName; FTPClient ftpClient = new FTPClient(); try { ftpClient.connect(ftpHostname, ftpPort); int reply = ftpClient.getReplyCode(); if (!FTPReply.isPositiveCompletion(reply)) { ftpClient.disconnect(); throw new IOException("Exception in connecting to FTP Server"); } if (!ftpClient.login(ftpUsername, ftpPassword)) { throw new IOException("Logging refused. check the FTP_USERNAME and the FTP_PASSWORD values."); } ftpClient.enterLocalPassiveMode(); getOut().println("Connected"); switch (ftpMode) { case "GET": filesRelativePathName = ftpGet(ftpClient); break; case "PUT": filesRelativePathName = ftpPut(ftpClient); break; default: throw new IllegalArgumentException("FTP MODE can only be PUT or GET."); } } catch (IOException e) { <START> throw new IOException(e); <END> } finally { ftpClient.logout(); ftpClient.disconnect(); getOut().println("Disconnected"); } return (Serializable) filesRelativePathName; }</code><technical_language>remove this catch (IOException e) bloc adds information</technical_language>

Target:
public Serializable execute(TaskResult... results) throws IOException { List<String> filesRelativePathName; FTPClient ftpClient = new FTPClient(); try { ftpClient.connect(ftpHostname, ftpPort); int reply = ftpClient.getReplyCode(); if (!FTPReply.isPositiveCompletion(reply)) { ftpClient.disconnect(); throw new IOException("Exception in connecting to FTP Server"); } if (!ftpClient.login(ftpUsername, ftpPassword)) { throw new IOException("Logging refused. check the FTP_USERNAME and FTP_PASSWORD values."); } ftpClient.enterLocalPassiveMode(); getOut().println("Connected"); switch (ftpMode) { case "GET": filesRelativePathName = ftpGet(ftpClient); break; case "PUT": filesRelativePathName = ftpPut(ftpClient); break; default: throw new IllegalArgumentException("FTP MODE can only be PUT or GET."); } } finally { ftpClient.logout(); ftpClient.disconnect(); getOut().println("Disconnected"); } return (Serializable) filesRelativePathName; }
Source:
<code>public void testInitializationWithQuotaUnset() { <START> int testCurrentTaskThreadPoolSize = 100; <END> LiveInstance liveInstance = createLiveInstance(null, null); liveInstance.setCurrentTaskThreadPoolSize(testCurrentTaskThreadPoolSize); AssignableInstance ai = new AssignableInstance(createClusterConfig(null, null, false), new InstanceConfig(testInstanceName), liveInstance); Assert.assertEquals(ai.getUsedCapacity().size(), 1); Assert.assertEquals( (int) ai.getUsedCapacity().get(LiveInstance.InstanceResourceType.TASK_EXEC_THREAD.name()) .get(AssignableInstance.DEFAULT_QUOTA_TYPE), 0); Assert.assertEquals( (int) ai.getTotalCapacity().get(LiveInstance.InstanceResourceType.TASK_EXEC_THREAD.name()) .get(AssignableInstance.DEFAULT_QUOTA_TYPE), testCurrentTaskThreadPoolSize); Assert.assertEquals(ai.getCurrentAssignments().size(), 0); }</code><technical_language>Nit: rename "expectedCurrentTaskThreadPoolSize"</technical_language>

Target:
public void testInitializationWithQuotaUnset() { int expectedCurrentTaskThreadPoolSize = 100; LiveInstance liveInstance = createLiveInstance(null, null); liveInstance.setCurrentTaskThreadPoolSize(expectedCurrentTaskThreadPoolSize); AssignableInstance ai = new AssignableInstance(createClusterConfig(null, null, false), new InstanceConfig(testInstanceName), liveInstance); Assert.assertEquals(ai.getUsedCapacity().size(), 1); Assert.assertEquals( (int) ai.getUsedCapacity().get(LiveInstance.InstanceResourceType.TASK_EXEC_THREAD.name()) .get(AssignableInstance.DEFAULT_QUOTA_TYPE), 0); Assert.assertEquals( (int) ai.getTotalCapacity().get(LiveInstance.InstanceResourceType.TASK_EXEC_THREAD.name()) .get(AssignableInstance.DEFAULT_QUOTA_TYPE), expectedCurrentTaskThreadPoolSize); Assert.assertEquals(ai.getCurrentAssignments().size(), 0); }
Source:
<code>public void drawItems(Rectangle bounds, ITimeDataProvider timeProvider, Item[] items, int topIndex, int nameSpace, GC gc) { for (int i = topIndex; i < items.length; i++) { Item item = items[i]; drawItem(item, bounds, timeProvider, i, nameSpace, gc); <START> } <END> fTimeGraphProvider.postDrawControl(bounds, gc); }</code><technical_language>moved paint method</technical_language>

Target:
public void drawItems(Rectangle bounds, ITimeDataProvider timeProvider, Item[] items, int topIndex, int nameSpace, GC gc) { for (int i = topIndex; i < items.length; i++) { Item item = items[i]; drawItem(item, bounds, timeProvider, i, nameSpace, gc); } }
Source:
<code>private void addClickHandler(final Button button) { button.addClickHandler(new ClickHandler() { @SuppressWarnings("unchecked") @Override public void onClick(ClickEvent event) { <START> if (!button.isEnabled()) { <END> return; } MultiSelectionModel<EntityModel> sourceSelectionModel = (button == downButton) ? topSelectionModel : bottomSelectionModel; EntityModelCellTable<ListModel> sourceTable = (button == downButton) ? topTable : bottomTable; EntityModelCellTable<ListModel> targetTable = (button == downButton) ? bottomTable : topTable; Set<EntityModel> selectedItems = sourceSelectionModel.getSelectedSet(); ((Collection<EntityModel>) sourceTable.flush().getItems()).removeAll(selectedItems); ListModel targetListModel = targetTable.flush(); Collection<EntityModel> targetItems = (Collection<EntityModel>) targetListModel.getItems(); if (targetItems == null) { targetItems = new LinkedList<EntityModel>(); targetListModel.setItems(targetItems); } targetItems.addAll(selectedItems); refresh(); } }); }</code><technical_language>AFAIK if button is disabled get here..</technical_language>

Target:
private void addClickHandler(final Button button) { button.addClickHandler(new ClickHandler() { @SuppressWarnings("unchecked") @Override public void onClick(ClickEvent event) { MultiSelectionModel<EntityModel> sourceSelectionModel = getSelectionModelForButton(button); EntityModelCellTable<ListModel> sourceTable = (button == downButton) ? topTable : bottomTable; EntityModelCellTable<ListModel> targetTable = (button == downButton) ? bottomTable : topTable; Set<EntityModel> selectedItems = sourceSelectionModel.getSelectedSet(); ((Collection<EntityModel>) sourceTable.flush().getItems()).removeAll(selectedItems); ListModel targetListModel = targetTable.flush(); Collection<EntityModel> targetItems = (Collection<EntityModel>) targetListModel.getItems(); if (targetItems == null) { targetItems = new LinkedList<EntityModel>(); targetListModel.setItems(targetItems); } targetItems.addAll(selectedItems); refresh(); } }); }
Source:
<code><START> public void changeDisposition(int id){ <END> factionInfo.setDisposition(id, -1); }</code><technical_language>1TBS</technical_language>

Target:
public void changeDisposition(int id) { FactionInfo.setDisposition(id, -1); }
Source:
<code>public MotorcycleFlagEncoder( int speedBits, double speedFactor, int maxTurnCosts ) { super(speedBits, speedFactor, maxTurnCosts); restrictions.remove("motorcar"); restrictions.add("motorcycle"); trackTypeSpeedMap.clear(); defaultSpeedMap.clear(); trackTypeSpeedMap.put("grade1", 20); trackTypeSpeedMap.put("grade2", 15); trackTypeSpeedMap.put("grade3", 10); trackTypeSpeedMap.put("grade4", 5); trackTypeSpeedMap.put("grade5", 5); avoidSet.add("motorway"); avoidSet.add("trunk"); avoidSet.add("motorroad"); avoidSet.add("residential"); preferSet.add("primary"); preferSet.add("secondary"); preferSet.add("tertiary"); maxPossibleSpeed = 120; defaultSpeedMap.put("motorway", 100); defaultSpeedMap.put("motorway_link", 80); defaultSpeedMap.put("motorroad", 90); defaultSpeedMap.put("trunk", 80); defaultSpeedMap.put("trunk_link", 75); defaultSpeedMap.put("primary", 100); defaultSpeedMap.put("primary_link", 80); defaultSpeedMap.put("secondary", 90); defaultSpeedMap.put("secondary_link", 70); defaultSpeedMap.put("tertiary", 80); defaultSpeedMap.put("tertiary_link", 60); defaultSpeedMap.put("unclassified", 40); defaultSpeedMap.put("residential", 30); defaultSpeedMap.put("living_street", 5); defaultSpeedMap.put("service", 20); defaultSpeedMap.put("road", 40); defaultSpeedMap.put("track", 15); <START> enjoyableTags.add("scenic"); <END> frustratingTags.add("lit"); frustratingTags.add("motorroad"); frustratingTags.add("sidewalk"); }</code><technical_language>Interesting! knew this. Is this usable for bike @ratrun ? <LINK_0></technical_language>

Target:
public MotorcycleFlagEncoder( int speedBits, double speedFactor, int maxTurnCosts ) { super(speedBits, speedFactor, maxTurnCosts); restrictions.remove("motorcar"); restrictions.add("motorcycle"); trackTypeSpeedMap.clear(); defaultSpeedMap.clear(); trackTypeSpeedMap.put("grade1", 20); trackTypeSpeedMap.put("grade2", 15); trackTypeSpeedMap.put("grade3", 10); trackTypeSpeedMap.put("grade4", 5); trackTypeSpeedMap.put("grade5", 5); avoidSet.add("motorway"); avoidSet.add("trunk"); avoidSet.add("motorroad"); avoidSet.add("residential"); preferSet.add("primary"); preferSet.add("secondary"); preferSet.add("tertiary"); maxPossibleSpeed = 120; defaultSpeedMap.put("motorway", 100); defaultSpeedMap.put("motorway_link", 70); defaultSpeedMap.put("motorroad", 90); defaultSpeedMap.put("trunk", 80); defaultSpeedMap.put("trunk_link", 75); defaultSpeedMap.put("primary", 65); defaultSpeedMap.put("primary_link", 60); defaultSpeedMap.put("secondary", 60); defaultSpeedMap.put("secondary_link", 50); defaultSpeedMap.put("tertiary", 50); defaultSpeedMap.put("tertiary_link", 40); defaultSpeedMap.put("unclassified", 30); defaultSpeedMap.put("residential", 30); defaultSpeedMap.put("living_street", 5); defaultSpeedMap.put("service", 20); defaultSpeedMap.put("road", 20); defaultSpeedMap.put("track", 15); }
Source:
<code>public GetBiosInfoVDSCommand(P parameters) { <START> super(parameters, parameters.getVds()); <END> if (getVds() == null) { setVds(DbFacade.getInstance().getVdsDao().get(parameters.getVdsId())); parameters.setVds(getVds()); } }</code><technical_language>Remove code is useless , pass a vdsm</technical_language>

Target:
public GetBiosInfoVDSCommand(P parameters) { super(parameters, parameters.getVds()); }