auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public List<PartitionId> getAllPartitionIds(String partitionClass) { List<PartitionId> staticPartitionIds = staticClusterManager.getAllPartitionIds(partitionClass); return staticPartitionIds; <START> } <END></code><technical_language>combine lines</technical_language>

Target:
public List<PartitionId> getAllPartitionIds(String partitionClass) { return staticClusterManager.getAllPartitionIds(partitionClass); }
Source:
<code>public Generate(Supplier<Integer> interval) { this.interval = interval; <START> Simulator.pushEvent(new GenerateEvent(0)); <END> }</code><technical_language>java new GenerateEvent(interval)</technical_language>

Target:
public Generate(Supplier<Integer> interval) { this.interval = interval; Simulator.pushEvent(new GenerateEvent(interval.get())); }
Source:
<code>public String toString() { StringBuilder sb=new StringBuilder(); <START> Iterator<Map.Entry<String, String>> iterator = iterator(); <END> while(iterator.hasNext()) { Map.Entry<String, String> entry=iterator.next(); sb.append(entry.getKey()); sb.append(": "); sb.append(entry.getValue()); sb.append("\n"); } return sb.toString(); }</code><technical_language>able do a for() loop class implements Iterable, no</technical_language>

Target:
public String toString() { StringBuilder sb = new StringBuilder(); for (Map.Entry<String, String> entry: this) { sb.append(entry.getKey()); sb.append(": "); sb.append(entry.getValue()); sb.append("\n"); } return sb.toString(); }
Source:
<code>private void inspectGetCommand() { File configInfoDir = new VoltFile(m_voltdbRoot, Constants.CONFIG_DIR); switch (m_getOption) { case DEPLOYMENT: { File depFH = new VoltFile(configInfoDir, "deployment.xml"); if (!depFH.exists()) { System.out.println("FATAL: Deployment file \"" + depFH.getAbsolutePath() + "\" not found."); exit(-1); } m_pathToDeployment = depFH.getAbsolutePath(); return; } <START> case SCHEMA: <END> case CLASSES: { File catalogFH = new VoltFile(configInfoDir, "catalog.jar"); if (!catalogFH.exists()) { System.out.println("FATAL: Catalog jar file \"" + catalogFH.getAbsolutePath() + "\" not found. " + "Please make sure the database path points to an initialized database"); exit(-1); } m_pathToCatalog = catalogFH.getAbsolutePath(); return; } } }</code><technical_language>schema classes same</technical_language>

Target:
private void inspectGetCommand() { String parentPath = "."; if (!m_voltdbRoot.exists()) { try { parentPath = m_voltdbRoot.getCanonicalFile().getParent(); } catch (IOException io) System.err.println("FATAL: " + parentPath + " does not contain a " + "valid database root directory. Use the --dir option to specify the path to the root."); referToDocAndExit(); } File configInfoDir = new VoltFile(m_voltdbRoot, Constants.CONFIG_DIR); switch (m_getOption) { case DEPLOYMENT: { File depFH = new VoltFile(configInfoDir, "deployment.xml"); if (!depFH.exists()) { System.out.println("FATAL: Deployment file \"" + depFH.getAbsolutePath() + "\" not found."); referToDocAndExit(); } m_pathToDeployment = depFH.getAbsolutePath(); return; } case SCHEMA: { File catalogFH = new VoltFile(configInfoDir, "catalog.jar"); if (!catalogFH.exists()) { try { parentPath = m_voltdbRoot.getCanonicalFile().getParent(); } catch (IOException io) System.out.println("FATAL: Schema not found in the provided database directory " + parentPath + ". Make sure the database has been started "); referToDocAndExit(); } m_pathToCatalog = catalogFH.getAbsolutePath(); return; } } }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.sf__inspector); <START> smartStore = SalesforceSDKManagerWithSmartStore.getInstance() <END> .getSmartStore(); queryText = (MultiAutoCompleteTextView) findViewById(R.id.sf__inspector_query_text); pageSizeText = (EditText) findViewById(R.id.sf__inspector_pagesize_text); pageIndexText = (EditText) findViewById(R.id.sf__inspector_pageindex_text); resultGrid = (GridView) findViewById(R.id.sf__inspector_result_grid); setupAutocomplete(queryText); }</code><technical_language>want move this call onResume(). reason is that, fast user switching, if account switch occurs, this activity, stuck a handle SmartStore (the variable smartStore updated)</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.sf__inspector); queryText = (MultiAutoCompleteTextView) findViewById(R.id.sf__inspector_query_text); pageSizeText = (EditText) findViewById(R.id.sf__inspector_pagesize_text); pageIndexText = (EditText) findViewById(R.id.sf__inspector_pageindex_text); resultGrid = (GridView) findViewById(R.id.sf__inspector_result_grid); }
Source:
<code><S> CompletionStage<List<S>> run(final SphereClient client, final Function<T, S> resultsMapper) { <START> return queryPage(client, 0).thenApply(result -> { <END> final Stream<S> firstStream = result.getResults().stream().map(resultsMapper); Stream<S> nextStream = queryNextPages(client, result.getTotal(), resultsMapper) .flatMap(stage -> stage.toCompletableFuture().join()); return concat(firstStream, nextStream) .collect(toList()); }); }</code><technical_language>I personally extract this lambda a separate method a method handle instead of lambda. a matter of taste code is</technical_language>

Target:
<S> CompletionStage<List<S>> run(final SphereClient client, final Function<T, S> resultsMapper) { return queryPage(client, 0) .thenApply(result -> concatPagedResultToList(result, client, resultsMapper)); }
Source:
<code>private boolean isWritesetWritable(DistributionSchedule.WriteSet writeSet, long key, int allowedNonWritableCount) { if (allowedNonWritableCount < 0) { allowedNonWritableCount = 0; } final int sz = writeSet.size(); final int requiredWritable = sz - allowedNonWritableCount; int nonWritableCount = 0; for (int i = 0; i < sz; i++) { <START> if (!bk.getBookieClient().isWritable(getCurrentEnsemble().get(i), key)) { <END> nonWritableCount++; if (nonWritableCount >= allowedNonWritableCount) { return false; } } else { final int knownWritable = i - nonWritableCount; if (knownWritable >= requiredWritable) { return true; } } } return true; }</code><technical_language>Sample currentEnsemble starting loop</technical_language>

