auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static final AbstractTextColumn<Disk> getAllocationColumn(String sortBy) { AbstractTextColumn<Disk> column = new AbstractEnumColumn<Disk, VolumeType>() { @Override protected VolumeType getRawValue(Disk object) { return object.getDiskStorageType() == DiskStorageType.IMAGE || object.getDiskStorageType() == DiskStorageType.CINDER ? ((DiskImage) object).getVolumeType() : null; } @Override public SafeHtml getTooltip(Disk object) { if (object.getDiskStorageType() != DiskStorageType.IMAGE && object.getDiskStorageType() != DiskStorageType.CINDER) { return null; } DiskImage diskImage = (DiskImage) object; if (diskImage.getSnapshots().isEmpty()) { return null; } VolumeType originalVolumeType = <START> diskImage.getSnapshots().get(diskImage.getSnapshots().size() - 1).getVolumeType(); <END> return SafeHtmlUtils.fromString( StringFormat.format("%s: %s", AssetProvider.getConstants().originalAllocationDisk(), EnumTranslator.getInstance().translate(originalVolumeType))); } }; return makeSortable(column, sortBy); }</code><technical_language>Discussed offline, please check snapshot order rely in this logic is expect better, for parent image</technical_language>

Target:
public static final AbstractTextColumn<Disk> getAllocationColumn(String sortBy) { AbstractTextColumn<Disk> column = new AbstractEnumColumn<Disk, VolumeType>() { @Override protected VolumeType getRawValue(Disk object) { return object.getDiskStorageType() == DiskStorageType.IMAGE || object.getDiskStorageType() == DiskStorageType.CINDER ? ((DiskImage) object).getVolumeType() : null; } @Override public SafeHtml getTooltip(Disk object) { if (object.getDiskStorageType() != DiskStorageType.IMAGE && object.getDiskStorageType() != DiskStorageType.CINDER) { return null; } VolumeType originalVolumeType = null; for (DiskImage snapshot : ((DiskImage) object).getSnapshots()) { if (snapshot.getParentId() == null || snapshot.getParentId().equals(Guid.Empty)) { originalVolumeType = snapshot.getVolumeType(); break; } } if (originalVolumeType == null) { return null; } return SafeHtmlUtils.fromString( StringFormat.format("%s: %s", AssetProvider.getConstants().originalAllocationDisk(), EnumTranslator.getInstance().translate(originalVolumeType))); } }; return makeSortable(column, sortBy); }
Source:
<code>public Future<Response> submit() { <START> if (client.httpEngine() instanceof AsyncClientHttpEngine) <END> { return asyncSubmit(getFutureExtractorFunction(false, null), result -> result, getAsyncAbortedFunction(null), getAsyncExceptionFunction(null)); } else { return executorSubmit(client.asyncInvocationExecutor(), null, result -> result); } }</code><technical_language>I do understand need for repeating this if/else in 9 places in code. Repeating logic is error-prone, IMO. in a single place earlier</technical_language>

Target:
public Future<Response> submit() { return doSubmit(false, null, result -> result); }
Source:
<code>private String normalizableDateRangeForXML(String dateRange) { if (dateRange.indexOf('/') >= 0) { String[] dates = dateRange.split("/", 2); Instant dateFromInstant = instantFromIso(dates[0]); Instant dateToInstant = instantFromIso(dates[1]); String dateFrom = ""; <START> String dateTo = ""; <END> if (dateFromInstant != null) { dateFrom = Objects.toString(dateFromInstant.toEpochMilli()); } if (dateToInstant != null) { dateTo = Objects.toString(dateToInstant.toEpochMilli()); } return dateFrom + '/' + dateTo; } return null; }</code><technical_language>done here: final String dateFrom = (dateFromInstant != null) ? Objects.toString(dateFromInstant.toEpochMilli()) : ""; final String dateTo = (dateToInstant != null) ? Objects.toString(dateToInstant.toEpochMilli()) : "";</technical_language>

Target:
private String normalizableDateRangeForXML(String dateRange) { if (dateRange.indexOf('/') >= 0) { String[] dates = dateRange.split("/", 2); Instant dateFromInstant = instantFromIso(dates[0]); Instant dateToInstant = instantFromIso(dates[1]); final String dateFrom = (dateFromInstant != null) ? Objects.toString(dateFromInstant.toEpochMilli()) : ""; final String dateTo = (dateToInstant != null) ? Objects.toString(dateToInstant.toEpochMilli()) : ""; return dateFrom + '/' + dateTo; } return null; }
Source:
<code>private static void addFormattedText(XWPFRun run, String text, int fontSize, boolean bold) { <START> addFormattedText(run, text, "Calibri", fontSize, bold, null); <END> }</code><technical_language>I do null passed parameter, emulate behaviour of Optional</technical_language>

Target:
private static void addFormattedText(XWPFRun run, String text, int fontSize, boolean bold) { addFormattedText(run, text, FONT_FAMILY, fontSize, bold, null); }
Source:
<code>public boolean hasNext() throws IOException { if( csvWriter == null ){ <START> throw new IOException("Writer has been closed"); <END> } if (this.appending) { return false; } return iterator.hasNext(); }</code><technical_language>@tbarsballe done a QA run ensure closed writers return hasNext(): false (rather thrown IOException). Lets stick for consistency (principle of surprise)</technical_language>

Target:
public boolean hasNext() throws IOException { if( csvWriter == null ){ return false; } if (this.appending) { return false; } return iterator.hasNext(); }
Source:
<code>protected void stubPost(UrlMatchingStrategy url, String responseFile) throws Exception { stubFor(post(url) .withHeader("Authorization", equalTo("Basic dXNlcjpwYXNz")) .willReturn(aResponse() <START> .withStatus(200) <END> .withHeader("Content-Type", "application/json") .withBody(IOUtils.toString(getClass().getResourceAsStream(responseFile))))); }</code><technical_language>[Checkstyle] INFO: '200' is a magic number</technical_language>

