auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> private void logUefiParameters(Map<VirtualMachineProfile.Param, Object> params) { <END> StringBuffer msgBuf = new StringBuffer("Uefi params "); boolean log = false; if (params.get(VirtualMachineProfile.Param.UefiFlag) != null) { msgBuf.append(String.format("UefiFlag: %s ", params.get(VirtualMachineProfile.Param.UefiFlag))); log = true; } if (params.get(VirtualMachineProfile.Param.BootType) != null) { msgBuf.append(String.format("Boot Type: %s ", params.get(VirtualMachineProfile.Param.BootType))); log = true; } if (params.get(VirtualMachineProfile.Param.BootMode) != null) { msgBuf.append(String.format("Boot Mode: %s ", params.get(VirtualMachineProfile.Param.BootMode))); log = true; } if (log) { s_logger.info(msgBuf.toString()); } }</code><technical_language>@DaanHoogland is params = null</technical_language>

Target:
private void logUefiParameters(Map<VirtualMachineProfile.Param, Object> params) { if (params == null) { return; } StringBuffer msgBuf = new StringBuffer("Uefi params "); boolean log = false; if (params.get(VirtualMachineProfile.Param.UefiFlag) != null) { msgBuf.append(String.format("UefiFlag: %s ", params.get(VirtualMachineProfile.Param.UefiFlag))); log = true; } if (params.get(VirtualMachineProfile.Param.BootType) != null) { msgBuf.append(String.format("Boot Type: %s ", params.get(VirtualMachineProfile.Param.BootType))); log = true; } if (params.get(VirtualMachineProfile.Param.BootMode) != null) { msgBuf.append(String.format("Boot Mode: %s ", params.get(VirtualMachineProfile.Param.BootMode))); log = true; } if (log) { s_logger.info(msgBuf.toString()); } }
Source:
<code>protected void readNewTopologyAndHash(Transport transport, AtomicInteger topologyId) { final Log localLog = getLog(); int newTopologyId = transport.readVInt(); topologyId.set(newTopologyId); int clusterSize = transport.readVInt(); SocketAddress[] addresses = new SocketAddress[clusterSize]; for (int i = 0; i < clusterSize; i++) { String host = transport.readString(); int port = transport.readUnsignedShort(); addresses[i] = new InetSocketAddress(host, port); } short hashFunctionVersion = transport.readByte(); int numSegments = transport.readVInt(); SocketAddress[][] segmentOwners = new SocketAddress[numSegments][]; for (int i = 0; i < numSegments; i++) { short numOwners = transport.readByte(); segmentOwners[i] = new SocketAddress[numOwners]; for (int j = 0; j < numOwners; j++) { int memberIndex = transport.readVInt(); segmentOwners[i][j] = addresses[memberIndex]; } } List<SocketAddress> addressList = Arrays.asList(addresses); if (localLog.isInfoEnabled()) { localLog.newTopology(transport.getRemoteSocketAddress(), newTopologyId, addresses.length, new HashSet<SocketAddress>(addressList)); } transport.getTransportFactory().updateServers(addressList); if (hashFunctionVersion == 0) { <START> localLog.trace("Not using a consistent hash function (hash function version == 0)."); <END> } else { transport.getTransportFactory().updateHashFunction(segmentOwners, numSegments, hashFunctionVersion); } }</code><technical_language>if (trace)</technical_language>

Target:
protected void readNewTopologyAndHash(Transport transport, AtomicInteger topologyId) { final Log localLog = getLog(); int newTopologyId = transport.readVInt(); topologyId.set(newTopologyId); int clusterSize = transport.readVInt(); SocketAddress[] addresses = new SocketAddress[clusterSize]; for (int i = 0; i < clusterSize; i++) { String host = transport.readString(); int port = transport.readUnsignedShort(); addresses[i] = new InetSocketAddress(host, port); } short hashFunctionVersion = transport.readByte(); int numSegments = transport.readVInt(); SocketAddress[][] segmentOwners = new SocketAddress[numSegments][]; for (int i = 0; i < numSegments; i++) { short numOwners = transport.readByte(); segmentOwners[i] = new SocketAddress[numOwners]; for (int j = 0; j < numOwners; j++) { int memberIndex = transport.readVInt(); segmentOwners[i][j] = addresses[memberIndex]; } } List<SocketAddress> addressList = Arrays.asList(addresses); if (localLog.isInfoEnabled()) { localLog.newTopology(transport.getRemoteSocketAddress(), newTopologyId, addresses.length, new HashSet<SocketAddress>(addressList)); } transport.getTransportFactory().updateServers(addressList); if (hashFunctionVersion == 0) { if (trace) localLog.trace("Not using a consistent hash function (hash function version == 0)."); } else { transport.getTransportFactory().updateHashFunction(segmentOwners, numSegments, hashFunctionVersion); } }
Source:
<code>public boolean equals( Object o ) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } JournalRecord record = (JournalRecord)o; if (createdTimeMillisUTC != record.createdTimeMillisUTC) { return false; } <START> if (content != null ? !content.getUUID().equals(record.content.getUUID()) : record.content != null) { <END> return false; } return true; }</code><technical_language>This strange equals hashCode check _both_ createdTimeMillisUTC (which is process-specific) content's UUID (which is universal for ChangeSet). comparing JournalRecord instances separate machines, of duplicates? (Do do this?)</technical_language>

Target:
public boolean equals( Object o ) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } JournalRecord record = (JournalRecord)o; return content.getUUID().equals(record.content.getUUID()); }
Source:
<code>private ListenableFuture<? extends GeneratedMessage> issueRequest(final Mutation mutation) { try { if (mutation instanceof Put) { return client.mutateRowAsync(adapter.adapt((Put) mutation)); } else if (mutation instanceof Delete) { return client.mutateRowAsync(adapter.adapt((Delete) mutation)); } else if (mutation instanceof Increment) { return client.readModifyWriteRowAsync(adapter.adapt((Increment) mutation)); } else if (mutation instanceof Append) { return client.readModifyWriteRowAsync(adapter.adapt((Append) mutation)); } return Futures.immediateFailedFuture(new IllegalArgumentException( <START> "Encountered unknown action type: " + mutation.getClass())); <END> } catch (RuntimeException e) { return Futures.immediateFailedFuture(e); } }</code><technical_language>nit: Encountered unknown mutation</technical_language>

