auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public TmfModelResponse<ITmfCommonXAxisModel> fetchXY(TimeQueryFilter filter, @Nullable IProgressMonitor monitor) { boolean isComplete = true; ImmutableMap.Builder<String, IYModel> series = ImmutableMap.builder(); for (ITmfXYDataProvider dataProvider : fProviders) { TmfModelResponse<ITmfCommonXAxisModel> response = dataProvider.fetchXY(filter, monitor); isComplete &= response.getStatus() == ITmfResponse.Status.COMPLETED; ITmfCommonXAxisModel model = response.getModel(); if (model != null) { series.putAll(model.getYData()); } if (monitor != null && monitor.isCanceled()) { <START> TmfCommonXAxisResponseFactory.createCancelledResponse(CommonStatusMessage.TASK_CANCELLED); <END> } } return TmfCommonXAxisResponseFactory.create(fTitle, filter.getTimesRequested(), series.build(), isComplete); }</code><technical_language>do do this response</technical_language>

Target:
public TmfModelResponse<ITmfCommonXAxisModel> fetchXY(TimeQueryFilter filter, @Nullable IProgressMonitor monitor) { boolean isComplete = true; ImmutableMap.Builder<String, IYModel> series = ImmutableMap.builder(); for (ITmfXYDataProvider dataProvider : fProviders) { TmfModelResponse<ITmfCommonXAxisModel> response = dataProvider.fetchXY(filter, monitor); isComplete &= response.getStatus() == ITmfResponse.Status.COMPLETED; ITmfCommonXAxisModel model = response.getModel(); if (model != null) { series.putAll(model.getYData()); } if (monitor != null && monitor.isCanceled()) { return TmfCommonXAxisResponseFactory.createCancelledResponse(CommonStatusMessage.TASK_CANCELLED); } } return TmfCommonXAxisResponseFactory.create(fTitle, filter.getTimesRequested(), series.build(), isComplete); }
Source:
<code>private static PagesHashStrategy pagesHashStrategy() { return new SimplePagesHashStrategy( ImmutableList.of(BIGINT), ImmutableList.of(), ImmutableList.of(ImmutableList.of(TEST_PAGE.getBlock(0))), ImmutableList.of(), Optional.empty(), <START> Optional.of(new SortExpressionExtractor.RowSortExpressionContext(0))); <END> }</code><technical_language>SortExpressionExtractor renamed well</technical_language>

Target:
private static PagesHashStrategy pagesHashStrategy() { return new SimplePagesHashStrategy( ImmutableList.of(BIGINT), ImmutableList.of(), ImmutableList.of(ImmutableList.of(TEST_PAGE.getBlock(0))), ImmutableList.of(), Optional.empty(), Optional.of(0)); }
Source:
<code>private boolean internalValidateAndSetQuota() { if (isInternalExecution()) { return true; } if (getStoragePool() == null && getActionType().getQuotaDependency() != VdcActionType.QuotaDependency.NONE) { log.error("Command: " + this.getClass().getName() + ". Storage pool is not available for quota calculation. "); return false; } QuotaConsumptionParametersWrapper quotaConsumptionParametersWrapper = new QuotaConsumptionParametersWrapper(this, getReturnValue().getCanDoActionMessages()); quotaConsumptionParametersWrapper.setParameters(getQuotaConsumptionParameters()); <START> <END> return quotaConsumptionParametersWrapper.getParameters().isEmpty() || getQuotaManager().consume(quotaConsumptionParametersWrapper); }</code><technical_language>line is proof need QuotaConsumptionParametersWrapper</technical_language>

Target:
private boolean internalValidateAndSetQuota() { if (isInternalExecution()) { return true; } if (getStoragePool() == null && isQuotaDependant()) { log.error("Command: " + this.getClass().getName() + ". Storage pool is not available for quota calculation. "); return false; } QuotaConsumptionParametersWrapper quotaConsumptionParametersWrapper = new QuotaConsumptionParametersWrapper(this, getReturnValue().getCanDoActionMessages()); quotaConsumptionParametersWrapper.setParameters(getQuotaConsumptionParameters()); if (quotaConsumptionParametersWrapper.getParameters() == null || quotaConsumptionParametersWrapper.getParameters().isEmpty()) { log.error("Command: " + this.getClass().getName() + ". No Quota parameters available."); return false; } return getQuotaManager().consume(quotaConsumptionParametersWrapper); }
Source:
<code>public void onUpdate() { if (this.worldObj.blockExists(MathHelper.floor_double(this.posX), 0, MathHelper.floor_double(this.posZ))) { super.onUpdate(); this.sendMotionUpdates(); } if (!this.isSprinting() && runToggle) { if (canSprint()) { setSprinting(true); this.sendQueue.addToSendQueue(new Packet19EntityAction(this, 4)); <START> }else{ <END> setSprinting(false); } } }</code><technical_language>in this else if (!this.isSprinting()), this work? o.O</technical_language>