Target:
private boolean isWritesetWritable(DistributionSchedule.WriteSet writeSet, long key, int allowedNonWritableCount) { if (allowedNonWritableCount < 0) { allowedNonWritableCount = 0; } final int sz = writeSet.size(); final int requiredWritable = sz - allowedNonWritableCount; int nonWritableCount = 0; List<BookieSocketAddress> currentEnsemble = getCurrentEnsemble(); for (int i = 0; i < sz; i++) { if (!clientCtx.getBookieClient().isWritable(currentEnsemble.get(i), key)) { nonWritableCount++; if (nonWritableCount >= allowedNonWritableCount) { return false; } } else { final int knownWritable = i - nonWritableCount; if (knownWritable >= requiredWritable) { return true; } } } return true; }
Source:
<code>public void synchronizeKeyToPassive(PassiveSynchronizationChannel<EhcacheEntityMessage> syncChannel, int concurrencyKey) { LOGGER.info("Sync started for concurrency key {}.", concurrencyKey); if (concurrencyKey == DEFAULT_KEY) { stateService.getStateRepositoryManager().syncMessageFor(storeIdentifier).forEach(syncChannel::synchronizeToPassive); } else { BlockingQueue<EhcacheDataSyncMessage> messageQ = new SynchronousQueue<>(); int segmentId = concurrencyKey - DEFAULT_KEY - 1; CompletableFuture<Void> asyncGet = CompletableFuture.runAsync(() -> doGetsForSync(segmentId, messageQ)); try { boolean done = false; while (!done) { EhcacheDataSyncMessage msg = messageQ.take(); if (msg instanceof LastDataSyncMessage) { <START> done = true; <END> } else { syncChannel.synchronizeToPassive(msg); } } asyncGet.get(); } catch (InterruptedException | ExecutionException e) { throw new RuntimeException(e); } } sendMessageTrackerReplication(syncChannel, concurrencyKey - 1); LOGGER.info("Sync complete for concurrency key {}.", concurrencyKey); }</code><technical_language>real need for flag. break enough</technical_language>

Target:
public void synchronizeKeyToPassive(PassiveSynchronizationChannel<EhcacheEntityMessage> syncChannel, int concurrencyKey) { LOGGER.info("Sync started for concurrency key {}.", concurrencyKey); if (concurrencyKey == DEFAULT_KEY) { stateService.getStateRepositoryManager().syncMessageFor(storeIdentifier).forEach(syncChannel::synchronizeToPassive); } else { boolean interrupted = false; BlockingQueue<DataSyncMessageHandler> messageQ = new SynchronousQueue<>(); int segmentId = concurrencyKey - DEFAULT_KEY - 1; Thread thisThread = Thread.currentThread(); CompletableFuture<Void> asyncGet = CompletableFuture.runAsync( () -> doGetsForSync(segmentId, messageQ, syncChannel, thisThread), SYNC_GETS_EXECUTOR); try { try { while (messageQ.take().execute()) ; } catch (InterruptedException e) { interrupted = true; } if (interrupted) { asyncGet.get(10, TimeUnit.SECONDS); throw new InterruptedException(); } else { asyncGet.get(); } } catch (InterruptedException | ExecutionException | TimeoutException e) { throw new RuntimeException(e); } } sendMessageTrackerReplication(syncChannel, concurrencyKey - 1); LOGGER.info("Sync complete for concurrency key {}.", concurrencyKey); }
Source:
<code>public void sync() throws IOException { if (transactionEntries.size() > 0) { String key = TxConstants.TransactionLog.NUM_ENTRIES_APPENDED; <START> internalWriter.appendRaw(key.getBytes(), 0, key.getBytes().length, new SequenceFile.ValueBytes() { <END> @Override public void writeUncompressedBytes(DataOutputStream outStream) throws IOException { outStream.write(toBytes(transactionEntries.size())); outStream.flush(); } @Override public void writeCompressedBytes(DataOutputStream outStream) throws IllegalArgumentException, IOException { throw new IllegalArgumentException("UncompressedBytes cannot be compressed!"); } @Override public int getSize() { return Integer.SIZE / Byte.SIZE; } }); } for (Entry entry : transactionEntries) { internalWriter.append(entry.getKey(), entry.getEdit()); } transactionEntries.clear(); internalWriter.syncFs(); }</code><technical_language>a good idea move anonymous class a separate nested class. readability</technical_language>

