auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void onPartitionBecomeInactiveFromStandby(String partitionName) { ReplicaId replica = partitionNameToReplicaId.get(partitionName); if (replica != null) { Store localStore = getStore(replica.getPartitionId()); if (localStore != null) { localStore.setCurrentState(ReplicaState.INACTIVE); logger.info("Store is set to INACTIVE", partitionName); if (!controlCompactionForBlobStore(replica.getPartitionId(), false)) { logger.error("Failed to disable compaction on store {}", partitionName); throw new StateTransitionException("Couldn't disable compaction on replica " + replica.getReplicaPath(), StateTransitionException.TransitionErrorCode.ReplicaOperationFailure); } logger.info("Compaction is successfully disabled on store {}", partitionName); } else { throw new StateTransitionException("Store " + partitionName + " is not started", StateTransitionException.TransitionErrorCode.StoreNotStarted); } } else { throw new StateTransitionException("Replica " + partitionName + " is not found on current node", StateTransitionException.TransitionErrorCode.ReplicaNotFound); } }

Target:
public void onPartitionBecomeInactiveFromStandby(String partitionName) { ReplicaId replica = partitionNameToReplicaId.get(partitionName); if (replica != null) { Store localStore = getStore(replica.getPartitionId()); if (localStore != null) { localStore.setCurrentState(ReplicaState.INACTIVE); logger.info("Store is set to INACTIVE", partitionName); if (!controlCompactionForBlobStore(replica.getPartitionId(), false)) { logger.error("Failed to disable compaction on store {}", partitionName); throw new StateTransitionException("Couldn't disable compaction on replica " + replica.getReplicaPath(), ReplicaNotFound); } logger.info("Compaction is successfully disabled on store {}", partitionName); } else { throw new StateTransitionException("Store " + partitionName + " is not started", StoreNotStarted); } } else { throw new StateTransitionException("Replica " + partitionName + " is not found on current node", ReplicaNotFound); } }
Source:
public void checkAccess(Path path, AccessMode... accessModes) throws IOException { if (accessModes != null && accessModes.length != 0) { throw logger.logThrowableAsError( new AccessDeniedException("The access cannot be determined.")); } AzurePath.ensureFileSystemOpen(path); try { readAttributes(path, BasicFileAttributes.class); } catch(IOException e) { if (e.getCause() != null && e.getCause() instanceof BlobStorageException && BlobErrorCode.BLOB_NOT_FOUND.equals(((BlobStorageException) e.getCause()).getErrorCode())) { throw logger.logThrowableAsError(new NoSuchFileException(path.toString())); } else { throw e; } } }

Target:
public void checkAccess(Path path, AccessMode... accessModes) throws IOException { if (accessModes != null && accessModes.length != 0) { throw LoggingUtility.logError(logger, new AccessDeniedException("The access cannot be determined.")); } AzurePath.ensureFileSystemOpen(path); if (path instanceof AzurePath && ((AzurePath) path).isRoot()) { return; } try { readAttributes(path, BasicFileAttributes.class); } catch (IOException e) { Throwable cause = e.getCause(); if (cause instanceof BlobStorageException && BlobErrorCode.BLOB_NOT_FOUND.equals(((BlobStorageException) cause).getErrorCode())) { throw LoggingUtility.logError(logger, new NoSuchFileException(path.toString())); } else { throw LoggingUtility.logError(logger, e); } } }
Source:
public void recordImageCopyTime(Stack stack, long startMillis) { String[] tags = {MetricTag.TENANT.name(), Optional.ofNullable(stack.getTenant()).map(Tenant::getName).orElse("NA"), MetricTag.CLOUD_PROVIDER.name(), Optional.ofNullable(stack.cloudPlatform()).orElse("NA"), MetricTag.REGION.name(), Optional.ofNullable(stack.getRegion()).orElse("NA")}; long millispassed = System.currentTimeMillis() - startMillis; LOGGER.debug("Image copy duration report: ms", System.currentTimeMillis() - startMillis); recordTimer(millispassed, MetricType.STACK_IMAGE_COPY, tags); }

Target:
public void recordImageCopyTime(Stack stack, long startMillis) { String[] tags = {MetricTag.TENANT.name(), Optional.ofNullable(stack.getTenant()).map(Tenant::getName).orElse("NA"), MetricTag.CLOUD_PROVIDER.name(), Optional.ofNullable(stack.cloudPlatform()).orElse("NA"), MetricTag.REGION.name(), Optional.ofNullable(stack.getRegion()).orElse("NA")}; long millispassed = System.currentTimeMillis() - startMillis; LOGGER.debug("Image copy duration report: ms", millispassed); recordTimer(millispassed, MetricType.STACK_IMAGE_COPY, tags); }
Source:
public void initializeMetaCollection(Configuration configuration) throws CatalogException { Admin admin = configuration.getAdmin(); admin.setPassword(CatalogAuthenticationManager.cypherPassword(admin.getPassword())); Metadata metadata = new Metadata().setIdCounter(configuration.getCatalog().getOffset()).setVersion(VERSION); Document metadataObject = getMongoDBDocument(metadata, "Metadata"); metadataObject.put(PRIVATE_ID, MongoDBAdaptorFactory.METADATA_OBJECT_ID); Document adminDocument = getMongoDBDocument(admin, "Admin"); adminDocument.put("algorithm", "HS256"); adminDocument.put("secretKey", "222"); metadataObject.put("admin", adminDocument); metaCollection.insert(metadataObject, null); }

Target:
public void initializeMetaCollection(Configuration configuration) throws CatalogException { Admin admin = configuration.getAdmin(); admin.setPassword(CatalogAuthenticationManager.cypherPassword(admin.getPassword())); Metadata metadata = new Metadata().setIdCounter(configuration.getCatalog().getOffset()).setVersion(VERSION); Document metadataObject = getMongoDBDocument(metadata, "Metadata"); metadataObject.put(PRIVATE_ID, MongoDBAdaptorFactory.METADATA_OBJECT_ID); Document adminDocument = getMongoDBDocument(admin, "Admin"); metadataObject.put("admin", adminDocument); metaCollection.insert(metadataObject, null); }
Source:
public Response archiveBranch(long branchUuid) { BranchReadable branch = getBranchById(branchUuid); boolean modified = false; BranchArchivedState currentState = branch.getArchiveState(); if (BranchArchivedState.UNARCHIVED == currentState) { Callable<?> op = getBranchOps().archiveUnarchiveBranch(branch, ArchiveOperation.ARCHIVE); executeCallable(op); modified = true; activityLog.createEntry(BRANCH_OPERATION_TYPEID, ActivityLog.INITIAL_STATUS, String.format("Branch Operation Archive Branch {branchUUID: %s accountId: %s serverId: %s clientId: %s}", branchUuid, accountId, serverId, clientId)); } return asResponse(modified); }

