auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void convertTasksToWorkflowCoordinates(StringBuilder diagram, List<Task> tasks) { <START> int xAxe = 498; <END> for (Task task : tasks) { diagram.append(XmlGenerator.generateTaskShape(task.getOrdering(), xAxe)); xAxe = xAxe + 150; } XmlGenerator.generateBpmnEndEvent(diagram, xAxe); }</code><technical_language>I if do need magic number this define in constants beginning of class, we</technical_language>

Target:
private void convertTasksToWorkflowCoordinates(StringBuilder diagram, List<Task> tasks) { int diagramStart = 498; for (Task task : tasks) { diagram.append(XmlGenerator.generateTaskShape(task.getOrdering(), diagramStart)); diagramStart = diagramStart + BOX_DISTANCE; } XmlGenerator.generateBpmnEndEvent(diagram, diagramStart); }
Source:
<code>public AccessDeniedException(String file, String other, String reason) { <START> super(file + ", other " + other + ", reason " + reason); <END> }</code><technical_language>localize this</technical_language>

Target:
public AccessDeniedException(String file, String other, String reason) { super(MessageFormat.format(JGitText.get().accessFileDenied, file, other, reason)); }
Source:
<code>private static String getResultJobFilePath(final JavaSparkContext sparkContext, final SparkJobContext sparkJobContext) { <START> String resultPath = sparkJobContext.getResultPath(); <END> if (resultPath == null) { final Configuration hadoopConfiguration = sparkContext.hadoopConfiguration(); final String fileSystemPrefix = hadoopConfiguration.get("fs.defaultFS"); resultPath = fileSystemPrefix + DEFAULT_RESULT_PATH; } final String analysisJobXmlName = sparkJobContext.getAnalysisJobName(); final Date date = new Date(); if (!resultPath.endsWith("/")) { resultPath = resultPath + "/"; } final String filePath = resultPath + analysisJobXmlName + "-" + date.getTime() + ".analysis.result.dat"; return filePath; }</code><technical_language>feasible (or desirable) validate path is current cluster? if path is relative? HDFS / HDFSResource care of it</technical_language>

Target:
private static String getResultJobFilePath(final JavaSparkContext sparkContext, final SparkJobContext sparkJobContext) { String resultPath = sparkJobContext.getResultPath(); final Configuration hadoopConfiguration = sparkContext.hadoopConfiguration(); final String fileSystemPrefix = hadoopConfiguration.get("fs.defaultFS"); if (resultPath == null) { resultPath = fileSystemPrefix + DEFAULT_RESULT_PATH; } else { final URI uri = URI.create(resultPath); if (!uri.isAbsolute()){ resultPath = fileSystemPrefix + resultPath; } } final String analysisJobXmlName = sparkJobContext.getAnalysisJobName(); final Date date = new Date(); if (!resultPath.endsWith("/")) { resultPath = resultPath + "/"; } final String filePath = resultPath + analysisJobXmlName + "-" + date.getTime() + ".analysis.result.dat"; return filePath; }
Source:
<code>public void setJvm( String jvm ) throws Exception { <START> Field toolchainField = AbstractSurefireMojo.class.getDeclaredField( "jvm" ); <END> toolchainField.setAccessible( true ); toolchainField.set( this, jvm ); }</code><technical_language>pls substitute lines setInternalState( this, "jvm", jvm );</technical_language>

Target:
public void setJvm( String jvm ) throws Exception { setInternalState( this, "jvm", jvm ); }
Source:
<code>private void changeOreonAttributes(Actor oreon, TaskComponent taskComponent) { OreonAttributeComponent oreonAttributeComponent = oreon.getComponent(OreonAttributeComponent.class); String assignedTaskType = taskComponent.assignedTaskType; switch(assignedTaskType) { case AssignedTaskType.Eat: logger.info("eating task complete hunger to zero ", oreonAttributeComponent.hunger); oreonAttributeComponent.hunger = 0; break; case AssignedTaskType.Train_Strength: oreonAttributeComponent.strength += 10; <START> oreonAttributeComponent.strength = oreonAttributeComponent.strength > oreonAttributeComponent.maxStrength <END> ? oreonAttributeComponent.maxStrength : oreonAttributeComponent.strength; logger.info("Strength training complete, strength is now : {}", oreonAttributeComponent.strength); break; case AssignedTaskType.Train_Intelligence: oreonAttributeComponent.intelligence += 10; oreonAttributeComponent.intelligence = oreonAttributeComponent.intelligence > oreonAttributeComponent.maxIntelligence ? oreonAttributeComponent.maxIntelligence : oreonAttributeComponent.intelligence; logger.info("Intelligence training complete, intelligence is now : {}", oreonAttributeComponent.intelligence); break; case AssignedTaskType.Sleep: oreonAttributeComponent.health = 100; break; default: oreonAttributeComponent.hunger += 30; } oreon.save(oreonAttributeComponent); }</code><technical_language>Assigning sense. if ( str > max) { str = max; } statement</technical_language>

Target:
private void changeOreonAttributes(Actor oreon, TaskComponent taskComponent) { OreonAttributeComponent oreonAttributeComponent = oreon.getComponent(OreonAttributeComponent.class); String assignedTaskType = taskComponent.assignedTaskType; switch(assignedTaskType) { case AssignedTaskType.Eat: logger.info("eating task complete hunger to zero ", oreonAttributeComponent.hunger); oreonAttributeComponent.hunger = 0; break; case AssignedTaskType.Train_Strength: oreonAttributeComponent.strength += 10; if (oreonAttributeComponent.strength > oreonAttributeComponent.maxStrength) { oreonAttributeComponent.strength = oreonAttributeComponent.maxStrength; } logger.info("Strength training complete, strength is now : {}", oreonAttributeComponent.strength); break; case AssignedTaskType.Train_Intelligence: oreonAttributeComponent.intelligence += 10; if (oreonAttributeComponent.intelligence > oreonAttributeComponent.maxIntelligence) { oreonAttributeComponent.intelligence = oreonAttributeComponent.maxIntelligence; } logger.info("Intelligence training complete, intelligence is now : {}", oreonAttributeComponent.intelligence); break; case AssignedTaskType.Sleep: oreonAttributeComponent.health = 100; break; default: oreonAttributeComponent.hunger += 30; } oreon.save(oreonAttributeComponent); }
Source:
<code>protected Void convert(List<RiakKvPB.TsDelResp> responses) { <START> int numResponses = responses.size(); <END> checkIfMoreThanOneResponse(responses); return null; }</code><technical_language>code refactored, this line removed</technical_language>