Target:
public void sync() throws IOException { internalWriter.syncFs(); }
Source:
<code>public void cleanup() throws Exception { <START> <END> deleteDirectory("/storages/storage-common-proxies/maven-central/org/carlspring/maven/derby-maven-plugin"); deleteDirectory("/storages/storage-common-proxies/maven-oracle/com/oracle/jdbc/ojdbc8"); deleteDirectory("/storages/storage-common-proxies/maven-central/org/carlspring/properties-injector"); deleteDirectory("/storages/storage-common-proxies/maven-central/javax/media/jai_core"); artifactEntryService.deleteAll(); }</code><technical_language>a rule of thumb, safer paths start /, especially Linux/Unix, if a base path prepended. reason is -- in case of a minor bug in code (and human), if this path for some reason matches existing directory root of file system, wipe out stuff a massive mess... (I'm is issue code, point out good practice). mind changing this? :)</technical_language>

Target:
public void cleanup() throws Exception { deleteDirectoryRelativeToVaultDirectory( "storages/storage-common-proxies/maven-central/org/carlspring/maven/derby-maven-plugin"); deleteDirectoryRelativeToVaultDirectory("storages/storage-common-proxies/maven-oracle/com/oracle/jdbc/ojdbc8"); deleteDirectoryRelativeToVaultDirectory( "storages/storage-common-proxies/maven-central/org/carlspring/properties-injector"); deleteDirectoryRelativeToVaultDirectory("storages/storage-common-proxies/maven-central/javax/media/jai_core"); artifactEntryService.deleteAll(); }
Source:
<code>private static File asTemp(InputStream in, String prefix, String suffix, File dir) throws IOException { <START> dir.mkdirs(); <END> File tmp = File.createTempFile(prefix, suffix, dir); boolean keep = false; try { FileOutputStream out = new FileOutputStream(tmp); try { byte[] data = new byte[8192]; int n; while ((n = in.read(data)) > 0) { out.write(data, 0, n); } keep = true; return tmp; } finally { out.close(); } } finally { if (!keep) { tmp.delete(); } } }</code><technical_language>unrelated bug fix</technical_language>

Target:
private static File asTemp(InputStream in, String prefix, String suffix, File dir) throws IOException { File tmp = File.createTempFile(prefix, suffix, dir); boolean keep = false; try { FileOutputStream out = new FileOutputStream(tmp); try { byte[] data = new byte[8192]; int n; while ((n = in.read(data)) > 0) { out.write(data, 0, n); } keep = true; return tmp; } finally { out.close(); } } finally { if (!keep) { tmp.delete(); } } }
Source:
<code>public Function<Row, Row> makePostComputeManipulatorFn( final GroupByQuery query, final MetricManipulationFn fn ) { final Set<String> optimizedDims = extractionsToRewrite(query, false); final Function<Row, Row> preCompute = makePreComputeManipulatorFn(query, fn); if (optimizedDims.isEmpty()) { return preCompute; } final Map<String, ExtractionFn> extractionFnMap = new HashMap<>(); for (DimensionSpec dimensionSpec : query.getDimensions()) { final String dimension = dimensionSpec.getOutputName(); if (optimizedDims.contains(dimension)) { extractionFnMap.put(dimension, dimensionSpec.getExtractionFn()); } } return new Function<Row, Row>() { @Nullable @Override public Row apply(Row input) { Row preRow = preCompute.apply(input); if (preRow instanceof MapBasedRow) { MapBasedRow preMapRow = (MapBasedRow) preRow; Map<String, Object> event = Maps.newHashMap(preMapRow.getEvent()); for (String dim : optimizedDims) { final Object eventVal = event.get(dim); <START> event.remove(dim); <END> event.put(dim, extractionFnMap.get(dim).apply(eventVal == null ? "" : eventVal)); } return new MapBasedRow(preMapRow.getTimestamp(), event); } else { return preRow; } } }; }</code><technical_language>is this event.remove(dim) reduntant bcoz event.put(dim,..) next line overwrite anyway</technical_language>

Target:
public Function<Row, Row> makePostComputeManipulatorFn( final GroupByQuery query, final MetricManipulationFn fn ) { final Set<String> optimizedDims = ImmutableSet.copyOf( Iterables.transform( extractionsToRewrite(query), new Function<DimensionSpec, String>() { @Override public String apply(DimensionSpec input) { return input.getOutputName(); } } ) ); final Function<Row, Row> preCompute = makePreComputeManipulatorFn(query, fn); if (optimizedDims.isEmpty()) { return preCompute; } final Map<String, ExtractionFn> extractionFnMap = new HashMap<>(); for (DimensionSpec dimensionSpec : query.getDimensions()) { final String dimension = dimensionSpec.getOutputName(); if (optimizedDims.contains(dimension)) { extractionFnMap.put(dimension, dimensionSpec.getExtractionFn()); } } return new Function<Row, Row>() { @Nullable @Override public Row apply(Row input) { Row preRow = preCompute.apply(input); if (preRow instanceof MapBasedRow) { MapBasedRow preMapRow = (MapBasedRow) preRow; Map<String, Object> event = Maps.newHashMap(preMapRow.getEvent()); for (String dim : optimizedDims) { final Object eventVal = event.get(dim); event.put(dim, extractionFnMap.get(dim).apply(eventVal)); } return new MapBasedRow(preMapRow.getTimestamp(), event); } else { return preRow; } } }; }
Source:
<code><START> private static List<String> getScopeOfOperations(String oauth2SchemeKey, Operation operation) { <END> List<Map<String, List<String>>> security = operation.getSecurity(); if (security != null) { for (Map<String, List<String>> requirement : security) { if (requirement.get(oauth2SchemeKey) != null) { return requirement.get(oauth2SchemeKey); } } } return getScopeOfOperationsFromExtensions(operation); }</code><technical_language>too. move static non-static private methods</technical_language>

Target:
private List<String> getScopeOfOperations(String oauth2SchemeKey, Operation operation) { List<Map<String, List<String>>> security = operation.getSecurity(); if (security != null) { for (Map<String, List<String>> requirement : security) { if (requirement.get(oauth2SchemeKey) != null) { return requirement.get(oauth2SchemeKey); } } } return getScopeOfOperationsFromExtensions(operation); }
Source:
<code>public SubPlan createSubPlans(Session session, Plan plan, boolean forceSingleNode, PlanNodeIdAllocator idAllocator, WarningCollector warningCollector) { <START> Fragmenter fragmenter = new Fragmenter( <END> session, metadata, plan.getStatsAndCosts(), new PlanSanityChecker(forceSingleNode), warningCollector, sqlParser, idAllocator, new SymbolAllocator(plan.getTypes().allTypes()), getTableWriterNodeIds(plan.getRoot())); FragmentProperties properties = new FragmentProperties(new PartitioningScheme( Partitioning.create(SINGLE_DISTRIBUTION, ImmutableList.of()), plan.getRoot().getOutputVariables())); if (forceSingleNode || isForceSingleNodeOutput(session)) { properties = properties.setSingleNodeDistribution(); } PlanNode root = SimplePlanRewriter.rewriteWith(fragmenter, plan.getRoot(), properties); SubPlan subPlan = fragmenter.buildRootFragment(root, properties); subPlan = reassignPartitioningHandleIfNecessary(session, subPlan); subPlan = analyzeGroupedExecution(session, subPlan, false); checkState(!isForceSingleNodeOutput(session) || subPlan.getFragment().getPartitioning().isSingleNode(), "Root of PlanFragment is not single node"); sanityCheckFragmentedPlan(subPlan, warningCollector, getQueryMaxStageCount(session), config.getStageCountWarningThreshold()); return subPlan; }</code><technical_language>heart:</technical_language>

Target:
public SubPlan createSubPlans(Session session, Plan plan, boolean forceSingleNode, PlanNodeIdAllocator idAllocator, WarningCollector warningCollector) { Fragmenter fragmenter = new Fragmenter( session, metadata, plan.getStatsAndCosts(), new PlanSanityChecker(forceSingleNode), warningCollector, sqlParser, idAllocator, new PlanVariableAllocator(plan.getTypes().allVariables()), getTableWriterNodeIds(plan.getRoot())); FragmentProperties properties = new FragmentProperties(new PartitioningScheme( Partitioning.create(SINGLE_DISTRIBUTION, ImmutableList.of()), plan.getRoot().getOutputVariables())); if (forceSingleNode || isForceSingleNodeOutput(session)) { properties = properties.setSingleNodeDistribution(); } PlanNode root = SimplePlanRewriter.rewriteWith(fragmenter, plan.getRoot(), properties); SubPlan subPlan = fragmenter.buildRootFragment(root, properties); subPlan = reassignPartitioningHandleIfNecessary(session, subPlan); subPlan = analyzeGroupedExecution(session, subPlan, false); checkState(!isForceSingleNodeOutput(session) || subPlan.getFragment().getPartitioning().isSingleNode(), "Root of PlanFragment is not single node"); sanityCheckFragmentedPlan(subPlan, warningCollector, getQueryMaxStageCount(session), config.getStageCountWarningThreshold()); return subPlan; }
Source:
<code>public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); if (out.getVersion().onOrAfter(Version.V_7_8_0)) { out.writeOptionalFloat(requestsPerSecond); out.writeOptionalTimeValue(timeout); } <START> if (out.getVersion().onOrAfter(Version.CURRENT)) { END> out.writeString(jobId); } }</code><technical_language>suggestion if (out.getVersion().onOrAfter(Version.V_8_0_0)) { // TODO BWC for V_7_9_0</technical_language>

Target:
public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); if (out.getVersion().onOrAfter(Version.V_7_8_0)) { out.writeOptionalFloat(requestsPerSecond); out.writeOptionalTimeValue(timeout); } if (out.getVersion().onOrAfter(Version.V_8_0_0)) { out.writeString(jobId); } }
Source:
<code>public void testTraceFile() throws Throwable { TracepointActionManager tam = TracepointActionManager.getInstance(); IBreakpointManager bm = DebugPlugin.getDefault().getBreakpointManager(); @SuppressWarnings( "unchecked" ) ArrayList<ITracepointAction> actions = (ArrayList<ITracepointAction>)tam.getActions().clone(); for (ITracepointAction a : actions) { tam.deleteAction(a); } IBreakpoint[] bpts = bm.getBreakpoints(); Assert.assertTrue(bpts.length == 0); super.setLaunchAttributes(); setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, "${workspace_loc}"); String absoluteProgram = new Path("data/launch/bin/TracepointTestApp.exe").toFile().getAbsolutePath(); setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, absoluteProgram); setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, ICDTLaunchConfigurationConstants.DEBUGGER_MODE_CORE); setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_POST_MORTEM_TYPE, IGDBLaunchConfigurationConstants.DEBUGGER_POST_MORTEM_TRACE_FILE); setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_COREFILE_PATH, TRACE_FILE); doLaunch(); Thread.sleep(1000); actions = tam.getActions(); Assert.assertTrue(String.format("Unexpected count of tracepoint actions: %d", actions.size()), actions.size() == 3); bpts = bm.getBreakpoints(); <START> Assert.assertTrue(bpts.length == 2); <END> for (IBreakpoint b : bpts) { Assert.assertTrue(b instanceof ICTracepoint); checkTracepoint((ICTracepoint)b); } terminateSession(); doLaunch(); Thread.sleep(1000); actions = tam.getActions(); Assert.assertTrue(actions.size() == 3); bpts = bm.getBreakpoints(); Assert.assertTrue(bpts.length == 2); for (IBreakpoint b : bpts) { Assert.assertTrue(b instanceof ICTracepoint); checkTracepoint((ICTracepoint)b); } }</code><technical_language>left-over breakpoints in workspace, happened in GDBConsoleBreakpointsTest</technical_language>