Target:
public Response archiveBranch(long branchUuid) { BranchReadable branch = getBranchById(branchUuid); boolean modified = false; BranchArchivedState currentState = branch.getArchiveState(); if (BranchArchivedState.UNARCHIVED == currentState) { Callable<?> op = getBranchOps().archiveUnarchiveBranch(branch, ArchiveOperation.ARCHIVE); executeCallable(op); modified = true; try { activityLog.createEntry(BRANCH_OPERATION_TYPEID, ActivityLog.INITIAL_STATUS, String.format("Branch Operation Archive Branch {branchUUID: %s accountId: %s serverId: %s clientId: %s}", branchUuid, RestUtil.getAccountId(httpHeaders), RestUtil.getServerId(httpHeaders), RestUtil.getClientId(httpHeaders))); } catch (OseeCoreException ex) { OseeLog.log(ActivityLog.class, OseeLevel.SEVERE_POPUP, ex); } } return asResponse(modified); }
Source:
private List<DatastreamTask> getDatastreamTasks(List<Datastream> datastreams, Map<String, Set<DatastreamTask>> currentAssignment, int maxTasksPerDatastream) { Set<DatastreamTask> allTasks = new HashSet<>(); List<DatastreamTask> currentlyAssignedDatastreamTasks = new ArrayList<>(); currentAssignment.values().forEach(currentlyAssignedDatastreamTasks::addAll); for (Datastream datastream : datastreams) { Set<DatastreamTask> tasksForDatastream = currentlyAssignedDatastreamTasks.stream() .filter( x -> x.getDatastreams().stream().map(Datastream::getName).anyMatch(y -> y.contains(datastream.getName()))) .collect(Collectors.toSet()); if (tasksForDatastream.isEmpty()) { tasksForDatastream = createTasksForDatastream(datastream, maxTasksPerDatastream); } else { if (datastream.hasSource() && datastream.getSource().hasPartitions()) { int numberOfDatastreamPartitions = datastream.getSource().getPartitions(); Set<Integer> assignedPartitions = new HashSet<>(); int count = 0; for (DatastreamTask task : tasksForDatastream) { count += task.getPartitions().size(); assignedPartitions.addAll(task.getPartitions()); } if (count != numberOfDatastreamPartitions || assignedPartitions.size() != numberOfDatastreamPartitions) { LOG.error("Corrupted partition information for datastream {}. Expected number of partitions {}, actual {}: {}", datastream.getName(), numberOfDatastreamPartitions, count, assignedPartitions); tasksForDatastream = createTasksForDatastream(datastream, maxTasksPerDatastream); } } } allTasks.addAll(tasksForDatastream); } return new ArrayList<>(allTasks); }

Target:
private List<DatastreamTask> getDatastreamTasks(List<Datastream> datastreams, Map<String, Set<DatastreamTask>> currentAssignment, int maxTasksPerDatastream) { Set<DatastreamTask> allTasks = new HashSet<>(); List<DatastreamTask> currentlyAssignedDatastreamTasks = new ArrayList<>(); currentAssignment.values().forEach(currentlyAssignedDatastreamTasks::addAll); for (Datastream datastream : datastreams) { Set<DatastreamTask> tasksForDatastream = currentlyAssignedDatastreamTasks.stream() .filter( x -> x.getDatastreams().stream().map(Datastream::getName).anyMatch(y -> y.contains(datastream.getName()))) .collect(Collectors.toSet()); if (tasksForDatastream.isEmpty()) { tasksForDatastream = createTasksForDatastream(datastream, maxTasksPerDatastream); } else { if (datastream.hasSource() && datastream.getSource().hasPartitions()) { int numberOfDatastreamPartitions = datastream.getSource().getPartitions(); Set<Integer> assignedPartitions = new HashSet<>(); int count = 0; for (DatastreamTask task : tasksForDatastream) { count += task.getPartitions().size(); assignedPartitions.addAll(task.getPartitions()); } if (count != numberOfDatastreamPartitions || assignedPartitions.size() != numberOfDatastreamPartitions) { LOG.error("Corrupted partition information for datastream {}. Expected number of partitions {}, actual {}: {}", datastream.getName(), numberOfDatastreamPartitions, count, assignedPartitions); } } } allTasks.addAll(tasksForDatastream); } return new ArrayList<>(allTasks); }
Source:
public Response approve(Action action) { if (action.isSetCluster() && (action.getCluster().isSetId() || action.getCluster().isSetName())) { update(setCluster(get(), action.getCluster())); } validateEnums(Action.class, action); ApproveVdsParameters params = new ApproveVdsParameters(guid); params = (ApproveVdsParameters) getMapper (Action.class, VdsOperationActionParameters.class).map(action, (VdsOperationActionParameters) params); if (action.isSetSsh() && action.getSsh().isSetAuthenticationMethod()) { if (action.getSsh().getAuthenticationMethod() == VdsOperationActionParameters.AuthenticationMethod.Password.toString()) { params.setAuthMethod(VdsOperationActionParameters.AuthenticationMethod.Password); if (action.isSetRootPassword()) { params.setRootPassword(action.getRootPassword()); } else if (action.getSsh().isSetUser()) { params.setPassword(action.getSsh().getUser().getPassword()); } } else { params.setAuthMethod(VdsOperationActionParameters.AuthenticationMethod.PublicKey); } } else { params.setAuthMethod(VdsOperationActionParameters.AuthenticationMethod.PublicKey); } return doAction(VdcActionType.ApproveVds, params, action); }