Target:
public void onUpdate() { if (this.worldObj.blockExists(MathHelper.floor_double(this.posX), 0, MathHelper.floor_double(this.posZ))) { super.onUpdate(); this.sendMotionUpdates(); } if (!this.isSprinting() && runToggle) { if (canSprint()) { setSprinting(true); this.sendQueue.addToSendQueue(new Packet19EntityAction(this, 4)); } }else if(this.isSprinting() && !canSprint){ setSprinting(false); runToggle = false; } }
Source:
<code><START> public void SentMessage_shouldFillInAllParameters() { <END> Message message = new Message(); message.setId(1); message.setSubject("hello world"); message.setContent("hello world content"); message.setContentType("plain text"); message.setSentDate(new Date()); SentMessage sm = new SentMessage(message, 2, 3); Assert.assertEquals(message.getId(), sm.getMessageId()); Assert.assertEquals(Integer.valueOf(2), sm.getSenderId()); Assert.assertEquals(Integer.valueOf(3), sm.getReceiverId()); Assert.assertEquals(message.getSubject(), sm.getSubject()); Assert.assertEquals(message.getContent(), sm.getContent()); Assert.assertEquals(message.getContentType(), sm.getContentType()); Assert.assertEquals(message.getSentDate(), sm.getSentDate()); }</code><technical_language>![Codacy](<LINK_1> Issue found: [Method names underscores](<LINK_0></technical_language>

Target:
public void SentMessage_shouldFillInAllParameters() { Message message = new Message(); message.setId(1); message.setSubject("hello world"); message.setContent("hello world content"); message.setContentType("plain text"); message.setSentDate(new Date()); User sender = new User(); User receiver = new User(); sender.setUserId(2); receiver.setUserId(3); SentMessage sm = new SentMessage(message, sender, receiver); Assert.assertEquals(message.getId(), sm.getMessageId()); Assert.assertEquals(Integer.valueOf(2), sm.getSender().getUserId()); Assert.assertEquals(Integer.valueOf(3), sm.getReceiver().getUserId()); Assert.assertEquals(message.getSubject(), sm.getSubject()); Assert.assertEquals(message.getContent(), sm.getContent()); Assert.assertEquals(message.getContentType(), sm.getContentType()); Assert.assertEquals(message.getSentDate(), sm.getSentDate()); }
Source:
<code>public void handleCreatedEvent(ClientCacheEntryCreatedEvent e) { <START> createdEvents.add(e); <END> System.out.println("Created " + e); }</code><technical_language>logging here</technical_language>

Target:
public void handleCreatedEvent(ClientCacheEntryCreatedEvent e) { createdEvents.add(e); }
Source:
<code>public <V> Future<V> execute(BackgroundTask<V> task) { Task<V> javafxTask = getJavaFXTask(task); if (task.showToUser()) { <START> Globals.stateManager.addBackgroundTask(javafxTask); <END> } return execute(javafxTask); }</code><technical_language>try remove Globals class. Is insert stateManager a constructor parameter</technical_language>

Target:
public <V> Future<V> execute(BackgroundTask<V> task) { Task<V> javafxTask = getJavaFXTask(task); if (task.showToUser()) { stateManager.addBackgroundTask(javafxTask); } return execute(javafxTask); }
Source:
<code>private static List<Contig> getContigsInReadGroupSet(String readGroupSetId, SexChromosomeFilter sexChromosomeFilter, GenomicsFactory.OfflineAuth auth) throws IOException, GeneralSecurityException { String referenceSetId = GenomicsUtils.getReferenceSetId(readGroupSetId, auth); <START> if(null == referenceSetId) { <END> throw new IllegalArgumentException("No referenceSetId associated with readGroupSetId " + readGroupSetId + "."); } List<Contig> contigs = Lists.newArrayList(); for (Reference reference : GenomicsUtils.getReferences(referenceSetId, auth)) { String referenceName = reference.getName().toLowerCase(); if (sexChromosomeFilter == SexChromosomeFilter.EXCLUDE_XY && (referenceName.contains("x") || referenceName.contains("y"))) { continue; } contigs.add(new Contig(reference.getName(), 0, reference.getLength())); } return contigs; }</code><technical_language>nit: space if</technical_language>

Target:
private static List<Contig> getContigsInReadGroupSet(String readGroupSetId, SexChromosomeFilter sexChromosomeFilter, GenomicsFactory.OfflineAuth auth) throws IOException, GeneralSecurityException { List<Contig> contigs = Lists.newArrayList(); for (CoverageBucket bucket : GenomicsUtils.getCoverageBuckets(readGroupSetId, auth)) { if (sexChromosomeFilter == SexChromosomeFilter.EXCLUDE_XY && SEX_CHROMOSOME_REGEXP.matcher(bucket.getRange().getReferenceName()).matches()) { continue; } contigs.add(new Contig(bucket.getRange().getReferenceName(), (null == bucket.getRange().getStart()) ? 0 : bucket.getRange().getStart(), bucket.getRange().getEnd())); } return contigs; }
Source:
<code>public void testValidateMultipleInvalidAttributes() throws UnsupportedQueryException { List<SourceAttributeRestriction> restrictions = ImmutableList.of(mockRestriction("src-1", ImmutableSet.of("attr-1"))); Mockito.when(attributeExtractor.extractAttributes(any())) .thenReturn(ImmutableSet.of("attr-2", "attr-3")); QueryRequest request = mockQueryRequest("src-1"); validator = new UnsupportedAttributeQueryValidator(attributeExtractor); validator.setSourceAttributeRestrictions(restrictions); Set<QueryValidationViolation> violations = validator.validate(request); assertThat(violations, hasSize(2)); for (QueryValidationViolation violation : violations) { assertThat(violation.getSeverity(), is(Severity.ERROR)); Map<String, Object> extraData = violation.getExtraData(); assertThat((Set<String>) extraData.get("sources"), Matchers.hasItems("src-1")); String attribute = (String) extraData.get("attribute"); <START> if (attribute.equals("attr-2")) { <END> assertThat( violation.getMessage(), is("The field \"attr-2\" is not supported by the src-1 Content Store(s)")); } else if (attribute.equals("attr-3")) { assertThat( violation.getMessage(), is("The field \"attr-3\" is not supported by the src-1 Content Store(s)")); } else { fail("Unknown attribute found in violations"); } } }</code><technical_language>avoid conditional logic in unit tests possible. java assertThat(violation.getMessage(), is("The field \"" + attribute + "\" is supported src-1 Content Store(s)"));</technical_language>

Target:
public void testValidateMultipleInvalidAttributes() throws UnsupportedQueryException { Mockito.when(attributeExtractor.extractAttributes(any())) .thenReturn(ImmutableSet.of("attr-2", "attr-3")); QueryRequest request = mockQueryRequest("src-1"); validator = new UnsupportedAttributeQueryValidator(attributeExtractor, messageFormatSupplier); validator.bind(mockRestriction("src-1", ImmutableSet.of("attr-1"))); Set<QueryValidationViolation> violations = validator.validate(request); QueryValidationViolation violation1 = makeViolation( "The field \"attr-2\" is not supported by the src-1 Source(s)", "attr-2", "src-1"); QueryValidationViolation violation2 = makeViolation( "The field \"attr-3\" is not supported by the src-1 Source(s)", "attr-3", "src-1"); assertThat(violations, hasSize(2)); assertThat(violations, hasItems(violation1, violation2)); }
Source:
<code>private static EntitySpec<?> createEntitySpecFromServicesBlock(String plan, BrooklynClassLoadingContext loader, Set<String> encounteredTypes, boolean isApplication) { CampPlatform camp = CampInternalUtils.getCampPlatform(loader.getManagementContext()); AssemblyTemplate at = CampInternalUtils.registerDeploymentPlan(plan, loader, camp); AssemblyTemplateInstantiator instantiator = CampInternalUtils.getInstantiator(at); if (instantiator instanceof AssemblyTemplateSpecInstantiator) { EntitySpec<? extends Application> appSpec = ((AssemblyTemplateSpecInstantiator)instantiator).createApplicationSpec(at, camp, loader, encounteredTypes); if (!isApplication && EntityManagementUtils.canPromoteChildrenInWrappedApplication(appSpec) && appSpec.getChildren().size()==1) { <START> CampInternalUtils.resetSpecIfTemplateHasNoExplicitParameters(at, appSpec); <END> EntitySpec<?> childSpec = appSpec.getChildren().get(0); EntityManagementUtils.mergeWrapperParentSpecToChildEntity(appSpec, childSpec); return childSpec; } return appSpec; } else { throw new IllegalStateException("Unable to instantiate YAML; incompatible instantiator "+instantiator+" for "+at); } }</code><technical_language>happened in createWrapperApp</technical_language>

Target:
private static EntitySpec<?> createEntitySpecFromServicesBlock(String plan, BrooklynClassLoadingContext loader, Set<String> encounteredTypes, boolean isApplication) { CampPlatform camp = CampInternalUtils.getCampPlatform(loader.getManagementContext()); AssemblyTemplate at = CampInternalUtils.registerDeploymentPlan(plan, loader, camp); AssemblyTemplateInstantiator instantiator = CampInternalUtils.getInstantiator(at); if (instantiator instanceof AssemblyTemplateSpecInstantiator) { EntitySpec<? extends Application> appSpec = ((AssemblyTemplateSpecInstantiator)instantiator).createApplicationSpec(at, camp, loader, encounteredTypes); if (!isApplication && EntityManagementUtils.canPromoteChildrenInWrappedApplication(appSpec)) { EntitySpec<?> childSpec = Iterables.getOnlyElement(appSpec.getChildren()); EntityManagementUtils.mergeWrapperParentSpecToChildEntity(appSpec, childSpec); return childSpec; } return appSpec; } else { throw new IllegalStateException("Unable to instantiate YAML; incompatible instantiator "+instantiator+" for "+at); } }
Source:
<code>public void setFreshnessThreshold(final int value) { <START> _freshnessThreshold = value; <END> }</code><technical_language>I assume this is a time value, units in member column name</technical_language>

Target:
public void setFreshnessThreshold(final int value) { _freshnessThresholdInSeconds = value; }
Source:
<code>public void testIterator(Item expectedItem) { final TreasureChest chest = new TreasureChest(); <START> final TreasureChestItemIterator iterator = chest.iterator(expectedItem.getType()); <END> assertNotNull(iterator); while (iterator.hasNext()) { final Item item = iterator.next(); assertNotNull(item); assertEquals(expectedItem.getType(), item.getType()); final String name = item.toString(); assertNotNull(name); if (expectedItem.toString().equals(name)) { return; } } fail("Expected to find item [" + expectedItem + "] using iterator, but we didn't."); }</code><technical_language>change here. client of TreasureChest care if concrete implementation of Iterator is TreasureChestItemIterator else. need Iterator. This allows for easier refactoring freely change name of class client code affected. I hope sense</technical_language>

Target:
public void testIterator(Item expectedItem) { final TreasureChest chest = new TreasureChest(); final Iterator<Item> iterator = chest.iterator(expectedItem.getType()); assertNotNull(iterator); while (iterator.hasNext()) { final Item item = iterator.next(); assertNotNull(item); assertEquals(expectedItem.getType(), item.getType()); final String name = item.toString(); assertNotNull(name); if (expectedItem.toString().equals(name)) { return; } } fail("Expected to find item [" + expectedItem + "] using iterator, but we didn't."); }
Source:
<code>public List<String> getFiles() { <START> return filesToCheckout == null ? Collections.emptyList() : filesToCheckout; <END> }</code><technical_language>return immutable list here</technical_language>

Target:
public List<String> getFiles() { return filesToCheckout == null ? new ArrayList<>() : filesToCheckout; }
Source:
<code>public void clearVm(VmStatic vm) { Set<Guid> modifiedHosts; synchronized (this) { if (!resourcesByVm.containsKey(vm.getId())) { return; } log.debug("Clearing pending resources for VM {}", vm.getId()); modifiedHosts = new HashSet<>(); resourcesByVm.compute(vm.getId(), (vmId, resources) -> { for (PendingResource resource : resources) { resourcesByHost.computeIfPresent(resource.getHost(), <START> (hostId, hostResources) -> { modifiedHosts.add(hostId); hostResources.remove(resource); return hostResources; }); <END> pendingResources.remove(resource); } resources.clear(); return resources; }); } for (Guid hostId: modifiedHosts) { notifyHostManagers(hostId); } }</code><technical_language>Is a extract a static method reuse in clearHost block? modifiedHosts list complicate though</technical_language>

Target:
public void clearVm(VmStatic vm) { Set<Guid> modifiedHosts; synchronized (this) { if (!resourcesByVm.containsKey(vm.getId())) { return; } log.debug("Clearing pending resources for VM {}", vm.getId()); modifiedHosts = new HashSet<>(); resourcesByVm.compute(vm.getId(), (vmId, resources) -> { for (PendingResource resource : resources) { if(resourcesByHost.containsKey(resource.getHost())){ modifiedHosts.add(resource.getHost()); } removeFromSetMap(resourcesByHost, resource.getHost(), resource); pendingResources.remove(resource); } resources.clear(); return resources; }); } for (Guid hostId: modifiedHosts) { notifyHostManagers(hostId); } }
Source:
<code>private boolean sessionHasStarted(InputStream responseStream){ JSONHelper jsonHelper = new JSONHelper(); Map<String,Object> jsonResponse = jsonHelper.fromJson(new InputStreamReader(responseStream)); boolean responseLooksOkay = true; <START> responseLooksOkay = jsonResponse.containsKey("ok") && responseLooksOkay; <END> if(responseLooksOkay) { responseLooksOkay = (Boolean) jsonResponse.get("ok") && responseLooksOkay; } return responseLooksOkay; }</code><technical_language>write this more succinctly && is short-circuting: java boolean responseLooksOkay = jsonResponse.containsKey("ok") && (Boolean) jsonResponse.get("ok");</technical_language>

Target:
private boolean sessionHasStarted(InputStream responseStream){ JSONHelper jsonHelper = new JSONHelper(); Map<String,Object> jsonResponse = jsonHelper.fromJson(new InputStreamReader(responseStream)); return jsonResponse.containsKey("ok") && (Boolean) jsonResponse.get("ok"); }
Source:
<code>private void updateInstanceStatus(final WorkflowExecutionContext context) throws FalconException { if (context.getContextType() == WorkflowExecutionContext.Type.COORDINATOR_ACTION) { return; } WorkflowExecutionContext.EntityOperations entityOperation = context.getOperation(); switch (entityOperation) { case GENERATE: updateProcessInstance(context); break; case REPLICATE: updateReplicatedFeedInstance(context); break; case DELETE: updateEvictedFeedInstance(context); break; case IMPORT: updateImportedFeedInstance(context); break; case EXPORT: <START> onFeedInstanceExported(context); <END> break; default: throw new IllegalArgumentException("Invalid EntityOperation - " + entityOperation); } }</code><technical_language>Minor : uniform naming for similar methods? This updateExportedFeedInstance..</technical_language>

Target:
private void updateInstanceStatus(final WorkflowExecutionContext context) throws FalconException { if (context.getContextType() == WorkflowExecutionContext.Type.COORDINATOR_ACTION) { return; } WorkflowExecutionContext.EntityOperations entityOperation = context.getOperation(); switch (entityOperation) { case GENERATE: updateProcessInstance(context); break; case REPLICATE: updateReplicatedFeedInstance(context); break; case DELETE: updateEvictedFeedInstance(context); break; case IMPORT: updateImportedFeedInstance(context); break; case EXPORT: updateExportedFeedInstance(context); break; default: throw new IllegalArgumentException("Invalid EntityOperation - " + entityOperation); } }
Source:
<code>@Test public void testWindowFunctionsWithoutOver() { winSql( "select sum(empno) \n" + "from emp \n" + "group by deptno \n" + "order by ^row_number()^") .fails("OVER clause is necessary for window functions"); winSql( "select ^rank()^ \n" + "from emp") .fails("OVER clause is necessary for window functions"); winSql( "select cume_dist() over w , ^rank()^\n" <START> + "from emp group by deptno\n" <END> + "window w as (partition by deptno order by deptno)") .fails("OVER clause is necessary for window functions"); }</code><technical_language>a need add group-by group-by is needed nested aggregate. This points some other potential issue</technical_language>

Target:
@Test public void testWindowFunctionsWithoutOver() { winSql( "select sum(empno) \n" + "from emp \n" + "group by deptno \n" + "order by ^row_number()^") .fails("OVER clause is necessary for window functions"); winSql( "select ^rank()^ \n" + "from emp") .fails("OVER clause is necessary for window functions"); winSql( "select cume_dist() over w , ^rank()^\n" + "from emp \n" + "window w as (partition by deptno order by deptno)") .fails("OVER clause is necessary for window functions"); }
Source:
<code><START> public void getBuilderTest() { <END> SAMLAssertionBuilderFactoryImpl builderFactory = new SAMLAssertionBuilderFactoryImpl(); SAMLAssertionBuilder hokBuilder = builderFactory.getBuilder(SAMLAssertionBuilderConstants.HOK_ASSERTION_TYPE); assertTrue(hokBuilder instanceof HOKSAMLAssertionBuilder); SAMLAssertionBuilder svBuilder = builderFactory.getBuilder(SAMLAssertionBuilderConstants.SV_ASSERTION_TYPE); assertTrue(svBuilder instanceof SVSAMLAssertionBuilder); }</code><technical_language>this separate tests, separate conditions separate asserts? Also, is negative path test (i.e., testing behavior passing in a random String a null value)</technical_language>

Target:
public void getBuilderTest() { SAMLAssertionBuilderFactoryImpl builderFactory = new SAMLAssertionBuilderFactoryImpl(); SAMLAssertionBuilder hokBuilder = builderFactory.getBuilder(NhincConstants.HOK_ASSERTION_TYPE); assertTrue(hokBuilder instanceof HOKSAMLAssertionBuilder); SAMLAssertionBuilder svBuilder = builderFactory.getBuilder(NhincConstants.SV_ASSERTION_TYPE); assertTrue(svBuilder instanceof SVSAMLAssertionBuilder); }
Source:
<code>public ValidatorFactoryImpl(ConfigurationState configurationState) { this.messageInterpolator = configurationState.getMessageInterpolator(); this.constraintValidatorFactory = configurationState.getConstraintValidatorFactory(); this.traversableResolver = configurationState.getTraversableResolver(); ConstraintHelper constraintHelper = new ConstraintHelper(); boolean tmpFailFast = false; List<MetaDataProvider> metaDataProviders = newArrayList(); if ( !configurationState.getMappingStreams().isEmpty() ) { metaDataProviders.add( <START> new MetaDataProviderXmlSource( <END> constraintHelper, configurationState.getMappingStreams() ) ); } if ( configurationState instanceof ConfigurationImpl ) { ConfigurationImpl hibernateSpecificConfig = (ConfigurationImpl) configurationState; if ( hibernateSpecificConfig.getProgrammaticMappings().size() > 0 ) { metaDataProviders.add( new MetaDataProviderProgrammaticSource( constraintHelper, hibernateSpecificConfig.getProgrammaticMappings() ) ); } tmpFailFast = hibernateSpecificConfig.getFailFast(); } tmpFailFast = checkPropertiesForFailFast( configurationState, tmpFailFast ); this.failFast = tmpFailFast; metaDataManager = new BeanMetaDataManager( constraintHelper, metaDataProviders ); }</code><technical_language>I find new names a bit irritating. "Provider" "source" more synonym me. "XmlMetaDataSource"</technical_language>

Target:
public ValidatorFactoryImpl(ConfigurationState configurationState) { this.messageInterpolator = configurationState.getMessageInterpolator(); this.constraintValidatorFactory = configurationState.getConstraintValidatorFactory(); this.traversableResolver = configurationState.getTraversableResolver(); ConstraintHelper constraintHelper = new ConstraintHelper(); boolean tmpFailFast = false; List<MetaDataProvider> metaDataProviders = newArrayList(); if ( !configurationState.getMappingStreams().isEmpty() ) { metaDataProviders.add( new XmlMetaDataProvider( constraintHelper, configurationState.getMappingStreams() ) ); } if ( configurationState instanceof ConfigurationImpl ) { ConfigurationImpl hibernateSpecificConfig = (ConfigurationImpl) configurationState; if ( hibernateSpecificConfig.getProgrammaticMappings().size() > 0 ) { metaDataProviders.add( new ProgrammaticMetaDataProvider( constraintHelper, hibernateSpecificConfig.getProgrammaticMappings() ) ); } tmpFailFast = hibernateSpecificConfig.getFailFast(); } tmpFailFast = checkPropertiesForFailFast( configurationState, tmpFailFast ); this.failFast = tmpFailFast; metaDataManager = new BeanMetaDataManager( constraintHelper, metaDataProviders ); }
Source:
<code>public String convert(Object tuple) { if (tuple == null) { return null; } try { return writer.writeValueAsString(tuple); } catch (JsonProcessingException e) { logger.error("Error while converting tuple {}", tuple, e.getMessage()); } return null; <START> } <END></code><technical_language>LOG.error("Unable find provided class"); throw new RuntimeException(e);</technical_language>

Target:
public String convert(Object tuple) { if (tuple == null) { return null; } try { return objMapper.writeValueAsString(tuple); } catch (JsonProcessingException e) { logger.error("Error while converting tuple {}", tuple, e); } return null; }
Source:
<code>private JsonObject getFindByIndexBody(String selectorJson, FindByIndexOptions options) { JsonObject fieldsObject = new JsonObject(); if (options.getFields().size() > 0) { JsonElement fieldsArray = getGson().toJsonTree(options.getFields()); fieldsObject.add("fields", fieldsArray.getAsJsonArray()); } if (options.getSort().size() > 0) { JsonElement sortArray = getGson().toJsonTree(options.getSort()); fieldsObject.add("sort", sortArray.getAsJsonArray()); } JsonObject indexObject = new JsonObject(); <START> indexObject.addProperty("selector", selectorJson); <END> if (options.getLimit() != null) { indexObject.addProperty("limit", options.getLimit()); } if (options.getSkip() != null) { indexObject.addProperty("skip", options.getSkip()); } if (options.getReadQuorum() != null) { indexObject.addProperty("r", options.getReadQuorum()); } if (options.getUseIndex() != null) { indexObject.addProperty("use_index", options.getUseIndex()); } return indexObject; }</code><technical_language>this work? I supplied selector JSON of form "selector" : {}</technical_language>

Target:
private JsonObject getFindByIndexBody(String selectorJson, FindByIndexOptions options) { JsonArray fieldsArray = new JsonArray(); if (options.getFields().size() > 0) { for(String field : options.getFields()) { JsonPrimitive jsonField = client.getGson().fromJson(field, JsonPrimitive.class); fieldsArray.add(jsonField); } } JsonArray sortArray = new JsonArray(); if (options.getSort().size() > 0) { for(IndexField sort : options.getSort()) { JsonObject sortObject = new JsonObject(); sortObject.addProperty(sort.getName(), sort.getOrder().toString()); sortArray.add(sortObject); } } JsonObject indexObject = new JsonObject(); JsonObject selectorObject = null; boolean isObject = true; try { selectorObject = getGson().fromJson(selectorJson, JsonObject.class); } catch (JsonParseException e) { isObject = false; } if(!isObject) { if(selectorJson.startsWith("\"selector\"")) { selectorJson = selectorJson.substring(selectorJson.indexOf(":") + 1, selectorJson.length()).trim(); selectorObject = getGson().fromJson(selectorJson, JsonObject.class); } else { throw new JsonParseException("selectorJson should be valid json or like " + "\"selector\": {...} "); } } if(selectorObject.has("selector")) { indexObject.add("selector", selectorObject.get("selector")); } else { indexObject.add("selector", selectorObject); } if(fieldsArray.size() > 0) { indexObject.add("fields", fieldsArray); } if(sortArray.size() > 0) { indexObject.add("sort", sortArray); } if (options.getLimit() != null) { indexObject.addProperty("limit", options.getLimit()); } if (options.getSkip() != null) { indexObject.addProperty("skip", options.getSkip()); } if (options.getReadQuorum() != null) { indexObject.addProperty("r", options.getReadQuorum()); } if (options.getUseIndex() != null) { indexObject.add("use_index", getGson().fromJson(options.getUseIndex(), JsonArray.class)); } return indexObject; }
Source:
<code>public void setContributions(List<Contribution> contributionList) { <START> this.contributions=contributionList; <END> adapter.setContributions(contributionList); }</code><technical_language>delete this line field</technical_language>

Target:
public void setContributions(List<Contribution> contributionList) { this.contributions.clear(); this.contributions.addAll(contributionList); adapter.setContributions(contributions); }
Source:
<code>IndexDescriptor( IndexDescriptor indexDescriptor ) { schema = indexDescriptor.schema; type = indexDescriptor.type; <START> userSuppliedName = indexDescriptor.userSuppliedName; <END> providerDescriptor = indexDescriptor.providerDescriptor; }</code><technical_language>This constructor delegate other constructor. a bit weird enums in constructors. I prefer if live bottom of this class</technical_language>

Target:
IndexDescriptor( IndexDescriptor indexDescriptor ) { this( indexDescriptor.schema, indexDescriptor.type, indexDescriptor.userSuppliedName, indexDescriptor.providerDescriptor ); }
Source:
<code>private void addSmsApplicationsSelector(SharedPreferences prefs) { ListPreference smsAppList = (ListPreference) findPreference("sms-apps"); Intent intent = new Intent(Intent.ACTION_SENDTO); intent.setType("text/plain"); intent.setData(Uri.parse("sms:")); final PackageManager pm = getPackageManager(); List<ResolveInfo> availableSmsApps = pm.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY); CharSequence[] entries = new CharSequence[availableSmsApps.size() + 1]; CharSequence[] entryValues = new CharSequence[availableSmsApps.size() + 1]; entries[0] = this.getString(R.string.sms_apps_default); entryValues[0] = "defaultSmsApp"; int i = 1; for (ResolveInfo info : availableSmsApps) { <START> String appName = (String) (info.activityInfo.applicationInfo != null ? pm.getApplicationLabel(info.activityInfo.applicationInfo) : "(unknown)"); <END> entries[i] = appName; entryValues[i++] = info.activityInfo.packageName+"|"+info.activityInfo.name; } smsAppList.setEntries(entries); smsAppList.setEntryValues(entryValues); }</code><technical_language>Please string "(unknown)" translatable (it shown user all)</technical_language>

Target:
private void addSmsApplicationsSelector(SharedPreferences prefs) { ListPreference smsAppList = (ListPreference) findPreference("sms-apps"); Intent intent = new Intent(Intent.ACTION_SENDTO); intent.setType("text/plain"); intent.setData(Uri.parse("sms:")); final PackageManager pm = getPackageManager(); List<ResolveInfo> availableSmsApps = pm.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY); CharSequence[] entries = new CharSequence[availableSmsApps.size() + 1]; CharSequence[] entryValues = new CharSequence[availableSmsApps.size() + 1]; entries[0] = this.getString(R.string.sms_apps_default); entryValues[0] = "defaultSmsApp"; int i = 1; for (ResolveInfo info : availableSmsApps) { String appName = (String) (info.activityInfo.applicationInfo != null ? pm.getApplicationLabel(info.activityInfo.applicationInfo) : getString(R.string.sms_apps_unknown)); entries[i] = appName; entryValues[i++] = info.activityInfo.packageName+"|"+info.activityInfo.name; } smsAppList.setEntries(entries); smsAppList.setEntryValues(entryValues); }
Source:
<code>private void clearCompletedTasks() { final ProgressDialog pd = new ProgressDialog(this); final TodorooCursor<Task> tasks = taskService.fetchFiltered(filter.sqlQuery, null, Task.ID, Task.COMPLETION_DATE); pd.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); pd.setMessage(this.getString(R.string.gtasks_GLA_clearing));pd.setMax(tasks.getCount()); pd.show(); new Thread() { @Override public void run() { String listId = null; try { for (tasks.moveToFirst(); !tasks.isAfterLast(); tasks.moveToNext()) { Task t = new Task(tasks); if (t.isCompleted()) { if (listId == null) { listId = gtasksMetadataService.getTaskMetadata(t.getId()).getValue(GtasksMetadata.LIST_ID); } t.setValue(Task.DELETION_DATE, DateUtilities.now()); taskService.save(t); } pd.incrementProgressBy(1); } } finally { tasks.close(); <START> pd.dismiss(); <END> } if (listId != null) { gtasksTaskListUpdater.correctMetadataForList(listId); } GtasksListActivity.this.runOnUiThread(new Runnable() { public void run() { loadTaskListContent(true); } }); } }.start(); }</code><technical_language>DialogUtilities.dismissDialog catch errors</technical_language>