Target:
protected void stubPost(UrlMatchingStrategy url, String responseFile) throws Exception { stubFor(post(url) .withHeader("Authorization", equalTo("Basic dXNlcjpwYXNz")) .willReturn(aResponse() .withStatus(HttpStatus.SC_OK) .withHeader("Content-Type", "application/json") .withBody(IOUtils.toString(getClass().getResourceAsStream(responseFile))))); }
Source:
<code>private static <T, R> Function<T, Observable<R>> convertSingleMapperToObservableMapper( final Function<? super T, ? extends SingleSource<? extends R>> mapper) { return new Function<T, Observable<R>>() { @SuppressWarnings("unchecked") @Override public Observable<R> apply(T t) throws Exception { SingleSource<? extends R> source = mapper.apply(t); Single<? extends R> single; if (source instanceof Single) { single = (Single<? extends R>) source; } else { single = Single.unsafeCreate(source); } <START> return (Observable<R>) single.toObservable(); <END> } }; }</code><technical_language>use: java return RxJavaPlugins.onAssembly(new SingleToObservable(mapper.apply(t)));</technical_language>

Target:
private static <T, R> Function<T, Observable<R>> convertSingleMapperToObservableMapper( final Function<? super T, ? extends SingleSource<? extends R>> mapper) { ObjectHelper.requireNonNull(mapper, "mapper is null"); return new ObservableMapper<T,R>(mapper); }
Source:
<code>private boolean isNumberZero(String literalValue) { <START> return !literalValue.matches(".*[1-9]+.*") || (literalValue.startsWith("0x") && !literalValue.substring(2).matches(".*[1-9a-fA-F]+.*")); <END> }</code><technical_language>I wondering this is complicated</technical_language>

Target:
private static boolean isNumberZero(String literalValue) { return isNullCharacter(literalValue) || !(literalValue.matches("(.)*[1-9]+(.)*") || literalValue.matches("(0x|0X){1}(.)*[1-9a-fA-F]+(.)*") || literalValue.matches("(0b|0B){1}(.)*[1]+(.)*")); }
Source:
<code><START> public DataReader(IConnectionInterface connectionInterface) { <END> this.connectionInterface = connectionInterface; }</code><technical_language>I guess connectionInterface null, throw a NullPointerException if this occurs</technical_language>

Target:
public DataReader(IConnectionInterface connectionInterface) { if (connectionInterface == null) throw new NullPointerException("Connection interface cannot be null."); this.connectionInterface = connectionInterface; }
Source:
<code>public Multimap<CallStackDepth, ICalledFunction> queryCallStacks(Collection<CallStackDepth> callstacks, Collection<Long> times) { Map<Integer, CallStackDepth> quarks = new HashMap<>(); for (CallStackDepth csDepth : callstacks) { quarks.put(csDepth.getQuark(), csDepth); } Multimap<CallStackDepth, ICalledFunction> map = ArrayListMultimap.create(); try { Iterable<ITmfStateInterval> query2d = fStateSystem.query2D(quarks.keySet(), times); for (ITmfStateInterval callInterval : query2d) { if <START> (!callInterval.getStateValue().isNull()) <END> { CallStackDepth callStackDepth = Objects.requireNonNull(quarks.get(callInterval.getAttribute())); map.put(callStackDepth, callStackDepth.getCallStack().getFunctionFromInterval(callInterval)); } } } catch (IndexOutOfBoundsException | TimeRangeException | StateSystemDisposedException e) { e.printStackTrace(); } return map; }</code><technical_language>getValue</technical_language>