Target:
public Response approve(Action action) { if (action.isSetCluster() && (action.getCluster().isSetId() || action.getCluster().isSetName())) { update(setCluster(get(), action.getCluster())); } validateEnums(Action.class, action); ApproveVdsParameters params = new ApproveVdsParameters(guid); params = (ApproveVdsParameters) getMapper (Action.class, VdsOperationActionParameters.class).map(action, (VdsOperationActionParameters) params); VdsOperationActionParameters.AuthenticationMethod authMethod = VdsOperationActionParameters.AuthenticationMethod.PublicKey; if (action.isSetSsh() && action.getSsh().isSetAuthenticationMethod()) { if (action.getSsh().getAuthenticationMethod().equals( VdsOperationActionParameters.AuthenticationMethod.Password.toString())) { authMethod = VdsOperationActionParameters.AuthenticationMethod.Password; if (action.isSetRootPassword()) { params.setRootPassword(action.getRootPassword()); } else if (action.getSsh().isSetUser()) { params.setPassword(action.getSsh().getUser().getPassword()); } } } params.setAuthMethod(authMethod); return doAction(VdcActionType.ApproveVds, params, action); }
Source:
public static String demangleVmName(String name) { if (name == null) { return null; } return name.replaceAll("_[0-9]+_g\\$", ""); }

Target:
public static String demangleVmName(String name) { if (name == null) { return null; } return name.replaceAll("_[0-9]+_g\\$$", ""); }
Source:
private double logLikelihoodPoisson(@Nonnull CoverageModelCopyRatioEmissionData emissionData, double copyRatio) { final double multBias = FastMath.exp(emissionData.getMu()); final double readDepth = emissionData.getCopyRatioCallingMetadata().getSampleCoverageDepth(); final double poissonMean = readDepth * copyRatio * multBias + emissionData.getPoissonAdditiveNoise(); return new PoissonDistribution(null, poissonMean, PoissonDistribution.DEFAULT_EPSILON, PoissonDistribution.DEFAULT_MAX_ITERATIONS).logProbability(emissionData.getReadCount()); }

Target:
private double logLikelihoodPoisson(@Nonnull CoverageModelCopyRatioEmissionData emissionData, double copyRatio) { final double multBias = FastMath.exp(emissionData.getMu()); final double readDepth = emissionData.getCopyRatioCallingMetadata().getSampleCoverageDepth(); final double err = emissionData.getMappingErrorProbability(); final double poissonMean = readDepth * ((1 - err) * copyRatio * multBias + err); return new PoissonDistribution(null, poissonMean, PoissonDistribution.DEFAULT_EPSILON, PoissonDistribution.DEFAULT_MAX_ITERATIONS).logProbability(emissionData.getReadCount()); }
Source:
public Double getScore() {return score;}

Target:
public double getScore() { return score; }
Source:
public Function<Definition, Definition> defaultSteps() { DefinitionTransformer resolveStrict = DefinitionTransformer.from(new ResolveStrict(kompileOptions)::resolve, "resolving strict and seqstrict attributes"); DefinitionTransformer resolveContexts = DefinitionTransformer.from(new ResolveContexts(kompileOptions)::resolve, "resolving context sentences"); DefinitionTransformer resolveHeatCoolAttribute = DefinitionTransformer.fromSentenceTransformer(new ResolveHeatCoolAttribute()::resolve, "resolving heat and cool attributes"); DefinitionTransformer resolveAnonVars = DefinitionTransformer.fromSentenceTransformer(new ResolveAnonVar()::resolve, "resolving \"_\" vars"); DefinitionTransformer resolveSemanticCasts = DefinitionTransformer.fromSentenceTransformer(new ResolveSemanticCasts(kompileOptions.experimental.kore)::resolve, "resolving semantic casts"); DefinitionTransformer generateSortPredicateSyntax = DefinitionTransformer.from(new GenerateSortPredicateSyntax()::gen, "adding sort predicate productions"); return def -> func(this::resolveIOStreams) .andThen(resolveStrict) .andThen(resolveAnonVars) .andThen(resolveContexts) .andThen(resolveHeatCoolAttribute) .andThen(resolveSemanticCasts) .andThen(generateSortPredicateSyntax) .andThen(func(this::resolveFreshConstants)) .andThen(func(this::addImplicitComputationCellTransformer)) .andThen(func(this::concretizeTransformer)) .andThen(func(this::addSemanticsModule)) .andThen(func(this::addProgramModule)) .apply(def); }

Target:
public Function<Definition, Definition> defaultSteps() { DefinitionTransformer resolveStrict = DefinitionTransformer.from(new ResolveStrict(kompileOptions)::resolve, "resolving strict and seqstrict attributes"); DefinitionTransformer resolveContexts = DefinitionTransformer.from(new ResolveContexts(kompileOptions)::resolve, "resolving context sentences"); DefinitionTransformer resolveHeatCoolAttribute = DefinitionTransformer.fromSentenceTransformer(new ResolveHeatCoolAttribute()::resolve, "resolving heat and cool attributes"); DefinitionTransformer resolveAnonVars = DefinitionTransformer.fromSentenceTransformer(new ResolveAnonVar()::resolve, "resolving \"_\" vars"); DefinitionTransformer resolveSemanticCasts = DefinitionTransformer.fromSentenceTransformer(new ResolveSemanticCasts(kompileOptions.backend.equals(Backends.JAVA))::resolve, "resolving semantic casts"); DefinitionTransformer generateSortPredicateSyntax = DefinitionTransformer.from(new GenerateSortPredicateSyntax()::gen, "adding sort predicate productions"); return def -> func(this::resolveIOStreams) .andThen(resolveStrict) .andThen(resolveAnonVars) .andThen(resolveContexts) .andThen(resolveHeatCoolAttribute) .andThen(resolveSemanticCasts) .andThen(generateSortPredicateSyntax) .andThen(func(this::resolveFreshConstants)) .andThen(func(this::addImplicitComputationCellTransformer)) .andThen(func(this::concretizeTransformer)) .andThen(func(this::addSemanticsModule)) .andThen(func(this::addProgramModule)) .apply(def); }
Source:
protected boolean isJavaCodeMiningEnabled() { return ((ISourceViewerExtension5) getSourceViewer()).hasCodeMiningProviders(); }

Target:
boolean isJavaCodeMiningEnabled() { return ((ISourceViewerExtension5) getSourceViewer()).hasCodeMiningProviders(); }
Source:
public UniprotProxySequenceReader(String accession, CompoundSet<C> compoundSet) throws CompoundNotFoundException, IOException { if (!UP_AC_PATTERN.matcher(accession.toUpperCase()).matches()) { throw new CompoundNotFoundException("Accession provided " + accession + " doesn't comply with the uniprot acession pattern."); } setCompoundSet(compoundSet); uniprotDoc = this.getUniprotXML(accession); String seq = this.getSequence(uniprotDoc); setContents(seq); }