Target:
private ListenableFuture<? extends GeneratedMessage> issueRequest(final Mutation mutation) { try { if (mutation == null) { return Futures.immediateFailedFuture(new IllegalArgumentException( "Cannot perform a mutation on a null object.")); } if (mutation instanceof Put) { return client.mutateRowAsync(adapter.adapt((Put) mutation)); } else if (mutation instanceof Delete) { return client.mutateRowAsync(adapter.adapt((Delete) mutation)); } else if (mutation instanceof Increment) { return client.readModifyWriteRowAsync(adapter.adapt((Increment) mutation)); } else if (mutation instanceof Append) { return client.readModifyWriteRowAsync(adapter.adapt((Append) mutation)); } return Futures.immediateFailedFuture(new IllegalArgumentException( "Encountered unknown mutation type: " + mutation.getClass())); } catch (RuntimeException e) { return Futures.immediateFailedFuture(e); } }
Source:
<code>@Override public ICubeGenerator createCubeGenerator(ICubicWorldServer world) { CustomTerrainProcessor terrain = new CustomTerrainProcessor(world); <START> CustomFeatureProcessor features = new CustomFeatureProcessor(); <END> CustomPopulationProcessor population = new CustomPopulationProcessor(world); return new BasicCubeGenerator(world) { @Override public ICubePrimer generateCube(int cubeX, int cubeY, int cubeZ) { ICubePrimer primer = new CubePrimer(); terrain.calculate(primer, cubeX, cubeY, cubeZ); features.generate(world, primer, cubeX, cubeY, cubeZ); return primer; } @Override public void populate(Cube cube) { population.populate(cube); } @Override public Vec3i[] getPopRequirment(Cube cube) { return RECOMENDED_POPULATOR_REQUIRMENT; } }; }</code><technical_language>do this kind of formatting. This a lot of unnecessary changes renaming variables, IDEA formatter remove anyway</technical_language>

Target:
@Override public ICubeGenerator createCubeGenerator(ICubicWorldServer world) { CustomTerrainProcessor terrain = new CustomTerrainProcessor(world); CustomFeatureProcessor features = new CustomFeatureProcessor(); CustomPopulationProcessor population = new CustomPopulationProcessor(world); return new BasicCubeGenerator(world) { @Override public ICubePrimer generateCube(int cubeX, int cubeY, int cubeZ) { ICubePrimer primer = new CubePrimer(); terrain.calculate(primer, cubeX, cubeY, cubeZ); features.generate(world, primer, cubeX, cubeY, cubeZ); return primer; } @Override public void populate(Cube cube) { population.populate(cube); } @Override public Box getPopulationRequirement(Cube cube) { return RECOMMENDED_POPULATOR_REQUIREMENT; } }; }
Source:
<code>public Page<E> asPage() { Objects.requireNonNull(ctx); Watch w = Watch.start(); Page<E> result = new Page<E>().withStart(1).withPageSize(PAGE_SIZE); result.bindToRequest(ctx); if (advancedSearch) { QueryCompiler compiler = new QueryCompiler(baseQuery.getEntityDescriptor(), result.getQuery(), searchFields); Constraint constraint = compiler.compile(); if (constraint != null) { baseQuery.where(constraint); } } else { if (searchFields != null && searchFields.length > 0) { baseQuery.where(Like.allWordsInAnyField(result.getQuery(), searchFields)); } } for (Tuple<Facet, BiConsumer<Facet, SmartQuery<E>>> f : facets) { if (f.getSecond() != null) { f.getSecond().accept(f.getFirst(), baseQuery); } result.addFacet(f.getFirst()); } try { List<E> items = baseQuery.skip(result.getStart() - 1).limit(PAGE_SIZE + 1).queryList(); if (items.size() > PAGE_SIZE) { result.withHasMore(true); items.remove(items.size() - 1); } result.withDuration(w.duration()); result.withItems(items); <START> } catch (Throwable e) { <END> UserContext.handle(e); } return result; }</code><technical_language>Yay lets catch Throwables ;)</technical_language>

Target:
public Page<E> asPage() { Objects.requireNonNull(ctx); Watch w = Watch.start(); Page<E> result = new Page<E>().withStart(1).withPageSize(PAGE_SIZE); result.bindToRequest(ctx); if (advancedSearch) { QueryCompiler compiler = new QueryCompiler(baseQuery.getEntityDescriptor(), result.getQuery(), searchFields); Constraint constraint = compiler.compile(); if (constraint != null) { baseQuery.where(constraint); } } else { if (searchFields != null && searchFields.length > 0) { baseQuery.where(Like.allWordsInAnyField(result.getQuery(), searchFields)); } } for (Tuple<Facet, BiConsumer<Facet, SmartQuery<E>>> f : facets) { if (f.getSecond() != null) { f.getSecond().accept(f.getFirst(), baseQuery); } result.addFacet(f.getFirst()); } try { List<E> items = baseQuery.skip(result.getStart() - 1).limit(PAGE_SIZE + 1).queryList(); if (items.size() > PAGE_SIZE) { result.withHasMore(true); items.remove(items.size() - 1); } result.withDuration(w.duration()); result.withItems(items); } catch (Exception e) { UserContext.handle(e); } return result; }
Source:
<code>public PageableResult search(RequestContext context) throws ResponseException { String patientUuid = context.getRequest().getParameter("patient"); String encounterTypeUuid = context.getRequest().getParameter("encounterType"); String dateFrom = context.getRequest().getParameter(DATE_FROM); String dateTo = context.getRequest().getParameter(DATE_TO); <START> Date fromDate = dateFrom!=null ? isoParser.parseDateTime(dateFrom).toDate() : null; <END> Date toDate = dateTo != null? isoParser.parseDateTime(dateTo).toDate() : null; Patient patient = ((PatientResource1_8) Context.getService(RestService.class).getResourceBySupportedClass( Patient.class)).getByUniqueId(patientUuid); EncounterType encounterType = ((EncounterTypeResource1_8) Context.getService(RestService.class).getResourceBySupportedClass(EncounterType.class)).getByUniqueId(encounterTypeUuid); if (patient != null && encounterType != null) { List<Encounter> encounters = Context.getEncounterService() .getEncounters(patient, null, fromDate, toDate, null, Arrays.asList(encounterType), null, false); String order = context.getRequest().getParameter("order"); if ("desc".equals(order)) { Collections.reverse(encounters); } return new NeedsPaging<Encounter>(encounters, context); } return new EmptySearchResult(); }</code><technical_language>ConversionUtil.convert this work for other supported date formats, need include changes in pom file</technical_language>