Target:
public Multimap<CallStackDepth, ISegment> queryCallStacks(Collection<CallStackDepth> callstacks, Collection<Long> times) { Map<Integer, CallStackDepth> quarks = new HashMap<>(); for (CallStackDepth csDepth : callstacks) { quarks.put(csDepth.getQuark(), csDepth); } Multimap<CallStackDepth, ISegment> map = Objects.requireNonNull(ArrayListMultimap.create()); Collection<Long> queryTimes = getTimes(fStateSystem, times); try { Iterable<ITmfStateInterval> query2d = fStateSystem.query2D(quarks.keySet(), queryTimes); for (ITmfStateInterval callInterval : query2d) { CallStackDepth callStackDepth = Objects.requireNonNull(quarks.get(callInterval.getAttribute())); if (!callInterval.getStateValue().isNull()) { map.put(callStackDepth, callStackDepth.getCallStack().getFunctionFromInterval(callInterval)); } else { map.put(callStackDepth, new NullFunction(callInterval)); } } } catch (IndexOutOfBoundsException | TimeRangeException | StateSystemDisposedException e) { e.printStackTrace(); } return map; }
Source:
<code>public Iterable<Method> allPublicMethods() { <START> final Collection<Method> methods = new ArrayList<Method>(0); <END> final Predicate<Method> predicate = new MethodPredicate(); for (final Class<?> clazz : this.allTypes()) { methods.addAll( Collections2.filter( Arrays.asList(clazz.getDeclaredMethods()), predicate ) ); } return methods; }</code><technical_language>this: java return Iterables.concat( Iterables.transform( this.allTypes(), new Function<Class<?>, Iterable<Method>>() { // methods of class } ) );</technical_language>

Target:
public Iterable<Method> allPublicMethods() { return Iterables.concat( Iterables.transform( this.allTypes(), new Function<Class<?>, Iterable<Method>>() { @Override public Iterable<Method> apply(final Class<?> input) { return Iterables.filter( Arrays.asList(input.getDeclaredMethods()), new Predicate<Method>() { @Override public boolean apply(final Method method) { return Modifier.isPublic( method.getModifiers() ); } } ); } } ) ); }
Source:
<code>public void testApplicationSelectInsertWithAPI() throws Exception { try { LocalMode lma = LocalMode.newInstance(); Configuration conf = new Configuration(false); lma.prepareDAG(new ApplicationSelectInsertWithAPI(), conf); LocalMode.Controller lc = lma.getController(); lc.runAsync(); <START> <END> Assert.assertTrue(waitTillDirAppears(outputFolder, 20000)); lc.shutdown(); } catch (Exception e) { Assert.fail("constraint violations: " + e); } File file = new File(outputFolder); File file1 = new File(outputFolder + file.list()[0]); List<String> strings = FileUtils.readLines(file1); String[] actualLines = strings.toArray(new String[strings.size()]); String[] expectedLines = new String[]{"15/02/2016 10:18:00 +0000,15/02/2016 00:00:00 +0000,OILPAINT4", "", "15/02/2016 10:19:00 +0000,15/02/2016 00:00:00 +0000,OILPAINT5", ""}; Assert.assertTrue(Arrays.deepEquals(actualLines, expectedLines)); }</code><technical_language>nit: get rid of extra blank lines (check also)</technical_language>

Target:
public void testApplicationSelectInsertWithAPI() throws Exception { try { LocalMode lma = LocalMode.newInstance(); Configuration conf = new Configuration(false); lma.prepareDAG(new ApplicationSelectInsertWithAPI(), conf); LocalMode.Controller lc = lma.getController(); lc.runAsync(); Assert.assertTrue(waitTillFileIsPopulated(outputFolder, 40000)); lc.shutdown(); } catch (Exception e) { Assert.fail("constraint violations: " + e); } File file = new File(outputFolder); File file1 = new File(outputFolder + file.list()[0]); List<String> strings = FileUtils.readLines(file1); String[] actualLines = strings.toArray(new String[strings.size()]); String[] expectedLines = new String[]{"15/02/2016 10:18:00 +0000,15/02/2016 00:00:00 +0000,OILPAINT4", "", "15/02/2016 10:19:00 +0000,15/02/2016 00:00:00 +0000,OILPAINT5", ""}; Assert.assertTrue(Arrays.deepEquals(actualLines, expectedLines)); }
Source:
<code><START> public static void writeUuid(ByteBuffer buf, UUID uuid) { <END> buf.putLong(uuid.getMostSignificantBits()); buf.putLong(uuid.getLeastSignificantBits()); }</code><technical_language>This method private</technical_language>

Target:
private static void writeUuid(ByteBuffer buf, UUID uuid) { buf.putLong(uuid.getMostSignificantBits()); buf.putLong(uuid.getLeastSignificantBits()); }
Source:
<code>private JSONObject getSummaryDetails(Map<String, ISuiteResult> results) { Object firstSuite = results.keySet().toArray()[0]; ISuiteResult result = results.get(firstSuite); ITestContext testContext = result.getTestContext(); int passedTests = testContext.getPassedTests().getAllResults().size(); int failedTests = testContext.getFailedTests().getAllResults().size(); int skippedTests = testContext.getSkippedTests().getAllResults().size(); String suiteName = testContext.getName(); Date startDate = testContext.getStartDate(); Date endDate = testContext.getEndDate(); long duration = endDate.getTime() - startDate.getTime(); JSONObject jsonSummary = new JSONObject(); jsonSummary.put("suite_name", suiteName); jsonSummary.put("passed", passedTests); jsonSummary.put("failed", failedTests); jsonSummary.put("skipped", skippedTests); <START> jsonSummary.put("duration", duration / 1000); <END> return jsonSummary; }</code><technical_language>I recommend Java 8's Duration API instead above</technical_language>

Target:
private JSONObject getSummaryDetails(Map<String, ISuiteResult> results) { Object firstSuite = results.keySet().toArray()[0]; ISuiteResult result = results.get(firstSuite); ITestContext testContext = result.getTestContext(); int passedTests = testContext.getPassedTests().getAllResults().size(); int failedTests = testContext.getFailedTests().getAllResults().size(); int skippedTests = testContext.getSkippedTests().getAllResults().size(); String suiteName = testContext.getName(); JSONObject jsonSummary = new JSONObject(); jsonSummary.put("suite_name", suiteName); jsonSummary.put("passed", passedTests); jsonSummary.put("failed", failedTests); jsonSummary.put("skipped", skippedTests); jsonSummary.put("duration", Duration.of(testContext.getEndDate().getTime() - testContext.getStartDate().getTime(), ChronoUnit.SECONDS)); return jsonSummary; }
Source:
<code>protected void executeCommand() { <START> SetupNetworksParameters parameters = new AddNetworksByLabelParametersBuilder().buildParameters(getNic(), <END> getLabel(), getClusterNetworksByLabel()); parameters.setShouldBeLogged(false); VdcReturnValueBase result = getBackend().runInternalAction(VdcActionType.PersistentSetupNetworks, parameters); if (result.getSucceeded()) { getReturnValue().setActionReturnValue(getLabel()); } else { propagateFailure(result); } setSucceeded(result.getSucceeded()); }</code><technical_language>Please changed type PersistentSetupNetworks</technical_language>

Target:
protected void executeCommand() { PersistentSetupNetworksParameters parameters = new AddNetworksByLabelParametersBuilder().buildParameters(getNic(), getLabel(), getClusterNetworksByLabel()); parameters.setShouldBeLogged(false); VdcReturnValueBase result = getBackend().runInternalAction(VdcActionType.PersistentSetupNetworks, parameters); if (result.getSucceeded()) { getReturnValue().setActionReturnValue(getLabel()); } else { propagateFailure(result); } setSucceeded(result.getSucceeded()); }
Source:
<code>public void typed_predicate_factory_should_allow_typed_predicate_assertions() { Predicate<String> predicate = Strings::isNullOrEmpty; <START> assertThat((Object) predicate).instanceOf(predicate(String.class)).accepts(""); <END> }</code><technical_language>I agree, assertThat((Object) predicate).instanceOf(predicate(String.class)).accepts(""); is assertThat((Object) predicate).instanceOf(InstanceOfAssertFactories.<String>predicate()).accepts(""); is elegant all</technical_language>

Target:
void typed_predicate_factory_should_allow_typed_predicate_assertions() { Object value = (Predicate<String>) Strings::isNullOrEmpty; PredicateAssert<String> result = assertThat(value).asInstanceOf(predicate(String.class)); result.accepts(""); }
Source:
<code>public void fireProcessBean(BeanManagerImpl beanManager, Bean<?> bean, Extension extension) { if (isProcessBeanObserved()) { if (bean instanceof ManagedBean<?>) { ProcessManagedBeanImpl.fire(beanManager, (ManagedBean<?>) bean); } else if (bean instanceof SessionBean<?>) { ProcessSessionBeanImpl.fire(beanManager, Reflections.<SessionBean<Object>> cast(bean)); } else if (bean instanceof ProducerField<?, ?>) { ProcessProducerFieldImpl.fire(beanManager, (ProducerField<?, ?>) bean); } else if (bean instanceof ProducerMethod<?, ?>) { ProcessProducerMethodImpl.fire(beanManager, (ProducerMethod<?, ?>) bean); } else { <START> if (isProcessSynthethicBeanObserved()) { <END> ProcessSynthethicBeanImpl.fire(beanManager, bean, extension); } ProcessBeanImpl.fire(beanManager, bean); } } }</code><technical_language>I detect processSynthethicBeanObserved (we detect ProcessSyntheticAnnotatedType neither). Instead, check extension param: if (extension != null) {</technical_language>

Target:
public void fireProcessBean(BeanManagerImpl beanManager, Bean<?> bean, Extension extension) { if (isProcessBeanObserved()) { if (bean instanceof ManagedBean<?>) { ProcessManagedBeanImpl.fire(beanManager, (ManagedBean<?>) bean); } else if (bean instanceof SessionBean<?>) { ProcessSessionBeanImpl.fire(beanManager, Reflections.<SessionBean<Object>>cast(bean)); } else if (bean instanceof ProducerField<?, ?>) { ProcessProducerFieldImpl.fire(beanManager, (ProducerField<?, ?>) bean); } else if (bean instanceof ProducerMethod<?, ?>) { ProcessProducerMethodImpl.fire(beanManager, (ProducerMethod<?, ?>) bean); } else { if (extension != null) { ProcessSynthethicBeanImpl.fire(beanManager, bean, extension); } ProcessBeanImpl.fire(beanManager, bean); } } }
Source:
<code>protected void createUniqueConstraintsIfMissing(DatastoreProvider provider, List<UniqueConstraintDetails> constraints) { List<Statement> statements = new ArrayList<>(); for ( UniqueConstraintDetails constraint : constraints ) { log.tracef( "Creating unique constraint for nodes labeled as %1$s on property %2$s", constraint.getLabel(), constraint.getProperty() ); StringBuilder queryBuilder = new StringBuilder( "CREATE CONSTRAINT ON (n:" ); escapeIdentifier( queryBuilder, constraint.getLabel().name() ); queryBuilder.append( ") ASSERT n." ); escapeIdentifier( queryBuilder, constraint.getProperty() ); queryBuilder.append( " IS UNIQUE" ); statements.add( new Statement( queryBuilder.toString() ) ); } <START> <END> run( provider, statements ); }</code><technical_language>Bolt Neo4j share of this implementation RemoteStatement I suppose thought preferred this approach</technical_language>

Target:
protected void createUniqueConstraintsIfMissing(DatastoreProvider provider, List<UniqueConstraintDetails> constraints) { List<Statement> statements = new ArrayList<>(); for ( UniqueConstraintDetails constraint : constraints ) { log.tracef( "Creating unique constraint for nodes labeled as %1$s on property %2$s", constraint.getLabel(), constraint.getProperty() ); statements.add( new Statement( constraint.asCypherQuery() ) ); } run( provider, statements ); }
Source:
<code>private static byte[] qrCodePNGBytes(String uri) { Writer qrWriter = new QRCodeWriter(); BitMatrix matrix; try { <START> matrix = qrWriter.encode(uri, com.google.zxing.BarcodeFormat.QR_CODE, 320, 240); <END> } catch (WriterException e) { throw new RuntimeException(e); } ByteArrayOutputStream stream = new ByteArrayOutputStream(); try { MatrixToImageWriter.writeToStream(matrix, "PNG", stream); } catch (IOException e) { throw new RuntimeException(e); } return stream.toByteArray(); }</code><technical_language>import BarcodeFormat</technical_language>

Target:
private static byte[] qrCodePNGBytes(String uri) { Writer qrWriter = new QRCodeWriter(); BitMatrix matrix; try { matrix = qrWriter.encode(uri, BarcodeFormat.QR_CODE, 320, 240); } catch (WriterException e) { throw new RuntimeException(e); } ByteArrayOutputStream stream = new ByteArrayOutputStream(); try { MatrixToImageWriter.writeToStream(matrix, "PNG", stream); } catch (IOException e) { throw new RuntimeException(e); } return stream.toByteArray(); }
Source:
<code>public void declareOutputFields(OutputFieldsDeclarer declarer) { if (modelProcessor == null) { throw new RuntimeException("modelProcessor cannot be null"); } <START> for (org.apache.streamline.streams.layout.component.Stream stream : modelProcessor.getOutputStreams()) { <END> declarer.declareStream(stream.getId(), new Fields(StreamlineEvent.STREAMLINE_EVENT)); } }</code><technical_language>import this package</technical_language>

Target:
public void declareOutputFields(OutputFieldsDeclarer declarer) { for (Stream stream : modelProcessor.getOutputStreams()) { declarer.declareStream(stream.getId(), new Fields(StreamlineEvent.STREAMLINE_EVENT)); } }
Source:
<code>public void postContent(@NonNull TaskRepository repository, @NonNull ITask task, @NonNull AbstractTaskAttachmentSource source, @Nullable String comment, @Nullable TaskAttribute attachmentAttribute, @Nullable IProgressMonitor monitor) throws CoreException { try { monitor = Policy.monitorFor(monitor); monitor.beginTask("addAttachment Data", IProgressMonitor.UNKNOWN); BugzillaRestClient client = connector.getClient(repository); try { IOperationMonitor progress = OperationUtil.convert(monitor, "get Attachment Data", 3); <START> progress.addFlag(OperationFlag.BACKGROUND); <END> client.addAttachment(task.getTaskId(), comment, source, attachmentAttribute, progress); } catch (BugzillaRestException e) { throw new CoreException(new Status(IStatus.ERROR, BugzillaRestCore.ID_PLUGIN, 2, "Error add attachment data.\n\n" + e.getMessage(), e)); } } finally { monitor.done(); } }</code><technical_language>add this flag here. flag operation is running in background added tasks framework depending operation is triggered. applies getContent above</technical_language>

Target:
public void postContent(@NonNull TaskRepository repository, @NonNull ITask task, @NonNull AbstractTaskAttachmentSource source, @Nullable String comment, @Nullable TaskAttribute attachmentAttribute, @Nullable IProgressMonitor monitor) throws CoreException { try { monitor = Policy.monitorFor(monitor); monitor.beginTask("addAttachment Data", IProgressMonitor.UNKNOWN); BugzillaRestClient client = connector.getClient(repository); try { IOperationMonitor progress = OperationUtil.convert(monitor, "get Attachment Data", 3); client.addAttachment(task.getTaskId(), comment, source, attachmentAttribute, progress); } catch (BugzillaRestException e) { throw new CoreException(new Status(IStatus.ERROR, BugzillaRestCore.ID_PLUGIN, 2, "Error add attachment data.\n\n" + e.getMessage(), e)); } } finally { monitor.done(); } }
Source:
<code>private Image loadImage() { String b64 = getBASE64Image(); if(b64 != null) { BufferedImage newImage = null; <START> ByteArrayInputStream bais = null; <END> try { bais = new ByteArrayInputStream( Base64.getDecoder().decode(b64.getBytes())); newImage = ImageIO.read(bais); } catch (Throwable ex) { ex.printStackTrace(); } return newImage; } else{ return null; } }</code><technical_language>leaking BAIS? do need held open for BufferedImage's</technical_language>

Target:
private Image loadImage() { String b64 = getBASE64Image(); if (b64 != null) { BufferedImage newImage = null; try (ByteArrayInputStream bais = new ByteArrayInputStream( Base64.getDecoder().decode(b64.getBytes()))) { newImage = ImageIO.read(bais); } catch (Exception ex) { MegaMek.getLogger().error(this, ex); } return newImage; } else { return null; } }
Source:
<code>public void searchChargesByPartialCardHolderNameMatch() { Long chargeId = 12L; TestCharge testCharge = DatabaseFixtures .withDatabaseTestHelper(databaseTestHelper) .aTestCharge() .withTestAccount(defaultTestAccount) .withCardDetails(defaultTestCardDetails.withChargeId(chargeId)) .withChargeId(chargeId) .insert(); ChargeSearchParams params = new ChargeSearchParams() <START> .withCardHolderNameLike(CardHolderName.of("pay")); <END> List<ChargeEntity> charges = chargeDao.findAllBy(params); assertThat(charges.size(), is(1)); assertCharge("visa", testCharge, charges.get(0)); }</code><technical_language>clearer if explicitly set cardholder name in fixture, fact search parameter is a substring is more obvious</technical_language>

Target:
public void searchChargesByPartialCardHolderNameMatch() { String cardHolderName = "Mr. McPayment"; Long chargeId = 12L; TestCharge testCharge = DatabaseFixtures .withDatabaseTestHelper(databaseTestHelper) .aTestCharge() .withTestAccount(defaultTestAccount) .withCardDetails(defaultTestCardDetails .withChargeId(chargeId) .withCardHolderName(cardHolderName)) .withChargeId(chargeId) .insert(); ChargeSearchParams params = new ChargeSearchParams() .withCardHolderNameLike(CardHolderName.of("pay")); List<ChargeEntity> charges = chargeDao.findAllBy(params); assertThat(charges.size(), is(1)); ChargeEntity charge = charges.get(0); assertCharge("visa", testCharge, charge); assertThat(charge.getCardDetails().getCardHolderName(), is(cardHolderName)); assertThat(charge.getCardDetails().getLastDigitsCardNumber(), is(testCharge.cardDetails.getLastDigitsCardNumber())); }
Source:
<code>public boolean isExcluded(@NonNull SCMSourceRequest request, @NonNull SCMHead head) { if (head instanceof BranchSCMHead && request instanceof GitHubSCMSourceRequest) { for (GHPullRequest p : ((GitHubSCMSourceRequest) request).getPullRequests()) { GHRepository headRepo = p.getHead().getRepository(); if (headRepo != null && p.getBase().getRepository().getFullName().equalsIgnoreCase(headRepo.getFullName()) && p.getHead().getRef().equals(head.getName())) { <START> LOGGER.log(Level.WARNING, "Ignoring because " <END> + "current strategy excludes branches that ARE also filed as a pull request" , new Object[]{head.toString()}); return true; } } } return false; }</code><technical_language>Warning is higher priority INFO. Is needed here</technical_language>

Target:
public boolean isExcluded(@NonNull SCMSourceRequest request, @NonNull SCMHead head) { if (head instanceof BranchSCMHead && request instanceof GitHubSCMSourceRequest) { for (GHPullRequest p : ((GitHubSCMSourceRequest) request).getPullRequests()) { GHRepository headRepo = p.getHead().getRepository(); if (headRepo != null && p.getBase().getRepository().getFullName().equalsIgnoreCase(headRepo.getFullName()) && p.getHead().getRef().equals(head.getName())) { request.listener().getLogger().format( "Ignoring %s because current strategy excludes branches " + "that ARE also filed as a pull request%n" , head.toString()); return true; } } } return false; }
Source:
<code>public PartPresenter getPartByPath(Path path) { for (TabItem tab : parts.keySet()) { <START> if (((EditorTab)tab).getFile().getLocation().equals(path)) { <END> return parts.get(tab); } } return null; }</code><technical_language>Try avoid cast</technical_language>

Target:
public PartPresenter getPartByPath(Path path) { for (TabItem tab : parts.keySet()) { EditorTab editorTab = (EditorTab)tab; Path currentPath = editorTab.getFile().getLocation(); if (currentPath.equals(path)) { return parts.get(tab); } } return null; }
Source:
<code>public void destroyNode(String id) { try { suspendNode(id); serverStopped.apply(id); } catch (Exception e) { <START> e.printStackTrace(); <END> } api.getVirtualServerApi().destroy(id); String systemId = toSystemId.apply(id); systemNormal.apply(systemId); }</code><technical_language>a logger ignore exception propagate exception Throwables.propagate</technical_language>

Target:
public void destroyNode(String id) { suspendNode(id); serverStopped.apply(id); api.getVirtualServerApi().destroy(id); String systemId = toSystemId.apply(id); systemNormal.apply(systemId); }
Source:
<code>private void setCommonTaskMembers(AbstractTask task, CRTask crTask) { CRTask crTaskOnCancel = crTask.getOnCancel(); <START> if(crTaskOnCancel != null) <END> task.setCancelTask(toAbstractTask(crTaskOnCancel)); else task.setOnCancelConfig(OnCancelConfig.killAllChildProcess()); task.runIfConfigs = toRunIfConfigs(crTask.getRunIf()); }</code><technical_language>@tomzo - sense call setter if crTask.getOnCancel() is null. reason being, if decide change default of AbstractTask.onCancelConfig, wont multiple places fix</technical_language>

Target:
private void setCommonTaskMembers(AbstractTask task, CRTask crTask) { CRTask crTaskOnCancel = crTask.getOnCancel(); if(crTaskOnCancel != null) task.setCancelTask(toAbstractTask(crTaskOnCancel)); task.runIfConfigs = toRunIfConfigs(crTask.getRunIf()); }
Source:
<code>public void applicationTheme_importCSS_isUsed() { open(); checkLogsForErrors(); Assert.assertEquals("Imported FontAwesome css file should be applied.", "\"Font Awesome 5 Brands\"", $(SpanElement.class).id(FONTAWESOME_ID) <START> .getCssValue("font-family")); <END> }</code><technical_language>this check for more. resource is css applied exceptions console? check resource e.g. getDriver().get(getRootURL() + "/path/VAADIN/static/[THE_RESOURCE_THAT_IS_EXPECTED]"); Assert.assertFalse("Font resource available", driver.getPageSource().contains("HTTP ERROR 404 Found"));</technical_language>

Target:
public void applicationTheme_importCSS_isUsed() { open(); checkLogsForErrors(); Assert.assertEquals( "Imported FontAwesome css file should be applied.", "\"Font Awesome 5 Free\"", $(SpanElement.class).id(FONTAWESOME_ID) .getCssValue("font-family")); String iconUnicode = getCssPseudoElementValue(FONTAWESOME_ID, "::before"); Assert.assertEquals( "Font-Icon from FontAwesome css file should be applied.", "\"\uf0f4\"", iconUnicode); getDriver().get(getRootURL() + "/path/VAADIN/static/@fortawesome/fontawesome-free/webfonts/fa-solid-900.svg"); Assert.assertFalse("Font resource should be available", driver.getPageSource().contains("HTTP ERROR 404 Not Found")); }
Source:
<code>public void testBatchObjects() throws Exception { Repository repo = repoProvider.createGeogig("repo1", null); repoProvider.getTestRepository("repo1").initializeRpository(); new TestData(repo).init("testGeoGig", "geogig@geogig.org").loadDefaultData(); Iterator<RevCommit> masterCommits = repo.command(LogOp.class).call(); repo.command(CheckoutOp.class).setSource("branch1").call(); Iterator<RevCommit> branch1Commits = repo.command(LogOp.class).call(); JsonObject json = new JsonObject(); JsonArray want = new JsonArray(); json.add("want", want); JsonArray have = new JsonArray(); json.add("have", have); while (masterCommits.hasNext()) { want.add(masterCommits.next().getId().toString()); } while (branch1Commits.hasNext()) { have.add(branch1Commits.next().getId().toString()); } MockHttpServletRequestBuilder post = MockMvcRequestBuilders.post("/repos/repo1/repo/batchobjects").contentType( MediaType.APPLICATION_JSON).content(getBytes(json)); perform(post).andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_OCTET_STREAM)); <START> repo.close(); <END> }</code><technical_language>this response read verified</technical_language>

Target:
public void testBatchObjects() throws Exception { Repository repo = repoProvider.createGeogig("repo1", null); repoProvider.getTestRepository("repo1").initializeRpository(); new TestData(repo).init("testGeoGig", "geogig@geogig.org").loadDefaultData(); Iterator<RevCommit> masterCommits = repo.command(LogOp.class).call(); repo.command(CheckoutOp.class).setSource("branch1").call(); Iterator<RevCommit> branch1Commits = repo.command(LogOp.class).call(); JsonObject json = new JsonObject(); JsonArray want = new JsonArray(); json.add("want", want); JsonArray have = new JsonArray(); json.add("have", have); while (masterCommits.hasNext()) { want.add(masterCommits.next().getId().toString()); } while (branch1Commits.hasNext()) { have.add(branch1Commits.next().getId().toString()); } MockHttpServletRequestBuilder post = MockMvcRequestBuilders.post("/repos/repo1/repo/batchobjects").contentType( MediaType.APPLICATION_JSON).content(getBytes(json)); byte[] content = perform(post).andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_OCTET_STREAM)) .andReturn().getResponse().getContentAsByteArray(); ByteArrayInputStream bais = new ByteArrayInputStream(content); final ObjectSerializingFactory serialFac = DataStreamSerializationFactoryV1.INSTANCE; final int expectedNumRevObjects = 14; int actualNumRevObjects = 0; while (bais.available() > 0) { byte[] rawId = new byte[ObjectId.NUM_BYTES]; bais.read(rawId); ObjectId oid = ObjectId.createNoClone(rawId); serialFac.read(oid, bais); ++actualNumRevObjects; } assertEquals("Incorrect number of RevObjects in BatchObjects response", expectedNumRevObjects, actualNumRevObjects); repo.close(); }
Source:
<code><START> public final void setOutputStream(OutputStream outputStream) { <END> final OutputStreamWriter osw = new OutputStreamWriter(outputStream, StandardCharsets.UTF_8); writer = new PrintWriter(osw); }</code><technical_language>Please explain this change users need this method public? @romani is thoughts? writer final? I a reason users swap output streams in middle of execution</technical_language>