Target:
public UniprotProxySequenceReader(String accession, CompoundSet<C> compoundSet) throws CompoundNotFoundException, IOException { if (!UP_AC_PATTERN.matcher(accession.toUpperCase()).matches()) { throw new IllegalArgumentException("Accession provided " + accession + " doesn't comply with the uniprot acession pattern."); } setCompoundSet(compoundSet); uniprotDoc = this.getUniprotXML(accession); String seq = this.getSequence(uniprotDoc); setContents(seq); }
Source:
public boolean isLastConnectionForDomain(StorageDomain storageDomain) { List<StorageServerConnections> connectionsForDomain = getAllConnectionsForDomain(storageDomain.getId()); if (connectionsForDomain.size() == 1 && isConnectionAttachedToDomain(connectionsForDomain)) { return true; } return false; }

Target:
public boolean isLastConnectionForDomain(StorageDomain storageDomain) { List<StorageServerConnections> connectionsForDomain = getAllConnectionsForDomain(storageDomain.getId()); if (connectionsForDomain.size() == 1 && isAnyConnectionAttachedToDomain(connectionsForDomain)) { return true; } return false; }
Source:
public void setEntries(ISourceContainer[] entries) { fEntries.clear(); for (ISourceContainer entrie : entries) { if(entrie != null) { fEntries.add(entrie); } } if (getInput() == null) { setInput(fEntries); if(!fEntries.isEmpty() && fEntries.get(0)!=null) { setSelection(new StructuredSelection(fEntries.get(0))); } } else { refresh(); } fPanel.setDirty(true); fPanel.updateLaunchConfigurationDialog(); }

Target:
public void setEntries(ISourceContainer[] entries) { fEntries.clear(); for (ISourceContainer entry : entries) { if(entry != null) { fEntries.add(entry); } } if (getInput() == null) { setInput(fEntries); if(!fEntries.isEmpty() && fEntries.get(0)!=null) { setSelection(new StructuredSelection(fEntries.get(0))); } } else { refresh(); } fPanel.setDirty(true); fPanel.updateLaunchConfigurationDialog(); }
Source:
public void onMessage(final String message) { synchronized (_isProxied) { if (_isProxied.get()) { _originatorOut.write(message); } else { _destinationMessageQueue.add(message); } } }

Target:
public void onMessage(final String message) { ProxyConnection.this.getSelf().tell(new DestinationMessage(message), ProxyConnection.this.getSelf()); }
Source:
public void refreshNotationStructure() { if (hostView != null) { removeUnappliedStereotypes(hostView); if (stereoList.size() != 0) { refreshStereotypeStructure(); } } }

Target:
public void refreshNotationStructure() { if (hostView != null) { removeUnappliedStereotypes(hostView); if (!stereotypeList.isEmpty()) { refreshStereotypeStructure(); } } }
Source:
private static InstanceDiscoveryMetadata processSingleJsonArray(final JSONObject jsonObject) throws JSONException { final String preferredNetwork = jsonObject.getString(PREFERRED_NETWORK); final String preferredCache = jsonObject.getString(PREFERRED_CACHE); final JSONArray aliasArray = jsonObject.getJSONArray(ALIASES); final List<String> aliases = new ArrayList<>(); for (int i = 0; i < aliasArray.length(); i++) { aliases.add((String) aliasArray.get(i)); } return new InstanceDiscoveryMetadata(preferredNetwork, preferredCache, aliases); }

Target:
private static InstanceDiscoveryMetadata processSingleJsonArray(final JSONObject jsonObject) throws JSONException { final String preferredNetwork = jsonObject.getString(PREFERRED_NETWORK); final String preferredCache = jsonObject.getString(PREFERRED_CACHE); final JSONArray aliasArray = jsonObject.getJSONArray(ALIASES); final List<String> aliases = new ArrayList<>(); for (int i = 0; i < aliasArray.length(); i++) { aliases.add(aliasArray.getString(i)); } return new InstanceDiscoveryMetadata(preferredNetwork, preferredCache, aliases); }
Source:
public String getTimelineLogV2() { if (logV2.isPresent()) { return logV2.get().toProtobufBase64(); } else { return ""; } }

Target:
public String getTimelineLogV2() { if (logV2.isPresent()) { return logV2.get().toProtobufBase64(); } return ""; }
Source:
public boolean checkValidTopology (TTopologyTemplate topologyTemplate) { Map<TNodeTemplate, Set<TNodeTemplate>> transitiveAndDirectSuccessors = computeTransitiveClosure(topologyTemplate); for (TNodeTemplate node : getNodeTemplatesWithoutIncomingHostedOnRelationships(topologyTemplate)) { if (!ModelUtilities.getTargetLabel(node).isPresent()) { return false; } } for (TNodeTemplate node : transitiveAndDirectSuccessors.keySet()) { if (!transitiveAndDirectSuccessors.get(node).isEmpty()) { for (TNodeTemplate successor : transitiveAndDirectSuccessors.get(node)) { if (ModelUtilities.getTargetLabel(successor).isPresent() && ModelUtilities.getTargetLabel(node).isPresent() && !ModelUtilities.getTargetLabel(node).get().toLowerCase().equals(ModelUtilities.getTargetLabel(successor).get().toLowerCase())) { return false; } } } } return true; }

Target:
public boolean checkValidTopology (TTopologyTemplate topologyTemplate) { Map<TNodeTemplate, Set<TNodeTemplate>> transitiveAndDirectSuccessors = computeTransitiveClosure(topologyTemplate); for (TNodeTemplate node : getNodeTemplatesWithoutIncomingHostedOnRelationships(topologyTemplate)) { if (!ModelUtilities.getTargetLabel(node).isPresent()) { return false; } } for (TNodeTemplate node : transitiveAndDirectSuccessors.keySet()) { if (!transitiveAndDirectSuccessors.get(node).isEmpty()) { for (TNodeTemplate successor : transitiveAndDirectSuccessors.get(node)) { if (ModelUtilities.getTargetLabel(successor).isPresent() && ModelUtilities.getTargetLabel(node).isPresent() && !ModelUtilities.getTargetLabel(node).get().equalsIgnoreCase(ModelUtilities.getTargetLabel(successor).get())) { return false; } } } } return true; }
Source:
public static void copyObject_test7() throws Exception { System.out.println("Test: copyObject(String bucketName, String objectName, String destBucketName," + " String destObjectName, CopyConditions copyConditions) with modified after" + " condition (Negative Case)"); String bucketName = getRandomName(); String secondBucketName = getRandomName(); String fileName = createFile(3 * MB); client.makeBucket(bucketName); client.makeBucket(secondBucketName); client.putObject(bucketName, fileName, fileName); CopyConditions copyConditions = new CopyConditions(); DateTime dateRepresentation = new DateTime(2015, Calendar.MAY, 3, 10, 10); copyConditions.setUnmodified(dateRepresentation); ErrorResponseException expectedException = null; try { client.copyObject(bucketName, fileName, secondBucketName, copyConditions); } catch (ErrorResponseException e) { expectedException = e; } if (expectedException == null || !expectedException.errorResponse().code().equals("PreconditionFailed")) { throw new Exception("[FAILED] copyObject_test7(): copying should fail with unsatisified precondition."); } client.removeObject(bucketName, fileName); client.removeObject(secondBucketName, fileName); client.removeBucket(bucketName); client.removeBucket(secondBucketName); }