Target:
protected Void convert(List<RiakKvPB.TsDelResp> responses) { checkAndGetSingleResponse(responses); return null; }
Source:
<code>public boolean isPythonLoggingSupported() { return getControlService().isVersionSupported("2.7.0"); <START> } <END></code><technical_language>for providing details. Please propagate methods TargetNodeComponent done for isPerSyscallEventsSupported(). methods of TraceProviderGroup query parent</technical_language>

Target:
public boolean isPythonLoggingSupported() { return ((TargetNodeComponent) getParent()).isPythonLoggingSupported(); }
Source:
<code>protected int renameLdapSynchCollisionBehaviorValue() throws SQLException { int numberOfRecordsRenamed = 0; if (dbAccessor.tableExists(AMBARI_CONFIGURATION_TABLE)) { <START> LOG.debug(String.format("Executing: %s", RENAME_COLLISION_BEHAVIOR_PROPERTY_SQL)); <END> numberOfRecordsRenamed = dbAccessor.executeUpdate(RENAME_COLLISION_BEHAVIOR_PROPERTY_SQL); LOG.info(String.format("Renamed %d %s with incorrect LDAP configuration property name", numberOfRecordsRenamed, 1 >= numberOfRecordsRenamed ? "record" : "records")); } else { LOG.info(String.format("%s table does not exists; nothing to update", AMBARI_CONFIGURATION_TABLE)); } return numberOfRecordsRenamed; }</code><technical_language>please omit String.format placeholders lazy</technical_language>

Target:
protected int renameLdapSynchCollisionBehaviorValue() throws SQLException { int numberOfRecordsRenamed = 0; if (dbAccessor.tableExists(AMBARI_CONFIGURATION_TABLE)) { LOG.debug("Executing: {}", RENAME_COLLISION_BEHAVIOR_PROPERTY_SQL); numberOfRecordsRenamed = dbAccessor.executeUpdate(RENAME_COLLISION_BEHAVIOR_PROPERTY_SQL); LOG.info("Renamed with incorrect LDAP configuration property name", numberOfRecordsRenamed, 1 >= numberOfRecordsRenamed ? "record" : "records"); } else { LOG.info("{} table does not exists; nothing to update", AMBARI_CONFIGURATION_TABLE); } return numberOfRecordsRenamed; }
Source:
<code>public boolean matches(String address) { <START> String addressAndMask = preprocessAddressAndMask(address); <END> String ipAddr = addressAndMask[0]; int maskBits = Integer.parseInt(addressAndMask[1]); InetAddress remoteAddress = parseAddress(ipAddr); Assert.isTrue(remoteAddress.getAddress().length * 8 >= maskBits, String.format("Mask bits too long for this address %s", address)); if (!requiredAddress.getClass().equals(remoteAddress.getClass())) { return false; } if (nMaskBits < 0) { return remoteAddress.equals(requiredAddress); } byte[] remAddr = remoteAddress.getAddress(); byte[] reqAddr = requiredAddress.getAddress(); int nMaskFullBytes = nMaskBits / 8; byte finalByte = (byte) (0xFF00 >> (nMaskBits & 0x07)); for (int i = 0; i < nMaskFullBytes; i++) { if (remAddr[i] != reqAddr[i]) { return false; } } if (finalByte != 0) { return (remAddr[nMaskFullBytes] & finalByte) == (reqAddr[nMaskFullBytes] & finalByte); } return true; }</code><technical_language>address passed this method a mask, preprocessing is unnecessary here. such, preprocessAddressAndMask method is unnecessary for now</technical_language>

Target:
public boolean matches(String address) { InetAddress remoteAddress = parseAddress(address); if (!requiredAddress.getClass().equals(remoteAddress.getClass())) { return false; } if (nMaskBits < 0) { return remoteAddress.equals(requiredAddress); } byte[] remAddr = remoteAddress.getAddress(); byte[] reqAddr = requiredAddress.getAddress(); int nMaskFullBytes = nMaskBits / 8; byte finalByte = (byte) (0xFF00 >> (nMaskBits & 0x07)); for (int i = 0; i < nMaskFullBytes; i++) { if (remAddr[i] != reqAddr[i]) { return false; } } if (finalByte != 0) { return (remAddr[nMaskFullBytes] & finalByte) == (reqAddr[nMaskFullBytes] & finalByte); } return true; }
Source:
<code>public AlertFilterAPI(ExtensionAlertFilters extension) { super(); this.extension = extension; ApiView alertFilterList = new ApiView(VIEW_ALERT_FILTER_LIST, new String[] {PARAM_CONTEXT_ID}); alertFilterList.setDescriptionTag("alertFilters.api.view.alertFilterList"); this.addApiView(alertFilterList); ApiAction addAlertFilter = new ApiAction( ACTION_ADD_ALERT_FILTER, new String[] {PARAM_CONTEXT_ID, PARAM_RULE_ID, PARAM_NEW_LEVEL}, new String[] { PARAM_URL, PARAM_URL_IS_REGEX, PARAM_PARAMETER, PARAM_PARAMETER_IS_REGEX, PARAM_ATTACK, PARAM_ATTACK_IS_REGEX, PARAM_EVIDENCE, PARAM_EVIDENCE_IS_REGEX, <START> PARAM_ENABLED, <END> }); addAlertFilter.setDescriptionTag("alertFilters.api.action.addAlertFilter"); this.addApiAction(addAlertFilter); ApiAction removeAlertFilter = new ApiAction( ACTION_REMOVE_ALERT_FILTER, new String[] {PARAM_CONTEXT_ID, PARAM_RULE_ID, PARAM_NEW_LEVEL}, new String[] { PARAM_URL, PARAM_URL_IS_REGEX, PARAM_PARAMETER, PARAM_PARAMETER_IS_REGEX, PARAM_ATTACK, PARAM_ATTACK_IS_REGEX, PARAM_EVIDENCE, PARAM_EVIDENCE_IS_REGEX, PARAM_ENABLED, }); removeAlertFilter.setDescriptionTag("alertFilters.api.action.removeAlertFilter"); this.addApiAction(removeAlertFilter); }</code><technical_language>This create "problems" generating clients, enabled in place</technical_language>