Target:
public PageableResult search(RequestContext context) throws ResponseException { String patientUuid = context.getRequest().getParameter("patient"); String encounterTypeUuid = context.getRequest().getParameter("encounterType"); String dateFrom = context.getRequest().getParameter(DATE_FROM); String dateTo = context.getRequest().getParameter(DATE_TO); Date fromDate = dateFrom != null ? (Date)ConversionUtil.convert(dateFrom, Date.class) : null; Date toDate = dateTo != null? (Date)ConversionUtil.convert(dateTo, Date.class) : null; Patient patient = ((PatientResource1_8) Context.getService(RestService.class).getResourceBySupportedClass( Patient.class)).getByUniqueId(patientUuid); EncounterType encounterType = ((EncounterTypeResource1_8) Context.getService(RestService.class).getResourceBySupportedClass(EncounterType.class)).getByUniqueId(encounterTypeUuid); if (patient != null && encounterType != null) { List<Encounter> encounters = Context.getEncounterService() .getEncounters(patient, null, fromDate, toDate, null, Arrays.asList(encounterType), null, false); String order = context.getRequest().getParameter("order"); if ("desc".equals(order)) { Collections.reverse(encounters); } return new NeedsPaging<Encounter>(encounters, context); } return new EmptySearchResult(); }
Source:
<code>public AvroSchemaFactoryContext createContext() { AvroSchemaFactoryContext context = new AvroSchemaFactoryContext(replacements); for (Entry<Class<?>, Class<AvroSchemaFactory<?>>> entry : factories.entrySet()) { try { Class<AvroSchemaFactory<?>> clazz = entry.getValue(); Constructor<AvroSchemaFactory<?>> constructor = clazz.getConstructor(AvroSchemaFactoryContext.class); AvroSchemaFactory<?> factory = constructor.newInstance(context); context.register(entry.getKey(), factory); } catch (Exception e) { <START> log.error(e); <END> } } return context; }</code><technical_language>Please a more specific exception Exception, rethrow instead of logging</technical_language>

Target:
public AvroSchemaFactoryContext createContext() { AvroSchemaFactoryContext context = new AvroSchemaFactoryContext(replacements); for (Entry<Class<?>, Class<AvroSchemaFactory<?>>> entry : factories.entrySet()) { try { Class<AvroSchemaFactory<?>> clazz = entry.getValue(); Constructor<AvroSchemaFactory<?>> constructor = clazz.getConstructor(AvroSchemaFactoryContext.class); AvroSchemaFactory<?> factory = constructor.newInstance(context); context.register(entry.getKey(), factory); } catch (ReflectiveOperationException e) { throw new RuntimeServiceException(e); } } return context; }
Source:
<code>public CalledMethodsAnnotatedTypeFactory(BaseTypeChecker checker) { super( checker, CalledMethods.class, CalledMethodsBottom.class, CalledMethodsPredicate.class); Set<String> disabledFrameworks = new HashSet<>(); if (checker.hasOption(CalledMethodsChecker.DISABLE_BUILDER_FRAMEWORK_SUPPORTS)) { disabledFrameworks.addAll( Arrays.asList( checker.getOption( CalledMethodsChecker .DISABLE_BUILDER_FRAMEWORK_SUPPORTS) .split(",")) .stream() .map(String::toUpperCase) .collect(Collectors.toList())); } <START> builderFrameworkSupports = new ArrayList<>(); <END> enableFramework(CalledMethodsChecker.LOMBOK_SUPPORT, disabledFrameworks); enableFramework(CalledMethodsChecker.AUTOVALUE_SUPPORT, disabledFrameworks); if (!disabledFrameworks.isEmpty()) { StringJoiner sj = new StringJoiner(", "); disabledFrameworks.iterator().forEachRemaining(s -> sj.add(s)); String unrecognized = sj.toString(); throw new UserError( "The following argument(s) to the " + CalledMethodsChecker.DISABLE_BUILDER_FRAMEWORK_SUPPORTS + " command-line argument to the Called Methods Checker were unrecognized: " + unrecognized); } this.useValueChecker = checker.hasOption(CalledMethodsChecker.USE_VALUE_CHECKER); this.collectionsSingletonList = TreeUtils.getMethod( "java.util.Collections", "singletonList", 1, getProcessingEnv()); addAliasedAnnotation(OLD_CALLED_METHODS, CalledMethods.class, true); addAliasedAnnotation(OLD_NOT_CALLED_METHODS, this.top); this.postInit(); }</code><technical_language>inconsistent some fields set this. prefix, this is not. consistent. Also, please this constructor body initialize fields in order declared in class, code easier understand</technical_language>

Target:
public CalledMethodsAnnotatedTypeFactory(BaseTypeChecker checker) { super( checker, CalledMethods.class, CalledMethodsBottom.class, CalledMethodsPredicate.class); this.builderFrameworkSupports = new ArrayList<>(); String[] disabledFrameworks; if (checker.hasOption(CalledMethodsChecker.DISABLE_BUILDER_FRAMEWORK_SUPPORTS)) { disabledFrameworks = checker.getOption(CalledMethodsChecker.DISABLE_BUILDER_FRAMEWORK_SUPPORTS) .split(","); } else { disabledFrameworks = new String[0]; } enableFrameworks(disabledFrameworks); this.useValueChecker = checker.hasOption(CalledMethodsChecker.USE_VALUE_CHECKER); this.collectionsSingletonList = TreeUtils.getMethod( "java.util.Collections", "singletonList", 1, getProcessingEnv()); addAliasedAnnotation( "org.checkerframework.checker.builder.qual.CalledMethods", CalledMethods.class, true); addAliasedAnnotation( "org.checkerframework.checker.builder.qual.NotCalledMethods", this.top); this.postInit(); }
Source:
<code>public ValidationResult check(PageValidation pageValidation, String objectName, T spec) throws ValidationErrorException { PageElement mainObject = pageValidation.findPageElement(objectName); checkAvailability(mainObject, objectName); Rect area = mainObject.getArea(); String realText = mainObject.getText(); <START> realText = new String(realText.getBytes(Charset.forName("utf-8"))); <END> if (realText == null) { realText = ""; } realText = applyOperationsTo(realText, spec.getOperations()); checkValue(spec, objectName, realText, "text", area); return new ValidationResult(spec, asList(new ValidationObject(area, objectName))); }</code><technical_language>please move this line null pointer check? sense check for null variable used</technical_language>