Target:
public void testTraceFile() throws Throwable { deleteActionsAndBreakpoints(); startTraceFileSession(); checkActionsAndTracepoints(); }
Source:
<code>private void encodeEventData(ObjectOutput out, Object data) throws IOException { if(data != null) { <START> out.writeObject(data); <END> }else{ logger.warn("encodeEventData data is null"); } }</code><technical_language>implement this? java @Deprecated protected Object decodeHeartbeatData(Channel channel, ObjectInput in) throws IOException { return Response.HEARTBEAT_EVENT; }</technical_language>

Target:
private void encodeEventData(ObjectOutput out, Object data) throws IOException { out.writeObject(data); }
Source:
<code>public void run() { try { int entryCount; ScanResults currentScanResults = scanResults.get(); if (isScanning || currentScanResults == null) { return; } else { entryCount = queueEntryCount.get(); } long processStartTimeMs = time.milliseconds(); <START> for (int i = 0; i < entryCount; i++) { <END> if (cancelled) { return; } Pair<IndexValue, IndexValue> entry = recentEntryQueue.poll(); if (entry == null) { throw new IllegalStateException( "Invalid queue state. Expected entryCount " + entryCount + " current index: " + i); } metrics.statsRecentEntryQueueSize.update(queueEntryCount.decrementAndGet()); IndexValue newValue = entry.getFirst(); if (newValue.getOffset().compareTo(currentScanResults.scannedEndOffset) >= 0) { if (newValue.isFlagSet(IndexValue.Flags.Delete_Index)) { processNewDelete(currentScanResults, newValue, entry.getSecond()); } else { processNewPut(currentScanResults, newValue); } } } metrics.statsRecentEntryQueueProcessTimeMs.update(time.milliseconds() - processStartTimeMs, TimeUnit.MILLISECONDS); } catch (Exception e) { logger.error("Unexpected exception while running QueueProcessor", e); metrics.blobStoreStatsErrorCount.inc(); } }</code><technical_language>try couple cancelled check other conditional checks. for eg: for (int i = 0; i < entryCount && !cancelled; i++) {</technical_language>

Target:
public void run() { try { int entryCount; ScanResults currentScanResults = scanResults.get(); if (isScanning || currentScanResults == null) { return; } else { entryCount = queueEntryCount.get(); } long processStartTimeMs = time.milliseconds(); for (int i = 0; i < entryCount && !cancelled; i++) { Pair<IndexValue, IndexValue> entry = recentEntryQueue.poll(); if (entry == null) { throw new IllegalStateException( String.format("Invalid queue state in store %s. Expected entryCount %d, current index: %d", storeId, entryCount, i)); } metrics.statsRecentEntryQueueSize.update(queueEntryCount.decrementAndGet()); IndexValue newValue = entry.getFirst(); if (newValue.getOffset().compareTo(currentScanResults.scannedEndOffset) >= 0) { if (newValue.isFlagSet(IndexValue.Flags.Delete_Index)) { processNewDelete(currentScanResults, newValue, entry.getSecond()); } else { processNewPut(currentScanResults, newValue); } } } metrics.statsRecentEntryQueueProcessTimeMs.update(time.milliseconds() - processStartTimeMs, TimeUnit.MILLISECONDS); } catch (Exception e) { logger.error("Unexpected exception while running QueueProcessor in store {}", storeId, e); metrics.blobStoreStatsQueueProcessorErrorCount.inc(); } }
Source:
<code>public CreateDDiagramElementCommand(final TransactionalEditingDomain domain, final EObject semantic, final EdgeMapping mapping, final EdgeTarget source, final EdgeTarget target) { this(domain, semantic); edgeCandidate = new DEdgeCandidate(mapping, semantic, source, target, RefreshIdsHolder.getOrCreateHolder(getParentDiagram())); <START> this.container = (DragAndDropTarget) source; <END> }</code><technical_language>getparentDiagram() null.. set container calling method</technical_language>

Target:
public CreateDDiagramElementCommand(final TransactionalEditingDomain domain, final EObject semantic, final EdgeMapping mapping, final EdgeTarget source, final EdgeTarget target) { this(domain, semantic); this.container = (DragAndDropTarget) source; edgeCandidate = new DEdgeCandidate(mapping, semantic, source, target, RefreshIdsHolder.getOrCreateHolder(getParentDiagram())); }
Source:
<code>public void doubleConversionValidation() throws Exception { BpmnModel bpmnModel = readXMLFile(); assertNotNull(bpmnModel); validateModel(bpmnModel); <START> bpmnModel = exportAndReadXMLFile(bpmnModel); <END> validateModel(bpmnModel); }</code><technical_language>This validated assertion</technical_language>

Target:
public void doubleConversionValidation() throws Exception { BpmnModel bpmnModel = readXMLFile(); assertNotNull(bpmnModel); validateModel(bpmnModel); bpmnModel = exportAndReadXMLFile(bpmnModel); assertNotNull(bpmnModel); validateModel(bpmnModel); }
Source:
<code>public void testStartWithReconnectFuture() throws Exception { Future<Void> future = Future.future(); CountDownLatch latch = new CountDownLatch(1); <START> RabbitMQOptions options = "true".equalsIgnoreCase(System.getProperty("rabbitmq.local")) ? config().setUri(CLOUD_AMQP_URI) : config(); <END> options.setConnectionRetries(3); options.setConnectionRetryDelay(1L); RabbitMQClient.create(Vertx.vertx(), options).start(future.completer()); future.setHandler(onFailure(v -> { latch.countDown(); })); awaitLatch(latch); assertTrue(future.isComplete() && future.failed()); }</code><technical_language>Shouldnt : "true".equalsIgnoreCase(System.getProperty("rabbitmq.local")) ? config() : config().setUri(CLOUD_AMQP_URI)</technical_language>

Target:
public void testStartWithReconnectFuture() throws Exception { Future<Void> future = Future.future(); CountDownLatch latch = new CountDownLatch(1); RabbitMQOptions options = "true".equalsIgnoreCase(System.getProperty("rabbitmq.local")) ? config() : config().setUri(CLOUD_AMQP_URI); options.setConnectionRetries(3); options.setConnectionRetryDelay(1L); RabbitMQClient.create(Vertx.vertx(), options).start(future.completer()); future.setHandler(onFailure(v -> { latch.countDown(); })); awaitLatch(latch); assertTrue(future.isComplete() && future.failed()); }
Source:
<code>public void shouldSendEmailToAuthorIfIsNotConnected() { Post likedPost = mock(Post.class); String postOwner = "postOwner"; String likeOwner = "likeOwner"; String summary = "blabla"; LikePostEvent postLikedEvent = new LikePostEvent(likedPost, likeOwner); User liker = new User(likeOwner); User author = new User(postOwner); Long postId = new Long(928839); String postUrl = new String("<LINK_0>"); when(likedPost.getAuthor()).thenReturn(author); when(likedPost.getPostContent()).thenReturn(new Story(summary)); <START> when(likedPost.getId()).thenReturn(postId); <END> when(connectedUserService.isConnected(postOwner)).thenReturn(false); when(userService.findUserByUsername(likeOwner)).thenReturn(of(liker)); pushNotificationEventHandler.sendLikeNotificationToPostAuthor(postLikedEvent); verify(mailService, atLeastOnce()).sendLikedPostNotificationMail( new MailParameter(author, liker, summary, postUrl)); }</code><technical_language>MockPostRepository save likedPost, deal postId</technical_language>

Target:
public void shouldSendEmailToAuthorIfIsNotConnected() { Post likedPost = mock(Post.class); String postOwner = "postOwner"; String likeOwner = "likeOwner"; String summary = "blabla"; LikePostEvent postLikedEvent = new LikePostEvent(likedPost, likeOwner); User liker = new User(likeOwner); User author = new User(postOwner); Long postId = new Long(928839); String postUrl = new String("<LINK_0>"); when(likedPost.getAuthor()).thenReturn(author); when(likedPost.summary()).thenReturn(summary); when(likedPost.getId()).thenReturn(postId); when(connectedUserService.isConnected(postOwner)).thenReturn(false); when(userService.findUserByUsername(likeOwner)).thenReturn(of(liker)); pushNotificationEventHandler.sendLikeNotificationToPostAuthor(postLikedEvent); verify(mailService, atLeastOnce()).sendLikedPostNotificationMail( new MailParameter(author, liker, summary, postUrl)); }
Source:
<code>private static String getTracePath(String projectName, String traceName, Boolean isExperiment) { String separator = "/"; StringJoiner filePath = new StringJoiner(separator, separator, separator); filePath.add(projectName); String childrenName = isExperiment ? "Experiments" : "Traces"; filePath.add(childrenName); filePath.add(traceName); <START> return filePath.toString(); <END> }</code><technical_language>String.valueOf(filePath) is equivalent nonNull, remove a warning</technical_language>

Target:
private static String getTracePath(String projectName, String traceName, Boolean isExperiment) { String separator = "/"; StringJoiner filePath = new StringJoiner(separator, separator, separator); filePath.add(projectName); String childrenName = isExperiment ? "Experiments" : "Traces"; filePath.add(childrenName); filePath.add(traceName); return String.valueOf(filePath); }
Source:
<code><START> public void testVariantClear() { <END> System.out.println("------------------------------------------"); VARIANT variant = new VARIANT(new SHORT(33333)); HRESULT hr = OleAuto.INSTANCE.VariantClear(variant.getPointer()); assertTrue("hr: " + hr.intValue(), hr.intValue() == 0); System.out.println(variant.toString(true)); System.out.println("------------------------------------------"); }</code><technical_language>Please convert tests assertions simply printing output. In general, unit tests produce output assertions. is recommended message form of assertion, e.g. // prefer this assertTrue("The number of matches greater zero", matches > 0); // this assertTrue(matches > 0);</technical_language>

Target:
public void testVariantClear() { VARIANT variant = new VARIANT(new SHORT(33333)); HRESULT hr = OleAuto.INSTANCE.VariantClear(variant.getPointer()); assertTrue("hr: " + hr.intValue(), hr.intValue() == 0); }
Source:
<code>public static ArrayList<Guid> getStorageIdList(String storageIds) { ArrayList<String> storageStringList = splitStringList(storageIds); <START> ArrayList<Guid> storageGuidsList = new ArrayList<Guid>(); <END> if (!(storageStringList == null || storageStringList.isEmpty())) { for (String storageGuidString : storageStringList) { storageGuidsList.add(Guid.createGuidFromString(storageGuidString)); } } if (storageGuidsList.isEmpty()) { storageGuidsList.add(Guid.Empty); } return storageGuidsList; }</code><technical_language>need check for storageStringList.isEmpty()</technical_language>

Target:
public static ArrayList<Guid> getStorageIdList(String storageIds) { ArrayList<String> storageStringList = splitStringList(storageIds); ArrayList<Guid> storageGuidsList = new ArrayList<Guid>(); if (storageStringList != null) { for (String storageGuidString : storageStringList) { storageGuidsList.add(Guid.createGuidFromString(storageGuidString)); } } if (storageGuidsList.isEmpty()) { storageGuidsList.add(Guid.Empty); } return storageGuidsList; }
Source:
<code>public String getPrettySize(long bytes){ double oneKB = 1024; double oneMB = oneKB * 1024; double oneGB = oneMB * 1014; double oneTB = oneGB * 1024; <START> double onePB = oneTB * 1024; <END> if (bytes/oneKB < 1){ return String.format("%.3f", bytes) + " bytes"; } if (bytes/oneMB < 1){ return String.format("%.3f", bytes/oneKB) + " KB"; } if (bytes/oneGB < 1){ return String.format("%.3f", bytes/oneMB) + " MB"; } if (bytes/oneTB < 1){ return String.format("%.3f", bytes/oneGB) + " GB"; } return String.valueOf(bytes/onePB) + " PB"; }</code><technical_language>constants calculated time method runs</technical_language>

Target:
public String getPrettySize(long bytes){ if (bytes/ONE_KB < 1){ return String.format("%d", bytes) + " bytes"; } if (bytes/ONE_MB < 1){ return String.format("%.3f", bytes/ONE_KB) + " KB"; } if (bytes/ONE_GB < 1){ return String.format("%.3f", bytes/ONE_MB) + " MB"; } if (bytes/ONE_TB < 1){ return String.format("%.3f", bytes/ONE_GB) + " GB"; } if (bytes/ONE_PB < 1){ return String.format("%.3f", bytes/ONE_TB) + " TB"; } return String.format("%.3f", bytes/ONE_PB) + " PB"; }
Source:
<code>private void assignSplits() { final Iterator<Integer> awaitingReader = readersAwaitingSplit.iterator(); while (awaitingReader.hasNext()) { final int awaitingSubtask = awaitingReader.next(); <START> final Optional<FileSourceSplit> nextSplit = splitAssigner.getNext(null); <END> if (nextSplit.isPresent()) { context.assignSplit(nextSplit.get(), awaitingSubtask); awaitingReader.remove(); } else { break; } } }</code><technical_language>pass in hostName instead of null here</technical_language>

Target:
private void assignSplits() { final Iterator<Map.Entry<Integer, String>> awaitingReader = readersAwaitingSplit.entrySet().iterator(); while (awaitingReader.hasNext()) { final Map.Entry<Integer, String> nextAwaiting = awaitingReader.next(); final String hostname = nextAwaiting.getValue(); final int awaitingSubtask = nextAwaiting.getKey(); final Optional<FileSourceSplit> nextSplit = splitAssigner.getNext(hostname); if (nextSplit.isPresent()) { context.assignSplit(nextSplit.get(), awaitingSubtask); awaitingReader.remove(); } else { break; } } }
Source:
<code>public Connection getConnection() throws SQLException { String username = config.getString(JdbcSourceConnectorConfig.CONNECTION_USER_CONFIG); Password dbPassword = config.getPassword(JdbcSourceConnectorConfig.CONNECTION_PASSWORD_CONFIG); Properties properties = new Properties(); if (username != null) { properties.setProperty("user", username); } if (dbPassword != null) { properties.setProperty("password", dbPassword.value()); } properties = addConnectionProperties(properties); <START> DriverManager.setLoginTimeout(60); <END> Connection connection = DriverManager.getConnection(jdbcUrl, properties); if (jdbcDriverInfo == null) { jdbcDriverInfo = createJdbcDriverInfo(connection); } connections.add(connection); return connection; }</code><technical_language>This connector validation, right? a connector config is submitted a distributed worker, validated soon worker a chance it. Then, if worker leader, forwards config leader, validates _again_, finally writes config topic. of this is done, user's REST request is a 200-level response. this means connector config possibly (even likely, in cluster of more workers a <=50% chance of hitting leader a request) validated twice, REST request timeout in distributed mode is 90 seconds, 40-45 seconds more here? avoid scenario of connection 60 seconds succeed worker's validation, another 60 seconds succeed leader's validation, config written config topic--even point user's REST request met a 500 timeout response</technical_language>

Target:
public Connection getConnection() throws SQLException { String username = config.getString(JdbcSourceConnectorConfig.CONNECTION_USER_CONFIG); Password dbPassword = config.getPassword(JdbcSourceConnectorConfig.CONNECTION_PASSWORD_CONFIG); Properties properties = new Properties(); if (username != null) { properties.setProperty("user", username); } if (dbPassword != null) { properties.setProperty("password", dbPassword.value()); } properties = addConnectionProperties(properties); DriverManager.setLoginTimeout(40); Connection connection = DriverManager.getConnection(jdbcUrl, properties); if (jdbcDriverInfo == null) { jdbcDriverInfo = createJdbcDriverInfo(connection); } connections.add(connection); return connection; }
Source:
<code>private static ThreadPoolType initThreadPoolType(Properties properties, String property, ThreadPoolType defaultValue) { <START> SecurityManager security = System.getSecurityManager(); <END> if (security != null) { try { security.checkPermission(new java.lang.RuntimePermission("modifyThreadGroup")); } catch (java.security.AccessControlException e) { return ThreadPoolType.SINGLE_THREAD; } } if (properties == null || properties.get(property) == null) { return defaultValue; } String value = properties.getProperty(property); try { return ThreadPoolType.valueOf(value); } catch (Exception e) { throw BootstrapLogger.LOG.invalidThreadPoolType(value); } }</code><technical_language>move this kind of checks some util class. e.g. in API module / jar dup code place; api, impl, ..</technical_language>

Target:
private static ThreadPoolType initThreadPoolType(Properties properties, String property, ThreadPoolType defaultValue) { if (properties == null || properties.get(property) == null) { return defaultValue; } String value = properties.getProperty(property); try { return ThreadPoolType.valueOf(value); } catch (Exception e) { throw BootstrapLogger.LOG.invalidThreadPoolType(value); } }
Source:
<code>public void setAddress(String addr) { if (null == address) { final EndpointReferenceType reference = new EndpointReferenceType(); final AttributedURIType a = new AttributedURIType(); <START> a.setValue("/"); <END> reference.setAddress(a); address = reference; } else { EndpointReferenceUtils.setAddress(address, addr); } }</code><technical_language>This be: a.setValue(address);</technical_language>

Target:
public void setAddress(String addr) { if (null == address) { final EndpointReferenceType reference = new EndpointReferenceType(); final AttributedURIType a = new AttributedURIType(); a.setValue(addr); reference.setAddress(a); address = reference; } else { final AttributedURIType a = new AttributedURIType(); a.setValue(addr); address.setAddress(a); } }
Source:
<code>private Ordering<Row> makeComparator( List<DimensionSpec> dimensions, List<AggregatorFactory> aggs, List<PostAggregator> postAggs ) { Ordering<Row> ordering = new Ordering<Row>() { @Override public int compare(Row left, Row right) { return Longs.compare(left.getTimestampFromEpoch(), right.getTimestampFromEpoch()); } }; <START> Map<String, Object> possibleOrderDims = Maps.newTreeMap(String.CASE_INSENSITIVE_ORDER); <END> for (DimensionSpec spec : dimensions) { possibleOrderDims.put(spec.getOutputName(), spec); } for (final AggregatorFactory agg : aggs) { possibleOrderDims.put(agg.getName(), agg); } for (PostAggregator postAgg : postAggs) { possibleOrderDims.put(postAgg.getName(), postAgg); } for (OrderByColumnSpec columnSpec : columns) { String dimension = columnSpec.getDimension(); Object dimObj = possibleOrderDims.get(dimension); if (dimObj == null) { throw new ISE("Unknown column in order clause[%s]", columnSpec); } Ordering<Row> nextOrdering; if (dimObj instanceof DimensionSpec) { nextOrdering = dimensionOrdering(dimension, columnSpec.asNumber()); } else if (dimObj instanceof AggregatorFactory) { nextOrdering = metricOrdering(dimension, ((AggregatorFactory) dimObj).getComparator()); } else { nextOrdering = metricOrdering(dimension, ((PostAggregator) dimObj).getComparator()); } switch (columnSpec.getDirection()) { case DESCENDING: nextOrdering = nextOrdering.reverse(); } ordering = ordering.compound(nextOrdering); } return ordering; }</code><technical_language>Please explicit type parameter if possible, Object</technical_language>

Target:
private Ordering<Row> makeComparator( List<DimensionSpec> dimensions, List<AggregatorFactory> aggs, List<PostAggregator> postAggs ) { Ordering<Row> ordering = new Ordering<Row>() { @Override public int compare(Row left, Row right) { return Longs.compare(left.getTimestampFromEpoch(), right.getTimestampFromEpoch()); } }; Map<String, Function<OrderByColumnSpec, Ordering<Row>>> possibleOrderDims = Maps.newTreeMap(String.CASE_INSENSITIVE_ORDER); for (final DimensionSpec spec : dimensions) { possibleOrderDims.put( spec.getOutputName(), dimensionOrdering(spec.getOutputName()) ); } for (final AggregatorFactory agg : aggs) { possibleOrderDims.put( agg.getName(), metricOrdering(agg.getName(), agg.getComparator()) ); } for (final PostAggregator postAgg : postAggs) { possibleOrderDims.put( postAgg.getName(), metricOrdering(postAgg.getName(), postAgg.getComparator()) ); } for (OrderByColumnSpec columnSpec : columns) { Function<OrderByColumnSpec, Ordering<Row>> genOrderingFunc = possibleOrderDims.get(columnSpec.getDimension()); if (genOrderingFunc == null) { throw new ISE("Unknown column in order clause[%s]", columnSpec); } Ordering<Row> nextOrdering = genOrderingFunc.apply(columnSpec); switch (columnSpec.getDirection()) { case DESCENDING: nextOrdering = nextOrdering.reverse(); } ordering = ordering.compound(nextOrdering); } return ordering; }
Source:
<code>public void saveFile() throws IOException { File file = new File("src/test/resources/testmetaOldFormat.xml"); <START> testMetaOldFormat = FileReader.readFileToByteArray(file); <END> }</code><technical_language>Again, IOUtils</technical_language>

Target:
public void saveFile() throws IOException { File file = new File("src/test/resources/testmetaOldFormat.xml"); testMetaOldFormat = IOUtils.toByteArray(file.toURI()); }
Source:
<code>public void complete(ITextViewer viewer, int completionPosition, ICompilationUnit compilationUnit) { IDocument document = viewer.getDocument(); if (!(getContextType() instanceof JavaPostfixContextType)) return; Point selection = viewer.getSelectedRange(); String selectedText = null; if (selection.y != 0) { return; } JavaPostfixContext context = ((JavaPostfixContextType) getContextType()).createContext(document, completionPosition, selection.y, compilationUnit, currentNode, parentNode); context.setVariable("selection", selectedText); int start = context.getStart(); int end = context.getEnd(); IRegion region = new Region(start, end - start); Template[] templates = JavaPlugin.getDefault().getTemplateStore().getTemplates(getContextType().getId()); <START> for (int i = 0; i != templates.length; i++) { <END> Template template = templates[i]; if (context.canEvaluate(template)) { getProposals().add(new PostfixTemplateProposal(template, context, region, getImage())); } } }</code><technical_language>enhanced for loop</technical_language>

Target:
public void complete(ITextViewer viewer, int completionPosition, ICompilationUnit compilationUnit) { IDocument document = viewer.getDocument(); if (!(getContextType() instanceof JavaPostfixContextType)) return; Point selection = viewer.getSelectedRange(); String selectedText = null; if (selection.y != 0) { return; } JavaPostfixContext context = ((JavaPostfixContextType) getContextType()).createContext(document, completionPosition, selection.y, compilationUnit, currentNode, parentNode); context.setVariable("selection", selectedText); int start = context.getStart(); int end = context.getEnd(); IRegion region = new Region(start, end - start); Template[] templates = JavaPlugin.getDefault().getTemplateStore().getTemplates(getContextType().getId()); for (Template template : templates) { if (context.canEvaluate(template)) { getProposals().add(new PostfixTemplateProposal(template, context, region, getImage())); } } }
Source:
<code>public JensenShannonDistance() { <START> base = null; <END> }</code><technical_language>add default sense</technical_language>

Target:
public JensenShannonDistance() { base = Math.E; }
Source:
<code>public Setting getSetting(VDomainModelReference domainModelReference, EObject object) throws DatabindingFailedException { final VFeaturePathDomainModelReference featurePathReference = checkAndConvertDMR(domainModelReference); if (object == null) { throw new IllegalArgumentException("The given EObject must not be null."); } EObject currentObject = object; for (final EReference eReference : featurePathReference.getDomainModelEReferencePath()) { <START> currentObject = (EObject) currentObject.eGet(eReference); <END> } return InternalEObject.class.cast(currentObject).eSetting(featurePathReference.getDomainModelEFeature()); }</code><technical_language>I this include a null guard. want auto expanding domain configurable</technical_language>

Target:
public Setting getSetting(VDomainModelReference domainModelReference, EObject object) throws DatabindingFailedException { final VFeaturePathDomainModelReference featurePathReference = checkAndConvertDMR(domainModelReference); EObject currentObject = object; for (final EReference eReference : featurePathReference.getDomainModelEReferencePath()) { currentObject = (EObject) currentObject.eGet(eReference); if (currentObject == null) { throw new DatabindingFailedException("The path is not fully resolved."); } } return InternalEObject.class.cast(currentObject).eSetting(featurePathReference.getDomainModelEFeature()); }
Source:
<code>public void testGetVersion() throws Exception { BugzillaRestClient client = new BugzillaRestClient(actualFixture.location()); assertNotNull(client.getClient()); assertNull(client.getClient().getLoginToken()); BugzillaRestVersion version = client.getVersion(new NullOperationMonitor()); assertTrue("expeccted: " + actualFixture.getVersion() + " actual: " + version.toString(), <START> actualFixture.getVersion().compareTo(version.toString()) == 0); <END> }</code><technical_language>(spelling) I guess is a reason asserEquals oppossed compareTo? semantics there</technical_language>

Target:
public void testGetVersion() throws Exception { BugzillaRestClient client = new BugzillaRestClient(actualFixture.location()); assertNotNull(client.getClient()); assertNull(client.getClient().getLoginToken()); BugzillaRestVersion version = client.getVersion(new NullOperationMonitor()); assertEquals("expeccted: " + actualFixture.getVersion() + " actual: " + version.toString(), actualFixture.getVersion(), version.toString()); }
Source:
<code>public List<AuditEvent> pollConsumerEvents(PerunSession perunSession, String consumerName) throws InternalErrorException { if (consumerName == null) throw new InternalErrorException("Auditer consumer doesn't exist."); try { if(jdbc.queryForInt("select count(*) from auditer_consumers where name=?", consumerName) != 1) { throw new InternalErrorException("Auditer consumer doesn't exist."); <START> } <END> List<AuditEvent> eventList = new ArrayList<>(); int lastProcessedId = getLastProcessedId(consumerName); int maxId = jdbc.queryForInt("select max(id) from auditer_log"); if (maxId > lastProcessedId) { eventList = jdbc.query("select " + auditMessageMappingSelectQuery + " from auditer_log where id > ? and id <= ? order by id", AUDIT_EVENT_MAPPER, lastProcessedId, maxId); jdbc.update("update auditer_consumers set last_processed_id=?, modified_at=" + Compatibility.getSysdate() + " where name=?", maxId, consumerName); } return eventList; } catch (Exception ex) { throw new InternalErrorException(ex); } }</code><technical_language>this twice, create a new private public method "checkAuditerConsumerExists"</technical_language>

Target:
public List<AuditEvent> pollConsumerEvents(PerunSession perunSession, String consumerName) throws InternalErrorException { checkAuditerConsumerExists(perunSession, consumerName); try { List<AuditEvent> eventList = new ArrayList<>(); int lastProcessedId = getLastProcessedId(consumerName); int maxId = getLastMessageId(perunSession); if (maxId > lastProcessedId) { eventList = jdbc.query("select " + auditMessageMappingSelectQuery + " from auditer_log where id > ? and id <= ? order by id", AUDIT_EVENT_MAPPER, lastProcessedId, maxId); setLastProcessedId(perunSession, consumerName, maxId); } return eventList; } catch (Exception ex) { throw new InternalErrorException(ex); } }