auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private IProbeArrayStrategy createStrategyFor(final ClassLoader classLoader, final long classId, final String className, final int probeCount) { final Class<?> cls; final String field; synchronized (companions) { Companion companion = companions.get(classLoader); if (companion == null) { final byte[] definition = createCompanionClass(); try { cls = (Class<?>) DEFINE_CLASS.invoke(classLoader, COMPANION_NAME, definition, 0, definition.length); companion = new Companion(cls); } catch (IllegalAccessException e) { throw new RuntimeException(e); } catch (InvocationTargetException e) { throw new RuntimeException(e); } companions.put(classLoader, companion); } else { cls = companion.cls.get(); assert cls != null; } if (companion.usedFields == FIELDS_PER_CLASS) { <START> throw new UnsupportedOperationException(); <END> } field = "p" + companion.usedFields; companion.usedFields++; } final boolean[] probes = runtimeData .getExecutionData(classId, className, probeCount).getProbes(); try { cls.getField(field).set(null, probes); } catch (IllegalAccessException e) { throw new RuntimeException(); } catch (NoSuchFieldException e) { throw new RuntimeException(); } return new IProbeArrayStrategy() { public int storeInstance(MethodVisitor mv, int variable) { mv.visitFieldInsn(Opcodes.GETSTATIC, COMPANION_NAME, field, InstrSupport.DATAFIELD_DESC); mv.visitVarInsn(Opcodes.ASTORE, variable); return 1; } public void addMembers(ClassVisitor cv, int probeCount) { } }; }</code><technical_language>This unfortunate limitation. additional companion classes generated needed limit is reached</technical_language>

Target:
private IProbeArrayStrategy createStrategyFor(final ClassLoader classLoader, final long classId, final String className, final int probeCount) { final Class<?> cls; final String companionName; final int fieldId; synchronized (companions) { Companion companion = companions.get(classLoader); if (companion == null) { companion = new Companion(); companion.defineNew(classLoader); companions.put(classLoader, companion); } else if (companion.usedFields == FIELDS_PER_CLASS) { companion.defineNew(classLoader); } cls = companion.cls.get(); assert cls != null; companionName = companion.getName(); fieldId = companion.usedFields; companion.usedFields++; } final boolean[] probes = runtimeData .getExecutionData(classId, className, probeCount).getProbes(); try { cls.getMethod(INIT_METHOD_NAME, int.class, boolean[].class) .invoke(null, fieldId, probes); } catch (IllegalAccessException e) { throw new RuntimeException(); } catch (NoSuchMethodException e) { throw new RuntimeException(e); } catch (InvocationTargetException e) { throw new RuntimeException(e.getCause()); } return new IProbeArrayStrategy() { public int storeInstance(MethodVisitor mv, int variable) { mv.visitFieldInsn(Opcodes.GETSTATIC, companionName, fieldNameFor(fieldId), InstrSupport.DATAFIELD_DESC); mv.visitVarInsn(Opcodes.ASTORE, variable); return 1; } public void addMembers(ClassVisitor cv, int probeCount) { } }; }
Source:
<code><START> public List<Thing> parseGeneric(String jsonText) throws ParseException, RedditError { <END> return parseGeneric(jsonText, "children"); }</code><technical_language>parseGeneric sounds too...generic :)</technical_language>

Target:
public List<Thing> parseGeneric(String jsonText) throws RedditParseException { return parseGeneric(jsonText, "children"); }
Source:
<code>public List<ProgramState> setConstraint(ProgramState initialProgramState, BooleanConstraint booleanConstraint) { if (booleanConstraint == BooleanConstraint.FALSE) { return inverse().setConstraint(initialProgramState, BooleanConstraint.TRUE); } <START> Set<RelationalSymbolicValue> knownRelations = knownRelations(initialProgramState).collect(Collectors.toSet()); <END> Set<RelationalSymbolicValue> newRelations = new HashSet<>(); newRelations.add(this); newRelations.addAll(transitiveRelations(knownRelations)); boolean unfulfilled = newRelations.stream() .map(r -> r.resolveState(knownRelations)) .anyMatch(RelationState.UNFULFILLED::equals); if (unfulfilled) { return ImmutableList.of(); } return getNewProgramStates(initialProgramState, newRelations); }</code><technical_language>method knownRelations is I point of making returning a stream. return a set. I wondering making this method part of PS. else</technical_language>

Target:
public List<ProgramState> setConstraint(ProgramState initialProgramState, BooleanConstraint booleanConstraint) { if (booleanConstraint == BooleanConstraint.FALSE) { return inverse().setConstraint(initialProgramState, BooleanConstraint.TRUE); } Set<RelationalSymbolicValue> knownRelations = knownRelations(initialProgramState); Set<RelationalSymbolicValue> newRelations = new HashSet<>(); newRelations.add(this); newRelations.addAll(transitiveRelations(knownRelations)); boolean unfulfilled = newRelations.stream() .map(r -> r.resolveRelationState(knownRelations)) .anyMatch(RelationState.UNFULFILLED::equals); if (unfulfilled) { return ImmutableList.of(); } return getNewProgramStates(initialProgramState, newRelations); }
Source:
<code><START> boolean hasInflightBatches(TopicPartition topicPartition) { <END> return topicPartitionBookkeeper.contains(topicPartition) && !topicPartitionBookkeeper.getPartition(topicPartition).inflightBatchesBySequence.isEmpty(); }</code><technical_language>this method need synchronized</technical_language>

Target:
synchronized boolean hasInflightBatches(TopicPartition topicPartition) { return topicPartitionBookkeeper.contains(topicPartition) && !topicPartitionBookkeeper.getPartition(topicPartition).inflightBatchesBySequence.isEmpty(); }
Source:
<code>public Concept getNonCodedDrugConcept() { String conceptUuid = Context.getAdministrationService().getGlobalProperty(OpenmrsConstants.GP_DRUG_ORDER_DRUG_OTHER); <START> if (org.apache.commons.lang.StringUtils.isNotBlank(conceptUuid)) { <END> return Context.getConceptService().getConceptByUuid(conceptUuid); } return null; }</code><technical_language>update this StringUtils spring is imported in class, I equivalent method call is StringUtils.hasText()</technical_language>

