auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private ServerErrorCode validateRequest(PartitionId partition, RequestOrResponseType requestType, boolean skipPartitionAndDiskAvailableCheck) { if (partition == null) { metrics.badRequestError.inc(); return ServerErrorCode.Bad_Request; } if (!skipPartitionAndDiskAvailableCheck) { <START> ReplicaId localReplica = storageManager.getLocalReplica(partition); <END> if (localReplica != null && localReplica.getDiskId().getState() == HardwareState.UNAVAILABLE) { metrics.diskUnavailableError.inc(); return ServerErrorCode.Disk_Unavailable; } if (storageManager.getStore(partition) == null) { if (localReplica != null) { if (storageManager.isDiskUnavailable(storageManager.getDiskManager(partition))) { metrics.diskUnavailableError.inc(); localReplica.markDiskDown(); return ServerErrorCode.Disk_Unavailable; } else { metrics.replicaUnavailableError.inc(); return ServerErrorCode.Replica_Unavailable; } } else { metrics.partitionUnknownError.inc(); return ServerErrorCode.Partition_Unknown; } } } if (requestType.equals(RequestOrResponseType.PutRequest) && partition.getPartitionState() == PartitionState.READ_ONLY) { metrics.partitionReadOnlyError.inc(); return ServerErrorCode.Partition_ReadOnly; } if (!isRequestEnabled(requestType, partition)) { metrics.temporarilyDisabledError.inc(); return ServerErrorCode.Temporarily_Disabled; } return ServerErrorCode.No_Error; }</code><technical_language>this a method in ClusterParticipant StorageManager</technical_language>

Target:
private ServerErrorCode validateRequest(PartitionId partition, RequestOrResponseType requestType, boolean skipPartitionAndDiskAvailableCheck) { if (partition == null) { metrics.badRequestError.inc(); return ServerErrorCode.Bad_Request; } if (!skipPartitionAndDiskAvailableCheck) { ReplicaId localReplica = localPartitionToReplicaMap.get(partition); if (localReplica != null && localReplica.getDiskId().getState() == HardwareState.UNAVAILABLE) { metrics.diskUnavailableError.inc(); return ServerErrorCode.Disk_Unavailable; } if (storageManager.getStore(partition) == null) { if (localReplica != null) { if (!storageManager.isDiskAvailable(localReplica.getDiskId())) { metrics.diskUnavailableError.inc(); localReplica.markDiskDown(); return ServerErrorCode.Disk_Unavailable; } else { metrics.replicaUnavailableError.inc(); return ServerErrorCode.Replica_Unavailable; } } else { metrics.partitionUnknownError.inc(); return ServerErrorCode.Partition_Unknown; } } } if (requestType.equals(RequestOrResponseType.PutRequest) && partition.getPartitionState() == PartitionState.READ_ONLY) { metrics.partitionReadOnlyError.inc(); return ServerErrorCode.Partition_ReadOnly; } if (!isRequestEnabled(requestType, partition)) { metrics.temporarilyDisabledError.inc(); return ServerErrorCode.Temporarily_Disabled; } return ServerErrorCode.No_Error; }
Source:
<code>public TreeFillingConfigurationDialog(final Shell parentShell, final TreeFillingConfiguration treefillingConfiguration, final List<ILabelProviderConfiguration> existingLabelProvidersConfiguration, final List<PasteEObjectConfiguration> existingPasteConfigurations) { super(parentShell); this.modifiedTreefillingConfiguration = EcoreUtil.copy(treefillingConfiguration); this.existingLabelProviderConfigurations = existingLabelProvidersConfiguration; this.existingPasteConfigurations = existingPasteConfigurations; <START> setTitle(org.eclipse.papyrus.customization.nattableconfiguration.messages.Messages.TreeFillingConfigurationDialog_treeFillingConfigurationDialogName); <END> }</code><technical_language>import class Messages</technical_language>

Target:
public TreeFillingConfigurationDialog(final Shell parentShell, final TreeFillingConfiguration treefillingConfiguration, final List<ILabelProviderConfiguration> existingLabelProvidersConfiguration, final List<PasteEObjectConfiguration> existingPasteConfigurations) { super(parentShell); this.modifiedTreefillingConfiguration = EcoreUtil.copy(treefillingConfiguration); this.existingLabelProviderConfigurations = existingLabelProvidersConfiguration; this.existingPasteConfigurations = existingPasteConfigurations; setTitle(Messages.TreeFillingConfigurationDialog_treeFillingConfigurationDialogName); }
Source:
<code>public static void setup() throws Exception { <START> PhysicalPlans.InstanceInfo info = PhysicalPlans.InstanceInfo.newBuilder() <END> .setTaskId(TASK_ID) .setComponentIndex(COMPONENT_INDEX) .setComponentName(COMPONENT_NAME) .build(); instance = PhysicalPlans.Instance.newBuilder() .setInstanceId(INSTANCE_ID) .setStmgrId(STMGR_ID) .setInfo(info) .build(); instanceStateCheckpoint = CheckpointManager.InstanceStateCheckpoint.newBuilder() .setCheckpointId(CHECKPOINT_ID) .setState(ByteString.copyFrom(BYTES)) .build(); saveInstanceStateRequest = CheckpointManager.SaveInstanceStateRequest.newBuilder() .setInstance(instance) .setCheckpoint(instanceStateCheckpoint) .build(); getInstanceStateRequest = CheckpointManager.GetInstanceStateRequest.newBuilder() .setInstance(instance) .setCheckpointId(CHECKPOINT_ID) .build(); cleanStatefulCheckpointRequest = CheckpointManager.CleanStatefulCheckpointRequest.newBuilder() .setCleanAllCheckpoints(true) .setOldestCheckpointPreserved(CHECKPOINT_ID) .build(); registerStmgrRequest = CheckpointManager.RegisterStMgrRequest.newBuilder() .setTopologyId(TOPOLOGY_ID) .setStmgrId(STMGR_ID) .setTopologyName(TOPOLOGY_NAME) .build(); registerTMasterRequest = CheckpointManager.RegisterTMasterRequest.newBuilder() .setTopologyId(TOPOLOGY_ID) .setTopologyName(TOPOLOGY_NAME) .build(); }</code><technical_language>lots of duplication of boilerplate constants before() logic in of stateful storage tests in CheckpointManagerServerTest. share this code in some test helpers</technical_language>