Target:
public static void copyObject_test7() throws Exception { System.out.println("Test: copyObject(String bucketName, String objectName, String destBucketName," + "CopyConditions copyConditions) with modified after" + " condition (Negative Case)"); String filename = createFile(3 * MB); client.putObject(bucketName, filename, filename); Files.delete(Paths.get(filename)); String destBucketName = getRandomName(); client.makeBucket(destBucketName); CopyConditions copyConditions = new CopyConditions(); DateTime dateRepresentation = new DateTime(2015, Calendar.MAY, 3, 10, 10); copyConditions.setUnmodified(dateRepresentation); try { client.copyObject(bucketName, filename, destBucketName, copyConditions); } catch (ErrorResponseException e) { if (!e.errorResponse().code().equals("PreconditionFailed")) { throw e; } } client.removeObject(bucketName, filename); client.removeBucket(destBucketName); }
Source:
private void setSupportedResolutions() { if (ExtensionVersion.getRuntimeVersion().compareTo(Version.VERSION_1_1) < 0) { Log.d(TAG, "getSupportedResolution interface is available after vendor library " + "version 1.1."); return; } List<Pair<Integer, Size[]>> supportedResolutions = null; try { supportedResolutions = mImpl.getSupportedResolutions(); } catch (NoSuchMethodError e) { Log.e(TAG, "getSupportedResolution interface is not implemented in vendor library."); } if (supportedResolutions != null) { mBuilder.setSupportedResolutions(supportedResolutions); } }

Target:
private void setSupportedResolutions() { if (ExtensionVersion.getRuntimeVersion().compareTo(Version.VERSION_1_1) < 0) { return; } List<Pair<Integer, Size[]>> supportedResolutions = null; try { supportedResolutions = mImpl.getSupportedResolutions(); } catch (NoSuchMethodError e) { Log.e(TAG, "getSupportedResolution interface is not implemented in vendor library."); } if (supportedResolutions != null) { mBuilder.setSupportedResolutions(supportedResolutions); } }
Source:
public void checkDiskError() throws IOException { Set<FsVolumeSpi> unhealthyVolumes; try { unhealthyVolumes = volumeChecker.checkAllVolumes(data); LOG.info("checkDiskError got failed volumes - {}", unhealthyVolumes.size(), unhealthyVolumes); lastDiskErrorCheck = Time.monotonicNow(); } catch (InterruptedException e) { LOG.error("Interruped while running disk check", e); throw new IOException("Interrupted while running disk check", e); } handleVolumeFailures(unhealthyVolumes); }

Target:
public void checkDiskError() throws IOException { Set<FsVolumeSpi> unhealthyVolumes; try { unhealthyVolumes = volumeChecker.checkAllVolumes(data); lastDiskErrorCheck = Time.monotonicNow(); } catch (InterruptedException e) { LOG.error("Interruped while running disk check", e); throw new IOException("Interrupted while running disk check", e); } if (unhealthyVolumes.size() > 0) { LOG.warn("checkDiskError got failed volumes - {}", unhealthyVolumes.size(), unhealthyVolumes); handleVolumeFailures(unhealthyVolumes); } else { LOG.debug("checkDiskError encountered no failures"); } }
Source:
public static synchronized @Nullable SegmentStoreScatterDataProvider create(ITmfTrace trace, @Nullable ISegmentStoreProvider provider) { if (provider == null) { return null; } SegmentStoreScatterDataProvider dataProvider = PROVIDER_MAP.get(provider); if (dataProvider != null) { return dataProvider; } if (provider instanceof IAnalysisModule) { ((IAnalysisModule) provider).schedule(); dataProvider = new SegmentStoreScatterDataProvider(trace, provider); PROVIDER_MAP.put(provider, dataProvider); } return null; }

Target:
public static synchronized @Nullable SegmentStoreScatterDataProvider create(ITmfTrace trace, @Nullable ISegmentStoreProvider provider) { if (provider == null) { return null; } SegmentStoreScatterDataProvider dataProvider = PROVIDER_MAP.get(provider); if (dataProvider != null) { return dataProvider; } dataProvider = new SegmentStoreScatterDataProvider(trace, provider); PROVIDER_MAP.put(provider, dataProvider); if (provider instanceof IAnalysisModule) { ((IAnalysisModule) provider).schedule(); } return dataProvider; }
Source:
public GenericRecord parse(ByteBuffer bytes) { DatumReader<GenericRecord> reader = new GenericDatumReader<GenericRecord>(schemaObj); ByteBufferInputStream inputStream = new ByteBufferInputStream(Collections.singletonList(bytes)); try { return reader.read(null, DecoderFactory.get().binaryDecoder(inputStream, null)); } catch (EOFException eof) { throw new ParseException("Avro's unnecessary EOFException", eof); } catch (Exception e) { throw new ParseException(e, "Fail to decode avro message!"); } }