Target:
public AlertFilterAPI(ExtensionAlertFilters extension) { super(); this.extension = extension; ApiView alertFilterList = new ApiView(VIEW_ALERT_FILTER_LIST, new String[] {PARAM_CONTEXT_ID}); alertFilterList.setDescriptionTag("alertFilters.api.view.alertFilterList"); this.addApiView(alertFilterList); ApiAction addAlertFilter = new ApiAction( ACTION_ADD_ALERT_FILTER, new String[] {PARAM_CONTEXT_ID, PARAM_RULE_ID, PARAM_NEW_LEVEL}, new String[] { PARAM_URL, PARAM_URL_IS_REGEX, PARAM_PARAMETER, PARAM_ENABLED, PARAM_PARAMETER_IS_REGEX, PARAM_ATTACK, PARAM_ATTACK_IS_REGEX, PARAM_EVIDENCE, PARAM_EVIDENCE_IS_REGEX, }); addAlertFilter.setDescriptionTag("alertFilters.api.action.addAlertFilter"); this.addApiAction(addAlertFilter); ApiAction removeAlertFilter = new ApiAction( ACTION_REMOVE_ALERT_FILTER, new String[] {PARAM_CONTEXT_ID, PARAM_RULE_ID, PARAM_NEW_LEVEL}, new String[] { PARAM_URL, PARAM_URL_IS_REGEX, PARAM_PARAMETER, PARAM_ENABLED, PARAM_PARAMETER_IS_REGEX, PARAM_ATTACK, PARAM_ATTACK_IS_REGEX, PARAM_EVIDENCE, PARAM_EVIDENCE_IS_REGEX, }); removeAlertFilter.setDescriptionTag("alertFilters.api.action.removeAlertFilter"); this.addApiAction(removeAlertFilter); }
Source:
<code>private boolean checkContent(FileSystem fileSystem, UUID shardUuid, BitSet rowsToDelete) { OrcStorageManager manager = createOrcStorageManager(); Optional<BitSet> rows = manager.getRowsFromUuid(fileSystem, Optional.of(shardUuid)); <START> if (rows.isPresent()) { <END> return rows.get().equals(rowsToDelete); } return false; }</code><technical_language>return rows.map(r -> r.equals(rowsToDelete)).orElse(false);</technical_language>

Target:
private boolean checkContent(FileSystem fileSystem, UUID shardUuid, BitSet rowsToDelete) { OrcStorageManager manager = createOrcStorageManager(); Optional<BitSet> rows = manager.getRowsFromUuid(fileSystem, Optional.of(shardUuid)); return rows.map(r -> r.equals(rowsToDelete)).orElse(false); }
Source:
<code>public ByteBuffer serialize(String object) throws IOException { <START> LOG.info("serializing {}", object); <END> ByteBuffer byteBuffer = ByteBuffer.allocate(object.length()); byteBuffer.put(object.getBytes(CHARSET)); byteBuffer.flip(); return byteBuffer; }</code><technical_language>need for logging</technical_language>

Target:
public ByteBuffer serialize(String object) throws IOException { ByteBuffer byteBuffer = ByteBuffer.allocate(object.length()); byteBuffer.put(object.getBytes(CHARSET)); byteBuffer.flip(); return byteBuffer; }
Source:
<code>public void testWrongSyslogFormat() { udpOperation.get(ElytronDescriptionConstants.SYSLOG_FORMAT).set(BAD_RFC_STRING); ModelNode response = services.executeOperation(udpOperation); <START> assertCorrectError(response, "No enum constant org.jboss.logmanager.handlers.SyslogHandler.SyslogType.RFC1"); <END> assertFailed(response); }</code><technical_language>actual message here. message ID a pattern of message ID "RFC1" portion. reason is this test break if translations in</technical_language>

Target:
public void testWrongSyslogFormat() { udpOperation.get(ElytronDescriptionConstants.SYSLOG_FORMAT).set(BAD_RFC_STRING); ModelNode response = services.executeOperation(udpOperation); assertCorrectError(response, new String[] {"WFLYCTL0158", "RFC1"}); assertFailed(response); }
Source:
<code>public void safeRun() { boolean force = forceGarbageCollection.get(); if (force) { LOG.info("Garbage collector thread forced to perform GC before expiry of wait time."); } if (compactor instanceof TransactionalEntryLogCompactor) { <START> ((TransactionalEntryLogCompactor) compactor).cleanUpAndRecover(); <END> } entryLogMetaMap = extractMetaFromEntryLogs(entryLogMetaMap); doGcLedgers(); doGcEntryLogs(); boolean suspendMajor = suspendMajorCompaction.get(); boolean suspendMinor = suspendMinorCompaction.get(); if (suspendMajor) { LOG.info("Disk almost full, suspend major compaction to slow down filling disk."); } if (suspendMinor) { LOG.info("Disk full, suspend minor compaction to slow down filling disk."); } long curTime = MathUtils.now(); if (enableMajorCompaction && (!suspendMajor) && (force || curTime - lastMajorCompactionTime > majorCompactionInterval)) { LOG.info("Enter major compaction, suspendMajor {}", suspendMajor); doCompactEntryLogs(majorCompactionThreshold); lastMajorCompactionTime = MathUtils.now(); lastMinorCompactionTime = lastMajorCompactionTime; forceGarbageCollection.set(false); return; } if (enableMinorCompaction && (!suspendMinor) && (force || curTime - lastMinorCompactionTime > minorCompactionInterval)) { LOG.info("Enter minor compaction, suspendMinor {}", suspendMinor); doCompactEntryLogs(minorCompactionThreshold); lastMinorCompactionTime = MathUtils.now(); } forceGarbageCollection.set(false); }</code><technical_language>is add empty default method _cleanUpAndRecover_ AbstractLogCompactor override in TransactionalEntryLogCompactor . a more "object oriented"</technical_language>