Target:
public static void setup() throws Exception { final String INSTANCE_ID = "instance_id"; final String STMGR_ID = "stmgr_id"; final int TASK_ID = 1; final int COMPONENT_INDEX = 1; final String COMPONENT_NAME = "component_name"; final byte[] BYTES = "checkpoint manager server test bytes".getBytes(); PhysicalPlans.InstanceInfo info = PhysicalPlans.InstanceInfo.newBuilder() .setTaskId(TASK_ID) .setComponentIndex(COMPONENT_INDEX) .setComponentName(COMPONENT_NAME) .build(); instance = PhysicalPlans.Instance.newBuilder() .setInstanceId(INSTANCE_ID) .setStmgrId(STMGR_ID) .setInfo(info) .build(); instanceStateCheckpoint = CheckpointManager.InstanceStateCheckpoint.newBuilder() .setCheckpointId(CHECKPOINT_ID) .setState(ByteString.copyFrom(BYTES)) .build(); saveInstanceStateRequest = CheckpointManager.SaveInstanceStateRequest.newBuilder() .setInstance(instance) .setCheckpoint(instanceStateCheckpoint) .build(); getInstanceStateRequest = CheckpointManager.GetInstanceStateRequest.newBuilder() .setInstance(instance) .setCheckpointId(CHECKPOINT_ID) .build(); cleanStatefulCheckpointRequest = CheckpointManager.CleanStatefulCheckpointRequest.newBuilder() .setCleanAllCheckpoints(true) .setOldestCheckpointPreserved(CHECKPOINT_ID) .build(); registerStmgrRequest = CheckpointManager.RegisterStMgrRequest.newBuilder() .setTopologyId(TOPOLOGY_ID) .setStmgrId(STMGR_ID) .setTopologyName(TOPOLOGY_NAME) .build(); registerTMasterRequest = CheckpointManager.RegisterTMasterRequest.newBuilder() .setTopologyId(TOPOLOGY_ID) .setTopologyName(TOPOLOGY_NAME) .build(); }
Source:
<code>public void patchOwnMetadataByNonAdminUser() throws Exception { context.turnOffAuthorisationSystem(); EPerson ePerson = EPersonBuilder.createEPerson(context) .withNameInMetadata("John", "Doe") .withEmail("Johndoe@fake-email.com") .withPassword(password) .build(); String newName = "JohnReplace"; context.restoreAuthSystemState(); List<Operation> ops = new ArrayList<Operation>(); ReplaceOperation replaceOperation = new ReplaceOperation("/metadata/eperson.firstname", newName); ops.add(replaceOperation); String patchBody = getPatchContent(ops); String token = getAuthToken(ePerson.getEmail(), password); getClient(token).perform(patch("/api/eperson/epersons/" + ePerson.getID()) .content(patchBody) .contentType(MediaType.APPLICATION_JSON_PATCH_JSON)) .andExpect(status().isOk()) .andExpect(jsonPath("$.metadata", Matchers.allOf( MetadataMatcher.matchMetadata("eperson.firstname", newName)))); <START> } <END></code><technical_language>please additional get check changes persisted</technical_language>

Target:
public void patchOwnMetadataByNonAdminUser() throws Exception { context.turnOffAuthorisationSystem(); EPerson ePerson = EPersonBuilder.createEPerson(context) .withNameInMetadata("John", "Doe") .withEmail("Johndoe@example.com") .withPassword(password) .build(); String newName = "JohnReplace"; context.restoreAuthSystemState(); List<Operation> ops = new ArrayList<Operation>(); ReplaceOperation replaceOperation = new ReplaceOperation("/metadata/eperson.firstname", newName); ops.add(replaceOperation); String patchBody = getPatchContent(ops); String token = getAuthToken(ePerson.getEmail(), password); getClient(token).perform(patch("/api/eperson/epersons/" + ePerson.getID()) .content(patchBody) .contentType(MediaType.APPLICATION_JSON_PATCH_JSON)) .andExpect(status().isOk()) .andExpect(jsonPath("$.metadata", Matchers.allOf( MetadataMatcher.matchMetadata("eperson.firstname", newName)))); getClient(token).perform(get("/api/eperson/epersons/" + ePerson.getID())) .andExpect(status().isOk()) .andExpect(jsonPath("$", hasJsonPath("$.metadata", allOf( matchMetadata("eperson.firstname", newName))))); }
Source:
<code>private CardAuthorisationGatewayRequest buildTestAuthorisation3ds2RequestWithProvidedParameters(GatewayAccountEntity accountEntity) { ChargeEntity chargeEntity = aValidChargeEntity() .withExternalId("mq4ht90j2oir6am585afk58kml") .withGatewayAccountEntity(accountEntity) .build(); AuthCardDetails authCardDetails = buildTestAuthCardDetails(); authCardDetails.setJsScreenColorDepth("15"); authCardDetails.setJsScreenHeight("1500"); <START> authCardDetails.setJsScreenWidth("1500"); <END> authCardDetails.setJsTimezoneOffsetMins("3"); authCardDetails.setJsNavigatorLanguage("cy"); return new CardAuthorisationGatewayRequest(chargeEntity, authCardDetails); }</code><technical_language>Minor, height width different? provides a bit of protection values accidentally transposed</technical_language>

Target:
private CardAuthorisationGatewayRequest buildTestAuthorisation3ds2RequestWithProvidedParameters(GatewayAccountEntity accountEntity) { ChargeEntity chargeEntity = aValidChargeEntity() .withExternalId("mq4ht90j2oir6am585afk58kml") .withGatewayAccountEntity(accountEntity) .build(); AuthCardDetails authCardDetails = buildTestAuthCardDetails(); authCardDetails.setJsScreenColorDepth("15"); authCardDetails.setJsScreenHeight("1500"); authCardDetails.setJsScreenWidth("1000"); authCardDetails.setJsTimezoneOffsetMins("3"); authCardDetails.setJsNavigatorLanguage("cy"); return new CardAuthorisationGatewayRequest(chargeEntity, authCardDetails); }
Source:
<code>public void testWriteDistributedMap() { Map<Integer, String> map = createMapByEntryCount(); <START> mapChannel.send(this.messageBuilderFactory.withPayload(map).build()); <END> verifyDistributedMap(); }</code><technical_language>reason messageBuilderFactory in tests MessageBuilder, if get deal payload. new GenericMessage<>(map) is enough</technical_language>