Target:
public Concept getNonCodedDrugConcept() { String conceptUuid = Context.getAdministrationService().getGlobalProperty(OpenmrsConstants.GP_DRUG_ORDER_DRUG_OTHER); if (StringUtils.hasText(conceptUuid)) { return Context.getConceptService().getConceptByUuid(conceptUuid); } return null; }
Source:
<code><START> public ValidationResult canVnicWithExternalNetworkBePlugged() { <END> if (RequiredAction.PLUG == getRequiredAction() && !nic.isLinked()) { final boolean vnicAttachedToExternalNetwork = isVnicAttachedToExternalNetwork(); if (validationResult != ValidationResult.VALID) { return validationResult; } if (vnicAttachedToExternalNetwork) { return new ValidationResult(VdcBllMessages.PLUGGED_UNLINKED_VM_INTERFACE_WITH_EXTERNAL_NETWORK_IS_NOT_SUPPORTED); } } return ValidationResult.VALID; }</code><technical_language>simplified to: ValidationResult.failWith(VdcBllMessages.PLUGGED_UNLINKED_VM_INTERFACE_WITH_EXTERNAL_NETWORK_IS_NOT_SUPPORTED) .when(RequiredAction.PLUG == getRequiredAction() && !nic.isLinked() && isVnicAttachedToExternalNetwork());</technical_language>

Target:
public ValidationResult canVnicWithExternalNetworkBePlugged() { return ValidationResult.failWith(VdcBllMessages.PLUGGED_UNLINKED_VM_INTERFACE_WITH_EXTERNAL_NETWORK_IS_NOT_SUPPORTED) .when(RequiredAction.PLUG == getRequiredAction() && !nic.isLinked() && isVnicAttachedToExternalNetwork()); }
Source:
<code>public T jsonRead(JsonParser parser) throws IOException { switch (parser.getCurrentToken()) { case VALUE_NUMBER_INT: { return convertFromMillis(parser.getLongValue()); } case VALUE_NUMBER_FLOAT: { BigDecimal value = parser.getDecimalValue(); Timestamp timestamp = DecimalUtils.toTimestamp(value); return convertFromTimestamp(timestamp); } default: { String jsonDateTime = parser.getText(); Instant instant = Instant.parse(jsonDateTime.replace(" ", "T")); Timestamp ts = Timestamp.from(instant); <START> return convertFromTimestamp(ts); <END> } } }</code><technical_language>happy this change 1. do need replace T? (btw replacing single characters is replace(' ', 'T')) 2. change dateTimeParser.parse method obsolete. change 'parse' implementation. problem here? I assume, precision of fractions of DateTimeParser. Newer java versions (11+) probable needs 9 digits: yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSS'Z' @rbygrave I a good idea refactor DateTimeParser, Instant.parse instead of SimpleDateFormat</technical_language>

Target:
public T jsonRead(JsonParser parser) throws IOException { switch (parser.getCurrentToken()) { case VALUE_NUMBER_INT: { return convertFromMillis(parser.getLongValue()); } case VALUE_NUMBER_FLOAT: { BigDecimal value = parser.getDecimalValue(); Timestamp timestamp = DecimalUtils.toTimestamp(value); return convertFromTimestamp(timestamp); } default: { String jsonDateTime = parser.getText(); return convertFromTimestamp(dateTimeParser.parse(jsonDateTime)); } } }
Source:
<code>public void detachVideo() { RCLogger.i(TAG, "detachVideo()"); <START> if (localRenderLayout == null ||remoteRenderLayout == null) { <END> return; } localRender.setVisibility(View.INVISIBLE); remoteRender.setVisibility(View.INVISIBLE); peerConnectionClient.detachVideo(); }</code><technical_language>prompted this change? get a crash this</technical_language>

Target:
public void detachVideo() { RCLogger.i(TAG, "detachVideo()"); if (localRender != null) { localRender.setVisibility(View.INVISIBLE); } if(remoteRender != null) { remoteRender.setVisibility(View.INVISIBLE); } peerConnectionClient.detachVideo(); }
Source:
<code>private <T> Optional<T> readWithStatFrom(String path, ThrowingReader<T> supplier, BiConsumer<T, Stat> statDecorator, boolean quiet) { try { Stat stat = new Stat(); byte[] data = zookeeper.getData().storingStatIn(stat).forPath(path); if (ArrayUtils.isNotEmpty(data)) { T t = supplier.read(data); statDecorator.accept(t, stat); return Optional.of(t); <START> } else { <END> logWarnOrThrowException("No data at path " + path, new InternalProcessingException("No data at path " + path), quiet); } } catch (JsonMappingException malformedException) { logWarnOrThrowException("Unable to read data from path " + path, new MalformedDataException(path, malformedException), quiet); } catch (InternalProcessingException e) { throw e; } catch (Exception exception) { logWarnOrThrowException("Unable to read data from path " + path, new InternalProcessingException(exception), quiet); } return Optional.empty(); }</code><technical_language>else needed :)</technical_language>

Target:
private <T> Optional<T> readWithStatFrom(String path, ThrowingReader<T> supplier, BiConsumer<T, Stat> statDecorator, boolean quiet) { try { Stat stat = new Stat(); byte[] data = zookeeper.getData().storingStatIn(stat).forPath(path); if (ArrayUtils.isNotEmpty(data)) { T t = supplier.read(data); statDecorator.accept(t, stat); return Optional.of(t); } } catch (JsonMappingException malformedException) { logWarnOrThrowException("Unable to read data from path " + path, new MalformedDataException(path, malformedException), quiet); } catch (InternalProcessingException e) { throw e; } catch (Exception exception) { logWarnOrThrowException("Unable to read data from path " + path, new InternalProcessingException(exception), quiet); } return Optional.empty(); }
Source:
<code>public Node jjtGetChild(final int index) { try { return (Node) children.get(index); } catch (final ClassCastException e) { <START> return new AntlrBaseNode(); <END> } }</code><technical_language>unsure this is sane moreover, this silenced</technical_language>

Target:
public Node jjtGetChild(final int index) { try { return (Node) childrenStream().skip(index).findFirst().orElse(null); } catch (final ClassCastException e) { throw new IllegalArgumentException("Accessing invalid Antlr node", e); } }
Source:
<code>private void handleResponse(String clientEndpoint, final String ticket, final LwM2mResponse response) { excutorService.submit(new Runnable() { @Override public void run() { try { sendResponse(ticket, response); <START> } catch (Throwable t) { <END> LOG.error("Unable to send response.", t); sendError(ticket, String.format("Expected error while sending LWM2M response.(%s)", t.getMessage())); } } }); }</code><technical_language>catch throwable :scream:</technical_language>