Target:
private void setOutputStream(OutputStream outputStream) { final OutputStreamWriter osw = new OutputStreamWriter(outputStream, StandardCharsets.UTF_8); writer = new PrintWriter(osw); }
Source:
<code>public Folder findFolderByPath(final String path, final Host host, final User user, final boolean respectFrontEndPermissions) throws DotStateException, DotDataException, DotSecurityException { final Folder folder = folderFactory.findFolderByPath(path, host); if (folder != null && InodeUtils.isSet(folder.getInode()) && !permissionAPI.doesUserHavePermission(folder, PermissionAPI.PERMISSION_READ, user, respectFrontEndPermissions)) { if(FolderAPI.SYSTEM_FOLDER.equals(folder.getInode())) { if(!Host.SYSTEM_HOST.equals(host.getIdentifier())){ if(!permissionAPI.doesUserHavePermission(host, PermissionAPI.PERMISSION_READ, user, respectFrontEndPermissions)) { <START> throw new DotSecurityException("User " + (user.getUserId() != null ? user.getUserId() : "") + " does not have permission to read folder " + folder.getPath()); <END> } } } } return folder; }</code><technical_language>StringPool.EMPTY</technical_language>

Target:
public Folder findFolderByPath(final String path, final Host host, final User user, final boolean respectFrontEndPermissions) throws DotStateException, DotDataException, DotSecurityException { final Folder folder = folderFactory.findFolderByPath(path, host); if (folder != null && InodeUtils.isSet(folder.getInode()) && !permissionAPI.doesUserHavePermission(folder, PermissionAPI.PERMISSION_READ, user, respectFrontEndPermissions)) { if(FolderAPI.SYSTEM_FOLDER.equals(folder.getInode())) { if(!Host.SYSTEM_HOST.equals(host.getIdentifier())){ if(!permissionAPI.doesUserHavePermission(host, PermissionAPI.PERMISSION_READ, user, respectFrontEndPermissions)) { throw new DotSecurityException("User " + (user.getUserId() != null ? user.getUserId() : BLANK) + " does not have permission to read folder " + folder.getPath()); } } } } return folder; }
Source:
<code><START> public FileBasedConfig openSystemConfig(Config parent, FS fs) { <END> systemConfig.compareAndSet(null, createSystemConfig(parent, fs)); return systemConfig.get(); }</code><technical_language>is worthwhile check if null recreate systemConfig object in calls. load big deal, you</technical_language>