Target:
public void testWriteDistributedMap() { Map<Integer, String> map = createMapByEntryCount(); mapChannel.send(new GenericMessage<>(map)); verifyDistributedMap(); }
Source:
<code>private Optional<ScmInfo> getScmInfoForComponent(Component component) { ScannerReport.Changesets changesets = scannerReportReader.readChangesets(component.getReportAttributes().getRef()); if (changesets != null) { if (changesets.getChangesetCount() == 0) { return generateAndMergeDb(component, changesets.getCopyFromPrevious()); } return getScmInfoFromReport(component, changesets); } LOGGER.trace("No SCM info for file '{}'", component.getKey()); <START> return generateAndMergeDb(component, false); <END> }</code><technical_language>false ? If scanner send SCM information, DB data reused</technical_language>

Target:
private Optional<ScmInfo> getScmInfoForComponent(Component component) { ScannerReport.Changesets changesets = scannerReportReader.readChangesets(component.getReportAttributes().getRef()); if (changesets == null) { LOGGER.trace("No SCM info for file '{}'", component.getKey()); return generateAndMergeDb(component, false); } if (changesets.getChangesetCount() == 0) { return generateAndMergeDb(component, changesets.getCopyFromPrevious()); } return getScmInfoFromReport(component, changesets); }
Source:
<code>private void runReleaseHooks() { Set<Map.Entry<String, Runnable>> hooks = releaseHooks.entrySet(); if (!hooks.isEmpty()) { for (Map.Entry<String, Runnable> hookEntry : hooks) { try { LOG.debug("Running class loader shutdown hook: {}.", hookEntry.getKey()); hookEntry.getValue().run(); } catch (Throwable t) { <START> LOG.debug("Failed to run release hook '{}' for user code class loader.", hookEntry.getValue(), t); <END> } } releaseHooks.clear(); } }</code><technical_language>do debug is enough report this problem? I warn</technical_language>

Target:
private void runReleaseHooks() { Set<Map.Entry<String, Runnable>> hooks = releaseHooks.entrySet(); if (!hooks.isEmpty()) { for (Map.Entry<String, Runnable> hookEntry : hooks) { try { LOG.debug("Running class loader shutdown hook: {}.", hookEntry.getKey()); hookEntry.getValue().run(); } catch (Throwable t) { LOG.warn("Failed to run release hook '{}' for user code class loader.", hookEntry.getValue(), t); } } releaseHooks.clear(); } }
Source:
<code>public String getDiplayableSystemPosition() { if(null == getParentSystem() || null == sysPos) { return "?"; } <START> Integer pos = 0; <END> for(int i = 1; i <= sysPos; i++) { if(getParentSystem().getPlanet(i).getPlanetType().equals("Asteroid Belt")) { continue; } pos++; } return pos.toString(); }</code><technical_language>suggestion int pos = 0;</technical_language>

Target:
public String getDiplayableSystemPosition() { if(null == getParentSystem() || null == sysPos) { return "?"; } int pos = 0; for(int i = 1; i <= sysPos; i++) { if(getParentSystem().getPlanet(i).getPlanetType().equals("Asteroid Belt")) { continue; } pos++; } return Integer.toString(pos); }
Source:
<code>public void execute(SensorContext context, Map<InputFile, Set<Integer>> linesOfCode) { String baseDir = context.fileSystem().baseDir().getPath(); Settings settings = context.settings(); HashSet<InputFile> filesCovered = new HashSet<>(); List<File> reports = new ArrayList<>(); reports.addAll(getReports(settings, baseDir, REPORT_PATH_KEY, DEFAULT_REPORT_PATH)); reports.addAll(getReports(settings, baseDir, IT_REPORT_PATH_KEY, DEFAULT_REPORT_PATH)); <START> reports.addAll(getReports(settings, baseDir, OVERALL_REPORT_PATH_KEY, DEFAULT_REPORT_PATH)); <END> if (!reports.isEmpty()) { LOG.info("Python test coverage"); for (File report : reports) { Map<InputFile, NewCoverage> coverageMeasures = parseReport(report, context); saveMeasures(coverageMeasures, filesCovered); } } if (settings.getBoolean(FORCE_ZERO_COVERAGE_KEY) || (!settings.hasKey(FORCE_ZERO_COVERAGE_KEY) && !reports.isEmpty())) { LOG.debug("Zeroing coverage information for untouched files"); zeroMeasuresWithoutReports(context, filesCovered, linesOfCode); } }</code><technical_language>Do add DEFAULT_REPORT_PATH 3 times property is set</technical_language>

Target:
public void execute(SensorContext context, Map<InputFile, Set<Integer>> linesOfCode) { String baseDir = context.fileSystem().baseDir().getPath(); Settings settings = context.settings(); HashSet<InputFile> filesCovered = new HashSet<>(); List<File> reports = new ArrayList<>(); reports.addAll(getReports(settings, baseDir, REPORT_PATH_KEY, DEFAULT_REPORT_PATH)); reports.addAll(getReports(settings, baseDir, IT_REPORT_PATH_KEY, IT_DEFAULT_REPORT_PATH)); reports.addAll(getReports(settings, baseDir, OVERALL_REPORT_PATH_KEY, OVERALL_DEFAULT_REPORT_PATH)); if (!reports.isEmpty()) { LOG.info("Python test coverage"); for (File report : reports) { Map<InputFile, NewCoverage> coverageMeasures = parseReport(report, context); saveMeasures(coverageMeasures, filesCovered); } } if (settings.getBoolean(FORCE_ZERO_COVERAGE_KEY)) { LOG.debug("Zeroing coverage information for untouched files"); zeroMeasuresWithoutReports(context, filesCovered, linesOfCode); } }
Source:
<code>public String outString() { <START> return RawParseUtils.decode(out.toByteArray()); <END> }</code><technical_language>This potentially overcomplicated (e.g. fallback latin1). 'new String(out.toByteArray(), UTF_8)'? out.toString(UTF_8.name())</technical_language>

Target:
public String outString() { return new String(out.toByteArray(), UTF_8); }
Source:
<code>public Pair<Case.Alternative,Set<Block>> getAlternative() { Pair<Expression, Set<Block>> pair = result.getLocalExpr(); LetExpression guards = new LetExpression(pair.a, true); Set<Block> surroundingBlocks = pair.b; result.extendExprGraph(guards, this, surroundingBlocks); attachedBlocks.stream().filter(Block::isBottomMost).forEach(block -> { if (block instanceof MatchBlock) { guards.addLetBinding(((MatchBlock)block).getPrimaryBinder(), block.getAllInputs().get(0).getFullExpr()); } <START> else { <END> block.getAllOutputs().forEach(anchor -> { guards.addLetBinding(new ConstructorBinder("True", Collections.EMPTY_LIST), anchor.getVariable()); anchor.extendExprGraph(guards, this, surroundingBlocks); }); } block.extendExprGraph(guards, this, surroundingBlocks); }); return new Pair<>(new Case.Alternative(new ConstructorBinder("()", Collections.EMPTY_LIST), guards), surroundingBlocks); }</code><technical_language>newline else</technical_language>