Target:
public GenericRecord parse(ByteBuffer bytes) { DatumReader<GenericRecord> reader = new GenericDatumReader<GenericRecord>(schemaObj); ByteBufferInputStream inputStream = new ByteBufferInputStream(Collections.singletonList(bytes)); try { return reader.read(null, DecoderFactory.get().binaryDecoder(inputStream, null)); } catch (EOFException eof) { throw new ParseException( eof, "Avro's unnecessary EOFException, detail: [%s]", "<LINK_0>" ); } catch (Exception e) { throw new ParseException(e, "Fail to decode avro message!"); } }
Source:
private static ConcurrentMap<String, List<Request>> asMap( final Collection<Request> reqs) throws IOException { final ConcurrentMap<String, List<Request>> map = new ConcurrentHashMap<String, List<Request>>(reqs.size()); for (final Request req : reqs) { final String header = new RqHeaders.Smart( new RqHeaders.Base(req) ).single(Base.REQUIRED_HEADER); final Matcher matcher = RqMultipart.Base.NAME.matcher(header); if (!matcher.matches()) { throw new HttpException( HttpURLConnection.HTTP_BAD_REQUEST, String.format( "\"name\" not found in %s header:", "%s", Base.REQUIRED_HEADER, header ) ); } final String name = matcher.group(1); map.putIfAbsent(name, new LinkedList<Request>()); map.get(name).add(req); } return map; }

Target:
private static Map<String, List<Request>> asMap( final Collection<Request> reqs) throws IOException { final Map<String, List<Request>> map = new HashMap<>(reqs.size()); for (final Request req : reqs) { final String header = new RqHeaders.Smart( new RqHeaders.Base(req) ).single(Base.REQUIRED_HEADER); final Matcher matcher = Base.NAME.matcher(header); if (!matcher.matches()) { throw new HttpException( HttpURLConnection.HTTP_BAD_REQUEST, String.format( "\"name\" not found in Content-Disposition header: %s", header ) ); } final String name = matcher.group(1); if (!map.containsKey(name)) { map.put(name, new LinkedList<Request>()); } map.get(name).add(req); } return map; }
Source:
} catch (URISyntaxException e) { earlyException = new IllegalArgumentException(); earlyException.initCause(e); }

Target:
} catch (URISyntaxException e) { earlyException = new IllegalArgumentException(e); }
Source:
public void initialize() { view.refreshSelectPicker(); }

Target:
public void initialize() { if (!isSubmarine.get()) { view.refreshSelectPicker(); } }
Source:
public List<CommitValidationMessage> onCommitReceived( CommitReceivedEvent receiveEvent) throws CommitValidationException { if (receiveEvent.commit.getParentCount() > 1) { if (MagicBranch.isForReview(receiveEvent.command.getRefName())) { if (!refControl.canUploadMerges()) { throw new CommitValidationException( "you are not allowed to upload merges for review"); } } else { if (!refControl.canPushMergesOld() && !refControl.canPushMerges()) { throw new CommitValidationException( "you are not allowed to push merges directly bypassing code review"); } } } return Collections.<CommitValidationMessage> emptyList(); }

Target:
public List<CommitValidationMessage> onCommitReceived( CommitReceivedEvent receiveEvent) throws CommitValidationException { if (receiveEvent.commit.getParentCount() > 1) { if (MagicBranch.isMagicBranch(receiveEvent.command.getRefName())) { if (!refControl.canUploadMerges()) { throw new CommitValidationException( "you are not allowed to upload merges for review"); } } else if (!refControl.canPushMerges()) { throw new CommitValidationException( "you are not allowed to push merges directly bypassing code review"); } } return Collections.<CommitValidationMessage> emptyList(); }
Source:
public FSDataInputStream open(FileSystem fileSystem, Path path, Optional<byte[]> extraFileInfo) throws IOException { if (fileSystem instanceof CachingFileSystem) { CachingFileSystem cachingFileSystem = (CachingFileSystem) fileSystem; return fileOpener.open(cachingFileSystem.getDataTier(), path, extraFileInfo); } else { throw new IllegalArgumentException("Incorrect filesystem found: " + fileSystem.getClass().getName()); } }

Target:
public CachingInputStream open(FileSystem fileSystem, Path path, Optional<byte[]> extraFileInfo) throws IOException { checkArgument(fileSystem instanceof CachingFileSystem, "fileSystem should be of CachingFileSystem type."); CachingFileSystem cachingFileSystem = (CachingFileSystem) fileSystem; FSDataInputStream fsDataInputStream = fileOpener.open(cachingFileSystem.getDataTier(), path, extraFileInfo); return new CachingInputStream(fsDataInputStream, cacheManager, path, cachingFileSystem.isCacheValidationEnabled()); }
Source:
private InputStream exportGoodleDriveFile(final File file, final String mimetype, final Drive drive, final NodeRef nodeRef) throws IOException { final Object versionType = fileFolderService.getFileInfo(nodeRef).getProperties() .get(PROP_VERSION_TYPE); final String editorURL = String.valueOf(fileFolderService .getFileInfo(nodeRef).getProperties().getOrDefault(PROP_EDITORURL, "")); if (versionType == null || isGoogleDriveMimeType(mimetype) || editorURL.contains("://docs.google.com/document")) { try { return drive.files().export(file.getId(), mimetype).executeMediaAsInputStream(); } catch (GoogleJsonResponseException e) { log.info( "Failed to export GoogleDrive document from GD mimetype (retrying): " + e.getMessage()); } } return drive.files().get(file.getId()).executeMediaAsInputStream(); }

Target:
private InputStream exportGoodleDriveFile(final File file, final String mimetype, final Drive drive, final NodeRef nodeRef) throws IOException { final Object versionType = fileFolderService.getFileInfo(nodeRef).getProperties() .get(PROP_VERSION_TYPE); final String editorURL = String.valueOf(fileFolderService .getFileInfo(nodeRef).getProperties().getOrDefault(PROP_EDITORURL, "")); if (versionType == null || isGoogleDriveMimeType(mimetype) || editorURL.contains("://docs.google.com/")) { try { return drive.files().export(file.getId(), mimetype).executeMediaAsInputStream(); } catch (GoogleJsonResponseException e) { log.info( "Failed to export GoogleDrive document from GD mimetype (retrying): " + e.getMessage()); } } return drive.files().get(file.getId()).executeMediaAsInputStream(); }
Source:
public void testFunctionOnThisChained() { Optional<String> description = getTestMethodRef().getDescriptionForFunction(this::function); assertTrue(description.isPresent()); assertNameMatch("function", "testFunctionOnThisChained", CLASSNAME, description.get()); }