Target:
public FileBasedConfig openSystemConfig(Config parent, FS fs) { if (systemConfig.get() == null) { systemConfig.compareAndSet(null, createSystemConfig(parent, fs)); } return systemConfig.get(); }
Source:
<code>public void testParseRowWithConditional() throws IOException { final JsonInputFormat format = new JsonInputFormat( new JSONPathSpec( true, ImmutableList.of( new JSONPathFieldSpec(JSONPathFieldType.PATH, "foo", "$.[?(@.maybe_object)].maybe_object.foo.test"), new JSONPathFieldSpec(JSONPathFieldType.PATH, "baz", "$.maybe_object_2.foo.test"), new JSONPathFieldSpec(JSONPathFieldType.PATH, "bar", "$.[?(@.something_else)].something_else.foo") ) ), null ); final ByteSource source = new ByteSource( StringUtils.toUtf8("{\"timestamp\":\"2019-01-01\",\"something_else\": {\"foo\": \"test\"}}") ); final SplitReader reader = format.createReader( new TimestampSpec("timestamp", "iso", null), new DimensionsSpec(DimensionsSpec.getDefaultSchemas(ImmutableList.of("foo"))) ); try (CloseableIterator<InputRow> iterator = reader.read(source, null)) { while (iterator.hasNext()) { final InputRow row = iterator.next(); Assert.assertEquals("test", Iterables.getOnlyElement(row.getDimension("bar"))); Assert.assertEquals(Collections.emptyList(), row.getDimension("foo")); Assert.assertTrue(row.getDimension("baz").isEmpty()); } <START> } <END> }</code><technical_language>assert expected number of 1 iteration occurred</technical_language>