Target:
public Pair<Case.Alternative,Set<Block>> getAlternative() { Pair<Expression, Set<Block>> pair = result.getLocalExpr(); LetExpression guards = new LetExpression(pair.a, true); Set<Block> surroundingBlocks = pair.b; result.extendExprGraph(guards, Optional.of(this), surroundingBlocks); attachedBlocks.stream().filter(Block::isBottomMost).forEach(block -> { if (block instanceof MatchBlock) { guards.addLetBinding(((MatchBlock)block).getPrimaryBinder(), block.getAllInputs().get(0).getFullExpr()); } else { block.getAllOutputs().forEach(anchor -> { guards.addLetBinding(new ConstructorBinder("True"), anchor.getVariable()); anchor.extendExprGraph(guards, Optional.of(this), surroundingBlocks); }); } block.extendExprGraph(guards, Optional.of(this), surroundingBlocks); }); return new Pair<>(new Case.Alternative(new ConstructorBinder("()"), guards), surroundingBlocks); }
Source:
<code>private ImmutableSet<ExecutableElement> methodsToImplement( TypeElement autoValueClass, Set<ExecutableElement> methods) { ImmutableSet.Builder<ExecutableElement> toImplement = ImmutableSet.builder(); <START> boolean ok = true; <END> for (ExecutableElement method : methods) { if (method.getModifiers().contains(Modifier.ABSTRACT) && objectMethodToOverride(method) == ObjectMethodToOverride.NONE) { if (method.getParameters().isEmpty() && method.getReturnType().getKind() != TypeKind.VOID) { ok &= checkReturnType(autoValueClass, method); toImplement.add(method); } else { errorReporter.reportWarning("@AutoValue classes cannot have abstract methods other than" + " property getters and Builder converters", method); } } } if (!ok) { throw new AbortProcessingException(); } return toImplement.build(); }</code><technical_language>This a merge error. This code deleted</technical_language>

Target:
private ImmutableSet<ExecutableElement> methodsToImplement( TypeElement autoValueClass, Set<ExecutableElement> methods) { ImmutableSet.Builder<ExecutableElement> toImplement = ImmutableSet.builder(); Set<Name> toImplementNames = Sets.newHashSet(); boolean ok = true; for (ExecutableElement method : methods) { if (method.getModifiers().contains(Modifier.ABSTRACT) && objectMethodToOverride(method) == ObjectMethodToOverride.NONE) { if (method.getParameters().isEmpty() && method.getReturnType().getKind() != TypeKind.VOID) { ok &= checkReturnType(autoValueClass, method); if (toImplementNames.add(method.getSimpleName())) { toImplement.add(method); } } else { errorReporter.reportWarning("@AutoValue classes cannot have abstract methods other than" + " property getters and Builder converters", method); } } } if (!ok) { throw new AbortProcessingException(); } return toImplement.build(); }
Source:
<code>public void addEvents(Collection<IEventDeclaration> events) throws CTFReaderException { <START> if (fEvents != Collections.EMPTY_LIST) { <END> for (IEventDeclaration event : events) { if (event != null) { int index = event.getId().intValue(); while (fEvents.size() >= index) { fEvents.add(null); } if (fEvents.get(index) != null) { throw new CTFReaderException("Both lists have an event defined at position " + index); } fEvents.set(index, event); } } } else { fEvents = new ArrayList<>(events); } }</code><technical_language>consider case is a singletonList due unset id</technical_language>

Target:
public void addEvents(Collection<IEventDeclaration> events) throws CTFReaderException { if (fEvents != Collections.EMPTY_LIST) { if (fEventUnsetId) { throw new CTFReaderException("Cannot add to a stream with an unidentified event"); } for (IEventDeclaration event : events) { if (event != null) { int index = event.getId().intValue(); while (fEvents.size() >= index) { fEvents.add(null); } if (fEvents.get(index) != null) { throw new CTFReaderException("Both lists have an event defined at position " + index); } fEvents.set(index, event); } } } else { fEvents = new ArrayList<>(events); } }
Source:
<code>public static List<BasicML> loadBasicModels(ModelConfig modelConfig, EvalConfig evalConfig, SourceType sourceType, boolean gbtConvertToProb, String gbtScoreConvertStrategy) throws IOException { List<BasicML> models = new ArrayList<BasicML>(); FileSystem fs = ShifuFileUtils.getFileSystemBySourceType(sourceType); if(Constants.GENERIC.equals(modelConfig.getAlgorithm())) { List<FileStatus> genericModelConfigs = findGenericModels(modelConfig, evalConfig, sourceType); if(genericModelConfigs.isEmpty()) { <START> throw new RuntimeException("Load generic model failed."); <END> } loadGenericModels(modelConfig, genericModelConfigs, sourceType, models); log.debug("return generic model {}", models.size()); return models; } List<FileStatus> modelFileStats = locateBasicModels(modelConfig, evalConfig, sourceType); if(CollectionUtils.isNotEmpty(modelFileStats)) { for(FileStatus f: modelFileStats) { models.add(loadModel(modelConfig, f.getPath(), fs, gbtConvertToProb, gbtScoreConvertStrategy)); } } return models; }</code><technical_language>throw new RuntimeException("Cannot find generic models, please check if generic config file in " + folder +".");</technical_language>

Target:
public static List<BasicML> loadBasicModels(ModelConfig modelConfig, EvalConfig evalConfig, SourceType sourceType, boolean gbtConvertToProb, String gbtScoreConvertStrategy) throws IOException { List<BasicML> models = new ArrayList<BasicML>(); FileSystem fs = ShifuFileUtils.getFileSystemBySourceType(sourceType); if(Constants.GENERIC.equals(modelConfig.getAlgorithm())) { List<FileStatus> genericModelConfigs = findGenericModels(modelConfig, evalConfig, sourceType); if(genericModelConfigs.isEmpty()) { throw new RuntimeException("Load generic model failed."); } loadGenericModels(modelConfig, genericModelConfigs, sourceType, models); log.debug("return generic model {}", models.size()); return models; } List<FileStatus> modelFileStats = locateBasicModels(modelConfig, evalConfig, sourceType); if(CollectionUtils.isNotEmpty(modelFileStats)) { for(FileStatus fst: modelFileStats) { models.add(loadModel(modelConfig, fst.getPath(), fs, gbtConvertToProb, gbtScoreConvertStrategy)); } } return models; }
Source:
<code>public void testNormalCdf() throws Exception { <START> assertFunction("normal_cdf(0, 1, 1.96)", DOUBLE, 0.9750021048517796); <END> assertFunction("normal_cdf(10, 9, 10)", DOUBLE, 0.5); assertFunction("normal_cdf(-1.5, 2.1, -7.8)", DOUBLE, 0.0013498980316301035); assertInvalidFunction("normal_cdf(4, 0, 0.4)", "sd must > 0"); }</code><technical_language>(most?) Presto functions fail nan input, instead return a nan value. return depends function though. In general case arbitrary function return a non-nan for a nan input (e.g., java.lang.Double::doubleToLongBits())</technical_language>