Target:
private void handleResponse(String clientEndpoint, final String ticket, final LwM2mResponse response) { executorService.submit(new Runnable() { @Override public void run() { try { sendResponse(ticket, response); } catch (Throwable t) { LOG.error("Unable to send response.", t); sendError(ticket, String.format("Expected error while sending LWM2M response.(%s)", t.getMessage())); } } }); }
Source:
<code>public void setInterfaceConfig(String iface, InterfaceConfiguration cfg) { mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG); LinkAddress linkAddr = cfg.getLinkAddress(); if (linkAddr == null || linkAddr.getAddress() == null) { throw new IllegalStateException("Null LinkAddress given"); } final ArrayList<String> flags = new ArrayList<>(); <START> InterfaceConfigurationParcel cfgParcel = new InterfaceConfigurationParcel(); cfgParcel.ifName = iface; cfgParcel.hwAddr = ""; cfgParcel.addr = linkAddr.getAddress().getHostAddress(); cfgParcel.prefixLength = linkAddr.getPrefixLength(); cfg.getFlags().forEach(flags::add); cfgParcel.flags = flags.toArray(EMPTY_STRING_ARRAY); <END> try { mNetdService.interfaceSetCfg(cfgParcel); } catch (RemoteException | ServiceSpecificException e) { throw new IllegalStateException(e); } }</code><technical_language>Similarly above, this code moved a toParcel toInterfaceConfigurationParcel method in InterfaceConfiguration</technical_language>

Target:
public void setInterfaceConfig(String iface, InterfaceConfiguration cfg) { mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG); LinkAddress linkAddr = cfg.getLinkAddress(); if (linkAddr == null || linkAddr.getAddress() == null) { throw new IllegalStateException("Null LinkAddress given"); } final InterfaceConfigurationParcel cfgParcel = cfg.toParcel(iface); try { mNetdService.interfaceSetCfg(cfgParcel); } catch (RemoteException | ServiceSpecificException e) { throw new IllegalStateException(e); } }
Source:
<code>public String toString() { <START> String msg = "Buffered read safe SpHandle " + m_safeSpHandle; <END> msg += m_initiateMsg != null ? m_initiateMsg.toString() : m_fragmentMsg.toString(); return msg; }</code><technical_language>spHandle human-readable</technical_language>

Target:
public String toString() { String msg = "Buffered read safe SpHandle " + TxnEgo.txnIdToString(m_safeSpHandle) + ", "; msg += m_initiateMsg != null ? m_initiateMsg.toString() : m_fragmentMsg.toString(); return msg; }
Source:
<code>public boolean matchEvents() { if (!(fTraces.size() > 0)) { return false; } initMatching(); Job job = new Job(Messages.TmfEventMatching_MatchingEvents) { @Override protected IStatus run(final IProgressMonitor monitor) { SubMonitor subMonitor = SubMonitor.convert(monitor, fTraces.size()); <START> for (ITmfTrace trace : fTraces) { <END> subMonitor.beginTask(NLS.bind(Messages.TmfEventMatching_LookingEventsFrom, trace.getName()), IProgressMonitor.UNKNOWN); SubMonitor childMonitor = subMonitor.newChild(1); EventMatchingBuildRequest request = new EventMatchingBuildRequest(TmfEventMatching.this, trace, childMonitor); trace.sendRequest(request); try { request.waitForCompletion(); } catch (InterruptedException e) { Activator.logInfo(e.getMessage()); } if (childMonitor.isCanceled()) { return Status.CANCEL_STATUS; } } return Status.OK_STATUS; } }; job.schedule(); try { job.join(); } catch (InterruptedException e) { } finalizeMatching(); return true; }</code><technical_language>I realized fTraces is TmfExperiment. iteration. So, change of subMonitor help. Also, I noticed child monitor progress progress isd update is knowledge press call monitor.worked(). So, for user a rolling progress bar. I suggest, initial implementation. review right a update it. Sorry, for that</technical_language>

Target:
public boolean matchEvents() { if (!(fTraces.size() > 0)) { return false; } initMatching(); Job job = new Job(Messages.TmfEventMatching_MatchingEvents) { @Override protected IStatus run(final IProgressMonitor monitor) { for (ITmfTrace trace : fTraces) { monitor.beginTask(NLS.bind(Messages.TmfEventMatching_LookingEventsFrom, trace.getName()), IProgressMonitor.UNKNOWN); setName(NLS.bind(Messages.TmfEventMatching_RequestingEventsFrom, trace.getName())); EventMatchingBuildRequest request = new EventMatchingBuildRequest(TmfEventMatching.this, trace, monitor); trace.sendRequest(request); try { request.waitForCompletion(); } catch (InterruptedException e) { Activator.logInfo(e.getMessage()); } if (monitor.isCanceled()) { return Status.CANCEL_STATUS; } } return Status.OK_STATUS; } }; job.schedule(); try { job.join(); } catch (InterruptedException e) { } finalizeMatching(); return true; }
Source:
<code>public void startDialogWithoutPassingAnyParameters() throws IOException, InterruptedException { sttService = new STTServiceStub(); ksService = new KSServiceStub(); ttsService = new TTSServiceStub(); hliStub = new HumanLanguageInterpreterStub(); source = new AudioSourceStub(); registerService(sttService); registerService(ksService); registerService(ttsService); registerService(hliStub); registerService(source); Dictionary<String, Object> config = new Hashtable<String, Object>(); config.put(CONFIG_KEYWORD, "word"); config.put(CONFIG_DEFAULT_STT, sttService.getId()); config.put(CONFIG_DEFAULT_KS, ksService.getId()); config.put(CONFIG_DEFAULT_HLI, hliStub.getId()); config.put(CONFIG_DEFAULT_VOICE, voice.getUID()); ConfigurationAdmin configAdmin = super.getService(ConfigurationAdmin.class); String pid = "org.eclipse.smarthome.voice"; Configuration configuration = configAdmin.getConfiguration(pid); configuration.update(config); <START> Thread.sleep(100); <END> voiceManager.startDialog(); assertTrue(ksService.isWordSpotted()); }</code><technical_language>Please put lines a waitForAssert(() -> {})-Block instead. fixed sleep is guaranteed fail day some CI server..</technical_language>