Target:
public ValidationResult check(PageValidation pageValidation, String objectName, T spec) throws ValidationErrorException { PageElement mainObject = pageValidation.findPageElement(objectName); checkAvailability(mainObject, objectName); Rect area = mainObject.getArea(); String realText = mainObject.getText(); if (realText == null) { realText = ""; } realText = new String(realText.getBytes(Charset.forName("utf-8"))); realText = applyOperationsTo(realText, spec.getOperations()); checkValue(spec, objectName, realText, "text", area); return new ValidationResult(spec, asList(new ValidationObject(area, objectName))); }
Source:
<code>public void clear() { <START> log.warn("All in memory locks are going to be cleaned"); <END> globalLock.lock(); try { locks.clear(); releasedLock.signalAll(); } finally { globalLock.unlock(); } }</code><technical_language>"Cleaning in memory locks"</technical_language>

Target:
public void clear() { log.warn("Cleaning all in memory locks"); globalLock.lock(); try { locks.clear(); releasedLock.signalAll(); } finally { globalLock.unlock(); } }
Source:
<code>private void launchCheckSetupCDK(IServer s, CDKServer cdkServer, ControllableServerBehavior beh) throws CoreException { CDK3Server cdk3 = (CDK3Server)cdkServer; if( !cdk3.isCDKInitialized()) { int[] retmain = new int[1]; retmain[0] = -1; String home = cdk3.getMinishiftHome(); Display.getDefault().syncExec(() -> { MessageBox messageBox = new MessageBox(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), SWT.ICON_WARNING | SWT.OK | SWT.CANCEL); String msgText = "Your CDK installation has not been properly initialized. Would you like us to run setup-cdk for you?"; String msg = NLS.bind(msgText, home); messageBox.setMessage(msg); messageBox.setText("Warning: CDK has not been properly initialized!"); retmain[0] = messageBox.open(); }); if( retmain[0] == SWT.OK) { Job j = new SetupCDKJob(s, null, true); j.schedule(); try { j.join(); <START> } catch (InterruptedException e) { <END> } } if( !cdk3.isCDKInitialized()) { beh.setServerStopped(); throw new CoreException(CDKCoreActivator.statusFactory().errorStatus( "The server cannot be started until the CDK has been initialized.")); } } }</code><technical_language>![MAJOR](<LINK_1> 'Severity: MAJOR') re-interrupt this method rethrow "InterruptedException". [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
private void launchCheckSetupCDK(IServer s, CDKServer cdkServer, ControllableServerBehavior beh) throws CoreException { CDK3Server cdk3 = (CDK3Server)cdkServer; if( !cdk3.isCDKInitialized()) { int[] retmain = new int[1]; retmain[0] = -1; String home = cdk3.getMinishiftHome(); Display.getDefault().syncExec(() -> { Shell sh = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); String msgText = "Your CDK installation has not been properly initialized. Would you like us to run setup-cdk for you?"; String msg = NLS.bind(msgText, home); MessageDialog messageDialog = new MessageDialog(sh, "Warning: CDK has not been properly initialized!", null, msg, MessageDialog.WARNING, new String[] {IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL}, 0); retmain[0] = messageDialog.open(); }); if( retmain[0] == IDialogConstants.OK_ID) { Job j = new SetupCDKJob(s, null, true); j.schedule(); try { j.join(); } catch (InterruptedException e) { } } if( !cdk3.isCDKInitialized()) { beh.setServerStopped(); throw new CoreException(CDKCoreActivator.statusFactory().errorStatus( "The server cannot be started until the CDK has been initialized.")); } } }
Source:
<code>public static File copyDirectoryIfNonExistent(final FileSystem fileSystem, final String localDirectory) { try { final String hadoopGremlinLibsRemote = "hadoop-gremlin-" + Gremlin.version() + "-libs"; File file = new File(localDirectory); if ((Boolean.valueOf(System.getProperty("is.testing", "false")) || !file.exists()) && fileSystem.exists(new Path(localDirectory)) && fileSystem.isDirectory(new Path(localDirectory))) { final File tempDirectory = new File(System.getProperty("java.io.tmpdir") + "/" + hadoopGremlinLibsRemote); <START> if (!tempDirectory.exists()) assert tempDirectory.mkdir(); <END> final String tempPath = tempDirectory.getAbsolutePath() + "/" + new File(localDirectory).getName(); final RemoteIterator<LocatedFileStatus> files = fileSystem.listFiles(new Path(localDirectory), false); while (files.hasNext()) { final LocatedFileStatus f = files.next(); fileSystem.copyToLocalFile(f.getPath(), new Path(tempPath + "/" + f.getPath().getName())); } return new File(tempPath); } else return file; } catch (final IOException e) { throw new IllegalStateException(e.getMessage(), e); } }</code><technical_language>mkdir() mkdirs() java.io.dir set user assumptions existing directory structures</technical_language>