Target:
public void testNormalCdf() throws Exception { assertFunction("normal_cdf(0, 1, 1.96)", DOUBLE, 0.9750021048517796); assertFunction("normal_cdf(10, 9, 10)", DOUBLE, 0.5); assertFunction("normal_cdf(-1.5, 2.1, -7.8)", DOUBLE, 0.0013498980316301035); assertFunction("normal_cdf(0, 1, infinity())", DOUBLE, 1.0); assertFunction("normal_cdf(0, 1, -infinity())", DOUBLE, 0.0); assertFunction("normal_cdf(infinity(), 1, 0)", DOUBLE, 0.0); assertFunction("normal_cdf(-infinity(), 1, 0)", DOUBLE, 1.0); assertFunction("normal_cdf(0, infinity(), 0)", DOUBLE, 0.5); assertFunction("normal_cdf(nan(), 1, 0)", DOUBLE, Double.NaN); assertFunction("normal_cdf(0, 1, nan())", DOUBLE, Double.NaN); assertInvalidFunction("normal_cdf(0, 0, 0.1985)", "sd must > 0"); assertInvalidFunction("normal_cdf(0, nan(), 0.1985)", "sd must > 0"); }
Source:
<code><START> protected static synchronized List<IWorkspaceClassifierResolver> readExtensions() { <END> List<IWorkspaceClassifierResolver> resolvers = new ArrayList<>(); IExtensionRegistry registry = Platform.getExtensionRegistry(); IExtensionPoint ccpExtensionPoint = registry.getExtensionPoint(EXTENSION_WORKSPACE_CLASSIFIER_RESOLVERS); if(ccpExtensionPoint != null) { IExtension[] ccpExtensions = ccpExtensionPoint.getExtensions(); for(IExtension extension : ccpExtensions) { for(IConfigurationElement element : extension.getConfigurationElements()) { try { resolvers.add((IWorkspaceClassifierResolver) element.createExecutableExtension("class")); } catch(CoreException ex) { log.debug("Cannot instantiate IWorkspaceClassifierResolver", ex); } } } } resolvers.sort((l, r) -> l.getPriority() - r.getPriority()); return resolvers; }</code><technical_language>this need synchronized, access shared state managed this class</technical_language>

Target:
protected static List<IWorkspaceClassifierResolver> readExtensions() { List<IWorkspaceClassifierResolver> resolvers = new ArrayList<>(); IExtensionRegistry registry = Platform.getExtensionRegistry(); IExtensionPoint ccpExtensionPoint = registry.getExtensionPoint(EXTENSION_WORKSPACE_CLASSIFIER_RESOLVERS); if(ccpExtensionPoint != null) { IExtension[] ccpExtensions = ccpExtensionPoint.getExtensions(); for(IExtension extension : ccpExtensions) { for(IConfigurationElement element : extension.getConfigurationElements()) { try { resolvers.add((IWorkspaceClassifierResolver) element.createExecutableExtension("class")); } catch(CoreException ex) { log.error("Cannot instantiate IWorkspaceClassifierResolver", ex); } } } } resolvers.sort((l, r) -> l.getPriority() - r.getPriority()); return resolvers; }
Source:
<code>public Workbook strictParseWorkbook(final File file, final String programUUID) throws WorkbookParserException { final WorkbookParser parser = new WorkbookParser(this.maxRowLimit); final OntologyDataManagerImpl ontology = new OntologyDataManagerImpl(this.getSessionProvider()); <START> final GermplasmDataManager germplasmDataManager = new GermplasmDataManagerImpl(this.getSessionProvider()); <END> return this.strictParseWorkbook(file, parser, parser.parseFile(file, true), ontology, germplasmDataManager, programUUID); }</code><technical_language>Boy Scout Cleanup: final OntologyDataManagerImpl ontology = new OntologyDataManagerImpl(this.getSessionProvider()); final GermplasmDataManager germplasmDataManager = new GermplasmDataManagerImpl(this.getSessionProvider()); Instead of manual local creation of service dependencies this, follow standard pattern of OntologyDataManager GermplasmDataManager interface typed class member variables inject services spring auto wiring</technical_language>

Target:
public Workbook strictParseWorkbook(final File file, final String programUUID) throws WorkbookParserException { final WorkbookParser parser = new WorkbookParser(this.maxRowLimit); return this.strictParseWorkbook(file, parser, parser.parseFile(file, true), programUUID); }
Source:
<code>public SecurityHjsonIntegrationTestResourceConfig() { register(new AbstractBinder() { @Override protected void configure() { EntityDictionary dictionary = new EntityDictionary(TestCheckMappings.MAPPINGS); try { dictionary.addSecurityChecks(COMPILER.findAnnotatedClasses(SecurityCheck.class)); <START> dictionary.addSecurityChecks(Collections.singleton(OperatorCheck.class)); <END> } catch (ClassNotFoundException e) { } Elide elide = new Elide(new ElideSettingsBuilder(getDataStore()) .withEntityDictionary(dictionary) .withAuditLogger(new TestAuditLogger()) .withISO8601Dates("yyyy-MM-dd'T'HH:mm'Z'", Calendar.getInstance().getTimeZone()) .build()); bind(elide).to(Elide.class).named("elide"); } }); register(new ContainerRequestFilter() { @Override public void filter(final ContainerRequestContext requestContext) throws IOException { requestContext.setSecurityContext(securityContextMock); } }); }</code><technical_language>this automatically scanned discovered? Do need add here</technical_language>