Target:
public void startDialogWithoutPassingAnyParameters() throws IOException, InterruptedException { sttService = new STTServiceStub(); ksService = new KSServiceStub(); ttsService = new TTSServiceStub(); hliStub = new HumanLanguageInterpreterStub(); source = new AudioSourceStub(); registerService(sttService); registerService(ksService); registerService(ttsService); registerService(hliStub); registerService(source); Dictionary<String, Object> config = new Hashtable<String, Object>(); config.put(CONFIG_KEYWORD, "word"); config.put(CONFIG_DEFAULT_STT, sttService.getId()); config.put(CONFIG_DEFAULT_KS, ksService.getId()); config.put(CONFIG_DEFAULT_HLI, hliStub.getId()); config.put(CONFIG_DEFAULT_VOICE, voice.getUID()); ConfigurationAdmin configAdmin = super.getService(ConfigurationAdmin.class); String pid = "org.eclipse.smarthome.voice"; Configuration configuration = configAdmin.getConfiguration(pid); configuration.update(config); waitForAssert(() -> { try { voiceManager.startDialog(); } catch (Exception ex) { } assertTrue(ksService.isWordSpotted()); }); }
Source:
<code>public final <T> Set<ConstraintViolation<T>> validate(T object, Class<?>... groups) { Contracts.assertNotNull( object, MESSAGES.validatedObjectMustNotBeNull() ); <START> BeanMetaData<?> beanMetaData = beanMetaDataManager.getBeanMetaData( object.getClass() ); <END> if ( !beanMetaData.hasConstraints() ) { return Collections.emptySet(); } ValidationOrder validationOrder = determineGroupValidationOrder( groups ); ValidationContext<T> validationContext = getValidationContextBuilder().forValidate( object ); ValueContext<?, Object> valueContext = ValueContext.getLocalExecutionContext( parameterNameProvider, object, beanMetaData, PathImpl.createRootPath() ); return validateInContext( validationContext, valueContext, validationOrder ); }</code><technical_language>remove isConstrained() altogether then? a perf difference, do if helps (there is usage in validateValue() btw.)</technical_language>

Target:
public final <T> Set<ConstraintViolation<T>> validate(T object, Class<?>... groups) { Contracts.assertNotNull( object, MESSAGES.validatedObjectMustNotBeNull() ); ValidationContext<T> validationContext = getValidationContextBuilder().forValidate( object ); if ( !validationContext.getRootBeanMetaData().hasConstraints() ) { return Collections.emptySet(); } ValidationOrder validationOrder = determineGroupValidationOrder( groups ); ValueContext<?, Object> valueContext = ValueContext.getLocalExecutionContext( parameterNameProvider, object, validationContext.getRootBeanMetaData(), PathImpl.createRootPath() ); return validateInContext( validationContext, valueContext, validationOrder ); }
Source:
<code>BackgroundEditorPool() { backgroundEditors = new LRUCache(CAPACITY); Application application = ApplicationManager.getApplication(); this.messageBusConnection = application.getMessageBus().connect(); <START> messageBusConnection.subscribe(appLifecycleListener.TOPIC, appLifecycleListener); <END> Disposer.register(application, this); }</code><technical_language>"AppLifecycleListener.TOPIC accessed in a static way" suggestion messageBusConnection.subscribe(AppLifecycleListener.TOPIC, appLifecycleListener);</technical_language>

Target:
BackgroundEditorPool() { backgroundEditors = new LRUCache(CAPACITY); Application application = ApplicationManager.getApplication(); this.messageBusConnection = application.getMessageBus().connect(); messageBusConnection.subscribe(AppLifecycleListener.TOPIC, appLifecycleListener); Disposer.register(application, this); }
Source:
<code>public static RefineryRecipe findRecipe(FluidStack input0, FluidStack input1) { for(RefineryRecipe recipe : recipeList) { if(!input0.isEmpty()) { <START> if((!recipe.input0.isEmpty())&&input0.containsFluid(recipe.input0)) <END> { if((recipe.input1.isEmpty()&&input1.isEmpty())||((!recipe.input1.isEmpty())&&(!input1.isEmpty())&&input1.containsFluid(recipe.input1))) return recipe; } if((!recipe.input1.isEmpty())&&input0.containsFluid(recipe.input1)) { if(((recipe.input0.isEmpty())&&(input1.isEmpty()))||((!recipe.input0.isEmpty())&&(!input1.isEmpty())&&input1.containsFluid(recipe.input0))) return recipe; } } else if(!input1.isEmpty()) { if((recipe.input0.isEmpty())&&input1.containsFluid(recipe.input0)&&(recipe.input1.isEmpty())) return recipe; if((!recipe.input1.isEmpty())&&input1.containsFluid(recipe.input1)&&(recipe.input0.isEmpty())) return recipe; } } return null; }</code><technical_language>generally put brackets statements inverted, significantly improves readability is syntactically necessary (e.g. !(a>b), yes, a case for that)</technical_language>

Target:
public static RefineryRecipe findRecipe(FluidStack input0, FluidStack input1) { for(RefineryRecipe recipe : recipeList) { if(!input0.isEmpty()) { if(!recipe.input0.isEmpty()&&input0.containsFluid(recipe.input0)) { if((recipe.input1.isEmpty()&&input1.isEmpty())||(!recipe.input1.isEmpty()&&!input1.isEmpty()&&input1.containsFluid(recipe.input1))) return recipe; } if(!recipe.input1.isEmpty()&&input0.containsFluid(recipe.input1)) { if((recipe.input0.isEmpty()&&input1.isEmpty())||(!recipe.input0.isEmpty()&&!input1.isEmpty()&&input1.containsFluid(recipe.input0))) return recipe; } } else if(!input1.isEmpty()) { if(!recipe.input0.isEmpty()&&input1.containsFluid(recipe.input0)&&recipe.input1.isEmpty()) return recipe; if(!recipe.input1.isEmpty()&&input1.containsFluid(recipe.input1)&&recipe.input0.isEmpty()) return recipe; } } return null; }
Source:
<code>public boolean isContainer(){ <START> return !type.isUnit; <END> }</code><technical_language>Again, add a null check here, suggested in BlockModel section</technical_language>

Target:
public boolean isContainer(){ return type != null ? type.isContainer() : (children != null && children.size() > 0); }
Source:
<code>private ObjectNode processTProperties(Properties cProperties) { ObjectNode schema = JsonNodeFactory.instance.objectNode(); schema.put(JsonSchemaConstants.TAG_TITLE, cProperties.getDisplayName()); schema.put(JsonSchemaConstants.TAG_TYPE, JsonSchemaConstants.TYPE_OBJECT); schema.putObject(JsonSchemaConstants.TAG_PROPERTIES); List<Property> propertyList = getSubProperty(cProperties); for (Property property : propertyList) { String name = property.getName(); if (property.isRequired()) { addToRequired(schema, name); } ((ObjectNode) schema.get(JsonSchemaConstants.TAG_PROPERTIES)).set(name, processTProperty(property)); } List<Properties> propertiesList = getSubProperties(cProperties); for (Properties properties : propertiesList) { String name = properties.getName(); if (properties instanceof ReferenceProperties<?>) { ReferenceProperties<?> referenceProperties = (ReferenceProperties<?>) properties; <START> ((ObjectNode) schema.get(JsonSchemaConstants.TAG_PROPERTIES)).set(name, <END> processReferenceProperties(referenceProperties)); } else { ((ObjectNode) schema.get(JsonSchemaConstants.TAG_PROPERTIES)).set(name, processTProperties(properties)); } } return schema; }</code><technical_language>here, store reference definition name here</technical_language>