Target:
public void safeRun() { boolean force = forceGarbageCollection.get(); if (force) { LOG.info("Garbage collector thread forced to perform GC before expiry of wait time."); } compactor.cleanUpAndRecover(); entryLogMetaMap = extractMetaFromEntryLogs(entryLogMetaMap); doGcLedgers(); doGcEntryLogs(); boolean suspendMajor = suspendMajorCompaction.get(); boolean suspendMinor = suspendMinorCompaction.get(); if (suspendMajor) { LOG.info("Disk almost full, suspend major compaction to slow down filling disk."); } if (suspendMinor) { LOG.info("Disk full, suspend minor compaction to slow down filling disk."); } long curTime = MathUtils.now(); if (enableMajorCompaction && (!suspendMajor) && (force || curTime - lastMajorCompactionTime > majorCompactionInterval)) { LOG.info("Enter major compaction, suspendMajor {}", suspendMajor); doCompactEntryLogs(majorCompactionThreshold); lastMajorCompactionTime = MathUtils.now(); lastMinorCompactionTime = lastMajorCompactionTime; forceGarbageCollection.set(false); return; } if (enableMinorCompaction && (!suspendMinor) && (force || curTime - lastMinorCompactionTime > minorCompactionInterval)) { LOG.info("Enter minor compaction, suspendMinor {}", suspendMinor); doCompactEntryLogs(minorCompactionThreshold); lastMinorCompactionTime = MathUtils.now(); } forceGarbageCollection.set(false); }
Source:
<code>private void onDeleteClicked(Spinner spinner) { String reason = spinner.getSelectedItem().toString(); Single<String> deletionReason = reasonBuilder.getReason(media, reason); deletionReason .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(s -> { <START> if(null!=getActivity()) { <END> deleteTask = new DeleteTask(getActivity(), media, reason); deleteTask.execute(); } isDeleted = true; enableDeleteButton(false); }); }</code><technical_language>suggestion if (getActivity() != null) { <LINK_0></technical_language>

Target:
private void onDeleteClicked(Spinner spinner) { String reason = spinner.getSelectedItem().toString(); Single<String> deletionReason = reasonBuilder.getReason(media, reason); deletionReason .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(s -> { if (getActivity() != null) { deleteTask = new DeleteTask(getActivity(), media, reason); deleteTask.execute(); isDeleted = true; enableDeleteButton(false); } }); }
Source:
<code>public FieldInfo relationshipField(String relationshipName, Direction relationshipDirection, boolean strict) { for (FieldInfo fieldInfo : relationshipFields()) { String relationship = strict ? fieldInfo.relationshipTypeAnnotation() : fieldInfo.relationship(); <START> if (relationshipName.equalsIgnoreCase(relationship)) { <END> if (((fieldInfo.relationshipDirectionOrDefault(Direction.OUTGOING).equals(Direction.INCOMING) || fieldInfo .relationshipDirectionOrDefault(Direction.OUTGOING).equals(Direction.UNDIRECTED)) && (relationshipDirection.equals(Direction.INCOMING))) || (relationshipDirection.equals(Direction.OUTGOING) && !(fieldInfo .relationshipDirectionOrDefault(Direction.OUTGOING).equals(Direction.INCOMING)))) { return fieldInfo; } } } return null; }</code><technical_language>Please ==</technical_language>

Target:
public FieldInfo relationshipField(String relationshipName, Direction relationshipDirection, boolean strict) { for (FieldInfo fieldInfo : relationshipFields()) { String relationship = strict ? fieldInfo.relationshipTypeAnnotation() : fieldInfo.relationship(); if (relationshipName.equalsIgnoreCase(relationship)) { Direction declaredDirection = fieldInfo.relationshipDirectionOrDefault(Direction.OUTGOING); if (isActualDirectionCompatibleWithDeclaredDirection(relationshipDirection, declaredDirection)) { return fieldInfo; } } } return null; }
Source:
<code>public String getCellDataValueByPosition(int row, int col) { assertIsLegalCell(row, col); Object obj = widget.getDataValueByPosition(col, row); if(obj != null) { return obj.toString(); } <START> else <END> return ""; }</code><technical_language>{} block please</technical_language>

Target:
public String getCellDataValueByPosition(int row, int col) { assertIsLegalCell(row, col); Object obj = widget.getDataValueByPosition(col, row); if (obj != null) { return obj.toString(); } else { return ""; } }
Source:
<code>public Predicate<ChangeData> message(String text) { <START> return new MessagePredicate(args.dbProvider, args.repoManager, args.index, text); <END> }</code><technical_language>message operator is supported if secondary index is enabled, check for this creating predicate (the is done for file operator): if (args.index == ChangeIndex.DISABLED) { throw error("secondary index enabled for message:" + text); }</technical_language>

Target:
public Predicate<ChangeData> message(String text) { return new MessagePredicate(args.dbProvider, args.index, text); }
Source:
<code>private List<KeyValue<Windowed<String>, Long>> toList(final KeyValueIterator<Bytes, byte[]> iterator) { final List<KeyValue<Windowed<String>, Long>> results = new ArrayList<>(); final StateSerdes<String, Long> stateSerdes = StateSerdes.withBuiltinTypes("dummy", String.class, Long.class); while (iterator.hasNext()) { final KeyValue<Bytes, byte[]> next = iterator.next(); <START> final KeyValue<Windowed<String>, Long> deserialized; <END> if (schema instanceof WindowKeySchema) { deserialized = KeyValue.pair( WindowKeySchema.fromStoreKey( next.key.get(), windowSizeForTimeWindow, stateSerdes.keyDeserializer(), stateSerdes.topic() ), stateSerdes.valueDeserializer().deserialize("dummy", next.value) ); } else { deserialized = KeyValue.pair( SessionKeySchema.from(next.key.get(), stateSerdes.keyDeserializer(), "dummy"), stateSerdes.valueDeserializer().deserialize("dummy", next.value) ); } results.add(deserialized); } return results; }</code><technical_language>a huge fan of this "clean up". trading a tightly defined scope for de-duplicating trivial line results.add(deserialization). a good trade me</technical_language>

Target:
private List<KeyValue<Windowed<String>, Long>> toList(final KeyValueIterator<Bytes, byte[]> iterator) { final List<KeyValue<Windowed<String>, Long>> results = new ArrayList<>(); final StateSerdes<String, Long> stateSerdes = StateSerdes.withBuiltinTypes("dummy", String.class, Long.class); while (iterator.hasNext()) { final KeyValue<Bytes, byte[]> next = iterator.next(); if (schema instanceof WindowKeySchema) { final KeyValue<Windowed<String>, Long> deserialized = KeyValue.pair( WindowKeySchema.fromStoreKey( next.key.get(), windowSizeForTimeWindow, stateSerdes.keyDeserializer(), stateSerdes.topic() ), stateSerdes.valueDeserializer().deserialize("dummy", next.value) ); results.add(deserialized); } else { final KeyValue<Windowed<String>, Long> deserialized = KeyValue.pair( SessionKeySchema.from(next.key.get(), stateSerdes.keyDeserializer(), "dummy"), stateSerdes.valueDeserializer().deserialize("dummy", next.value) ); results.add(deserialized); } } return results; }
Source:
<code>protected void validate(CompilationUnit unit, ProblemCollector collector) { <START> if (Utils.isSequenceDiagramDescription(unit)) { <END> unit.accept(new SequenceDiagramVisitor(collector)); } }</code><technical_language>I this is necessary here, visitor filters sequence classes. Note in case of model errors, isModelElement check is needed, for invalid type declarations model packages well</technical_language>

Target:
protected void validate(CompilationUnit unit, ProblemCollector collector) { if (!ElementTypeTeller.isModelElement(unit)) { unit.accept(new SequenceDiagramVisitor(collector)); } }
Source:
<code>public boolean attachManagedBlockStorageDisks(VM vm, VmHandler vmHandler, VDS vds) { if (vm.getDiskMap().isEmpty()) { vmHandler.updateDisksFromDb(vm); } List<ManagedBlockStorageDisk> disks = DisksFilter.filterManagedBlockStorageDisks(vm.getDiskMap().values()); if <START> (vds.getConnectorInfo() == null && !disks.isEmpty()) { <END> AuditLogable event = new AuditLogableImpl(); event.addCustomValue("VdsName", vds.getName()); event.addCustomValue("VmName", vm.getName()); auditLogDirector.log(event, AuditLogType.CONNECTOR_INFO_MISSING_ON_VDS); return false; } return disks.stream() .allMatch(disk -> { VmDevice vmDevice = vmDeviceDao.get(new VmDeviceId(disk.getImageId(), vm.getId())); return this.saveDevices(disk, vds, vmDevice); }); }</code><technical_language>!disks.isEmpty() && vds.getConnectorInfo() == null</technical_language>

Target:
public boolean attachManagedBlockStorageDisks(VM vm, VmHandler vmHandler, VDS vds) { if (vm.getDiskMap().isEmpty()) { vmHandler.updateDisksFromDb(vm); } List<ManagedBlockStorageDisk> disks = DisksFilter.filterManagedBlockStorageDisks(vm.getDiskMap().values()); if (!disks.isEmpty() && vds.getConnectorInfo() == null) { AuditLogable event = new AuditLogableImpl(); event.addCustomValue("VdsName", vds.getName()); event.addCustomValue("VmName", vm.getName()); auditLogDirector.log(event, AuditLogType.CONNECTOR_INFO_MISSING_ON_VDS); return false; } return disks.stream() .allMatch(disk -> { VmDevice vmDevice = vmDeviceDao.get(new VmDeviceId(disk.getImageId(), vm.getId())); return this.saveDevices(disk, vds, vmDevice); }); }
Source:
<code>public static boolean isKeyFrame(byte[] buff, int off, int len) { <START> if (buff == null || buff.length < off + len || len < RTPHeader.SIZE) <END> { return false; } if (!DePacketizer.VP8PayloadDescriptor.isValid(buff, off)) { return false; } if (!DePacketizer.VP8PayloadDescriptor.isStartOfFrame(buff, off)) { return false; } int szVP8PayloadDescriptor = DePacketizer .VP8PayloadDescriptor.getSize(buff, off); return DePacketizer.VP8PayloadHeader.isKeyFrame( buff, off + szVP8PayloadDescriptor); }</code><technical_language>RawPacket.FIXED_HEADER_SIZE instead? avoid adding dependency fmj</technical_language>

Target:
public static boolean isKeyFrame(byte[] buff, int off, int len) { if (buff == null || buff.length < off + len || len < RawPacket.FIXED_HEADER_SIZE) { return false; } if (!DePacketizer.VP8PayloadDescriptor.isValid(buff, off)) { return false; } if (!DePacketizer.VP8PayloadDescriptor.isStartOfFrame(buff, off)) { return false; } int szVP8PayloadDescriptor = DePacketizer .VP8PayloadDescriptor.getSize(buff, off); return DePacketizer.VP8PayloadHeader.isKeyFrame( buff, off + szVP8PayloadDescriptor); }
Source:
<code>protected ViewModel doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { String sptoken = Strings.clean(fieldValueResolver.getValue(request, "sptoken")); if (sptoken == null) { if (isJsonPreferred(request, response)) { Map<String,Object> model = new HashMap<String, Object>(); model.put("status", HttpServletResponse.SC_BAD_REQUEST); model.put("message", i18n(request, "stormpath.web.verifyEmail.form.errors.noToken")); response.setStatus(HttpServletResponse.SC_BAD_REQUEST); return new DefaultViewModel("stormpathJsonView", model); } Map<String, ?> model = createModel(request, response); return new DefaultViewModel(view, model).setRedirect(false); } try { return verify(request, response, sptoken); } catch (Exception e) { if (isJsonPreferred(request, response)) { Map<String,Object> model = errorModelFactory.toError(request, e).toMap(); errorModelFactory.toError(request, e); response.setStatus(errorModelFactory.toError(request, e).getStatus()); <START> return new DefaultViewModel("stormpathJsonView", model); <END> } List<ErrorModel> errors = new ArrayList<ErrorModel>(); ErrorModel error = ErrorModel.builder().setStatus(HttpServletResponse.SC_BAD_REQUEST).setMessage(i18n(request, "stormpath.web.verifyEmail.form.errors.invalidLink")).build(); errors.add(error); Map<String, ?> model = createModel(request, response, null, errors); return new DefaultViewModel(view, model); } }</code><technical_language>stormpathJsonView a constant somewhere</technical_language>

Target:
protected ViewModel doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { String sptoken = Strings.clean(request.getParameter("sptoken")); if (sptoken == null) { if (isJsonPreferred(request, response)) { Map<String,Object> model = new HashMap<String, Object>(); model.put("status", HttpServletResponse.SC_BAD_REQUEST); model.put("message", i18n(request, "stormpath.web.verifyEmail.form.errors.noToken")); response.setStatus(HttpServletResponse.SC_BAD_REQUEST); return new DefaultViewModel(STORMPATH_JSON_VIEW_NAME, model); } Map<String, ?> model = createModel(request, response); return new DefaultViewModel(view, model).setRedirect(false); } try { return verify(request, response, sptoken); } catch (Exception e) { if (isJsonPreferred(request, response)) { ErrorModel error = errorModelFactory.toError(request, e); response.setStatus(error.getStatus()); Map<String,Object> model = error.toMap(); return new DefaultViewModel(STORMPATH_JSON_VIEW_NAME, model); } List<ErrorModel> errors = new ArrayList<ErrorModel>(); ErrorModel error = ErrorModel.builder().setStatus(HttpServletResponse.SC_BAD_REQUEST).setMessage(i18n(request, "stormpath.web.verifyEmail.form.errors.invalidLink")).build(); errors.add(error); Map<String, ?> model = createModel(request, response, null, errors); return new DefaultViewModel(view, model); } }
Source:
<code>public void testCountMismatches(final String readString, final String cigar, final String reference, final int expectedMismatchesExact, final int expectedMismatchesAmbiguous) { final SAMRecord rec = new SAMRecord(null); rec.setReadName("test"); rec.setReadString(readString); final byte[] byteArray = new byte[readString.length()]; <START> for(int i =0; i< readString.length();i++){ <END> byteArray[i]=(byte)33; } rec.setBaseQualities(byteArray); rec.setCigarString(cigar); final byte[] refBases = StringUtil.stringToBytes(reference); final int nExact = SequenceUtil.countMismatches(rec, refBases, -1, false, false); Assert.assertEquals(nExact, expectedMismatchesExact); final int sumMismatchesQualityExact = SequenceUtil.sumQualitiesOfMismatches(rec, refBases, -1, false); Assert.assertEquals(sumMismatchesQualityExact, expectedMismatchesExact * 33); final int nAmbiguous = SequenceUtil.countMismatches(rec, refBases, -1, false, true); Assert.assertEquals(nAmbiguous, expectedMismatchesAmbiguous); }</code><technical_language>Arrays.fill save a lines here</technical_language>

Target:
public void testCountMismatches(final String readString, final String cigar, final String reference, final int expectedMismatchesExact, final int expectedMismatchesAmbiguous) { final SAMRecord rec = new SAMRecord(null); rec.setReadName("test"); rec.setReadString(readString); final byte[] byteArray = new byte[readString.length()]; Arrays.fill(byteArray, (byte)33); rec.setBaseQualities(byteArray); rec.setCigarString(cigar); final byte[] refBases = StringUtil.stringToBytes(reference); final int nExact = SequenceUtil.countMismatches(rec, refBases, -1, false, false); Assert.assertEquals(nExact, expectedMismatchesExact); final int sumMismatchesQualityExact = SequenceUtil.sumQualitiesOfMismatches(rec, refBases, -1, false); Assert.assertEquals(sumMismatchesQualityExact, expectedMismatchesExact * 33); final int nAmbiguous = SequenceUtil.countMismatches(rec, refBases, -1, false, true); Assert.assertEquals(nAmbiguous, expectedMismatchesAmbiguous); }
Source:
<code>public GavinJobExecution findGavinJobExecution(String jobIdentifier) { GavinJobExecution result = dataService.findOneById(GAVIN_JOB_EXECUTION, jobIdentifier, GavinJobExecution.class); if (result == null) { <START> throw new UnknownEntityException(dataService.getEntityType(GAVIN_JOB_EXECUTION), jobIdentifier); <END> } return result; }</code><technical_language>autowire metadata</technical_language>

Target:
public GavinJobExecution findGavinJobExecution(String jobIdentifier) { GavinJobExecution result = dataService.findOneById(GAVIN_JOB_EXECUTION, jobIdentifier, GavinJobExecution.class); if (result == null) { throw new UnknownEntityException(gavinJobExecutionMetaData, jobIdentifier); } return result; }
Source:
<code>public void visitToken(DetailAST ast) { DetailAST astNode; switch (ast.getType()) { case TokenTypes.TYPECAST: <START> astNode = ast.findFirstToken(TokenTypes.RPAREN); <END> break; case TokenTypes.ARRAY_DECLARATOR: astNode = getArrayDeclaratorPreviousElement(ast); break; case TokenTypes.INDEX_OP: astNode = getIndexOpPreviousElement(ast); break; default: astNode = ast; } final String line = getLine(ast.getLineNo() - 1); final int after = getPositionAfter(astNode); if ((after >= line.length() || Character.isWhitespace(line.charAt(after))) && hasRedundantWhitespace(line, after)) { log(astNode.getLineNo(), after, MSG_KEY, astNode.getText()); } }</code><technical_language>@mkordas , do expect ? If is counting of metrics - please switch off. need notification if method is more approved limit</technical_language>

Target:
public void visitToken(DetailAST ast) { final DetailAST whitespaceFollowedAst = getWhitespaceFollowedNode(ast); final int whitespaceColumnNo = getPositionAfter(whitespaceFollowedAst); final int whitespaceLineNo = whitespaceFollowedAst.getLineNo(); if (hasTrailingWhitespace(ast, whitespaceColumnNo, whitespaceLineNo)) { log(whitespaceLineNo, whitespaceColumnNo, MSG_KEY, whitespaceFollowedAst.getText()); } }
Source:
<code>private List<Observation> convertObservationMapToList(Map<String, String> observations, DateTime obsDatetime) { List<Observation> observationList = new ArrayList<>(); for (String observationConceptName : observations.keySet()) { if (valueIsNotEmpty(observations, observationConceptName)) { String[] observationValues = observations.get(observationConceptName).replace(", ", ",").split(","); for (String value : observationValues) { <START> if (value != null && !value.isEmpty()) { <END> Observation observation = new Observation(); ConceptName conceptName = new ConceptName(observationConceptName); Concept concept = new Concept(conceptName); observation.setConcept(concept); Observation.ObservationValue observationValue = new Observation.ObservationValue(value); observation.setValue(observationValue); observation.setObsDatetime(obsDatetime.toDate()); observationList.add(observation); } } } else { LOGGER.warn("Observation value is null or empty for concept: " + observationConceptName + " and will not be created"); } } return observationList; }</code><technical_language>StringUtils.isNotEmpty</technical_language>

Target:
private List<Observation> convertObservationMapToList(Map<String, String> observations, DateTime obsDatetime) { List<Observation> observationList = new ArrayList<>(); for (String observationConceptName : observations.keySet()) { if (valueIsNotEmpty(observations, observationConceptName)) { String[] observationValues = observations.get(observationConceptName).replace(", ", ",").split(","); for (String value : observationValues) { if (StringUtils.isNotEmpty(value)) { Observation observation = new Observation(); ConceptName conceptName = new ConceptName(observationConceptName); Concept concept = new Concept(conceptName); observation.setConcept(concept); Observation.ObservationValue observationValue = new Observation.ObservationValue(value); observation.setValue(observationValue); observation.setObsDatetime(obsDatetime.toDate()); observationList.add(observation); } } } else { LOGGER.warn("Observation value is null or empty for concept: " + observationConceptName + " and will not be created"); } } return observationList; }
Source:
<code>public static String autoConvert(long size , SizeUnit inUnit) { <START> for(long i = (SizeUnit.values())[SizeUnit.values().length - 1].getUnitWeight(); i >= inUnit.getUnitWeight(); i-- ) { <END> if(size/Math.pow(CONVERT_FACTOR, i-1) >= 1) { return ((String.valueOf(convert(size, inUnit, SizeUnit.getUnit(i)).floatValue())).concat(" ")).concat(SizeUnit.getUnit(i).toString()); } } return String.valueOf(size).concat(" ").concat(SizeUnit.BYTES.toString()); }</code><technical_language>This code relies implementation of values() method of enum type. requires user adds additional entity enum maintain order. ordered list (as this code assumes) in SizeUnit iterate in a safer manner</technical_language>

Target:
public static Size autoConvert(long size , SizeUnit inUnit) { for(long i = (SizeUnit.values())[SizeUnit.values().length - 1].getUnitWeight(); i >= inUnit.getUnitWeight(); i-- ) { if(size/Math.pow(CONVERT_FACTOR, i-1) >= 1) { return new SizeConverter.Size(SizeConverter.SizeUnit.getUnit(i), SizeConverter.convert(size, inUnit, SizeUnit.getUnit(i)).doubleValue()); } } return new Size(SizeUnit.BYTES, new Double(new Long(size))); }
Source:
<code>public void testAddNetworkToNicAlongWithAddingItIntoBond() { Network networkA = createNetworkWithName("networkA"); VdsNetworkInterface nicA = createNic("nicA"); VdsNetworkInterface nicB = createNic("nicB"); NetworkAttachment networkAttachment = createNetworkAttachment(networkA, (Guid)null); networkAttachment.setNicId(nicA.getId()); networkAttachment.setNicName(nicA.getName()); networkAttachment.setNetworkId(networkA.getId()); networkAttachment.setNetworkName(networkA.getName()); Bond bond = new Bond(); bond.setName("bond1"); setBondSlaves(bond, nicA, nicB); addNetworkIdToNetworkDaoMock(networkA); addNetworkToClusterDaoMock(networkA.getId()); HostSetupNetworksValidator validator = new HostSetupNetworksValidatorBuilder() .setParams(new ParametersBuilder() .addNetworkAttachments(networkAttachment) <START> .addBonds(CreateOrUpdateBond.fromBond(bond)) <END> .build()) .addExistingInterfaces(nicA, nicB) .addNetworks(networkA) .build(); ValidationResult validate = validator.validate(); assertThat(validate, not(isValid())); EngineMessage engineMessage = EngineMessage.NETWORK_INTERFACE_ADDED_TO_BOND_AND_NETWORK_IS_ATTACHED_TO_IT_AT_THE_SAME_TIME; assertThat(validate, failsWith(engineMessage, ReplacementUtils.getVariableAssignmentString(engineMessage, nicA.getName()), ReplacementUtils.createSetVariableString(HostSetupNetworksValidator.VAR_NETWORK_NAME, networkA.getName()))); }</code><technical_language>#838</technical_language>

Target:
public void testAddNetworkToNicAlongWithAddingItIntoBond() { Network networkA = createNetworkWithName("networkA"); VdsNetworkInterface nicA = createNic("nicA"); VdsNetworkInterface nicB = createNic("nicB"); NetworkAttachment networkAttachment = createNetworkAttachment(networkA, (Guid)null); networkAttachment.setNicId(nicA.getId()); networkAttachment.setNicName(nicA.getName()); networkAttachment.setNetworkId(networkA.getId()); networkAttachment.setNetworkName(networkA.getName()); CreateOrUpdateBond createOrUpdateBond = createNewCreateOrUpdateBond(Guid.newGuid(), "bond1", nicA.getName(), nicB.getName()); addNetworkIdToNetworkDaoMock(networkA); addNetworkToClusterDaoMock(networkA.getId()); HostSetupNetworksValidator validator = new HostSetupNetworksValidatorBuilder() .setParams(new ParametersBuilder() .addNetworkAttachments(networkAttachment) .addBonds(createOrUpdateBond) .build()) .addExistingInterfaces(nicA, nicB) .addNetworks(networkA) .build(); ValidationResult validate = validator.validate(); assertThat(validate, not(isValid())); EngineMessage engineMessage = EngineMessage.NETWORK_INTERFACE_ADDED_TO_BOND_AND_NETWORK_IS_ATTACHED_TO_IT_AT_THE_SAME_TIME; assertThat(validate, failsWith(engineMessage, ReplacementUtils.getVariableAssignmentString(engineMessage, nicA.getName()), ReplacementUtils.createSetVariableString(HostSetupNetworksValidator.VAR_NETWORK_NAME, networkA.getName()))); }
Source:
<code>public void onItemClick(int position) { Intent intent = new Intent(this, ListActivity.class); String listName = nameListsAdapter.getItem(position); intent.putExtra(LIST_NAME_KEY, listName); <START> intent.putExtra(LIST_TYPE, NAME_CHOOSING_FRAGMENT); <END> intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); startActivity(intent); }</code><technical_language>move a simple, declarative boolean passing model, need this line</technical_language>