Target:
public SecurityHjsonIntegrationTestResourceConfig() { register(new AbstractBinder() { @Override protected void configure() { Map<String, Class<? extends Check>> map = new HashMap<>(TestCheckMappings.MAPPINGS); map.put(OperatorCheck.OPERTOR_CHECK, OperatorCheck.class); EntityDictionary dictionary = new EntityDictionary(map); try { dictionary.addSecurityChecks(COMPILER.findAnnotatedClasses(SecurityCheck.class)); } catch (ClassNotFoundException e) { } Elide elide = new Elide(new ElideSettingsBuilder(getDataStore()) .withEntityDictionary(dictionary) .withAuditLogger(new TestAuditLogger()) .withISO8601Dates("yyyy-MM-dd'T'HH:mm'Z'", Calendar.getInstance().getTimeZone()) .build()); bind(elide).to(Elide.class).named("elide"); } }); register(new ContainerRequestFilter() { @Override public void filter(final ContainerRequestContext requestContext) throws IOException { requestContext.setSecurityContext(securityContextMock); } }); }
Source:
<code>public int getPartition(BytesWritable bytesWritable, Text text, int numPartitions) { final ByteBuffer bytes = ByteBuffer.wrap(bytesWritable.getBytes()); bytes.position(4); int shardNum = bytes.getInt(); <START> return shardNum % numPartitions; <END> }</code><technical_language>This throw exception in remote mode (mapred.job.tracker != "local")</technical_language>

Target:
public int getPartition(BytesWritable bytesWritable, Text text, int numPartitions) { final ByteBuffer bytes = ByteBuffer.wrap(bytesWritable.getBytes()); bytes.position(4); int shardNum = bytes.getInt(); if (config.get("mapred.job.tracker").equals("local")) { return shardNum % numPartitions; } else { if (shardNum >= numPartitions) { throw new ISE("Not enough partitions, shard[%,d] >= numPartitions[%,d]", shardNum, numPartitions); } return shardNum; } }
Source:
<code>public void updateTimerLongerDelayTest() { CountDownProcessEventListener countDownListener = new CountDownProcessEventListener(TIMER_NAME, 1); setProcessScenario(TIMER_FILE); kieSession.addEventListener(countDownListener); final List<Long> list = new ArrayList<Long>(); kieSession.addEventListener(new DefaultProcessEventListener() { @Override public void beforeProcessStarted(ProcessStartedEvent event) { list.add(event.getProcessInstance().getId()); } }); <START> assertEquals(0, list.size()); <END> long id = kieSession.startProcess(PROCESS_NAME).getId(); long startTime = System.currentTimeMillis(); assertEquals(1, list.size()); kieSession.execute(new UpdateTimerCommand(id, TIMER_NAME, 8)); countDownListener.waitTillCompleted(); assertTrue("The timer has not fired!", timerHasFired()); long firedTime = timerFiredTime(); long timeDifference = Math.abs(firedTime - startTime - 8000); logger.info("Start time: " + startTime + ", fired time: " + firedTime + ", difference: " + (firedTime-startTime)); assertTrue("Timer is fired in wrong time", timeDifference < 500); assertNull("Process is not ended.", kieSession.getProcessInstance(id)); }</code><technical_language>I project AssertJ in places. others mind, this Assertions.assertThat(list).isEmpty(). clearer in code, a descriptive error message fails. @mswiderski Do agree? (Similarly other assertion.)</technical_language>

Target:
public void updateTimerLongerDelayTest() { CountDownProcessEventListener countDownListener = new CountDownProcessEventListener(TIMER_NAME, 1); setProcessScenario(TIMER_FILE); kieSession.addEventListener(countDownListener); final List<Long> list = new ArrayList<Long>(); kieSession.addEventListener(new DefaultProcessEventListener() { @Override public void beforeProcessStarted(ProcessStartedEvent event) { list.add(event.getProcessInstance().getId()); } }); Assertions.assertThat(list).isEmpty(); long id = kieSession.startProcess(PROCESS_NAME).getId(); long startTime = System.currentTimeMillis(); Assertions.assertThat(list).isNotEmpty(); kieSession.execute(new UpdateTimerCommand(id, TIMER_NAME, 8)); countDownListener.waitTillCompleted(); Assertions.assertThat(timerHasFired()).isTrue(); long firedTime = timerFiredTime(); long timeDifference = Math.abs(firedTime - startTime - 8000); logger.info("Start time: " + startTime + ", fired time: " + firedTime + ", difference: " + (firedTime-startTime)); Assertions.assertThat(timeDifference).isLessThan(500); Assertions.assertThat(kieSession.getProcessInstance(id)).isNull(); }
Source:
<code>public VdsStatic(String hostName, String uniqueId, int port, int sshPort, String sshUsername, Guid clusterId, Guid vdsId, String vdsName, boolean serverSslEnabled, VDSType vdsType, Guid hostProviderId) { this(); this.hostName = hostName; this.uniqueId = uniqueId; this.port = port; if (sshPort > 0) { this.sshPort = sshPort; } if (sshUsername != null) { this.sshUsername = sshUsername; } this.clusterId = clusterId; this.id = vdsId; this.name = vdsName; this.serverSslEnabled = serverSslEnabled; this.setVdsType(vdsType); this.hostProviderId = hostProviderId; comment = ""; <START> this.vgpuPlacement = VgpuPlacementEnum.COMPACT.getValue(); <END> }</code><technical_language>redundant of call empty constructor #192</technical_language>

Target:
public VdsStatic(String hostName, String uniqueId, int port, int sshPort, String sshUsername, Guid clusterId, Guid vdsId, String vdsName, boolean serverSslEnabled, VDSType vdsType, Guid hostProviderId) { this(); this.hostName = hostName; this.uniqueId = uniqueId; this.port = port; if (sshPort > 0) { this.sshPort = sshPort; } if (sshUsername != null) { this.sshUsername = sshUsername; } this.clusterId = clusterId; this.id = vdsId; this.name = vdsName; this.serverSslEnabled = serverSslEnabled; this.setVdsType(vdsType); this.hostProviderId = hostProviderId; comment = ""; }
Source:
<code>public void run() { while (!stopThread) { try { synchronized(close) { connect(); try { close.wait(); } catch (InterruptedException ie) { <START> stopThread = true; <END> disconnect(); } } } catch (Exception e1) { try { listener.onConnectException(e1); } catch (Exception e2) { break; } if (!stopThread && reconnect) { try { Thread.sleep(reconnectInterval); } catch (InterruptedException ie) { stopThread = true; } } } } }</code><technical_language>stopThread is for other threads communicate in, this change it. Move call disconnect stopThread loop, cleanup thread is exiting. Move InterruptedException catch outer try, done other skip call onConnectException reconnect sleep</technical_language>