Target:
private ObjectNode processTProperties(Properties cProperties) { ObjectNode schema = JsonNodeFactory.instance.objectNode(); schema.put(JsonSchemaConstants.TAG_TYPE, JsonSchemaConstants.TYPE_OBJECT); schema.putObject(JsonSchemaConstants.TAG_PROPERTIES); List<Property> propertyList = getSubProperty(cProperties); for (Property property : propertyList) { String name = property.getName(); if (property.isRequired()) { addToRequired(schema, name); } ((ObjectNode) schema.get(JsonSchemaConstants.TAG_PROPERTIES)).set(name, processTProperty(property)); } List<Properties> propertiesList = getSubProperties(cProperties); for (Properties properties : propertiesList) { String name = properties.getName(); if (properties instanceof ReferenceProperties<?>) { ReferenceProperties<?> referenceProperties = (ReferenceProperties<?>) properties; ((ObjectNode) schema.get(JsonSchemaConstants.TAG_PROPERTIES)).set(name, processReferenceProperties(referenceProperties)); } else { ((ObjectNode) schema.get(JsonSchemaConstants.TAG_PROPERTIES)).set(name, processTProperties(properties)); } } return schema; }
Source:
<code><START> public Object getAttribute(final short tag) { <END> AttributeTagInfo info = lazyAttributeTags.get(tag); if (info != null) { if (!initializedAttributes.contains(info.lazyAttribute)) { Object ret; try { Method method = this.getClass().getDeclaredMethod(info.getterImplName); method.setAccessible(true); ret = method.invoke(this); } catch (IllegalAccessException e) { throw new RuntimeException(e); } catch (NoSuchMethodException e) { throw new RuntimeException(e); } catch (InvocationTargetException e) { throw new RuntimeException(e); } setAttribute(tag, ret); } } return super.getAttribute(tag); }</code><technical_language>happen if user calls this method get attribute other RG</technical_language>

Target:
public Object getAttribute(final short tag) { LazyAttribute attr = lazyAttributeTags.get(tag); if (attr != null) { if (!initializedAttributes.contains(attr)) { setAttribute(tag, attr.getAttribute(this)); } } return super.getAttribute(tag); }
Source:
<code>public ColumnGetter newColumnGetter(JdbcInputConnection con, AbstractJdbcInputPlugin.PluginTask task, JdbcColumn column, JdbcColumnOption option) { ColumnGetter getter = super.newColumnGetter(con, task, column, option); switch (column.getTypeName()) { case "DATE": <START> return new TimestampWithTimeZoneIncrementalHandler(getter); <END> case "TIMESTAMP": return new TimestampWithTimeZoneIncrementalHandler(getter); default: return getter; } }</code><technical_language>TimestampWithoutTimeZoneIncrementalHandler Oracle DATE type TIMESTAMP type timezone</technical_language>

Target:
public ColumnGetter newColumnGetter(JdbcInputConnection con, AbstractJdbcInputPlugin.PluginTask task, JdbcColumn column, JdbcColumnOption option) { ColumnGetter getter = super.newColumnGetter(con, task, column, option); switch (column.getTypeName()) { case "DATE": return new TimestampWithoutTimeZoneIncrementalHandler(getter); case "TIMESTAMP": return new TimestampWithoutTimeZoneIncrementalHandler(getter); default: return getter; } }
Source:
<code>public KafkaTestMessageBus(KafkaTestSupport kafkaTestSupport, MultiTypeCodec<Object> codec) { try { ZookeeperConnect zookeeperConnect = new ZookeeperConnect(); <START> zookeeperConnect.setZkConnect(kafkaTestSupport.getZkconnectstring()); <END> KafkaMessageBus messageBus = new KafkaMessageBus(zookeeperConnect, kafkaTestSupport.getBrokerAddress(), kafkaTestSupport.getZkconnectstring(), codec); messageBus.afterPropertiesSet(); GenericApplicationContext context = new GenericApplicationContext(); context.refresh(); messageBus.setApplicationContext(context); this.setMessageBus(messageBus); } catch (Exception e) { throw new RuntimeException(e); } }</code><technical_language>method getZkconnectstring name well-formated in camel style</technical_language>

Target:
public KafkaTestMessageBus(KafkaTestSupport kafkaTestSupport, MultiTypeCodec<Object> codec) { try { ZookeeperConnect zookeeperConnect = new ZookeeperConnect(); zookeeperConnect.setZkConnect(kafkaTestSupport.getZkConnectString()); KafkaMessageBus messageBus = new KafkaMessageBus(zookeeperConnect, kafkaTestSupport.getBrokerAddress(), kafkaTestSupport.getZkConnectString(), codec); messageBus.afterPropertiesSet(); GenericApplicationContext context = new GenericApplicationContext(); context.refresh(); messageBus.setApplicationContext(context); this.setMessageBus(messageBus); } catch (Exception e) { throw new RuntimeException(e); } }
Source:
<code>private List<Map<String, Object>> parseChannels(XmlDocument document, List<VmDevice> devices) { List<VmDevice> dbDevices = filterDevices(devices, VmDeviceGeneralType.CHANNEL); List<Map<String, Object>> result = new ArrayList<>(); for (XmlNode node : selectNodes(document, VmDeviceGeneralType.CHANNEL)) { String address = DomainXmlUtils.parseAddress(node); if (address.isEmpty()) { continue; } Map<String, Object> dev = new HashMap<>(); dev.put(VdsProperties.Type, VmDeviceGeneralType.CHANNEL.getValue()); dev.put(VdsProperties.Device, DomainXmlUtils.parseAttribute(node, TYPE)); dev.put(VdsProperties.Address, address); dev.put(VdsProperties.Alias, parseAlias(node)); Optional<VmDevice> dbDev = Optional.empty(); if (dev.get(VdsProperties.Alias).toString().startsWith(DomainXmlUtils.USER_ALIAS_PREFIX)) { dbDev = correlateWithUserAlias(dev, dbDevices); <START> } <END> if (dbDev.isPresent()) { dbDevices.remove(dbDev.get()); dev.put(VdsProperties.DeviceId, dbDev.get().getDeviceId().toString()); dev.put(VdsProperties.SpecParams, dbDev.get().getSpecParams()); } else { dev.put(VdsProperties.DeviceId, Guid.newGuid().toString()); } result.add(dev); } return result; }</code><technical_language>writing alias for channel? I do. This is existing problem...but correlating channels create new device. is correct? please check</technical_language>