Target:
public void onItemClick(int position) { Intent intent = new Intent(this, ListActivity.class); String listName = nameListsAdapter.getItem(position); intent.putExtra(LIST_NAME_KEY, listName); intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); startActivity(intent); }
Source:
<code>public void testGetListTrialSummariesBadSorterOrder() throws Exception { UriComponents uriComponents = UriComponentsBuilder.newInstance().path("/maize/brapi/v1/trials") .queryParam("programDbId", 1).queryParam("pageSize", 10) .queryParam("pageNumber", 1) <START> .queryParam("sortOrder", "Ascendin").build().encode(); <END> this.mockMvc.perform(MockMvcRequestBuilders.get(uriComponents.toUriString()).contentType(this.contentType)) .andExpect(MockMvcResultMatchers.status().isNotFound()) .andDo(MockMvcResultHandlers.print()).andExpect(jsonPath("$.metadata.status.message", is("sortOrder bad filter, expect Ascending/Descending"))) ; }</code><technical_language>Ascending</technical_language>

Target:
public void testGetListTrialSummariesBadSorterOrder() throws Exception { UriComponents uriComponents = UriComponentsBuilder.newInstance().path("/maize/brapi/v1/trials") .queryParam("programDbId", 1).queryParam("pageSize", 10) .queryParam("pageNumber", 1) .queryParam("sortOrder", "invalid_sort_order").build().encode(); this.mockMvc.perform(MockMvcRequestBuilders.get(uriComponents.toUriString()).contentType(this.contentType)) .andExpect(MockMvcResultMatchers.status().isNotFound()) .andDo(MockMvcResultHandlers.print()).andExpect(jsonPath("$.metadata.status.message", is("sortOrder bad filter, expect asc/desc"))) ; }
Source:
<code>protected AbstractContentStore( ContentHasher hasher, IdGenerator idGenerator, MessageSender<ResourceUpdatedMessage> sender, EquivalenceGraphStore graphStore, Clock clock, MetricRegistry metricRegistry, String metricPrefix ) { this.hasher = checkNotNull(hasher); this.idGenerator = checkNotNull(idGenerator); this.sender = checkNotNull(sender); this.graphStore = checkNotNull(graphStore); this.clock = checkNotNull(clock); this.writingVisitor = new ContentWritingVisitor(); this.metricRegistry = metricRegistry; writeContent = metricPrefix + "writeContent"; writeBroadcast = metricPrefix + "writeBroadcast"; <START> visit = metricPrefix + "visit"; <END> }</code><technical_language>missed periods. guessing prefix a trailing this be: writeContent = metricPrefix + "writeContent."; writeBroadcast = metricPrefix + "writeBroadcast."; visit = metricPrefix + "visit.";</technical_language>