Target:
private void clearCompletedTasks() { final ProgressDialog pd = new ProgressDialog(this); final TodorooCursor<Task> tasks = taskService.fetchFiltered(filter.sqlQuery, null, Task.ID, Task.COMPLETION_DATE); pd.setMessage(this.getString(R.string.gtasks_GTA_clearing)); pd.show(); new Thread() { @Override public void run() { String listId = null; try { for (tasks.moveToFirst(); !tasks.isAfterLast(); tasks.moveToNext()) { Task t = new Task(tasks); if (t.isCompleted()) { if (listId == null) { listId = gtasksMetadataService.getTaskMetadata(t.getId()).getValue(GtasksMetadata.LIST_ID); } t.setValue(Task.DELETION_DATE, DateUtilities.now()); taskService.save(t); } } } finally { tasks.close(); DialogUtilities.dismissDialog(GtasksListActivity.this, pd); } if (listId != null) { gtasksTaskListUpdater.correctMetadataForList(listId); } GtasksListActivity.this.runOnUiThread(new Runnable() { public void run() { loadTaskListContent(true); } }); } }.start(); }
Source:
<code>public ReactorConnection(String connectionId, ConnectionOptions connectionOptions, ReactorProvider reactorProvider, ReactorHandlerProvider handlerProvider, TokenManagerProvider tokenManagerProvider, MessageSerializer messageSerializer, String product, String clientVersion, SenderSettleMode senderSettleMode, ReceiverSettleMode receiverSettleMode) { this.connectionOptions = connectionOptions; this.reactorProvider = reactorProvider; this.connectionId = connectionId; this.handlerProvider = handlerProvider; this.tokenManagerProvider = Objects.requireNonNull(tokenManagerProvider, "'tokenManagerProvider' cannot be null."); this.messageSerializer = messageSerializer; this.handler = handlerProvider.createConnectionHandler(connectionId, connectionOptions.getFullyQualifiedNamespace(), connectionOptions.getTransportType(), connectionOptions.getProxyOptions(), product, clientVersion); this.retryPolicy = RetryUtil.getRetryPolicy(connectionOptions.getRetry()); this.senderSettleMode = senderSettleMode; this.receiverSettleMode = receiverSettleMode; this.connectionMono = Mono.fromCallable(this::getOrCreateConnection) .doOnSubscribe(c -> hasConnection.set(true)); this.endpointStates = this.handler.getEndpointStates() .takeUntilOther(shutdownSignals) .map(state -> { <START> logger.verbose("connectionId[{}]: State {}", connectionId, state); <END> return AmqpEndpointStateUtil.getConnectionState(state); }).subscribeWith(ReplayProcessor.cacheLastOrDefault(AmqpEndpointState.UNINITIALIZED)); }</code><technical_language>curious if need cache event</technical_language>