Target:
public static File copyDirectoryIfNonExistent(final FileSystem fileSystem, final String localDirectory) { try { final String hadoopGremlinLibsRemote = "hadoop-gremlin-" + Gremlin.version() + "-libs"; File file = new File(localDirectory); if ((Boolean.valueOf(System.getProperty("is.testing", "false")) || !file.exists()) && fileSystem.exists(new Path(localDirectory)) && fileSystem.isDirectory(new Path(localDirectory))) { final File tempDirectory = new File(System.getProperty("java.io.tmpdir") + System.getProperty("file.separator") + hadoopGremlinLibsRemote); if (!tempDirectory.exists()) assert tempDirectory.mkdirs(); final String tempPath = tempDirectory.getAbsolutePath() + System.getProperty("file.separator") + new File(localDirectory).getName(); final RemoteIterator<LocatedFileStatus> files = fileSystem.listFiles(new Path(localDirectory), false); while (files.hasNext()) { final LocatedFileStatus f = files.next(); fileSystem.copyToLocalFile(f.getPath(), new Path(tempPath + System.getProperty("file.separator") + f.getPath().getName())); } return new File(tempPath); } else return file; } catch (final IOException e) { throw new IllegalStateException(e.getMessage(), e); } }
Source:
<code>public ResultSet<ContextualStatistics> execute() { Map<Context, ContextualStatistics> contextualStatistics = new LinkedHashMap<Context, ContextualStatistics>(contexts.size()); Collection<ManagementProvider<?>> managementProviders = capabilityManagement.getManagementProvidersByCapability(capabilityName); for (Context context : contexts) { Map<String, Number> statistics = new HashMap<String, Number>(); for (ManagementProvider<?> managementProvider : managementProviders) { if (managementProvider.supports(context)) { for (Map.Entry<String, Number> entry : managementProvider.collectStatistics(context, statisticNames).entrySet()) { <START> if (entry.getValue().doubleValue() != -1.0d) { <END> statistics.put(entry.getKey(), entry.getValue()); } } } } contextualStatistics.put(context, new ContextualStatistics(capabilityName, context, statistics)); } return new DefaultResultSet<ContextualStatistics>(contextualStatistics); }</code><technical_language>This tricky. If talking counters here, check < 0</technical_language>

Target:
public ResultSet<ContextualStatistics> execute() { Map<Context, ContextualStatistics> contextualStatistics = new LinkedHashMap<Context, ContextualStatistics>(contexts.size()); Collection<ManagementProvider<?>> managementProviders = capabilityManagement.getManagementProvidersByCapability(capabilityName); for (Context context : contexts) { Map<String, Number> statistics = new HashMap<String, Number>(); for (ManagementProvider<?> managementProvider : managementProviders) { if (managementProvider.supports(context)) { for (Map.Entry<String, Number> entry : managementProvider.collectStatistics(context, statisticNames).entrySet()) { if (entry.getValue().doubleValue() >= 0) { statistics.put(entry.getKey(), entry.getValue()); } } } } contextualStatistics.put(context, new ContextualStatistics(capabilityName, context, statistics)); } return new DefaultResultSet<ContextualStatistics>(contextualStatistics); }
Source:
<code>public FilteredClassLoader(URL[] urls, ClassLoader parent) { super(urls, null); delegatedClasses.add("org.apache.hadoop.fs.ozone.OzoneClientAdapter"); delegatedClasses.add("org.apache.hadoop.security.token.Token"); delegatedClasses.add("org.apache.hadoop.fs.ozone.BasicKeyInfo"); delegatedClasses.add("org.apache.hadoop.fs.ozone.OzoneFSOutputStream"); delegatedClasses.add("org.apache.hadoop.fs.ozone.OzoneFSStorageStatistics"); delegatedClasses.add("org.apache.hadoop.fs.ozone.Statistic"); delegatedClasses.add("org.apache.hadoop.fs.Seekable"); String[] dynamicDelegatedClasses = System.getProperty("HADOOP_OZONE_DELEGATED_CLASSES").split(";"); for (String delegatedClass : dynamicDelegatedClasses) { delegatedClasses.add(delegatedClass); <START> } <END> this.delegate = parent; systemClassLoader = getSystemClassLoader(); }</code><technical_language>replace code L60-64 delegatedClasses.addAll( getTrimmedStringCollection(System.getenv("HADOOP_OZONE_DELEGATED_CLASSES")));</technical_language>

Target:
public FilteredClassLoader(URL[] urls, ClassLoader parent) { super(urls, null); delegatedClasses.add("org.apache.hadoop.fs.ozone.OzoneClientAdapter"); delegatedClasses.add("org.apache.hadoop.security.token.Token"); delegatedClasses.add("org.apache.hadoop.fs.ozone.BasicKeyInfo"); delegatedClasses.add("org.apache.hadoop.fs.ozone.OzoneFSOutputStream"); delegatedClasses.add("org.apache.hadoop.fs.ozone.OzoneFSStorageStatistics"); delegatedClasses.add("org.apache.hadoop.fs.ozone.Statistic"); delegatedClasses.add("org.apache.hadoop.fs.Seekable"); delegatedClasses.addAll(StringUtils.getTrimmedStringCollection( System.getenv("HADOOP_OZONE_DELEGATED_CLASSES"))); this.delegate = parent; systemClassLoader = getSystemClassLoader(); }
Source:
<code>public void testAddCatalogItem() throws Exception { assertEquals(countCatalogPolicies(), 0); <START> String registeredTypeName = "my.catalog.app.id.load"; <END> addCatalogOSGiPolicy(registeredTypeName, SIMPLE_POLICY_TYPE); CatalogItem<?, ?> item = mgmt().getCatalog().getCatalogItem(registeredTypeName); assertEquals(item.getRegisteredTypeName(), registeredTypeName); assertEquals(countCatalogPolicies(), 1); }</code><technical_language>id in CatalogYamlEntityTest. matter torn a new ManagementContext</technical_language>

Target:
public void testAddCatalogItem() throws Exception { assertEquals(countCatalogPolicies(), 0); String registeredTypeName = "my.catalog.policy.id.load"; addCatalogOSGiPolicy(registeredTypeName, SIMPLE_POLICY_TYPE); CatalogItem<?, ?> item = mgmt().getCatalog().getCatalogItem(registeredTypeName); assertEquals(item.getRegisteredTypeName(), registeredTypeName); assertEquals(countCatalogPolicies(), 1); deleteCatalogEntity(registeredTypeName); }
Source:
<code>private List<LookupBean> getLookupListFromCoordinator(String tier) { try { <START> boolean[] firstAttempt = new boolean[] {true}; <END> Map<String, LookupExtractorFactoryContainer> lookupMap = RetryUtils.retry( () -> { if (firstAttempt[0]) { firstAttempt[0] = false; } else { Thread.sleep(60_000); } return tryGetLookupListFromCoordinator(tier); }, e -> true, lookupConfig.getCoordinatorFetchRetries() ); if (lookupMap != null) { List<LookupBean> lookupBeanList = new ArrayList<>(); lookupMap.forEach((k, v) -> lookupBeanList.add(new LookupBean(k, null, v))); return lookupBeanList; } else { return null; } } catch (Exception e) { LOG.error(e, "Error while trying to get lookup list from coordinator for tier[%s]", tier); return null; } }</code><technical_language>Suggest AtomicBoolean instead more clear is doing</technical_language>