Target:
protected AbstractContentStore( ContentHasher hasher, IdGenerator idGenerator, MessageSender<ResourceUpdatedMessage> sender, EquivalenceGraphStore graphStore, Clock clock, MetricRegistry metricRegistry, String metricPrefix ) { this.hasher = checkNotNull(hasher); this.idGenerator = checkNotNull(idGenerator); this.sender = checkNotNull(sender); this.graphStore = checkNotNull(graphStore); this.clock = checkNotNull(clock); this.writingVisitor = new ContentWritingVisitor(); this.metricRegistry = metricRegistry; writeContent = metricPrefix + "writeContent."; writeBroadcast = metricPrefix + "writeBroadcast."; visitMeterPrefix = metricPrefix + "visitMeterPrefix"; }
Source:
<code>public IndexedSeq<Character> scan(Character zero, BiFunction<? super Character, ? super Character, ? extends Character> operation) { <START> return Collections.scanLeft(this, zero, operation, Iterator::toCharSeq); <END> }</code><technical_language>Awesome, fast :-) method return CharSeq instead of IndexedSeq&lt;Character&gt;</technical_language>

Target:
public CharSeq scan(Character zero, BiFunction<? super Character, ? super Character, ? extends Character> operation) { return Collections.scanLeft(this, zero, operation, Iterator::toCharSeq); }
Source:
<code>public void write(OutputStream out) { try { IOUtils.copy(results.getInputStream(), out); <START> results.disconnect(); <END> } catch (IOException e) { throw new WebApplicationException(Response.status(Status.SERVICE_UNAVAILABLE).entity("Service Unavailable, IO Exception with Search Engine").build()); } }</code><technical_language>I results.disconnect() in a finally block want release connection back</technical_language>