Target:
public ReactorConnection(String connectionId, ConnectionOptions connectionOptions, ReactorProvider reactorProvider, ReactorHandlerProvider handlerProvider, TokenManagerProvider tokenManagerProvider, MessageSerializer messageSerializer, String product, String clientVersion, SenderSettleMode senderSettleMode, ReceiverSettleMode receiverSettleMode) { this.connectionOptions = connectionOptions; this.reactorProvider = reactorProvider; this.connectionId = connectionId; this.handlerProvider = handlerProvider; this.tokenManagerProvider = Objects.requireNonNull(tokenManagerProvider, "'tokenManagerProvider' cannot be null."); this.messageSerializer = messageSerializer; this.handler = handlerProvider.createConnectionHandler(connectionId, connectionOptions.getFullyQualifiedNamespace(), connectionOptions.getTransportType(), connectionOptions.getProxyOptions(), product, clientVersion); this.retryPolicy = RetryUtil.getRetryPolicy(connectionOptions.getRetry()); this.senderSettleMode = senderSettleMode; this.receiverSettleMode = receiverSettleMode; this.connectionMono = Mono.fromCallable(this::getOrCreateConnection); this.endpointStates = this.handler.getEndpointStates() .takeUntilOther(shutdownSignals) .map(state -> { logger.verbose("connectionId[{}]: State {}", connectionId, state); return AmqpEndpointStateUtil.getConnectionState(state); }).subscribeWith(ReplayProcessor.cacheLastOrDefault(AmqpEndpointState.UNINITIALIZED)); }
Source:
<code>public void validateSectionsAndTeams(List<StudentAttributes> studentList, String courseId) throws EntityDoesNotExistException, EnrollException { List<StudentAttributes> mergedList = getMergedList(studentList, courseId); <START> if(mergedList.size() < 2){ END> return; } String errorMessage = ""; errorMessage += getSectionInvalidityInfo(mergedList); errorMessage += getTeamInvalidityInfo(mergedList); if(!errorMessage.equals("")){ throw new EnrollException(errorMessage); } }</code><technical_language>While original code include spaces surrounding if statement, good address :)</technical_language>