Target:
public void testParseRowWithConditional() throws IOException { final JsonInputFormat format = new JsonInputFormat( new JSONPathSpec( true, ImmutableList.of( new JSONPathFieldSpec(JSONPathFieldType.PATH, "foo", "$.[?(@.maybe_object)].maybe_object.foo.test"), new JSONPathFieldSpec(JSONPathFieldType.PATH, "baz", "$.maybe_object_2.foo.test"), new JSONPathFieldSpec(JSONPathFieldType.PATH, "bar", "$.[?(@.something_else)].something_else.foo") ) ), null ); final ByteEntity source = new ByteEntity( StringUtils.toUtf8("{\"timestamp\":\"2019-01-01\",\"something_else\": {\"foo\": \"test\"}}") ); final InputEntityReader reader = format.createReader( new InputRowSchema( new TimestampSpec("timestamp", "iso", null), new DimensionsSpec(DimensionsSpec.getDefaultSchemas(ImmutableList.of("foo"))), Collections.emptyList() ) ); final int numExpectedIterations = 1; try (CloseableIterator<InputRow> iterator = reader.read(source, null)) { int numActualIterations = 0; while (iterator.hasNext()) { final InputRow row = iterator.next(); Assert.assertEquals("test", Iterables.getOnlyElement(row.getDimension("bar"))); Assert.assertEquals(Collections.emptyList(), row.getDimension("foo")); Assert.assertTrue(row.getDimension("baz").isEmpty()); numActualIterations++; } Assert.assertEquals(numExpectedIterations, numActualIterations); } }
Source:
<code>private void mergeAll(Collection<? extends Diff> differences, boolean leftToRight, IBatchMerger merger, Registry mergerRegistry, Monitor emfMonitor) { if (leftToRight) { merger.copyAllLeftToRight(differences, emfMonitor); } else { merger.copyAllRightToLeft(differences, emfMonitor); } for (Diff difference : differences) { final IMerger diffMerger = mergerRegistry.getHighestRankingMerger(difference); if (LOGGER.isDebugEnabled()) { <START> LOGGER.debug("mergeAll(Collection<? extends Diff>, boolean, IBatchMerger, Registry, Monitor) - Selected merger for diff " END> + difference.hashCode() + ": " + merger.getClass().getSimpleName()); } if (diffMerger instanceof IMerger2) { final Set<Diff> resultingMerges = MergeDependenciesUtil.getAllResultingMerges(difference, mergerRegistry, !leftToRight); addOrUpdateMergeData(resultingMerges, getMergeMode()); final Set<Diff> resultingRejections = MergeDependenciesUtil.getAllResultingRejections( difference, mergerRegistry, !leftToRight); addOrUpdateMergeData(resultingRejections, getMergeMode().inverse()); } else { addOrUpdateMergeData(Collections.singleton(difference), getMergeMode()); } } }</code><technical_language>state parameters if is a chance of mistake. I method this name listing param types is useless reading log more difficult</technical_language>