Target:
private List<Map<String, Object>> parseChannels(XmlDocument document, List<VmDevice> devices) { List<Map<String, Object>> result = new ArrayList<>(); for (XmlNode node : selectNodes(document, VmDeviceGeneralType.CHANNEL)) { String address = DomainXmlUtils.parseAddress(node); if (address.isEmpty()) { continue; } Map<String, Object> dev = new HashMap<>(); dev.put(VdsProperties.Type, VmDeviceGeneralType.CHANNEL.getValue()); dev.put(VdsProperties.Device, DomainXmlUtils.parseAttribute(node, TYPE)); dev.put(VdsProperties.Address, address); dev.put(VdsProperties.Alias, parseAlias(node)); dev.put(VdsProperties.DeviceId, Guid.newGuid().toString()); result.add(dev); } return result; }
Source:
<code>public synchronized void initialize() throws IOException { if (initialized) { return; } <START> Preconditions.checkArgument(chunkOffsets == null); <END> List<ChunkInfo> chunks = getChunkInfos(); if (chunks != null && !chunks.isEmpty()) { this.chunkOffsets = new long[chunks.size()]; long tempOffset = 0; this.chunkStreams = new ArrayList<>(chunks.size()); for (int i = 0; i < chunks.size(); i++) { addStream(chunks.get(i)); chunkOffsets[i] = tempOffset; tempOffset += chunks.get(i).getLen(); } initialized = true; this.chunkIndex = 0; if (blockPosition > 0) { seek(blockPosition); } } }</code><technical_language>Do need this Precondition check</technical_language>

Target:
public synchronized void initialize() throws IOException { if (initialized) { return; } List<ChunkInfo> chunks = getChunkInfos(); if (chunks != null && !chunks.isEmpty()) { this.chunkOffsets = new long[chunks.size()]; long tempOffset = 0; this.chunkStreams = new ArrayList<>(chunks.size()); for (int i = 0; i < chunks.size(); i++) { addStream(chunks.get(i)); chunkOffsets[i] = tempOffset; tempOffset += chunks.get(i).getLen(); } initialized = true; this.chunkIndex = 0; if (blockPosition > 0) { seek(blockPosition); } } }
Source:
<code>@Test public void testOverWithoutPartition() { final FrameworkConfig config = RelBuilderTest.config().build(); final RelBuilder builder = RelBuilder.create(config); final RexBuilder rexBuilder = builder.getRexBuilder(); final RelDataType type = rexBuilder.getTypeFactory().createSqlType(SqlTypeName.BIGINT); final RelDataType fieldType = rexBuilder.getTypeFactory().createSqlType(SqlTypeName.ANY); final RelNode rel = builder .scan("EMP") .project( builder.field("ENAME"), <START> rexBuilder.makeOver( <END> type, SqlStdOperatorTable.COUNT, new ArrayList<>(), new ArrayList<>(), ImmutableList.of( new RexFieldCollation( rexBuilder.makeInputRef(fieldType, 7), ImmutableSet.of())), RexWindowBound.create( SqlWindow.createUnboundedPreceding(SqlParserPos.ZERO), null), RexWindowBound.create( SqlWindow.createCurrentRow(SqlParserPos.ZERO), null), true, true, false, false, false)) .build(); String relJson = RelOptUtil.dumpPlan("", rel, SqlExplainFormat.JSON, SqlExplainLevel.EXPPLAN_ATTRIBUTES); String s = deserializeAndDumpToTextFormat(getSchema(rel), relJson); final String expected = "" + "LogicalProject(ENAME=[$1], $f1=[COUNT() OVER (ORDER BY $7 NULLS LAST ROWS" + " BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)])\n" + " LogicalTableScan(table=[[scott, EMP]])\n"; assertThat(s, isLinux(expected)); }</code><technical_language>similar, add a helper function create rel node, dfferent arguments for partition order keys</technical_language>

Target:
@Test public void testOverWithoutPartition() { final RelNode rel = mockCountOver("EMP", ImmutableList.of(), ImmutableList.of("DEPTNO")); String relJson = RelOptUtil.dumpPlan("", rel, SqlExplainFormat.JSON, SqlExplainLevel.EXPPLAN_ATTRIBUTES); String s = deserializeAndDumpToTextFormat(getSchema(rel), relJson); final String expected = "" + "LogicalProject($f0=[COUNT() OVER (ORDER BY $7 NULLS LAST ROWS" + " BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)])\n" + " LogicalTableScan(table=[[scott, EMP]])\n"; assertThat(s, isLinux(expected)); }
Source:
<code>private String serializeToXmlString(EntityDescriptor entityDescriptor) { try { <START> Marshaller marshaller = XMLObjectProviderRegistrySupport.getMarshallerFactory().getMarshaller(entityDescriptor); <END> if (marshaller == null) { throw new Saml2Exception("Unable to resolve Marshaller"); } Element element = marshaller.marshall(entityDescriptor); return SerializeSupport.prettyPrintXML(element); } catch (Exception e) { throw new Saml2Exception(e); } }</code><technical_language>I lines 71-74 need try block. nice out in order try block small possible</technical_language>

Target:
private String serializeToXmlString(EntityDescriptor entityDescriptor) { Marshaller marshaller = XMLObjectProviderRegistrySupport.getMarshallerFactory().getMarshaller(entityDescriptor); if (marshaller == null) { throw new Saml2Exception("Unable to resolve Marshaller"); } Element element; try { element = marshaller.marshall(entityDescriptor); } catch (Exception e) { throw new Saml2Exception(e); } return SerializeSupport.prettyPrintXML(element); }
Source:
<code>public static boolean validateRequest(String strToSign, String signature, String userKey) { <START> String expectedSignature = Hex.encode(sign(getSignatureKey( <END> userKey, strToSign), strToSign)); return expectedSignature.equals(signature); }</code><technical_language>move this line in a method getSignature() doc, this is signature</technical_language>