Target:
public void validateSectionsAndTeams(List<StudentAttributes> studentList, String courseId) throws EntityDoesNotExistException, EnrollException { List<StudentAttributes> mergedList = getMergedList(studentList, courseId); if (mergedList.size() < 2) { return; } String errorMessage = ""; errorMessage += getSectionInvalidityInfo(mergedList); errorMessage += getTeamInvalidityInfo(mergedList); if (!errorMessage.isEmpty()) { throw new EnrollException(errorMessage); } }
Source:
<code>private <X> Iterator<X> chooseIterator(K from, K to, boolean forEntries) { switch (transaction.isolationLevel) { case READ_UNCOMMITTED: return new UncommittedIterator<>(this, from, to, false, forEntries); case REPEATABLE_READ: case SERIALIZABLE: return transaction.hasChanges() ? new RepeatableIterator<K, X>(this, from, to, forEntries) : <START> new CommittedIterator<K, X>(this, from, to, forEntries); <END> case READ_COMMITTED: default: return new CommittedIterator<>(this, from, to, forEntries); } }</code><technical_language>shortened more, if wish: Java if (transaction.hasChanges()) { return new Repeatable } //$FALL-THROUGH$</technical_language>

Target:
private <X> Iterator<X> chooseIterator(K from, K to, boolean forEntries) { switch (transaction.isolationLevel) { case READ_UNCOMMITTED: return new UncommittedIterator<>(this, from, to, forEntries); case REPEATABLE_READ: case SERIALIZABLE: if (transaction.hasChanges()) { return new RepeatableIterator<>(this, from, to, forEntries); } case READ_COMMITTED: default: return new CommittedIterator<>(this, from, to, forEntries); } }
Source:
<code>public static Filter[] getActiveFilters(IPreferenceStore store) { Filter[] filters = null; String[] activefilters; activefilters = ScriptDebugOptionsManager .parseList(store .getString(IDLTKDebugUIPreferenceConstants.PREF_ACTIVE_FILTERS_LIST)); filters = new Filter[activefilters.length]; for (int i = 0; i < activefilters.length; i++) { String[] split = activefilters[i].split(":"); if (split.length == 1) { filters[i] = new Filter(split[0], true, 0); } else { <START> filters[i] = new Filter(split[0], true, (Integer.valueOf(split[1])) <END> .intValue()); } } return filters; }</code><technical_language>parseInt()</technical_language>