Target:
private List<LookupBean> getLookupListFromCoordinator(String tier) { try { MutableBoolean firstAttempt = new MutableBoolean(true); Map<String, LookupExtractorFactoryContainer> lookupMap = RetryUtils.retry( () -> { if (firstAttempt.isTrue()) { firstAttempt.setValue(false); } else { Thread.sleep(60_000); } return tryGetLookupListFromCoordinator(tier); }, e -> true, lookupConfig.getCoordinatorFetchRetries() ); if (lookupMap != null) { List<LookupBean> lookupBeanList = new ArrayList<>(); lookupMap.forEach((k, v) -> lookupBeanList.add(new LookupBean(k, null, v))); return lookupBeanList; } else { return null; } } catch (Exception e) { LOG.error(e, "Error while trying to get lookup list from coordinator for tier[%s]", tier); return null; } }
Source:
<code>private void updateActionAvailability(GlusterVolumeEntity volumeEntity) { boolean allowStartSessionCommand = true; if(volumeEntity == null) { return; } if(getSelectedItem() == null) { allowStartSessionCommand = false; } else { if(getSelectedItems().size() == 1) { GlusterGeoRepSession selectedSession = (GlusterGeoRepSession)getSelectedItem(); allowStartSessionCommand = selectedSession .getStatus() == GeoRepSessionStatus.NOTSTARTED || selectedSession.getStatus() == GeoRepSessionStatus.STOPPED; <START> } <END> } getNewSessionCommand().setIsAvailable(true); getRemoveSessionCommand().setIsAvailable(false); getStartSessionCommand().setIsExecutionAllowed(allowStartSessionCommand); getStopSessionCommand().setIsAvailable(false); getSessionOptionsCommand().setIsAvailable(false); getViewSessionDetailsCommand().setIsAvailable(false); getRefreshSessionsCommand().setIsAvailable(true); }</code><technical_language>if multiple volumes selected? need add else block</technical_language>

Target:
private void updateActionAvailability(GlusterVolumeEntity volumeEntity) { boolean allowStartSessionCommand = true; if(volumeEntity == null) { return; } if(getSelectedItem() == null) { allowStartSessionCommand = false; } else if(getSelectedItems().size() == 1) { GlusterGeoRepSession selectedSession = (GlusterGeoRepSession)getSelectedItem(); allowStartSessionCommand = selectedSession .getStatus() == GeoRepSessionStatus.NOTSTARTED || selectedSession.getStatus() == GeoRepSessionStatus.STOPPED; } else { allowStartSessionCommand = false; } getNewSessionCommand().setIsAvailable(true); getRemoveSessionCommand().setIsAvailable(false); getStartSessionCommand().setIsExecutionAllowed(allowStartSessionCommand); getStopSessionCommand().setIsAvailable(false); getSessionOptionsCommand().setIsAvailable(false); getViewSessionDetailsCommand().setIsAvailable(false); getRefreshSessionsCommand().setIsAvailable(true); }
Source:
<code>public String fileToJSON(String yamlRun) throws IOException { Yaml yaml = new Yaml(); <START> final FileInputStream fileInputStream = FileUtils.openInputStream(new File(yamlRun)); <END> Map<String, Object> map = yaml.load(fileInputStream); JSONObject jsonObject = new JSONObject(map); return jsonObject.toString(); }</code><technical_language>leaks fileInputStream, want a <LINK_0></technical_language>

Target:
public String fileToJSON(String yamlRun) throws IOException { Yaml yaml = new Yaml(); try (FileInputStream fileInputStream = FileUtils.openInputStream(new File(yamlRun))) { Map<String, Object> map = yaml.load(fileInputStream); JSONObject jsonObject = new JSONObject(map); return jsonObject.toString(); } }
Source:
<code>protected String mapPassword(Object passwordValue) { <START> String passwordValueString; if (!(passwordValue instanceof String)) { passwordValueString = new String((byte[]) passwordValue); } else { passwordValueString = (String) passwordValue; } <END> if (!isBase64EncodedPassword()) { return passwordValueString; } return decodeBase64EncodedPassword(passwordValueString); }</code><technical_language>suggestion String passwordValueString = super.mapPassword(passwordValue);</technical_language>

Target:
protected String mapPassword(Object passwordValue) { String passwordValueString = super.mapPassword(passwordValue); if (!isUserPasswordEncoded()) { return passwordValueString; } return decodeBase64EncodedPassword(passwordValueString); }
Source:
<code>public ProjectApi create(ProjectInput <START> in) <END> { throw new NotImplementedException(); }</code><technical_language>Do need a throws declaration here? inconsistent in existing methods</technical_language>

Target:
public ProjectApi create(ProjectInput in) throws RestApiException { throw new NotImplementedException(); }
Source:
<code>protected void onGooglePlayServicesReady() { SupportMapFragment fragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map); map = fragment.getMap(); map.setMyLocationEnabled(true); <START> map.getUiSettings().setZoomControlsEnabled(false); <END> map.getUiSettings().setMyLocationButtonEnabled(false); MarkerOptions markerOptions = MapUtil.getUserSpeechBubbleMarkerOptions( request.getClient(), iconGenerator, SpeechBubble.ColorType.BLUE ); map.addMarker(markerOptions); MapUtil.panAndZoomToUser(map, request.getClient(), MapUtil.DEFAULT_ZOOM_LEVEL); }</code><technical_language>disallowing zoom controls for a reason? noticing a lot of calls made. standardize a common function set settings for maps. do a common mode of operation</technical_language>