Target:
public static boolean validateRequest(String strToSign, String signature, String userKey) { String expectedSignature = Hex.encode(sign(getSigningKey(userKey, strToSign), strToSign)); return expectedSignature.equals(signature); }
Source:
<code>protected void setSaveSearchParams(Map<String, String> params, SavedSearch search) throws IOException { Map<String, String> namedParams = new HashMap<>(); if (params != null) { for (String key : params.keySet()) { <START> String value = params.get(key); <END> try { Property prop = search.getDocument().getProperty(key); DocumentHelper.setProperty(search.getDocument().getCoreSession(), search.getDocument(), key, value, true); } catch (PropertyNotFoundException e) { namedParams.put(key, value); } } } search.setNamedParams(namedParams); }</code><technical_language>entrySet() avoid re-do a get(key)</technical_language>

Target:
protected void setSaveSearchParams(Map<String, String> params, SavedSearch search) throws IOException { Map<String, String> namedParams = new HashMap<>(); if (params != null) { for (Map.Entry<String, String> entry : params.entrySet()) { String key = entry.getKey(); String value = entry.getValue(); try { Property prop = search.getDocument().getProperty(key); DocumentHelper.setProperty(search.getDocument().getCoreSession(), search.getDocument(), key, value, true); } catch (PropertyNotFoundException e) { namedParams.put(key, value); } } } search.setNamedParams(namedParams); }
Source:
<code>public void testCreateBaseEntitlementWithoutBaseEntitlement() throws AccountApiException, EntitlementApiException { final LocalDate initialDate = new LocalDate(2013, 8, 7); clock.setDay(initialDate); final Account account = accountApi.createAccount(getAccountData(7), callContext); final PlanPhaseSpecifier baseSpec = new PlanPhaseSpecifier("Cleaning", ProductCategory.ADD_ON, BillingPeriod.MONTHLY, PriceListSet.DEFAULT_PRICELIST_NAME, null); final PlanPhaseSpecifier addOnSpec = new PlanPhaseSpecifier("Bullets", ProductCategory.ADD_ON, BillingPeriod.MONTHLY, PriceListSet.DEFAULT_PRICELIST_NAME, null); EntitlementSpecifier addOnEntitlementSpecifier1 = new DefaultEntitlementSpecifier("addOnExternalKey", baseSpec, null); EntitlementSpecifier addOnEntitlementSpecifier2 = new DefaultEntitlementSpecifier("addOnExternalKey2", addOnSpec, null); final List<EntitlementSpecifier> specifierList = new ArrayList<EntitlementSpecifier>(); specifierList.add(addOnEntitlementSpecifier1); specifierList.add(addOnEntitlementSpecifier2); <START> testListener.pushExpectedEvents(); <END> try { entitlementApi.createBaseEntitlementWithAddOns(account.getId(), specifierList, initialDate, ImmutableList.<PluginProperty>of(), callContext); fail(); } catch (EntitlementApiException e) { assertEquals(e.getMessage(), "Missing Base Subscription."); } assertListenerStatus(); final List<Entitlement> allEntitlementsForAccount = entitlementApi.getAllEntitlementsForAccountId(account.getId(), callContext); assertTrue(allEntitlementsForAccount.size() == 0); }</code><technical_language>Unnecessary, event is expected</technical_language>

Target:
public void testCreateBaseEntitlementWithoutBaseEntitlement() throws AccountApiException, EntitlementApiException { final LocalDate initialDate = new LocalDate(2013, 8, 7); clock.setDay(initialDate); final Account account = accountApi.createAccount(getAccountData(7), callContext); final PlanPhaseSpecifier baseSpec = new PlanPhaseSpecifier("Cleaning", ProductCategory.ADD_ON, BillingPeriod.MONTHLY, PriceListSet.DEFAULT_PRICELIST_NAME, null); final PlanPhaseSpecifier addOnSpec = new PlanPhaseSpecifier("Bullets", ProductCategory.ADD_ON, BillingPeriod.MONTHLY, PriceListSet.DEFAULT_PRICELIST_NAME, null); final String externalKey = "addOnExternalKey"; EntitlementSpecifier addOnEntitlementSpecifier1 = new DefaultEntitlementSpecifier(baseSpec, null); EntitlementSpecifier addOnEntitlementSpecifier2 = new DefaultEntitlementSpecifier(addOnSpec, null); final List<EntitlementSpecifier> specifierList = new ArrayList<EntitlementSpecifier>(); specifierList.add(addOnEntitlementSpecifier1); specifierList.add(addOnEntitlementSpecifier2); try { entitlementApi.createBaseEntitlementWithAddOns(account.getId(), externalKey, specifierList, initialDate, ImmutableList.<PluginProperty>of(), callContext); fail(); } catch (EntitlementApiException e) { assertEquals(e.getMessage(), "Missing Base Subscription."); } final List<Entitlement> allEntitlementsForAccount = entitlementApi.getAllEntitlementsForAccountId(account.getId(), callContext); assertTrue(allEntitlementsForAccount.size() == 0); }
Source:
<code>public CapSpeedModifier(double minSpeed, double maxSpeed) { <START> speedCap = new Util.Range(minSpeed, maxSpeed); <END> }</code><technical_language>a constructor (e.g. replace this(new Util.Range(minSpeed, maxSpeed));)</technical_language>

Target:
public CapSpeedModifier(double minSpeed, double maxSpeed) { this(new Util.Range(minSpeed, maxSpeed)); }
Source:
<code>private void checkVariableName(@Nonnull String name, Attribute node) { <START> boolean isCamelCase = name.matches(CAMEL_CASE_PATTERN); <END> boolean isLowercase = StringUtils.isAllLowerCase(name); if (!(isCamelCase || isLowercase)) { createViolation(node.getLine(), RULE_MESSAGE); } }</code><technical_language>I avoid this method compiles time pattern. Create Pattern static matcher</technical_language>