Target:
public void write(OutputStream out) { try { IOUtils.copy(results.getInputStream(), out); } catch (IOException e) { throw new WebApplicationException(Response.status(Status.SERVICE_UNAVAILABLE).entity("Service Unavailable, IO Exception with Search Engine").build()); } finally { results.disconnect(); } }
Source:
<code>public Response installExtension( final @PathParam("extensionId") @ApiParam(value = "extension ID", required = true) String extensionId) { <START> Executors.newSingleThreadExecutor().execute(new Runnable() { <END> @Override public void run() { try { extensionService.install(extensionId); postInstalledEvent(extensionId); } catch (Exception e) { logger.error("Exception while installing extension: {}", e.getMessage()); postFailureEvent(extensionId, e.getMessage()); } } }); return Response.ok().build(); }</code><technical_language>thread pool manager</technical_language>

Target:
public Response installExtension( final @PathParam("extensionId") @ApiParam(value = "extension ID", required = true) String extensionId) { ThreadPoolManager.getPool(THREAD_POOL_NAME).submit(new Runnable() { @Override public void run() { try { extensionService.install(extensionId); postInstalledEvent(extensionId); } catch (Exception e) { logger.error("Exception while installing extension: {}", e.getMessage()); postFailureEvent(extensionId, e.getMessage()); } } }); return Response.ok().build(); }
Source:
<code>public boolean onKeyUp(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_ENTER) { if (brandText.hasFocus()) { yearText.requestFocus(); return true; } else if (playerNameText.hasFocus()) { teamText.requestFocus(); return true; <START> } else if (teamText.hasFocus() == true) { <END> playerPositionSpinner.requestFocus(); return true; } } return super.onKeyUp(keyCode, event); }</code><technical_language>} else if (teamText.hasFocus()) {</technical_language>

Target:
public boolean onKeyUp(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_ENTER) { if (brandText.hasFocus()) { yearText.requestFocus(); return true; } else if (playerNameText.hasFocus()) { teamText.requestFocus(); return true; } else if (teamText.hasFocus()) { playerPositionSpinner.requestFocus(); return true; } } return super.onKeyUp(keyCode, event); }
Source:
<code>@Test public void queryMapToOneOrDefaultEmpty() { Employee employees = db.createQuery(TABLE_EMPLOYEE, SELECT_EMPLOYEES + " WHERE 1=2") .mapToOneOrDefault(Employee.MAPPER, null) .toBlocking() .first(); <START> assertThat(employees).isNull(); <END> }</code><technical_language>duplicate this test a non-null default? rename this "EmptyUsingNull" something</technical_language>

Target:
@Test public void queryMapToOneOrDefaultEmpty() { Employee employees = db.createQuery(TABLE_EMPLOYEE, SELECT_EMPLOYEES + " WHERE 1=2") .mapToOneOrDefault(Employee.MAPPER, new Employee("bob", "Bob Bobberson")) .toBlocking() .first(); assertThat(employees).isEqualTo(new Employee("bob", "Bob Bobberson")); }