Target:
public void run() { while (!stopThread) { try { synchronized(close) { connect(); try { close.wait(); } catch (InterruptedException ie) { throw ie; } } } catch (InterruptedException ie) { } catch (Exception e1) { try { listener.onConnectException(e1); } catch (Exception e2) { break; } if (!stopThread && reconnect) { try { Thread.sleep(reconnectInterval); } catch (InterruptedException ie) { } } } } try { disconnect(); } catch (Exception e) { } }
Source:
<code>public void validateFullRepresentation() throws Exception { super.validateDefaultRepresentation(); assertPropPresent("uuid"); assertPropPresent("diagnosis"); assertPropPresent("patient"); <START> assertPropPresent("condition"); <END> assertPropPresent("certainty"); assertPropPresent("rank"); assertPropPresent("voided"); assertPropPresent("auditInfo"); assertPropPresent("display"); }</code><technical_language>instead assertPropEquals for returns true in ObsResource1_9Test</technical_language>

Target:
public void validateFullRepresentation() throws Exception { super.validateDefaultRepresentation(); assertPropPresent("uuid"); assertPropEquals("diagnosis", getObject().getDiagnosis()); assertPropPresent("patient"); assertPropPresent("condition"); assertPropEquals("certainty", getObject().getCertainty()); assertPropEquals("rank", getObject().getRank()); assertPropEquals("voided", getObject().getVoided()); assertPropPresent("auditInfo"); assertPropPresent("display"); }
Source:
<code>public static AlarmStatus isValidAlarms(final List<Alarm> alarms, final DateTime now, final DateTimeZone timeZone){ final Set<Integer> alarmDays = new HashSet<Integer>(); for(final Alarm alarm: alarms){ if(!alarm.isEnabled) { return AlarmStatus.OK; } if(!alarm.isRepeated){ if (!isValidNoneRepeatedAlarm(alarm)) { return AlarmStatus.NOT_VALID_NON_REPEATED_ALARM; } if(alarm.isSmart){ final DateTime expectedRingTime = new DateTime(alarm.year, alarm.month, alarm.day, alarm.hourOfDay, alarm.minuteOfHour, timeZone); if(alarmDays.contains(expectedRingTime.getDayOfWeek())){ <START> return AlarmStatus.SMART_ALARM_ALREADY_SET; <END> } alarmDays.add(expectedRingTime.getDayOfWeek()); } }else{ if(!alarm.isSmart) { continue; } for (final Integer dayOfWeek : alarm.dayOfWeek) { if (alarmDays.contains(dayOfWeek)) { return AlarmStatus.DUPLICATE_DAYS; } alarmDays.add(dayOfWeek); } } } return AlarmStatus.OK; }</code><technical_language>This is checkout for smart alarm perday, DUPLICATE_DAYS</technical_language>

Target:
public static AlarmStatus isValidAlarms(final List<Alarm> alarms, final DateTime now, final DateTimeZone timeZone){ final Set<Integer> alarmDays = new HashSet<Integer>(); for(final Alarm alarm: alarms){ if(!alarm.isEnabled) { return AlarmStatus.OK; } if(!alarm.isRepeated){ if (!isValidNoneRepeatedAlarm(alarm)) { return AlarmStatus.NOT_VALID_NON_REPEATED_ALARM; } if(alarm.isSmart){ final DateTime expectedRingTime = new DateTime(alarm.year, alarm.month, alarm.day, alarm.hourOfDay, alarm.minuteOfHour, timeZone); if(alarmDays.contains(expectedRingTime.getDayOfWeek())){ return AlarmStatus.SMART_ALARM_ALREADY_SET; } alarmDays.add(expectedRingTime.getDayOfWeek()); } }else{ if(!alarm.isSmart) { continue; } for (final Integer dayOfWeek : alarm.dayOfWeek) { if (alarmDays.contains(dayOfWeek)) { return AlarmStatus.SMART_ALARM_ALREADY_SET; } alarmDays.add(dayOfWeek); } } } return AlarmStatus.OK; }
Source:
<code>public boolean preservesOrdering() { <START> return false; <END> }</code><technical_language>this true index == 0 allow optimizations for this case</technical_language>

Target:
public boolean preservesOrdering() { return index == 0 ? true : false; }
Source:
<code>public static VClass getLangAwardRangeVClass(VitroRequest vreq) { WebappDaoFactory ctxDaoFact = ModelAccess.on(vreq).getWebappDaoFactory(LanguageOption.LANGUAGE_AWARE); <START> return ctxDaoFact.getVClassDao().getVClassByURI(getRangeUri(vreq)); <END> }</code><technical_language>variable name here, ctxDaoFact, is a misleading... a minor point</technical_language>

Target:
public static VClass getLangAwardRangeVClass(VitroRequest vreq) { WebappDaoFactory vreqDaoFact = ModelAccess.on(vreq).getWebappDaoFactory( LanguageOption.LANGUAGE_AWARE); return vreqDaoFact.getVClassDao().getVClassByURI(getRangeUri(vreq)); }
Source:
<code>public long freeMemory(long windowId) throws IOException { long memoryFreed = 0; Iterator<Map.Entry<Long, Map<Slice, BucketedValue>>> entryIter = committedData.entrySet().iterator(); while (entryIter.hasNext()) { Map.Entry<Long, Map<Slice, BucketedValue>> bucketEntry = entryIter.next(); if (bucketEntry.getKey() > windowId) { break; } Map<Slice, BucketedValue> windowData = bucketEntry.getValue(); entryIter.remove(); for (Map.Entry<Slice, BucketedValue> entry : windowData.entrySet()) { memoryFreed += entry.getKey().length + entry.getValue().getSize(); } } fileCache.clear(); if (cachedBucketMetas != null) { for (BucketsFileSystem.TimeBucketMeta tbm : cachedBucketMetas.values()) { FileAccess.FileReader reader = readers.remove(tbm.getTimeBucketId()); if (reader != null) { memoryFreed += tbm.getSizeInBytes(); reader.close(); } } <START> cachedBucketMetas.clear(); <END> } cachedBucketMetas = null; sizeInBytes.getAndAdd(-memoryFreed); windowsForFreeMemory.add(windowId); return memoryFreed; }</code><technical_language>changes cache</technical_language>