Target:
private void checkVariableName(@Nonnull String name, Attribute node) { boolean isCamelCase = CAMEL_CASE_PATTERN.matcher(name).matches(); boolean isLowercase = StringUtils.isAllLowerCase(name); if (!(isCamelCase || isLowercase)) { createViolation(node.getLine(), RULE_MESSAGE); } }
Source:
<code>private void init(File path) throws CTFReaderException { File[] files = path.listFiles(METADATA_FILE_FILTER); Arrays.sort(files, METADATA_COMPARATOR); File[] indexDir = path.listFiles(INDEX_FILE_FILTER); Multimap<File, StreamInputPacketIndexEntry> entries = HashMultimap.<File, StreamInputPacketIndexEntry> create(); for (File index : indexDir) { File[] indexFiles = index.listFiles(); for (File indexFile : indexFiles) { CTFIndexFile cif = new CTFIndexFile(indexFile); for (StreamInputPacketIndexEntry sipie : cif.getStreamInputPacketIndexEntries()) { <START> entries.put(index, sipie); <END> } } } for (File streamFile : files) { openStreamInput(streamFile, entries.get(streamFile)); } for (CTFStream stream : getStreams()) { Set<CTFStreamInput> inputs = stream.getStreamInputs(); for (CTFStreamInput s : inputs) { addStream(s); } } }</code><technical_language>store file index key index index directory. calling openStreamInput call entries.get(streamFile) stream file is e.g. channel_0. empty Collection is passed method openStreamInput(). This incorrect (unless I miss something). a side node, I if index created reading trace trace indexing</technical_language>

Target:
private void init(File path) throws CTFReaderException { File[] streamFiles = path.listFiles(METADATA_FILE_FILTER); Arrays.sort(streamFiles, METADATA_COMPARATOR); File[] indexDir = path.listFiles(INDEX_FILE_FILTER); Multimap<String, StreamInputPacketIndexEntry> entries = HashMultimap.<String, StreamInputPacketIndexEntry> create(); for (File index : indexDir) { File[] indexFiles = index.listFiles(); for (File indexFile : indexFiles) { try { CTFIndexFile cif = new CTFIndexFile(indexFile); for (StreamInputPacketIndexEntry sipie : cif.getStreamInputPacketIndexEntries()) { String name = indexFile.getName(); int pos = name.lastIndexOf('.', 0); if( pos > 0) { name = name.substring(0, pos); } entries.put(name, sipie); } } catch (CTFReaderException ex) { Activator.log(ex.getMessage(), ex); } } } for (File streamFile : streamFiles) { openStreamInput(streamFile, entries.get(streamFile.getName())); } for (CTFStream stream : getStreams()) { Set<CTFStreamInput> inputs = stream.getStreamInputs(); for (CTFStreamInput s : inputs) { addStream(s); } } }
Source:
<code>private static <C> CacheStream<C> applyTimeOut(CacheStream<C> stream, Cache<?, ?> cache) { <START> return stream.timeout(cache.getCacheConfiguration().clustering().sync().replTimeout(), <END> TimeUnit.MILLISECONDS); }</code><technical_language>remoteTimeout() is correct</technical_language>

Target:
private static <C> CacheStream<C> applyTimeOut(CacheStream<C> stream, Cache<?, ?> cache) { return stream.timeout(cache.getCacheConfiguration().clustering().remoteTimeout(), TimeUnit.MILLISECONDS); }
Source:
<code>private Observable<ResultSet> scheduleStatement(Statement st, Scheduler scheduler) { <START> while(true) { <END> if(mostInFlightRequests.apply(session) < maximumInflightRequests) { ResultSetFuture future = session.executeAsync(st); return ListenableFutureObservable.from(future, scheduler); } else { try { Thread.sleep(0, 1); } catch (InterruptedException e) { } } } }</code><technical_language>a semaphore here</technical_language>

Target:
private Observable<ResultSet> scheduleStatement(Statement st, Scheduler scheduler) { while(true) { if(availableInFlightSlots(st)) { ResultSetFuture future = session.executeAsync(st); return ListenableFutureObservable.from(future, scheduler); } else { try { Thread.sleep(0, 1); } catch (InterruptedException e) { } } } }
Source:
<code>private <C extends WriteCommand, Item> Object handleRemoteReadWriteManyCommand( InvocationContext ctx, C command, WriteManyCommandHelper<C, ?, Item> helper) throws Exception { List<Object> remoteKeys = new ArrayList<>(); for (Item item : helper.getItems(command)) { Object key = helper.item2key(item); CacheEntry cacheEntry = ctx.lookupEntry(key); if (cacheEntry == null) { <START> if (command.hasAnyFlag(FlagBitSets.SKIP_REMOTE_LOOKUP) || command.hasAnyFlag( <END> FlagBitSets.CACHE_MODE_LOCAL)) { entryFactory.wrapExternalEntry(ctx, key, null, false, true); } else { remoteKeys.add(key); } } } CompletionStage<Void> delay; if (!remoteKeys.isEmpty()) { delay = remoteGetMany(ctx, command, remoteKeys); } else { delay = CompletableFutures.completedNull(); } Object result = asyncInvokeNext(ctx, command, delay); if (helper.shouldRegisterRemoteCallback(command)) { return makeStage(result).thenApply(ctx, command, helper.remoteCallback); } else { return result; } }</code><technical_language>replace || bitwise I</technical_language>

Target:
private <C extends WriteCommand, Item> Object handleRemoteReadWriteManyCommand( InvocationContext ctx, C command, WriteManyCommandHelper<C, ?, Item> helper) throws Exception { List<Object> remoteKeys = null; for (Item item : helper.getItems(command)) { Object key = helper.item2key(item); CacheEntry cacheEntry = ctx.lookupEntry(key); if (cacheEntry == null) { if (command.hasAnyFlag(FlagBitSets.SKIP_REMOTE_LOOKUP | FlagBitSets.CACHE_MODE_LOCAL)) { entryFactory.wrapExternalEntry(ctx, key, null, false, true); } else { if (remoteKeys == null) { remoteKeys = new ArrayList<>(); } remoteKeys.add(key); } } } Object result; if (remoteKeys != null) { result = asyncInvokeNext(ctx, command, remoteGetMany(ctx, command, remoteKeys)); } else { result = invokeNext(ctx, command); } if (helper.shouldRegisterRemoteCallback(command)) { return makeStage(result).thenApply(ctx, command, helper.remoteCallback); } else { return result; } }
Source:
<code><START> public Flux<FileRange> listRanges(FileRange range) { <END> String rangeString = range == null ? null : range.toString(); return azureFileStorageClient.files().getRangeListWithRestResponseAsync(shareName, filePath, shareSnapshot, null, rangeString, Context.NONE) .flatMapMany(this::convertListRangesResponseToFileRangeInfo); }</code><technical_language>This ins't a paged response, return a Mono a list instead</technical_language>

Target:
public Flux<FileRange> listRanges(FileRange range) { String rangeString = range == null ? null : range.toString(); return azureFileStorageClient.files().getRangeListWithRestResponseAsync(shareName, filePath, snapshot, null, rangeString, Context.NONE) .flatMapMany(this::convertListRangesResponseToFileRangeInfo); }