Target:
public static Filter[] getActiveFilters(IPreferenceStore store) { Filter[] filters = null; String[] activefilters; activefilters = ScriptDebugOptionsManager.parseList(store.getString( IDLTKDebugUIPreferenceConstants.PREF_ACTIVE_FILTERS_LIST)); filters = new Filter[activefilters.length]; for (int i = 0; i < activefilters.length; i++) { String[] split = activefilters[i].split(":"); if (split.length == 1) { filters[i] = new Filter(split[0], true, 0); } else { filters[i] = new Filter(split[0], true, Integer.parseInt(split[1])); } } return filters; }
Source:
<code>public boolean equals(Object obj) { if (obj == null) { return false; } <START> if (!(obj instanceof IpServiceEdgeRequestDTO)) { return false; } <END> if (!super.equals(obj)) { return false; } return java.util.Objects.equals(applicationId, ((ApplicationEdgeRequestDTO) obj).applicationId); }</code><technical_language>class is wrong in this instanceof comparison. is IntelliJ generated equals if want @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; if (!super.equals(o)) return false; ApplicationEdgeRequestDTO = (ApplicationEdgeRequestDTO) o; return Objects.equals(applicationId, that.applicationId); } suggestion if (!(obj instanceof ApplicationEdgeRequestDTO)) { return false; }</technical_language>