Target:
private void mergeAll(Collection<? extends Diff> differences, boolean leftToRight, IBatchMerger merger, Registry mergerRegistry, Monitor emfMonitor) { if (leftToRight) { merger.copyAllLeftToRight(differences, emfMonitor); } else { merger.copyAllRightToLeft(differences, emfMonitor); } for (Diff difference : differences) { final IMerger diffMerger = mergerRegistry.getHighestRankingMerger(difference); if (LOGGER.isDebugEnabled()) { LOGGER.debug("mergeAll - Selected merger for diff " + difference.hashCode() + ": " + merger.getClass().getSimpleName()); } if (diffMerger instanceof IMerger2) { final Set<Diff> resultingMerges = MergeDependenciesUtil.getAllResultingMerges(difference, mergerRegistry, !leftToRight); addOrUpdateMergeData(resultingMerges, getMergeMode()); final Set<Diff> resultingRejections = MergeDependenciesUtil.getAllResultingRejections( difference, mergerRegistry, !leftToRight); addOrUpdateMergeData(resultingRejections, getMergeMode().inverse()); } else { addOrUpdateMergeData(Collections.singleton(difference), getMergeMode()); } } }
Source:
<code>APIResult submitExtensionJob(String extensionName, String jobName, InputStream configStream, SortedMap<EntityType, List<Entity>> entityMap) throws FalconException, IOException { checkIfExtensionIsEnabled(extensionName); <START> checkIfExtensionJobExists(jobName, extensionName); <END> for (Map.Entry<EntityType, List<Entity>> entry : entityMap.entrySet()) { for (Entity entity : entry.getValue()) { submitInternal(entity, "falconUser"); } } storeExtension(extensionName, jobName, configStream, entityMap); return new APIResult(APIResult.Status.SUCCEEDED, "Extension job submitted successfully" + jobName); }</code><technical_language>Job exist post submit. this check in schedule</technical_language>