Target:
public void testFunctionOnThisChained() { Optional<String> description = getTestMethodRef().getDescriptionForFunction(this::function); assertTrue(description.isPresent()); assertNameMatch("::function", "testFunctionOnThisChained", CLASSNAME, description.get()); }
Source:
public void testRefreshingUserMetadata() { ApiClient client = getWebClient(USER_2_USERNAME, testingPostgres); UsersApi usersApi = new UsersApi(client); WorkflowsApi workflowsApi = new WorkflowsApi(client); Workflow workflow = manualRegisterAndPublish(workflowsApi, "DockstoreTestUser2/parameter_test_workflow", "testname", "cwl", SourceControl.GITHUB, "/Dockstore.cwl", false); final long count = testingPostgres.runSelectStatement("select count(*) from user_profile where location='Toronto'", long.class); assertEquals("One user should have this info now, there are " + count, 1, count); }

Target:
public void testRefreshingUserMetadata() { ApiClient client = getWebClient(USER_2_USERNAME, testingPostgres); UsersApi usersApi = new UsersApi(client); WorkflowsApi workflowsApi = new WorkflowsApi(client); Workflow workflow = manualRegisterAndPublish(workflowsApi, "DockstoreTestUser2/parameter_test_workflow", "testname", DescriptorLanguage.CWL.getShortName(), SourceControl.GITHUB, "/Dockstore.cwl", false); final long count = testingPostgres.runSelectStatement("select count(*) from user_profile where location='Toronto'", long.class); assertEquals("One user should have this info now, there are " + count, 1, count); }
Source:
public Flux<FeedResponse<T>> drainAsync(int maxPageSize) { return this.component.drainAsync(maxPageSize) .collectList() .map(superList -> { double requestCharge = 0; HashMap<String, String> headers = new HashMap<>(); List<Document> documentList = new ArrayList<>(); for (FeedResponse<T> page : superList) { List<Document> results = (List<Document>) page.getResults(); documentList.addAll(results); requestCharge += page.getRequestCharge(); } this.aggregateGroupings(documentList); return (FeedResponse<T>)createFeedResponseFromGroupingTable(maxPageSize, requestCharge); }).expand(tFeedResponse -> { FeedResponse<T> response = (FeedResponse<T>)createFeedResponseFromGroupingTable(maxPageSize, 0); if (response == null) { return Mono.empty(); } return Mono.just(response); }); }

Target:
public Flux<FeedResponse<T>> drainAsync(int maxPageSize) { return this.component.drainAsync(maxPageSize) .collectList() .map(superList -> { double requestCharge = 0; HashMap<String, String> headers = new HashMap<>(); List<Document> documentList = new ArrayList<>(); for (FeedResponse<T> page : superList) { List<Document> results = (List<Document>) page.getResults(); documentList.addAll(results); requestCharge += page.getRequestCharge(); } this.aggregateGroupings(documentList); return createFeedResponseFromGroupingTable(maxPageSize, requestCharge); }).expand(tFeedResponse -> { FeedResponse<T> response = createFeedResponseFromGroupingTable(maxPageSize, 0); if (response == null) { return Mono.empty(); } return Mono.just(response); }); }
Source:
protected void handleMessageInternal(final Message<?> message) throws Exception { String topic = this.topicExpression != null ? this.topicExpression.getValue(this.evaluationContext, message, String.class) : message.getHeaders().get("topic", String.class); Assert.state(StringUtils.hasText(topic), "'topic' can't be evaluated to empty."); Object messageKey = this.messageKeyExpression != null ? this.messageKeyExpression.getValue(this.evaluationContext, message) : message.getHeaders().get("messageKey"); this.kafkaProducerContext.send(topic, messageKey, message); }

Target:
protected void handleMessageInternal(final Message<?> message) throws Exception { String topic = this.topicExpression != null ? this.topicExpression.getValue(this.evaluationContext, message, String.class) : message.getHeaders().get(KafkaHeaders.TOPIC, String.class); Assert.state(StringUtils.hasText(topic), "'topic' can't be evaluated to empty."); Object messageKey = this.messageKeyExpression != null ? this.messageKeyExpression.getValue(this.evaluationContext, message) : message.getHeaders().get(KafkaHeaders.MESSAGE_KEY); this.kafkaProducerContext.send(topic, messageKey, message); }
Source:
public String toString() { return "ResponseInfo{" + "requestInfo=" + requestInfo + ", error=" + error + ", response=" + content + ", dataNode=" + dataNode + '}'; }

Target:
public String toString() { return "ResponseInfo{requestInfo=" + requestInfo + ", error=" + error + ", response=" + content + ", dataNode=" + dataNode + '}'; }
Source:
void setVariantId(String variantId) { if ("".equals(variantId)) { throw new IllegalArgumentException("variantId (vid) should not be null"); } this.variantId = variantId; }

Target:
void setVariantId(String variantId) { if (variantId == null || variantId.isEmpty()) { throw new IllegalArgumentException("variantId (vid) should not be null"); } this.variantId = variantId; }
Source:
public void testTotalArticleIsIndexedInRemovedStatus() throws Exception { setAllBlogEntriesToStatus( BlogStatus.REMOVED ); Transaction tx = fullTextSession.beginTransaction(); List<Blog> blogEntries = getBlogEntries(); assertThat( blogEntries ).as( "TotalArticle is explicit not intercepted" ).contains( totalArticle ); tx.commit(); }

Target:
public void testTotalArticleIsIndexedInRemovedStatus() throws Exception { setAllBlogEntriesToStatus( BlogStatus.REMOVED ); Transaction tx = fullTextSession.beginTransaction(); List<Blog> blogEntries = getBlogEntries(); assertThat( blogEntries ).as( "TotalArticle is explicitly not intercepted" ).contains( totalArticle ); tx.commit(); }
Source:
private void onUpdate() { if (pollingJob == null || pollingJob.isCancelled()) { Configuration config = getThing().getConfiguration(); int refreshInterval = DEFAULT_REFRESH_INTERVAL; Object refreshConfig = config.get("refresh"); if (refreshConfig != null) { refreshInterval = ((BigDecimal) refreshConfig).intValue(); } pollingJob = scheduler.scheduleAtFixedRate(pollingRunnable, 0, refreshInterval, TimeUnit.SECONDS); } }