Target:
public boolean equals(Object obj) { if (obj == null) { return false; } if (!(obj instanceof ApplicationEdgeRequestDTO)) { return false; } if (!super.equals(obj)) { return false; } return java.util.Objects.equals(applicationId, ((ApplicationEdgeRequestDTO) obj).applicationId); }
Source:
<code>private static <T> void load(Class<T> targetClass) { ServiceLoader.load(targetClass, ServiceLoaderTestCase.class.getClassLoader()) <START> .forEach(object -> System.out.println("\t" + object.getClass().getName())); <END> }</code><technical_language>want get rid of this System.out running loose in this test case</technical_language>

Target:
private static <T> void load(Class<T> targetClass) { ServiceLoader.load(targetClass, ServiceLoaderTestCase.class.getClassLoader()) .forEach(object -> LOGGER.tracef("\t" + object.getClass().getName())); }
Source:
<code>private List<LUNs> getLunsFromVgInfo() { GetVGInfoVDSCommandParameters params = new GetVGInfoVDSCommandParameters( <START> Optional.ofNullable(getVds()).map(VDS::getId).orElse(null), getStorageDomain().getStorage()); <END> if (getVds() == null) { return (List<LUNs>) VdsCommandsHelper.runVdsCommandWithoutFailover( VDSCommandType.GetVGInfo, params, getStoragePoolId(), null).getReturnValue(); } return (List<LUNs>) runVdsCommand(VDSCommandType.GetVGInfo, params).getReturnValue(); }</code><technical_language>export vdsId it, if vds id call getVds() a db call avoid. Guid vdsId = Optional.ofNullable(getVds()).map(VDS::getId).orElse(null) or: Guid vdsId = getVds() != null ? getVds().getId() : null;</technical_language>