Target:
APIResult submitExtensionJob(String extensionName, String jobName, InputStream configStream, SortedMap<EntityType, List<Entity>> entityMap) throws FalconException, IOException { checkIfExtensionIsEnabled(extensionName); checkIfExtensionJobNameExists(jobName, extensionName); for (Map.Entry<EntityType, List<Entity>> entry : entityMap.entrySet()) { for (Entity entity : entry.getValue()) { submitInternal(entity, "falconUser"); } } storeExtension(extensionName, jobName, configStream, entityMap); return new APIResult(APIResult.Status.SUCCEEDED, "Extension job submitted successfully" + jobName); }
Source:
<code>public VmReplicateDiskParameters(Guid vdsId, Guid vmId, Guid storagePoolId, Guid srcStorageDomainId, Guid targetStorageDomainId, Guid imageGroupId, Guid imageId, <START> String diskType) { <END> super(vdsId, vmId); this.storagePoolId = storagePoolId; this.srcStorageDomainId = srcStorageDomainId; this.targetStorageDomainId = targetStorageDomainId; this.imageGroupId = imageGroupId; this.imageId = imageId; }</code><technical_language>added this ctor's signature, forgot save in a data member</technical_language>

Target:
public VmReplicateDiskParameters(Guid vdsId, Guid vmId, Guid storagePoolId, Guid srcStorageDomainId, Guid targetStorageDomainId, Guid imageGroupId, Guid imageId, String diskType) { super(vdsId, vmId); this.storagePoolId = storagePoolId; this.srcStorageDomainId = srcStorageDomainId; this.targetStorageDomainId = targetStorageDomainId; this.imageGroupId = imageGroupId; this.imageId = imageId; this.diskType = diskType; }
Source:
<code>public static FxRate parse(String rateStr) { ArgChecker.notNull(rateStr, "rateStr"); Matcher matcher = REGEX_FORMAT.matcher(rateStr.toUpperCase(Locale.ENGLISH)); if (matcher.matches() == false) { throw new IllegalArgumentException("Invalid rate: " + rateStr); } Currency base = Currency.parse(matcher.group(1)); Currency counter = Currency.parse(matcher.group(2)); <START> double rate = Double.parseDouble(matcher.group(3)); <END> return new FxRate(CurrencyPair.of(base, counter), rate); }</code><technical_language>Regex guarantee double is valid e.g. GBP/EUR --- catch parse exception wrap, tighten regex</technical_language>

Target:
public static FxRate parse(String rateStr) { ArgChecker.notNull(rateStr, "rateStr"); Matcher matcher = REGEX_FORMAT.matcher(rateStr.toUpperCase(Locale.ENGLISH)); if (matcher.matches() == false) { throw new IllegalArgumentException("Invalid rate: " + rateStr); } try { Currency base = Currency.parse(matcher.group(1)); Currency counter = Currency.parse(matcher.group(2)); double rate = Double.parseDouble(matcher.group(3)); return new FxRate(CurrencyPair.of(base, counter), rate); } catch (RuntimeException ex) { throw new IllegalArgumentException("Unable to parse rate: " + rateStr, ex); } }
Source:
<code>public static boolean isNullOrEquivalent(@Nullable String value) { <START> return INSTANCE.isUseDefaultValuesForNull() ? Strings.isNullOrEmpty(value) : value == null; <END> }</code><technical_language>add regexp check isNullOrEmpty()</technical_language>

Target:
public static boolean isNullOrEquivalent(@Nullable String value) { return replaceWithDefault() ? Strings.isNullOrEmpty(value) : value == null; }
Source:
<code>public void cleanUp() { File folder = app.getExternalFilesDir(null); if (folder == null) return; Observable.just(folder) .flatMap(new Func1<File, Observable<File>>() { @Override public Observable<File> call(File folder) { return Observable.from(folder.listFiles()); } }) .filter(new Func1<File, Boolean>() { @Override public Boolean call(File file) { return file.getName().endsWith(".log"); } }) .subscribeOn(Schedulers.io()) .forEach(new Action1<File>() { @Override public void call(File file) { file.delete(); } <START> }); <END> }</code><technical_language>I AsyncTask imperative code in doInBackground. 7 lines instead of 20</technical_language>

Target:
public void cleanUp() { new AsyncTask<Void, Void, Void>() { @Override protected Void doInBackground(Void... folders) { File folder = app.getExternalFilesDir(null); if (folder != null) { for (File file : folder.listFiles()) { if (file.getName().endsWith(".log")) { file.delete(); } } } return null; } }.execute(); }
Source:
<code>private GraphQLOutputType outputTypeOf(String type) { if (type == null) { return Scalars.GraphQLString; } type = type.trim(); if (type.startsWith("[")) { return new GraphQLList(inputTypeOf(type.substring(1, type.length() - 1))); } switch (type) { case "Int": return Scalars.GraphQLInt; case "String": return Scalars.GraphQLString; case "Boolean": return Scalars.GraphQLBoolean; case "Float": <START> return Scalars.GraphQLBoolean; <END> default: return new GraphQLTypeReference(type); } }</code><technical_language>boolean? really</technical_language>

Target:
private GraphQLOutputType outputTypeOf(String type) { if (type == null) { return Scalars.GraphQLString; } type = type.trim(); if (type.startsWith("[")) { return new GraphQLList(inputTypeOf(type.substring(1, type.length() - 1))); } switch (type) { case "Int": return Scalars.GraphQLInt; case "String": return Scalars.GraphQLString; case "Boolean": return Scalars.GraphQLBoolean; case "Float": return Scalars.GraphQLFloat; default: return new GraphQLTypeReference(type); } }