Target:
private void onUpdate() { if (pollingJob == null || pollingJob.isCancelled()) { Configuration config = getThing().getConfiguration(); int refreshInterval = DEFAULT_REFRESH_INTERVAL; Object refreshConfig = config.get("refresh"); if (refreshConfig != null) { refreshInterval = ((BigDecimal) refreshConfig).intValue(); } pollingJob = scheduler.scheduleWithFixedDelay(pollingRunnable, 0, refreshInterval, TimeUnit.SECONDS); } }
Source:
public void testAllExpire() throws InterruptedException { Cache<Object, String> cache0 = cache(0, CACHE_NAME); Cache<Object, String> cache1 = cache(1, CACHE_NAME); Cache<Object, String> cache2 = cache(2, CACHE_NAME); MagicKey key = new MagicKey(cache0); String expectedValue = key + "-expiring"; cache0.put(key, key + "-expiring", 1000, TimeUnit.MILLISECONDS); ClusterListener clusterListener = listener(); cache0.addListener(clusterListener); ts0.advance(1001); ts1.advance(1001); ts2.advance(1001); assertNull(cache0.get(key)); assertNull(cache1.get(key)); assertNull(cache2.get(key)); int expectCount = clusterListener.hasIncludeState() ? 2 : 1; eventually(() -> clusterListener.events.size() >= expectCount); CacheEntryEvent event = clusterListener.events.get(clusterListener.hasIncludeState() ? 1 : 0); assertEquals(Event.Type.CACHE_ENTRY_EXPIRED, event.getType()); assertEquals(key, event.getKey()); if (event.getValue() == null) { System.currentTimeMillis(); } assertEquals(expectedValue, event.getValue()); }

Target:
public void testAllExpire() throws InterruptedException { Cache<Object, String> cache0 = cache(0, CACHE_NAME); Cache<Object, String> cache1 = cache(1, CACHE_NAME); Cache<Object, String> cache2 = cache(2, CACHE_NAME); MagicKey key = new MagicKey(cache0); String expectedValue = key + "-expiring"; cache0.put(key, key + "-expiring", 1000, TimeUnit.MILLISECONDS); ClusterListener clusterListener = listener(); cache0.addListener(clusterListener); ts0.advance(1001); ts1.advance(1001); ts2.advance(1001); assertNull(cache0.get(key)); assertNull(cache1.get(key)); assertNull(cache2.get(key)); int expectCount = clusterListener.hasIncludeState() ? 2 : 1; eventually(() -> clusterListener.events.size() >= expectCount); CacheEntryEvent event = clusterListener.events.get(clusterListener.hasIncludeState() ? 1 : 0); assertEquals(Event.Type.CACHE_ENTRY_EXPIRED, event.getType()); assertEquals(key, event.getKey()); assertEquals(expectedValue, event.getValue()); }
Source:
public String getStereotypeTextToDisplay(View model) { String textToDisplay = EMPTY_STRING; String finalText = EMPTY_STRING; Iterator<?> iter = model.getChildren().iterator(); while (iter.hasNext()) { Object object = iter.next(); if (object instanceof DecorationNode) { DecorationNode label = (DecorationNode) object; if (StereotypeDisplayUtils.STEREOTYPE_LABEL_TYPE.equals(label.getType())) { if (label.isVisible()) { textToDisplay = addStereotypeName(textToDisplay, label, model); } } } } if ((textToDisplay != null) && (!EMPTY_STRING.equals(textToDisplay))) { finalText = StereotypeDisplayUtils.QUOTE_LEFT + textToDisplay + StereotypeDisplayUtils.QUOTE_RIGHT; } return finalText; }

Target:
public String getStereotypeTextToDisplay(View model) { StringBuilder textToDisplay = new StringBuilder(); StringBuilder finalText = new StringBuilder(); Iterator<?> childrenIterator = model.getChildren().iterator(); while (childrenIterator.hasNext()) { Object object = childrenIterator.next(); if (isStereotypeLabel(object)) { if (((View) object).isVisible()) { if (!EMPTY_STRING.equals(textToDisplay.toString()) && (textToDisplay != null)) { textToDisplay.append(StereotypeDisplayUtils.STEREOTYPE_LABEL_SEPARATOR); } textToDisplay.append(getStereotypeName((DecorationNode) object)); } } } if ((textToDisplay.toString() != null) && (!EMPTY_STRING.equals(textToDisplay.toString()))) { finalText.append(StereotypeDisplayUtils.QUOTE_LEFT).append(textToDisplay).append(StereotypeDisplayUtils.QUOTE_RIGHT); } return finalText.toString(); }
Source:
public static HttpRequestEvent createHttpRequestEvent(RequestInfo requestInfo, ResponseInfo responseInfo) { requireNonNull(requestInfo, "requestInfo is null"); requireNonNull(responseInfo, "responseInfo is null"); Request request = requestInfo.getRequest(); Response response = responseInfo.getResponse(); String requestUri = null; if (request.getURI() != null) { requestUri = request.getURI().toString(); } String method = request.getMethod(); if (method != null) { method = method.toUpperCase(); } String protocol = getHeader(request, "X-FORWARDED-PROTO"); if (protocol == null) { protocol = request.getScheme(); } if (protocol != null) { protocol = protocol.toLowerCase(); } long timeToLastByte = max(responseInfo.getResponseTimestampMillis() - requestInfo.getRequestTimestampMillis(), 0L); long responseSize = NO_RESPONSE; int responseCode = NO_RESPONSE; if (response != null) { responseSize = responseInfo.getResponseSize(); responseCode = response.getStatus(); } return new HttpRequestEvent( Instant.ofEpochMilli(requestInfo.getRequestTimestampMillis()), protocol, method, requestUri, responseSize, responseCode, timeToLastByte, getFailureReason(responseInfo)); }

Target:
static HttpRequestEvent createHttpRequestEvent(RequestInfo requestInfo, ResponseInfo responseInfo) { requireNonNull(requestInfo, "requestInfo is null"); requireNonNull(responseInfo, "responseInfo is null"); Request request = requestInfo.getRequest(); Optional<Response> response = responseInfo.getResponse(); String requestUri = null; if (request.getURI() != null) { requestUri = request.getURI().toString(); } String method = request.getMethod(); if (method != null) { method = method.toUpperCase(Locale.US); } long responseSize = NO_RESPONSE; int responseCode = NO_RESPONSE; if (response.isPresent()) { responseSize = responseInfo.getResponseSize(); responseCode = response.get().getStatus(); } long timeToLastByte = max(responseInfo.getResponseTimestampMillis() - requestInfo.getRequestTimestampMillis(), 0L); return new HttpRequestEvent( Instant.ofEpochMilli(requestInfo.getRequestTimestampMillis()), request.getVersion().toString(), method, requestUri, getHeader(request, TRACETOKEN_HEADER), responseSize, responseCode, timeToLastByte, getFailureReason(responseInfo)); }