Target:
private List<LUNs> getLunsFromVgInfo() { GetVGInfoVDSCommandParameters params = new GetVGInfoVDSCommandParameters(getParameters().getVdsId(), getStorageDomain().getStorage()); if (getParameters().getVdsId() == null) { return (List<LUNs>) VdsCommandsHelper.runVdsCommandWithoutFailover( VDSCommandType.GetVGInfo, params, getStoragePoolId(), null).getReturnValue(); } return (List<LUNs>) runVdsCommand(VDSCommandType.GetVGInfo, params).getReturnValue(); }
Source:
<code>private Set<PersistentResource> getRelationWithSortingAndPagination(String relationName, boolean checked) { if (checked && !checkRelation(relationName)) { return Collections.emptySet(); } final Class<?> relationClass = dictionary.getParameterizedType(obj, relationName); boolean isAnyToMany = dictionary.isMappedInterface(relationClass) <START> && dictionary.getAttributeOrRelationAnnotation(obj.getClass(), ToMany.class, relationName) != null; <END> if (isAnyToMany || (! requestScope.getPagination().isDefaultInstance() && !CanPaginateVisitor.canPaginate(relationClass, dictionary, requestScope))) { throw new InvalidPredicateException(String.format("Cannot paginate %s", dictionary.getJsonAliasFor(relationClass))); } Optional<FilterExpression> filterExpression = getExpressionForRelation(relationName); return getRelationUnchecked(relationName, filterExpression, true); }</code><technical_language>ways for MappedInterfaces marked AnyToMany? If so, this overly restrictive check, right</technical_language>

Target:
private Set<PersistentResource> getRelationWithSortingAndPagination(String relationName, boolean checked) { if (checked && !checkRelation(relationName)) { return Collections.emptySet(); } final Class<?> relationClass = dictionary.getParameterizedType(obj, relationName); if (dictionary.isMappedInterface(relationClass) || (! requestScope.getPagination().isDefaultInstance() && !CanPaginateVisitor.canPaginate(relationClass, dictionary, requestScope))) { throw new InvalidPredicateException(String.format("Cannot paginate %s", dictionary.getJsonAliasFor(relationClass))); } Optional<FilterExpression> filterExpression = getExpressionForRelation(relationName); return getRelationUnchecked(relationName, filterExpression, true); }
Source:
<code>public void validate() throws IllegalAlgorithmArgumentException { boolean queryServiceSet = false; if (null != getExecution().getQueryServiceClasses() && !getExecution().getQueryServiceClasses().isEmpty()) { queryServiceSet = true; } if (null != getExecution().getQueryServices() && !getExecution().getQueryServices().isEmpty()) { queryServiceSet = true; } if (!queryServiceSet) { throw new IllegalAlgorithmArgumentException(getClass(), "queryService", "Required parameter 'query services' is missing!"); } if (null == getExecution().getSearchResultLinkerClass()) { <START> throw new IllegalAlgorithmArgumentException(getClass(), "searchResultLinkerClass", "Required parameter 'SearchResultLinkerClass' is missing!"); <END> } }</code><technical_language>catch null == getExecution().getTextualReferences, people omit JSON</technical_language>

Target:
public void validate() throws IllegalAlgorithmArgumentException { boolean queryServiceSet = false; if (null != getExecution().getQueryServiceClasses() && !getExecution().getQueryServiceClasses().isEmpty()) { queryServiceSet = true; } if (null != getExecution().getQueryServices() && !getExecution().getQueryServices().isEmpty()) { queryServiceSet = true; } if (null == getExecution().getTextualReferences()) { throw new IllegalAlgorithmArgumentException(getClass(), "TextualReference", "Required parameter 'textual references' is missing!"); } if (!queryServiceSet) { throw new IllegalAlgorithmArgumentException(getClass(), "queryService", "Required parameter 'query services' is missing!"); } if (null == getExecution().getSearchResultLinkerClass()) { throw new IllegalAlgorithmArgumentException(getClass(), "searchResultLinkerClass", "Required parameter 'SearchResultLinkerClass' is missing!"); } }
Source:
<code>public void theGetDebugInformationRequestIsReceived(final Map<String, String> requestData) throws Throwable { final FindMessageLogsRequest request = FindMessageLogsRequestFactory.fromParameterMap(requestData); final FindMessageLogsAsyncResponse asyncResponse = this.requestClient.doRequest(request); <START> assertNotNull("asyncResponse should not be null", asyncResponse); <END> ScenarioContext.current().put(PlatformSmartmeteringKeys.KEY_CORRELATION_UID, asyncResponse.getCorrelationUid()); }</code><technical_language>capital 'AsyncResponse'</technical_language>

Target:
public void theGetDebugInformationRequestIsReceived(final Map<String, String> requestData) throws Throwable { final FindMessageLogsRequest findMessageLogsRequest = FindMessageLogsRequestFactory .fromParameterMap(requestData); final FindMessageLogsAsyncResponse findMessageLogsAsyncResponse = this.smartMeteringManagementRequestClient .doRequest(findMessageLogsRequest); assertNotNull("AsyncResponse should not be null", findMessageLogsAsyncResponse); ScenarioContext.current().put(PlatformSmartmeteringKeys.KEY_CORRELATION_UID, findMessageLogsAsyncResponse.getCorrelationUid()); }
Source:
<code>public void visitLiteral(JCLiteral literal) { String s = literal.toString(); switch (literal.typetag) { case FLOAT: if (s.endsWith("F")) { s = s.substring(0, s.length() - 1); } break; case LONG: if (s.endsWith("L")) { s = s.substring(0, s.length() - 1); } break; default: } if (s.startsWith("\"") && context.options.isUseSingleQuotesForStringLiterals()) { <START> s = "'" + s.substring(1, s.length() - 1).replace("'", "\\\"") + "'"; <END> } print(s); }</code><technical_language>replacing "'" "\\\"", I understand logic here. I surprised string quote char is option (thus referencing sense), get string literal quote is delegated adapter (getStringLiteralQuote), depend transpiler's option, right</technical_language>

Target:
public void visitLiteral(JCLiteral literal) { String s = literal.toString(); switch (literal.typetag) { case FLOAT: if (s.endsWith("F")) { s = s.substring(0, s.length() - 1); } break; case LONG: if (s.endsWith("L")) { s = s.substring(0, s.length() - 1); } break; default: } if (s.startsWith("\"") && context.options.isUseSingleQuotesForStringLiterals()) { s = "'" + s.substring(1, s.length() - 1).replace("'", "\'") + "'"; } print(s); }