Target:
protected void onGooglePlayServicesReady() { SupportMapFragment fragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map); map = fragment.getMap(); map.setMyLocationEnabled(true); MarkerOptions markerOptions = MapUtil.getUserSpeechBubbleMarkerOptions( request.getClient(), iconGenerator, SpeechBubble.ColorType.BLUE ); map.addMarker(markerOptions); MapUtil.panAndZoomToUser(map, request.getClient(), MapUtil.DEFAULT_ZOOM_LEVEL); }
Source:
<code>public void testWarmUpConnections() throws IOException { MockClusterMap mockClusterMap = new MockClusterMap(); List<DataNodeId> localDataNodeIds = mockClusterMap.getDataNodeIds() .stream() .filter(dataNodeId -> mockClusterMap.getDatacenterName(mockClusterMap.getLocalDatacenterId()) .equals(dataNodeId.getDatacenterName())) .collect(Collectors.toList()); int maxPort = mockClusterMap.isSslPortsEnabled() ? MAX_PORTS_SSL : MAX_PORTS_PLAIN_TEXT; Assert.assertEquals("Connection count is not expected", maxPort * localDataNodeIds.size(), networkClient.warmUpConnections(localDataNodeIds, 1.0, 2000)); Assert.assertEquals("Connection count is not expected", (int) (0.5 * maxPort) * localDataNodeIds.size(), networkClient.warmUpConnections(localDataNodeIds, 0.5, 2000)); <START> Assert.assertEquals("Connection count is not expected", 0 * maxPort * localDataNodeIds.size(), <END> networkClient.warmUpConnections(localDataNodeIds, 0, 2000)); selector.setState(MockSelectorState.Good); }</code><technical_language>need 0 here, instead of 0 * maxPort * localDataNodeIds.size()</technical_language>

Target:
public void testWarmUpConnections() throws IOException { MockClusterMap mockClusterMap = new MockClusterMap(true, 9, 3, 3, false); List<DataNodeId> localDataNodeIds = mockClusterMap.getDataNodeIds() .stream() .filter(dataNodeId -> mockClusterMap.getDatacenterName(mockClusterMap.getLocalDatacenterId()) .equals(dataNodeId.getDatacenterName())) .collect(Collectors.toList()); int maxPort = mockClusterMap.isSslPortsEnabled() ? MAX_PORTS_SSL : MAX_PORTS_PLAIN_TEXT; doTestWarmUpConnections(localDataNodeIds, maxPort, PortType.PLAINTEXT); for (DataNodeId dataNodeId : localDataNodeIds) { ((MockDataNodeId) dataNodeId).setSslEnabledDataCenters( Collections.singletonList(mockClusterMap.getDatacenterName(mockClusterMap.getLocalDatacenterId()))); } doTestWarmUpConnections(localDataNodeIds, maxPort, PortType.SSL); }
Source:
<code>public void setData(BufferInfo vertexBufferInfo, BufferInfo normalBufferInfo, float[] textureCoords, float[] colors, int[] indices, boolean createVBOs) { if (textureCoords == null || textureCoords.length == 0) { textureCoords = new float[(mNumVertices / 3) * 2]; } setTextureCoords(textureCoords); if (colors == null || colors.length == 0) { <START> setColors(0xff000000 + (int) (Math.random() * 0xffffff)); <END> } else { setColors(colors); } setIndices(indices); mBuffers.put(VERTEX_BUFFER_KEY, vertexBufferInfo); mBuffers.put(NORMAL_BUFFER_KEY, normalBufferInfo); mOriginalGeometry = null; if (createVBOs) { createBuffers(); } }</code><technical_language>@It constants OPAQUE WHITE simply do OPAQUE | (int) (Math.random() * WHITE); Thinking more, is in a huge range of color possibilities. private static final Random RANDOM = new Random(); ... // Create a 'random' color a a set of 6 color shades of RGB set opaque OPAQUE | 0xf << RANDOM.nextInt(7);</technical_language>

Target:
public void setData(BufferInfo vertexBufferInfo, BufferInfo normalBufferInfo, float[] textureCoords, float[] colors, int[] indices, boolean createVBOs) { if (textureCoords == null || textureCoords.length == 0) { textureCoords = new float[(mNumVertices / 3) * 2]; } setTextureCoords(textureCoords); if (colors == null || colors.length == 0) { setColors(0xff000000 + (int) (Math.random() * 0xffffff)); } else { setColors(colors); } setIndices(indices); mBuffers.add(VERTEX_BUFFER_KEY, vertexBufferInfo); mBuffers.add(NORMAL_BUFFER_KEY, normalBufferInfo); mOriginalGeometry = null; if (createVBOs) { createBuffers(); } }
Source:
<code><START> public void setFinishedBuilding(boolean isFinishedBuilding) { <END> this.isFinishedBuilding = isFinishedBuilding; }</code><technical_language>variable protected, public, setter remain protected. getter also, possibly</technical_language>

Target:
protected void setFinishedBuilding(boolean isFinishedBuilding) { this.fFinishedBuilding = isFinishedBuilding; }
Source:
<code>protected void abortOldUploads() { ConfigurationService configurationService = Framework.getService(ConfigurationService.class); <START> if (configurationService == null) { <END> return; } if (configurationService.isBooleanTrue(MULTIPART_CLEANUP_DISABLED_PROPERTY)) { return; } new Thread(this::abortOldMultipartUploadsInternal, "Nuxeo-S3-abortOldMultipartUploads-" + bucketName).start(); }</code><technical_language>in case happen</technical_language>

Target:
protected void abortOldUploads() { if (getBooleanProperty(MULTIPART_CLEANUP_DISABLED_PROPERTY)) { log.debug("Cleanup of old multipart uploads is disabled"); return; } new Thread(this::abortOldMultipartUploadsInternal, "Nuxeo-S3-abortOldMultipartUploads-" + bucketName).start(); }
Source:
<code>public void drawMarker(double xPosition, double yPosition) { <START> double markerSpan = this.mapCanvas.getWidth() / HUNDRED; <END> double upperLeftX = xPosition - markerSpan; double upperLeftY = yPosition + markerSpan; double upperRightX = xPosition + markerSpan; double upperRightY = yPosition + markerSpan; double lowerLeftX = xPosition - markerSpan; double lowerLeftY = yPosition - markerSpan; double lowerRightX = xPosition + markerSpan; double lowerRightY = yPosition - markerSpan; Line upperLeftToLowerRight = new Line(upperLeftX, upperLeftY, lowerRightX, lowerRightY); Line upperRightToLowerLeft = new Line(upperRightX, upperRightY, lowerLeftX, lowerLeftY); upperLeftToLowerRight.setFill(null); upperLeftToLowerRight.setStroke(Color.RED); upperLeftToLowerRight.setStrokeWidth(2); upperLeftToLowerRight.setVisible(true); upperRightToLowerLeft.setFill(null); upperRightToLowerLeft.setStroke(Color.RED); upperRightToLowerLeft.setStrokeWidth(2); upperRightToLowerLeft.setVisible(true); this.getChildren().add(upperLeftToLowerRight); this.getChildren().add(upperRightToLowerLeft); }</code><technical_language>work if canvas is square</technical_language>