Target:
public long freeMemory(long windowId) throws IOException { long memoryFreed = 0; Iterator<Map.Entry<Long, Map<Slice, BucketedValue>>> entryIter = committedData.entrySet().iterator(); while (entryIter.hasNext()) { Map.Entry<Long, Map<Slice, BucketedValue>> bucketEntry = entryIter.next(); if (bucketEntry.getKey() > windowId) { break; } Map<Slice, BucketedValue> windowData = bucketEntry.getValue(); entryIter.remove(); for (Map.Entry<Slice, BucketedValue> entry : windowData.entrySet()) { memoryFreed += entry.getKey().length + entry.getValue().getSize(); } } fileCache.clear(); if (cachedBucketMetas != null) { for (BucketsFileSystem.TimeBucketMeta tbm : cachedBucketMetas.values()) { FileAccess.FileReader reader = readers.remove(tbm.getTimeBucketId()); if (reader != null) { memoryFreed += tbm.getSizeInBytes(); reader.close(); } } } sizeInBytes.getAndAdd(-memoryFreed); windowsForFreeMemory.add(windowId); return memoryFreed; }
Source:
<code>private com.alliander.osgp.dto.valueobjects.smartmetering.DayProfile processDayProfile(final DayProfile dp) { final com.alliander.osgp.dto.valueobjects.smartmetering.DayProfile dpDto = new com.alliander.osgp.dto.valueobjects.smartmetering.DayProfile(); <START> if (dp.getDayId() != null) { <END> dpDto.setDayId(dp.getDayId().intValue()); } dpDto.setDayProfileActionCollection(this.processDayProfileAction(dp.getDayProfileActionCollection())); return dpDto; }</code><technical_language>'dto is immutable</technical_language>

Target:
private com.alliander.osgp.dto.valueobjects.smartmetering.DayProfile processDayProfile(final DayProfile dp) { return new com.alliander.osgp.dto.valueobjects.smartmetering.DayProfile(dp.getDayId(), this.processDayProfileAction(dp.getDayProfileActionList())); }
Source:
<code>public void shouldConcatenateTwoListsWithSameElements() { final List<Integer> list1 = Collections.unmodifiableList( IntStream.range(0, 4).boxed().collect(Collectors.toList()) ); final List<Integer> list2 = Collections.unmodifiableList( IntStream.range(1, 6).boxed().collect(Collectors.toList()) ); final List<Integer> sortedCancatenatedList = Stream.concat(list1.stream(), list2.stream()) .collect(Collectors.toList()); Collections.sort(sortedCancatenatedList); <START> final List<Integer> expected = Collections.unmodifiableList( <END> sortedCancatenatedList); final List<Integer> actual = ListOps.concat(list1, list2); Collections.sort(actual); assertNotNull(actual); assertFalse(actual.isEmpty()); assertEquals(expected, actual); }</code><technical_language>significantly increase readability of a test expectation is close "literal" possible. Otherwise, reader apply operations in head visualize result. For example: java final List<Integer> expected = Collections.unmodifiableList( IntStream.range(0, 4, 1, 6).boxed().collect(Collectors.toList()) ); another example of this in reduceShouldConcatenateTwoNonEmptyLists(),</technical_language>

Target:
public void shouldConcatenateTwoListsWithSameElements() { final List<Integer> list1 = Collections.unmodifiableList( Arrays.asList(0, 1, 2, 3, 4) ); final List<Integer> list2 = Collections.unmodifiableList( Arrays.asList(1, 2, 3, 4, 5, 6) ); final List<Integer> expected = Arrays.asList(0, 1, 2, 3, 4, 1, 2, 3, 4, 5, 6); final List<Integer> actual = ListOps.concat(list1, list2); assertNotNull(actual); assertFalse(actual.isEmpty()); assertEquals(expected, actual); }
Source:
<code>private Prepared parseWith() { List<TableView> viewsCreated = new ArrayList<>(); readIf("RECURSIVE"); boolean isPersistent = readIf("PERSISTENT"); if(session.isParsingView()){ isPersistent = true; } do { viewsCreated.add(parseSingleCommonTableExpression(isPersistent)); } while (readIf(",")); Prepared p = null; if(isToken("SELECT")) { Query query = parseSelectUnion(); query.setPrepareAlways(true); query.setNeverLazy(true); p = query; } else if(readIf("INSERT")) { p = parseInsert(); p.setPrepareAlways(true); } else if(readIf("UPDATE")) { p = parseUpdate(); p.setPrepareAlways(true); } else if(readIf("MERGE")) { p = parseMerge(); p.setPrepareAlways(true); } else if(readIf("DELETE")) { p = parseDelete(); p.setPrepareAlways(true); } else if(readIf("CREATE")) { if (!isToken("TABLE")){ throw DbException.get(ErrorCode.SYNTAX_ERROR_1, WITH_STATEMENT_SUPPORTS_LIMITED_STATEMENTS); } p = parseCreate(); p.setPrepareAlways(true); } else { throw DbException.get(ErrorCode.SYNTAX_ERROR_1, WITH_STATEMENT_SUPPORTS_LIMITED_STATEMENTS); } if(!isPersistent){ Collections.reverse(viewsCreated); p.setCteCleanups(viewsCreated); <START> } <END> return p; }</code><technical_language>if views inter-dependent need a loop clean (which do in a couple of other places)</technical_language>

Target:
private Prepared parseWith() { List<TableView> viewsCreated = new ArrayList<>(); readIf("RECURSIVE"); boolean isPersistent = readIf("PERSISTENT"); if (session.isParsingCreateView()) { isPersistent = true; } do { viewsCreated.add(parseSingleCommonTableExpression(isPersistent)); } while (readIf(",")); Prepared p = null; Collections.reverse(viewsCreated); if (isToken("SELECT")) { Query query = parseSelectUnion(); query.setPrepareAlways(true); query.setNeverLazy(true); p = query; } else if (readIf("INSERT")) { p = parseInsert(); p.setPrepareAlways(true); } else if (readIf("UPDATE")) { p = parseUpdate(); p.setPrepareAlways(true); } else if (readIf("MERGE")) { p = parseMerge(); p.setPrepareAlways(true); } else if (readIf("DELETE")) { p = parseDelete(); p.setPrepareAlways(true); } else if (readIf("CREATE")) { if (!isToken("TABLE")) { throw DbException.get(ErrorCode.SYNTAX_ERROR_1, WITH_STATEMENT_SUPPORTS_LIMITED_SUB_STATEMENTS); } p = parseCreate(); p.setPrepareAlways(true); } else { throw DbException.get(ErrorCode.SYNTAX_ERROR_1, WITH_STATEMENT_SUPPORTS_LIMITED_SUB_STATEMENTS); } if (!isPersistent) { p.setCteCleanups(viewsCreated); } return p; }
Source:
<code>public ContentEvent nextEvent() { <START> return this.deserializer.deserialize(buffer.remove(buffer.size() - 1)); <END> }</code><technical_language>this reverse order of messages</technical_language>

Target:
public ContentEvent nextEvent() { return this.deserializer.deserialize(buffer.remove(0)); }