Target:
public void drawMarker(double xPosition, double yPosition) { double markerSpan = Math.sqrt(Math.pow(this.mapCanvas.getWidth(), 2) + Math.pow(this.mapCanvas.getHeight(), 2)) / HUNDRED; double upperLeftX = xPosition - markerSpan; double upperLeftY = yPosition + markerSpan; double upperRightX = xPosition + markerSpan; double upperRightY = yPosition + markerSpan; double lowerLeftX = xPosition - markerSpan; double lowerLeftY = yPosition - markerSpan; double lowerRightX = xPosition + markerSpan; double lowerRightY = yPosition - markerSpan; Line upperLeftToLowerRight = new Line(upperLeftX, upperLeftY, lowerRightX, lowerRightY); Line upperRightToLowerLeft = new Line(upperRightX, upperRightY, lowerLeftX, lowerLeftY); upperLeftToLowerRight.setFill(null); upperLeftToLowerRight.setStroke(Color.RED); upperLeftToLowerRight.setStrokeWidth(2); upperLeftToLowerRight.setVisible(true); upperRightToLowerLeft.setFill(null); upperRightToLowerLeft.setStroke(Color.RED); upperRightToLowerLeft.setStrokeWidth(2); upperRightToLowerLeft.setVisible(true); this.getChildren().add(upperLeftToLowerRight); this.getChildren().add(upperRightToLowerLeft); }
Source:
<code>private RevObject writeBlob(final Repository repo, final String data) throws IOException { final RevWalk revWalk = new RevWalk(repo); final byte[] bytes = Constants.encode(data); final ObjectId id; <START> try (final ObjectInserter inserter = repo.newObjectInserter()) { <END> id = inserter.insert(Constants.OBJ_BLOB, bytes); inserter.flush(); } try { parse(id); fail("Object " + id.name() + " should not exist in test repository"); } catch (MissingObjectException e) { } return revWalk.lookupBlob(id); }</code><technical_language>(optional) [and in other files]</technical_language>

Target:
private RevObject writeBlob(final Repository repo, final String data) throws IOException { final RevWalk revWalk = new RevWalk(repo); final byte[] bytes = Constants.encode(data); final ObjectId id; try (ObjectInserter inserter = repo.newObjectInserter()) { id = inserter.insert(Constants.OBJ_BLOB, bytes); inserter.flush(); } try { parse(id); fail("Object " + id.name() + " should not exist in test repository"); } catch (MissingObjectException e) { } return revWalk.lookupBlob(id); }
Source:
<code>public Long getLong(String key, Long defaultValue) { try { <START> return getValue(Long.class, key); <END> } catch (NoSuchElementException e) { return defaultValue; } }</code><technical_language>create a variant of getValue(Class<T> type, String key, T defaultValue) handle NoSuchElementException instead of handle exception in getXXX methods</technical_language>

Target:
public Long getLong(String key, Long defaultValue) { return getValueWithDefault(Long.class, key, defaultValue); }
Source:
<code>protected boolean canDoAction() { GlusterVolumeEntity volume = getGlusterVolume(); if (!super.canDoAction()) { return false; } if (!validate(getBrickValidator().isValidParam(volume, getParameters().getBricks()))) { <START> return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_REMOVE_BRICKS_PARAMS_INVALID); <END> } if (!(getGlusterTaskUtils().isTaskOfType(volume, GlusterTaskType.REMOVE_BRICK)) || !(getGlusterTaskUtils().isTaskStatus(volume, JobExecutionStatus.FINISHED))) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_REMOVE_BRICKS_NOT_FINISHED); } return true; }</code><technical_language>validate() takes care of adding canDoActionMessage, returning false is enough</technical_language>

Target:
protected boolean canDoAction() { GlusterVolumeEntity volume = getGlusterVolume(); if (!super.canDoAction()) { return false; } if (!validate(getBrickValidator().canStopOrCommitRemoveBrick(volume, getParameters().getBricks()))) { return false; } if (!(getGlusterTaskUtils().isTaskOfType(volume, GlusterTaskType.REMOVE_BRICK)) || !(getGlusterTaskUtils().isTaskStatus(volume, JobExecutionStatus.FINISHED))) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_REMOVE_BRICKS_NOT_FINISHED); } return true; }
Source:
<code>public JsonWriter value(Number value) throws IOException { if (value == null) { return nullValue(); } double d = value.doubleValue(); if (!isLenient()) { if (Double.isNaN(d) || Double.isInfinite(d)) { throw new IllegalArgumentException("JSON forbids NaN and infinities: " + value); } } <START> if (floor(d) == d) { <END> int a = value.intValue(); generator.writeNumber(a); } else { generator.writeNumber(d); } return this; }</code><technical_language>I is perform instanceof: java if (value instanceof Integer) { generator.writeNumber(value.intValue()); } else if (value instanceof Float) { generator.writeNumber(value.floatNumber()); } else if (value instanceof Short) { generator.writeNumber(value.shortValue()); } else if{ //.... Long / BigInteger / BigDecimal etc.. } else { // double default writer.writeNumber(value.doubleValue()); }</technical_language>

Target:
public JsonWriter value(Number value) throws IOException { if (value == null) { return nullValue(); } if (value instanceof Integer) { generator.writeNumber(value.intValue()); } else if (value instanceof Short) { generator.writeNumber(value.shortValue()); } else if (value instanceof Long) { generator.writeNumber(value.longValue()); } else if (value instanceof Float) { float f = value.floatValue(); checkStrictNumber(f); generator.writeNumber(f); } else if (value instanceof BigInteger) { generator.writeNumber((BigInteger) value); } else if (value instanceof BigDecimal) { BigDecimal bd = (BigDecimal) value; checkStrictNumber(bd); generator.writeNumber(bd); } else { double d = value.doubleValue(); checkStrictNumber(d); generator.writeNumber(d); } return this; }