auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public DMNType resolveTypeRef(DMNModelImpl dmnModel, DMNNode node, NamedElement model, DMNModelInstrumentedBase localElement, QName typeRef) { if ( typeRef != null ) { String namespace = getNamespace( dmnModel, localElement, typeRef ); DMNType type = dmnModel.getTypeRegistry().resolveType( namespace, typeRef.getLocalPart() ); if( type == null && DMNModelInstrumentedBase.URI_FEEL.equals( namespace ) ) { if ( model instanceof Decision && ((Decision) model).getExpression() instanceof DecisionTable ) { DecisionTable dt = (DecisionTable) ((Decision) model).getExpression(); if ( dt.getOutput().size() > 1 ) { CompositeTypeImpl compType = new CompositeTypeImpl( dmnModel.getNamespace(), model.getName()+"_Type", model.getId(), dt.getHitPolicy().isMultiHit() ); for ( OutputClause oc : dt.getOutput() ) { DMNType fieldType = resolveTypeRef( dmnModel, node, model, oc, oc.getTypeRef() ); compType.addField( oc.getName(), fieldType ); } dmnModel.getTypeRegistry().registerType( compType ); return compType; } else if ( dt.getOutput().size() == 1 ) { return resolveTypeRef( dmnModel, node, model, dt.getOutput().get( 0 ), dt.getOutput().get( 0 ).getTypeRef() ); } } } else if( type == null ) { MsgUtil.reportMessage( logger, DMNMessage.Severity.ERROR, localElement, dmnModel, null, null, Msg.UNKNOWN_TYPE_REF_ON_NODE, typeRef.toString(), Optional.ofNullable(localElement.getParentDRGElement()).map(x->x.getIdentifierString()).orElse(null) ); } return type; } return dmnModel.getTypeRegistry().resolveType( DMNModelInstrumentedBase.URI_FEEL, BuiltInType.UNKNOWN.getName() ); }

Target:
public DMNType resolveTypeRef(DMNModelImpl dmnModel, DMNNode node, NamedElement model, DMNModelInstrumentedBase localElement, QName typeRef) { if ( typeRef != null ) { String namespace = getNamespace( localElement, typeRef ); DMNType type = dmnModel.getTypeRegistry().resolveType( namespace, typeRef.getLocalPart() ); if( type == null && DMNModelInstrumentedBase.URI_FEEL.equals( namespace ) ) { if ( model instanceof Decision && ((Decision) model).getExpression() instanceof DecisionTable ) { DecisionTable dt = (DecisionTable) ((Decision) model).getExpression(); if ( dt.getOutput().size() > 1 ) { CompositeTypeImpl compType = new CompositeTypeImpl( dmnModel.getNamespace(), model.getName()+"_Type", model.getId(), dt.getHitPolicy().isMultiHit() ); for ( OutputClause oc : dt.getOutput() ) { DMNType fieldType = resolveTypeRef( dmnModel, node, model, oc, oc.getTypeRef() ); compType.addField( oc.getName(), fieldType ); } dmnModel.getTypeRegistry().registerType( compType ); return compType; } else if ( dt.getOutput().size() == 1 ) { return resolveTypeRef( dmnModel, node, model, dt.getOutput().get( 0 ), dt.getOutput().get( 0 ).getTypeRef() ); } } } else if( type == null ) { MsgUtil.reportMessage( logger, DMNMessage.Severity.ERROR, localElement, dmnModel, null, null, Msg.UNKNOWN_TYPE_REF_ON_NODE, typeRef.toString(), localElement.getParentDRGElement().getIdentifierString() ); } return type; } return dmnModel.getTypeRegistry().resolveType( DMNModelInstrumentedBase.URI_FEEL, BuiltInType.UNKNOWN.getName() ); }
Source:
public Map<Guid, List<String>> getHostNetworksByCluster(Guid clusterId) { MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource() .addValue("cluster_id", clusterId); List<Pair<Guid, String>> list = getCallsHandler().executeReadList("GetHostNetworksByCluster", new RowMapper<Pair<Guid, String>>() { @Override public Pair<Guid, String> mapRow(ResultSet rs, int arg1) throws SQLException { return new Pair<Guid, String>(getGuid(rs, "vds_id"), rs.getString("network_name")); } }, parameterSource); Map<Guid, List<String>> map = new HashMap<Guid, List<String>>(); if (list != null) { for (Pair<Guid, String> pair : list) { List<String> hostNameList = map.get(pair.getFirst()); if (hostNameList == null) { hostNameList = new ArrayList<>(); map.put(pair.getFirst(), hostNameList); } hostNameList.add(pair.getSecond()); } } return map; }

Target:
public Map<Guid, List<String>> getHostNetworksByCluster(Guid clusterId) { MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource() .addValue("cluster_id", clusterId); List<Pair<Guid, String>> hostNetworks = getCallsHandler().executeReadList("GetHostNetworksByCluster", HostNetworkNameMapper, parameterSource); Map<Guid, List<String>> neworksByHost = new HashMap<>(); for (Pair<Guid, String> pair : hostNetworks) { if (!neworksByHost.containsKey(pair.getFirst())) { neworksByHost.put(pair.getFirst(), new ArrayList<String>()); } neworksByHost.get(pair.getFirst()).add(pair.getSecond()); } return neworksByHost; }
Source:
public void shouldPerformIndexScan() throws Exception { int label = token.nodeLabel( "Node" ); int prop = token.propertyKey( "prop" ); CapableIndexReference index = schemaRead.index( label, prop ); IndexValueCapability wildcardCapability = index.value( new ValueGroup[]{null} ); try ( NodeValueIndexCursor node = cursors.allocateNodeValueIndexCursor(); PrimitiveLongSet uniqueIds = Primitive.longSet() ) { read.nodeIndexScan( index, node, null ); assertFoundNodesAndValue( node, 24, uniqueIds, wildcardCapability ); } }

Target:
public void shouldPerformIndexScan() throws Exception { int label = token.nodeLabel( "Node" ); int prop = token.propertyKey( "prop" ); CapableIndexReference index = schemaRead.index( label, prop ); IndexValueCapability wildcardCapability = index.valueCapability( ValueGroup.UNKNOWN ); try ( NodeValueIndexCursor node = cursors.allocateNodeValueIndexCursor(); PrimitiveLongSet uniqueIds = Primitive.longSet() ) { read.nodeIndexScan( index, node, IndexOrder.NONE ); assertFoundNodesAndValue( node, 24, uniqueIds, wildcardCapability ); } }
Source:
protected final void store(TxInvocationContext ctx) throws Throwable { List<WriteCommand> modifications = ctx.getCacheTransaction().getAllModifications(); if (modifications.isEmpty()) { if (trace) getLog().trace("Transaction has not logged any modifications!"); return; } if (trace) getLog().tracef("Cache loader modification list: %s", modifications); BatchUpdater modsBuilder = BatchUpdater.createNonTxStoreUpdater(this); for (WriteCommand cacheCommand : modifications) { if (isStoreEnabled(cacheCommand)) { cacheCommand.acceptVisitor(ctx, modsBuilder); } } BatchModification sharedMods = modsBuilder.modifications; BatchModification nonSharedMods = modsBuilder.nonSharedModifications; persistenceManager.writeBatchToAllNonTxStores(sharedMods.getMarshalledEntries(), BOTH, 0); persistenceManager.writeBatchToAllNonTxStores(nonSharedMods.getMarshalledEntries(), PRIVATE, 0); persistenceManager.deleteBatchFromAllNonTxStores(sharedMods.getKeysToRemove(), BOTH, 0); persistenceManager.deleteBatchFromAllNonTxStores(nonSharedMods.getKeysToRemove(), PRIVATE, 0); if (trace) { getLog().tracef("Writing shared batch with #entries=%s and non-shared batch with #entries=%s", sharedMods.getMarshalledEntries().size(), nonSharedMods.getMarshalledEntries().size()); getLog().tracef("Deleting shared batch with #entries=%s and non-shared batch with #entries=%s", sharedMods.getKeysToRemove().size(), nonSharedMods.getKeysToRemove().size()); } if (getStatisticsEnabled() && modsBuilder.putCount > 0) { cacheStores.getAndAdd(modsBuilder.putCount); } }

Target:
protected final void store(TxInvocationContext ctx) throws Throwable { List<WriteCommand> modifications = ctx.getCacheTransaction().getAllModifications(); if (modifications.isEmpty()) { if (trace) getLog().trace("Transaction has not logged any modifications!"); return; } if (trace) getLog().tracef("Cache loader modification list: %s", modifications); TxBatchUpdater modsBuilder = TxBatchUpdater.createNonTxStoreUpdater(this, persistenceManager, entryFactory, marshaller); for (WriteCommand cacheCommand : modifications) { if (isStoreEnabled(cacheCommand)) { cacheCommand.acceptVisitor(ctx, modsBuilder); } } BatchModification sharedMods = modsBuilder.getModifications(); BatchModification nonSharedMods = modsBuilder.getNonSharedModifications(); persistenceManager.writeBatchToAllNonTxStores(sharedMods.getMarshalledEntries(), BOTH, 0); persistenceManager.writeBatchToAllNonTxStores(nonSharedMods.getMarshalledEntries(), PRIVATE, 0); persistenceManager.deleteBatchFromAllNonTxStores(sharedMods.getKeysToRemove(), BOTH, 0); persistenceManager.deleteBatchFromAllNonTxStores(nonSharedMods.getKeysToRemove(), PRIVATE, 0); if (trace) { getLog().tracef("Writing shared batch with #entries=%d and non-shared batch with #entries=%d", sharedMods.getMarshalledEntries().size(), nonSharedMods.getMarshalledEntries().size()); getLog().tracef("Deleting shared batch with #entries=%d and non-shared batch with #entries=%d", sharedMods.getKeysToRemove().size(), nonSharedMods.getKeysToRemove().size()); } if (getStatisticsEnabled() && modsBuilder.getPutCount() > 0) { cacheStores.getAndAdd(modsBuilder.getPutCount()); } }
Source:
public Response update(String json) { if(!DeploymentEnvironment.isAppEngineDevelopment() && !user.get().getEmail().endsWith("@bedatadriven.com")) { return Response.status(Status.FORBIDDEN).build(); } Gson gson = new Gson(); final JsonElement jsonElement = gson.fromJson(json, JsonElement.class); return queryExecutor.doWork(new HibernateQueryExecutor.StoreSession<Response>() { @Override public Response execute(CollectionCatalog catalog) { Updater updater = new Updater(catalog); try { updater.execute(jsonElement.getAsJsonObject()); } catch (InvalidUpdateException e) { throw new WebApplicationException(Response.status(Status.BAD_REQUEST).entity(e.getMessage()).build()); } return Response.ok().build(); } }); }

Target:
public Response update(String json) { assertUserIsTrustedWhileInBeta(); Gson gson = new Gson(); final JsonElement jsonElement = gson.fromJson(json, JsonElement.class); return queryExecutor.doWork(new HibernateQueryExecutor.StoreSession<Response>() { @Override public Response execute(CollectionCatalog catalog) { Updater updater = new Updater(catalog); try { updater.execute(jsonElement.getAsJsonObject()); } catch (InvalidUpdateException e) { throw new WebApplicationException(Response.status(Status.BAD_REQUEST) .entity(e.getMessage()) .build()); } return Response.ok().build(); } }); }
Source:
private void addDAGToCurrentDAG(ModuleMeta moduleMeta) { LogicalPlan subDag = moduleMeta.getDag(); String subDAGName = moduleMeta.getName(); String name; for (OperatorMeta operatorMeta : subDag.getAllOperators()) { name = subDAGName + MODULE_NAMESPACE_SEPARATOR + operatorMeta.getName(); Operator op = this.addOperator(name, operatorMeta.getOperator()); this.getMeta(op).copyFrom(operatorMeta); OperatorMeta operatorMetaNew = this.getOperatorMeta(name); operatorMetaNew.setModuleName(operatorMeta.getModuleName() == null ? subDAGName : subDAGName + MODULE_NAMESPACE_SEPARATOR + operatorMeta.getModuleName()); } for (StreamMeta streamMeta : subDag.getAllStreams()) { OutputPortMeta sourceMeta = streamMeta.getSource(); List<InputPort<?>> ports = new LinkedList<>(); for (InputPortMeta inputPortMeta : streamMeta.getSinks()) { ports.add(inputPortMeta.getPortObject()); } InputPort[] inputPorts = ports.toArray(new InputPort[]{}); name = subDAGName + MODULE_NAMESPACE_SEPARATOR + streamMeta.getName(); StreamMeta streamMetaNew = this.addStream(name, sourceMeta.getPortObject(), inputPorts); streamMetaNew.copyFrom(streamMeta); } }

Target:
private void addDAGToCurrentDAG(ModuleMeta moduleMeta) { LogicalPlan subDag = moduleMeta.getDag(); String subDAGName = moduleMeta.getName(); String name; for (OperatorMeta operatorMeta : subDag.getAllOperators()) { name = subDAGName + MODULE_NAMESPACE_SEPARATOR + operatorMeta.getName(); Operator op = this.addOperator(name, operatorMeta.getOperator()); OperatorMeta operatorMetaNew = this.getMeta(op); operatorMetaNew.copyAttributesFrom(operatorMeta); operatorMetaNew.setModuleName(operatorMeta.getModuleName() == null ? subDAGName : subDAGName + MODULE_NAMESPACE_SEPARATOR + operatorMeta.getModuleName()); } for (StreamMeta streamMeta : subDag.getAllStreams()) { OutputPortMeta sourceMeta = streamMeta.getSource(); List<InputPort<?>> ports = new LinkedList<>(); for (InputPortMeta inputPortMeta : streamMeta.getSinks()) { ports.add(inputPortMeta.getPortObject()); } InputPort[] inputPorts = ports.toArray(new InputPort[]{}); name = subDAGName + MODULE_NAMESPACE_SEPARATOR + streamMeta.getName(); StreamMeta streamMetaNew = this.addStream(name, sourceMeta.getPortObject(), inputPorts); streamMetaNew.setLocality(streamMeta.getLocality()); } }
Source:
public AccessContext(IASTName name) { this.name = name; this.isPrefixLookup = false; }

Target:
public AccessContext(IASTName name) { this(name, false); }
Source:
protected boolean acquireLock() { if (getLock() == null) { if (!super.acquireLock()) { return false; } if (!Guid.Empty.equals(getVmId()) && isVmPrestarted()) { EngineLock runLock = vmPoolHandler.createLock(getVmId()); Map<String, Pair<String, String>> exclusiveLocks = new HashMap<>(); Map<String, Pair<String, String>> sharedLocks = new HashMap<>(); exclusiveLocks.putAll(getContext().getLock().getExclusiveLocks()); exclusiveLocks.putAll(runLock.getExclusiveLocks()); if (getContext().getLock().getSharedLocks() != null) { sharedLocks.putAll(getContext().getLock().getSharedLocks()); } if (runLock.getSharedLocks() != null) { sharedLocks.putAll(runLock.getSharedLocks()); } setLock(new EngineLock(exclusiveLocks, sharedLocks)); } } return true; }

Target:
protected boolean acquireLock() { if (getLock() == null) { if (!super.acquireLock()) { return false; } if (!Guid.Empty.equals(getVmId()) && isVmPrestarted()) { EngineLock runLock = vmPoolHandler.createLock(getVmId()); Map<String, Pair<String, String>> exclusiveLocks = new HashMap<>(); Map<String, Pair<String, String>> sharedLocks = new HashMap<>(); if (getContext().getLock().getExclusiveLocks() != null) { exclusiveLocks.putAll(getContext().getLock().getExclusiveLocks()); } exclusiveLocks.putAll(runLock.getExclusiveLocks()); if (getContext().getLock().getSharedLocks() != null) { sharedLocks.putAll(getContext().getLock().getSharedLocks()); } if (runLock.getSharedLocks() != null) { sharedLocks.putAll(runLock.getSharedLocks()); } setLock(new EngineLock(exclusiveLocks, sharedLocks)); } } return true; }
Source:
public void failed(final Exception ex) { LOG.log(Level.WARNING, "Dashboard: Post request failed - ", ex); }

Target:
public void failed(final Exception ex) { LOG.log(Level.WARNING, "Dashboard: Post request failed.", ex); }
Source:
public List<String> readDepgraphs() { if (depgraphs != null) { return depgraphs; } List<String> result = new ArrayList<>(); for (String file : depgraphFiles) { try { result.add(Files.toString(new File(file), UTF_8)); } catch (FileNotFoundException e) { throw new IllegalArgumentException("depgraph file not found: " + file, e); } catch (IOException e) { throw new RuntimeException("error reading depgraph file " + file, e); } } return result; }

Target:
public List<String> readDepgraphs() { List<String> result = new ArrayList<>(); for (String file : depgraphFiles) { try { result.add(Files.toString(new File(file), UTF_8)); } catch (FileNotFoundException e) { throw new IllegalArgumentException("depgraph file not found: " + file, e); } catch (IOException e) { throw new RuntimeException("error reading depgraph file " + file, e); } } return result; }
Source:
public void onEvent(Event event) { long eventSeenAt = 0L; boolean trackMetrics = false; EventType eventType = event.getHeader().getEventType(); if (eventType == EventType.QUERY) { transactionStartTime = event.getHeader().getTimestamp(); } else if (eventType == EventType.XID) { trackMetrics = true; eventSeenAt = System.currentTimeMillis(); long transactionCommitTime = event.getHeader().getTimestamp(); replicationLag = eventSeenAt - transactionCommitTime; executionTime = transactionCommitTime - transactionStartTime; } else if (eventType == EventType.GTID) { gtid = ((GtidEventData)event.getData()).getGtid(); } BinlogConnectorEvent ep = new BinlogConnectorEvent(event, client.getBinlogFilename(), client.getGtidSet(), gtid); while (mustStop.get() != true) { try { if ( queue.offer(ep, 100, TimeUnit.MILLISECONDS ) ) { break; } } catch (InterruptedException e) { return; } } if (trackMetrics) { queueTimer.update(System.currentTimeMillis() - eventSeenAt, TimeUnit.MILLISECONDS); } }

Target:
public void onEvent(Event event) { long eventSeenAt = 0; boolean trackMetrics = false; if (event.getHeader().getEventType() == EventType.GTID) { gtid = ((GtidEventData)event.getData()).getGtid(); } BinlogConnectorEvent ep = new BinlogConnectorEvent(event, client.getBinlogFilename(), client.getGtidSet(), gtid); if (ep.isCommitEvent()) { trackMetrics = true; eventSeenAt = System.currentTimeMillis(); replicationLag = eventSeenAt - event.getHeader().getTimestamp(); } while (mustStop.get() != true) { try { if ( queue.offer(ep, 100, TimeUnit.MILLISECONDS ) ) { break; } } catch (InterruptedException e) { return; } } if (trackMetrics) { queueTimer.update(System.currentTimeMillis() - eventSeenAt, TimeUnit.MILLISECONDS); } }
Source:
public String toString() { String result = ""; if (major != null) { result += major.toString(); } if (minor != null) { result += (result.length() > 0 ? "." : "") + minor.toString(); } if (micro != null) { result += (result.length() > 0 ? "." : "") + micro.toString(); } if (qualifier != null) { result += qualifier.toString(); } return result; }

Target:
public String toString() { return orgVersion; }
Source:
public void executeQueryWithSnapshotEngine() { db = new EnterpriseGraphDatabaseFactory() .newEmbeddedDatabaseBuilder( testDirectory.directory("withSnapshotEngine") ) .setConfig( new BoltConnector( "bolt" ).type, "BOLT" ) .setConfig( new BoltConnector( "bolt" ).enabled, "true" ) .setConfig( new BoltConnector( "bolt" ).listen_address, "localhost:0" ) .setConfig( GraphDatabaseSettings.snapshot_query, Settings.TRUE ) .newGraphDatabase(); initDatabase(); connectDirver(); verifyQueryExecution(); }

Target:
public void executeQueryWithSnapshotEngine() { executeQuery( "withSnapshotEngine", Settings.TRUE ); }
Source:
public void getInstanceAsync_nonLooperThreadShouldThrow() { DynamicRealm.getInstanceAsync(defaultConfig, new DynamicRealm.Callback() { @Override public void onSuccess(DynamicRealm realm) { } }); }

Target:
public void getInstanceAsync_nonLooperThreadShouldThrow() { DynamicRealm.getInstanceAsync(defaultConfig, new DynamicRealm.Callback() { @Override public void onSuccess(DynamicRealm realm) { fail(); } }); }
Source:
public void testHelpfulErrorOnNothingSet() throws Exception { try { h.createQuery("select * from something where name = :name").list(); fail("should have raised exception"); } catch (UnableToExecuteStatementException e) { assertThat(e).isNotNull(); } catch (Exception e) { fail("Raised incorrect exception"); } }

Target:
public void testHelpfulErrorOnNothingSet() throws Exception { h.createQuery("select * from something where name = :name").list(); }
Source:
public static InputStream getResource(String propertyName, String fileName, String defaultDir) { try { String filePath = System.getProperty(propertyName); InputStream in = loadFromFile(filePath); if (in != null) { logger.info("Loading resource from file name: {}," + " defined by Java property: {}", filePath, propertyName); return in; } in = ResourceUtils.class.getResourceAsStream( "/" + fileName); if (in != null) { logger.info( "Info: Using relex algorithms file defined as a resource."); return in; } File defaultRelexPath = new File(defaultDir, fileName); in = loadFromFile(defaultRelexPath); if (in != null) { logger.info( "Info: Using default relex algorithms file: {}", defaultRelexPath); return in; } throw new RuntimeException("Error loading " + fileName + " file."); } catch (FileNotFoundException exception) { throw new RuntimeException(exception); } }

Target:
public static InputStream getResource(String propertyName, String fileName, String defaultDir) { try { String filePath = System.getProperty(propertyName); InputStream in = loadFromFile(filePath); if (in != null) { logger.info("Info: Loading resource from file name: {}," + " defined by Java property: {}", filePath, propertyName); return in; } in = ResourceUtils.class.getResourceAsStream( "/" + fileName); if (in != null) { logger.info("Info: Loading resource from jar.", fileName); return in; } File defaultRelexPath = new File(defaultDir, fileName); in = loadFromFile(defaultRelexPath); if (in != null) { logger.info("Info: Loading resource from file {}/{}.", defaultDir, fileName); return in; } throw new RuntimeException("Error loading " + fileName + " file."); } catch (FileNotFoundException exception) { throw new RuntimeException(exception); } }
Source:
public static List<MainType> getMainTypesByTumorTypes(Set<TumorType> tumorTypes) { Set<MainType> mainTypes = new HashSet<>(); for (TumorType tumorType : tumorTypes) { if (tumorType.getMainType() != null && tumorType.getParent() != null) { mainTypes.add(tumorType.getMainType()); } } List<MainType> toReturn = new ArrayList<>(); toReturn.addAll(mainTypes); return toReturn; }

Target:
public static List<MainType> getMainTypesByTumorTypes(Set<TumorType> tumorTypes) { Set<MainType> mainTypes = new HashSet<>(); for (TumorType tumorType : tumorTypes) { if (tumorType.getMainType() != null && tumorType.getParent() != null) { mainTypes.add(tumorType.getMainType()); } } return new ArrayList<>(mainTypes); }
Source:
public void checkSpecificAccessControl() { if (userInfo.isInstructor) { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, userInfo.id); gateKeeper.verifyAccessible( instructor, logic.getCourse(courseId), Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_STUDENT); return; } throw new UnauthorizedAccessException("Instructor privilege is required to delete students from course."); }

Target:
public void checkSpecificAccessControl() { if (!userInfo.isInstructor) { throw new UnauthorizedAccessException("Instructor privilege is required to delete students from course."); } String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, userInfo.id); gateKeeper.verifyAccessible( instructor, logic.getCourse(courseId), Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_STUDENT); }
Source:
public static MutableOcflRepository createRepository(final Path ocflStorageRootDir, final Path ocflWorkDir) throws IOException { Files.createDirectories(ocflStorageRootDir); Files.createDirectories(ocflWorkDir); log.info("Fedora OCFL persistence directories:\n- {}\n- {}", ocflStorageRootDir, ocflWorkDir); final var defaultFcrepoAlg = ContentDigest.DEFAULT_DIGEST_ALGORITHM; final DigestAlgorithm ocflDigestAlg = translateFedoraDigestToOcfl(defaultFcrepoAlg); if (ocflDigestAlg == null) { throw new UnsupportedDigestAlgorithmException( "Unable to map Fedora default digest algorithm " + defaultFcrepoAlg + " into OCFL"); } final OcflConfig config = new OcflConfig(); config.setDefaultDigestAlgorithm(ocflDigestAlg); return new OcflRepositoryBuilder() .layoutConfig(DefaultLayoutConfig.nTupleHashConfig()) .ocflConfig(config) .storage((FileSystemOcflStorage.builder().repositoryRoot(ocflStorageRootDir).build())) .workDir(ocflWorkDir) .buildMutable(); }

Target:
public static MutableOcflRepository createRepository(final Path ocflStorageRootDir, final Path ocflWorkDir) throws IOException { Files.createDirectories(ocflStorageRootDir); Files.createDirectories(ocflWorkDir); log.debug("Fedora OCFL persistence directories:\n- {}\n- {}", ocflStorageRootDir, ocflWorkDir); final var defaultFcrepoAlg = ContentDigest.DEFAULT_DIGEST_ALGORITHM; final DigestAlgorithm ocflDigestAlg = translateFedoraDigestToOcfl(defaultFcrepoAlg); if (ocflDigestAlg == null) { throw new UnsupportedDigestAlgorithmException( "Unable to map Fedora default digest algorithm " + defaultFcrepoAlg + " into OCFL"); } final OcflConfig config = new OcflConfig(); config.setDefaultDigestAlgorithm(ocflDigestAlg); return new OcflRepositoryBuilder() .layoutConfig(DefaultLayoutConfig.nTupleHashConfig()) .ocflConfig(config) .storage((FileSystemOcflStorage.builder().repositoryRoot(ocflStorageRootDir).build())) .workDir(ocflWorkDir) .buildMutable(); }
Source:
public String getName() { return NbBundle.getMessage(this.getClass(), "CommonFilesNode.getName.text"); }

Target:
public String getName() { return Bundle.CommonFilesNode_getName_text(); }
Source:
private void visitClassOrInterface(String name, FunctionType ftype) { final boolean emitInstance = !ftype.isInterface(); if (emitInstance) { emit("class"); emit(name); visitTemplateTypes(ftype); emit("extends"); emit(name + INSTANCE_CLASS_SUFFIX); visitTemplateTypes(ftype); emit("{"); indent(); emitBreak(); visitProperties(ftype, true); unindent(); emit("}"); emitBreak(); } if (ftype.isConstructor()) { emit("class"); } else if (ftype.isInterface()) { emit("interface"); } else { checkState(false, "Unexpected function type " + ftype); } emit(emitInstance ? name + INSTANCE_CLASS_SUFFIX : name); visitTemplateTypes(ftype); if (ftype.getExtendedInterfacesCount() > 0) { emit("extends"); Iterator<ObjectType> it = ftype.getExtendedInterfaces().iterator(); emitCommaSeparatedInterfaces(it); } ObjectType superType = getSuperType(ftype); if (superType != null) { emit("extends"); if (isPrivate(superType.getJSDocInfo())) { emit(Constants.INTERNAL_NAMESPACE + ".PrivateClass"); } else { Visitor<Void> visitor = new ExtendsImplementsTypeVisitor( emitInstance && !isDefinedInPlatformExterns(superType)); superType.visit(visitor); } } Iterator<ObjectType> it = ftype.getOwnImplementedInterfaces().iterator(); if (it.hasNext()) { emit("implements"); emitCommaSeparatedInterfaces(it); } boolean implementsIArrayLike = any(ftype.getOwnImplementedInterfaces(), IARRAYLIKE_PREDICATE); visitObjectType(ftype, ftype.getPrototype(), ftype.isDict() || implementsIArrayLike); }

Target:
private void visitClassOrInterface(String name, FunctionType ftype) { final boolean emitInstance = !ftype.isInterface(); if (emitInstance) { emit("class"); emit(name); visitTemplateTypes(ftype); emit("extends"); emit(name + INSTANCE_CLASS_SUFFIX); visitTemplateTypes(ftype); emit("{"); indent(); emitBreak(); visitProperties(ftype, true); unindent(); emit("}"); emitBreak(); } if (ftype.isConstructor()) { emit("class"); } else if (ftype.isInterface()) { emit("interface"); } else { checkState(false, "Unexpected function type " + ftype); } emit(emitInstance ? name + INSTANCE_CLASS_SUFFIX : name); visitTemplateTypes(ftype); if (ftype.getExtendedInterfacesCount() > 0) { emit("extends"); Iterator<ObjectType> it = ftype.getExtendedInterfaces().iterator(); emitCommaSeparatedInterfaces(it); } ObjectType superType = getSuperType(ftype); if (superType != null) { emit("extends"); if (isPrivate(superType.getJSDocInfo())) { emit(Constants.INTERNAL_NAMESPACE + ".PrivateClass"); } else { Visitor<Void> visitor = new ExtendsImplementsTypeVisitor( emitInstance && !isDefinedInPlatformExterns(superType)); superType.visit(visitor); } } Iterator<ObjectType> it = ftype.getOwnImplementedInterfaces().iterator(); if (it.hasNext()) { emit("implements"); emitCommaSeparatedInterfaces(it); } boolean implementsIArrayLike = any(ftype.getAllImplementedInterfaces(), IS_IARRAYLIKE); visitObjectType(ftype, ftype.getPrototype(), ftype.isDict() || implementsIArrayLike); }
Source:
public Optional<ImmutableDyeableData> with(Key<? extends BaseValue<?>> key, Object value, ImmutableDyeableData immutable) { if (key.equals(Keys.DYE_COLOR)) { return Optional.of(new ImmutableSpongeDyeableData((DyeColor) value)); } return Optional.empty(); }

Target:
public Optional<ImmutableDyeableData> with(Key<? extends BaseValue<?>> key, Object value, ImmutableDyeableData immutable) { if (key.equals(Keys.DYE_COLOR)) { return Optional.of(ImmutableDataCachingUtil.getManipulator(ImmutableDyeableData.class, value)); } return Optional.empty(); }
Source:
protected void compute(CoreSession session, List<String> ids, Map<String, Serializable> properties) { Collection<DocumentRef> refs = ids.stream().map(IdRef::new).collect(Collectors.toList()); DocumentModelList docs = session.getDocuments(refs.toArray(new DocumentRef[refs.size()])); Collection<DocumentRef> proxies = docs.stream() .filter(DocumentModel::isProxy) .map(DocumentModel::getRef) .collect(Collectors.toList()); session.removeDocuments(proxies.toArray(new DocumentRef[0])); session.save(); }

Target:
protected void compute(CoreSession session, List<String> ids, Map<String, Serializable> properties) { String query = String.format(QUERY_TEMPLATE, String.join("', '", ids)); Set<DocumentRef> proxies = new HashSet<>(); try (IterableQueryResult res = session.queryAndFetch(query, NXQL.NXQL)) { for (Map<String, Serializable> map : res) { proxies.add(new IdRef((String) map.get(NXQL.ECM_UUID))); } } session.removeDocuments(proxies.toArray(new DocumentRef[0])); session.save(); }
Source:
public boolean doesUserHasPermissionToAddContent (final String containerInode) throws DotDataException { if(!InodeUtils.isSet(containerInode)) { return false; } else { final User systemUser = APILocator.getUserAPI().getSystemUser(); Container container = null; try { container = APILocator.getContainerAPI().find(containerInode, systemUser, false); } catch (DotSecurityException e) { Logger.debug(this.getClass(), "Exception on doesUserHasPermissionToAddContent exception message: " + e.getMessage(), e); throw new DotRuntimeException(e); } final User loggedInUser = APILocator.getLoginServiceAPI().getLoggedInUser(); final List<ContentType> contentTypesInContainer = containerAPI.getContentTypesInContainer(loggedInUser, container); return !contentTypesInContainer.isEmpty(); } }

Target:
public boolean doesUserHasPermissionToAddContent (final String containerInode) throws DotDataException { if(!InodeUtils.isSet(containerInode)) { return false; } else { final User systemUser = userAPI.getSystemUser(); Container container = null; try { container = containerAPI.find(containerInode, systemUser, false); } catch (DotSecurityException e) { Logger.debug(this.getClass(), "Exception on doesUserHasPermissionToAddContent exception message: " + e.getMessage(), e); throw new DotRuntimeException(e); } final List<ContentType> contentTypesInContainer = containerAPI.getContentTypesInContainer(backuser, container); return contentTypesInContainer != null && !contentTypesInContainer.isEmpty(); } }
Source:
public void testHealthCheckIsRescheduled() { ArgumentCaptor<ServicePool.HealthCheckVerifier> verifyCapture = ArgumentCaptor.forClass(ServicePool.HealthCheckVerifier.class); verify(_healthCheckExecutor).scheduleAtFixedRate(verifyCapture.capture(), anyLong(), anyLong(), any(TimeUnit.class)); ServicePool.HealthCheckVerifier verify = verifyCapture.getValue(); when(_healthCheckExecutor.submit(any(ServicePool.HealthCheck.class))).thenThrow(NullPointerException.class); try { _pool.execute(NEVER_RETRY, new ServiceCallback<Service, Void>() { @Override public Void call(Service service) throws ServiceException { throw new ServiceException(); } }); fail(); } catch (MaxRetriesException expected) { } ArgumentCaptor<ServicePool.HealthCheck> healthCheckCapture = ArgumentCaptor.forClass(ServicePool.HealthCheck.class); verify(_healthCheckExecutor, times(1)).submit(healthCheckCapture.capture()); ServicePool.HealthCheck healthCheck = healthCheckCapture.getValue(); verify.run(); verify(_healthCheckExecutor, times(2)).submit(any(ServicePool.HealthCheck.class)); reset(_healthCheckExecutor); when(_healthCheckExecutor.submit(any(ServicePool.HealthCheck.class))).thenReturn(mock(Future.class)); verify.run(); verify(_healthCheckExecutor, times(1)).submit(any(ServicePool.HealthCheck.class)); verify.run(); verify(_healthCheckExecutor, times(1)).submit(any(ServicePool.HealthCheck.class)); }

Target:
public void testHealthCheckIsRescheduled() { ArgumentCaptor<ServicePool.HealthCheckVerifier> healthCheckVerifierCaptor = ArgumentCaptor.forClass(ServicePool.HealthCheckVerifier.class); verify(_healthCheckExecutor).scheduleAtFixedRate(healthCheckVerifierCaptor.capture(), anyLong(), anyLong(), any(TimeUnit.class)); ServicePool.HealthCheckVerifier healthCheckVerifier = healthCheckVerifierCaptor.getValue(); when(_healthCheckExecutor.submit(any(ServicePool.HealthCheck.class))).thenThrow(NullPointerException.class); try { _pool.execute(NEVER_RETRY, new ServiceCallback<Service, Void>() { @Override public Void call(Service service) throws ServiceException { throw new ServiceException(); } }); fail(); } catch (MaxRetriesException expected) { } verify(_healthCheckExecutor, times(1)).submit(any(ServicePool.HealthCheck.class)); healthCheckVerifier.run(); verify(_healthCheckExecutor, times(2)).submit(any(ServicePool.HealthCheck.class)); reset(_healthCheckExecutor); when(_healthCheckExecutor.submit(any(ServicePool.HealthCheck.class))).thenReturn(mock(Future.class)); healthCheckVerifier.run(); verify(_healthCheckExecutor, times(1)).submit(any(ServicePool.HealthCheck.class)); healthCheckVerifier.run(); verify(_healthCheckExecutor, times(1)).submit(any(ServicePool.HealthCheck.class)); }
Source:
private void spillToDisk() { try { Arrays.sort(this.ramRecords, 0, this.numRecordsInRam, this.comparator); final Path f = newTempFile(); OutputStream os = null; try { os = tempStreamFactory.wrapTempOutputStream(Files.newOutputStream(f), Defaults.BUFFER_SIZE); this.codec.setOutputStream(os); for (int i = 0; i < this.numRecordsInRam; ++i) { this.codec.encode(ramRecords[i]); this.ramRecords[i] = null; } os.flush(); } catch (RuntimeIOException ex) { throw new RuntimeIOException("Problem writing temporary file " + f.toUri().toString() + ". Try setting TMP_DIR to a file system with lots of space.", ex); } finally { if (os != null) { os.close(); } } this.numRecordsInRam = 0; this.files.add(f); } catch (IOException e) { throw new RuntimeIOException(e); } }

Target:
private void spillToDisk() { try { Arrays.sort(this.ramRecords, 0, this.numRecordsInRam, this.comparator); final Path f = newTempFile(); OutputStream os = null; try { os = tempStreamFactory.wrapTempOutputStream(Files.newOutputStream(f), Defaults.BUFFER_SIZE); this.codec.setOutputStream(os); for (int i = 0; i < this.numRecordsInRam; ++i) { this.codec.encode(ramRecords[i]); this.ramRecords[i] = null; } os.flush(); } catch (RuntimeIOException ex) { throw new RuntimeIOException("Problem writing temporary file " + f.toUri() + ". Try setting TMP_DIR to a file system with lots of space.", ex); } finally { if (os != null) { os.close(); } } this.numRecordsInRam = 0; this.files.add(f); } catch (IOException e) { throw new RuntimeIOException(e); } }
Source:
public int getItemViewType(int position) { return layoutsForItems.get(position).layoutRes; }

Target:
public int getItemViewType(int position) { Event event = getItem(position).first; return EventViewType.valueOf(event).getLayoutRes(); }
Source:
void decrement() { AtomicLong localCount = count; if ( localCount != null ) { if ( (localCount.decrementAndGet() == 0) ) { count = null; if ( localCount.compareAndSet(0, Long.MIN_VALUE) ) { completionProc.run(); } } } }

Target:
void decrement() { if ( active && (count.decrementAndGet() == 0) ) { Runnable proc = completionProc.getAndSet(null); if ( proc != null ) { active = false; proc.run(); } } }
Source:
public void test30(@Injectable final List<AuthorizationValue> auths) throws Exception{ String pathFile = FileUtils.readFileToString(new File("src/test/resources/oas3.yaml.template")); pathFile = pathFile.replace("${dynamicPort}", String.valueOf(this.serverPort)); ParseOptions options = new ParseOptions(); options.setResolve(true); SwaggerParseResult result = new OpenAPIV3Parser().readContents(pathFile, auths, options ); Assert.assertNotNull(result); Assert.assertNotNull(result.getOpenAPI()); Assert.assertEquals(result.getOpenAPI().getOpenapi(), "3.0"); Assert.assertEquals(result.getOpenAPI().getComponents().getSchemas().get("OrderRef").getType(),"object"); }

Target:
public void test30(@Injectable final List<AuthorizationValue> auths) throws Exception{ String pathFile = FileUtils.readFileToString(new File("src/test/resources/oas3.yaml.template")); pathFile = pathFile.replace("${dynamicPort}", String.valueOf(this.serverPort)); ParseOptions options = new ParseOptions(); options.setResolve(true); SwaggerParseResult result = new OpenAPIV3Parser().readContents(pathFile, auths, options ); Assert.assertNotNull(result); Assert.assertNotNull(result.getOpenAPI()); Assert.assertEquals(result.getOpenAPI().getOpenapi(), "3.0.0"); Assert.assertEquals(result.getOpenAPI().getComponents().getSchemas().get("OrderRef").getType(),"object"); }
Source:
public CommonTargetToModelUpdateStrategy(VElement vElement, EStructuralFeature eStructuralFeature) { this.vElement = vElement; this.eStructuralFeature = eStructuralFeature; }

Target:
public CommonTargetToModelUpdateStrategy(VElement vElement, EStructuralFeature eStructuralFeature) { super(POLICY_UPDATE); this.vElement = vElement; this.eStructuralFeature = eStructuralFeature; }
Source:
public DockerImageName(String fullImageName) { this.rawName = fullImageName; final int slashIndex = fullImageName.indexOf('/'); String remoteName; if (slashIndex == -1 || (!fullImageName.substring(0, slashIndex).contains(".") && !fullImageName.substring(0, slashIndex).contains(":") && !fullImageName.substring(0, slashIndex).equals("localhost"))) { registry = ""; remoteName = fullImageName; } else { registry = fullImageName.substring(0, slashIndex); remoteName = fullImageName.substring(slashIndex + 1); } if (remoteName.contains("@sha256:")) { repo = remoteName.split("@sha256:")[0]; versioning = new Versioning.Sha256Versioning(remoteName.split("@sha256:")[1]); } else if (remoteName.contains(":")) { repo = remoteName.split(":")[0]; versioning = new Versioning.TagVersioning(remoteName.split(":")[1]); } else { repo = remoteName; versioning = Versioning.TagVersioning.LATEST; } compatibleSubstituteFor = null; }

Target:
public DockerImageName(String fullImageName) { this.rawName = fullImageName; final int slashIndex = fullImageName.indexOf('/'); String remoteName; if (slashIndex == -1 || (!fullImageName.substring(0, slashIndex).contains(".") && !fullImageName.substring(0, slashIndex).contains(":") && !fullImageName.substring(0, slashIndex).equals("localhost"))) { registry = ""; remoteName = fullImageName; } else { registry = fullImageName.substring(0, slashIndex); remoteName = fullImageName.substring(slashIndex + 1); } if (remoteName.contains("@sha256:")) { repo = remoteName.split("@sha256:")[0]; versioning = new Sha256Versioning(remoteName.split("@sha256:")[1]); } else if (remoteName.contains(":")) { repo = remoteName.split(":")[0]; versioning = new TagVersioning(remoteName.split(":")[1]); } else { repo = remoteName; versioning = Versioning.ANY; } compatibleSubstituteFor = null; }
Source:
protected HttpJsonRequest createPingRequest(Machine machine) throws ServerException { Map<String, ? extends Server> servers = machine.getRuntime().getServers(); Server wsAgentServer = servers.get(Constants.WS_AGENT_PORT); if (wsAgentServer == null) { LOG.error("{} WorkspaceId: {}, DevMachine Id: {}, found servers: {}", WS_AGENT_SERVER_NOT_FOUND_ERROR, machine.getWorkspaceId(), machine.getId(), servers); throw new ServerException(WS_AGENT_SERVER_NOT_FOUND_ERROR); } String wsAgentPingUrl = wsAgentServer.getUrl(); if (!wsAgentPingUrl.endsWith("/")) { wsAgentPingUrl = wsAgentPingUrl.concat("/"); } return httpJsonRequestFactory.fromUrl(wsAgentPingUrl) .setMethod(HttpMethod.GET) .setTimeout(wsAgentPingConnectionTimeoutMs); }

Target:
protected HttpJsonRequest createPingRequest(Machine machine) throws ServerException { return wsAgentPingRequestFactory.createRequest(machine); }
Source:
protected ValidatorLocator getValidatorLocator() { if (validatorLocator == null) { validatorLocator = new ValidatorLocator(); validatorLocator.populate(); } return validatorLocator; }

Target:
protected ValidatorLocator getValidatorLocator() { return validatorLocator; }
Source:
public void testSaveAsXml() { final String xml = "xml"; final String comment = "comment"; final Map<String, Object> attributes = new HashMap<>(); final Path path = mock(Path.class); final Metadata metadata = mock(Metadata.class); final CommentedOption options = mock(CommentedOption.class); when(metadataService.setUpAttributes(path, metadata)).thenReturn(attributes); when(commentedOptionFactory.makeCommentedOption(comment)).thenReturn(options); diagramService.saveAsXml(path, xml, metadata, comment); verify(diagramServiceController, times(1)).saveAsXml(eq(path), eq(xml), eq(attributes), eq(options)); }

Target:
public void testSaveAsXml() { final String xml = "xml"; final String comment = "comment"; final Map<String, Object> attributes = Collections.singletonMap("key", "value"); final Path path = mock(Path.class); final Metadata metadata = mock(Metadata.class); final CommentedOption options = mock(CommentedOption.class); when(metadataService.setUpAttributes(path, metadata)).thenReturn(attributes); when(commentedOptionFactory.makeCommentedOption(comment)).thenReturn(options); diagramService.saveAsXml(path, xml, metadata, comment); verify(diagramServiceController, times(1)).saveAsXml(eq(path), eq(xml), eq(attributes), eq(options)); }
Source:
public void removeMessagesFromGroup(Object groupId, Collection<Message<?>> messages) { Assert.notNull(groupId, "'groupId' must not be null"); Assert.notNull(messages, "'messageToRemove' must not be null"); for (Message<?> messageToRemove : messages) { doRemove(groupId, messageToRemove); } updateGroup(groupId, lastModifiedUpdate()); }

Target:
public void removeMessagesFromGroup(Object groupId, Collection<Message<?>> messages) { Assert.notNull(groupId, "'groupId' must not be null"); Assert.notNull(messages, "'messageToRemove' must not be null"); Collection<UUID> ids = new ArrayList<UUID>(); for (Message<?> messageToRemove : messages) { ids.add(messageToRemove.getHeaders().getId()); if (ids.size() >= getRemoveBatchSize()) { removeMessages(groupId, ids); ids.clear(); } } if (ids.size() > 0) { removeMessages(groupId, ids); } updateGroup(groupId, lastModifiedUpdate()); }
Source:
public boolean onPreferenceClick(Preference preference) { String preferenceKey = preference != null ? preference.getKey() : ""; if (preferenceKey.equals(getString(R.string.pref_key_device_settings))) { return handleDevicePreferenceClick(); } else if (preferenceKey.equals(getString(R.string.pref_key_app_about))) { return handleAboutPreferenceClick(); } else if (preferenceKey.equals(getString(R.string.pref_key_oss_licenses))) { return handleOssPreferenceClick(); } else if (preference == mPrivacySettings) { setupPrivacySettings(); } return false; }

Target:
public boolean onPreferenceClick(Preference preference) { String preferenceKey = preference != null ? preference.getKey() : ""; if (preferenceKey.equals(getString(R.string.pref_key_device_settings))) { return handleDevicePreferenceClick(); } else if (preferenceKey.equals(getString(R.string.pref_key_app_about))) { return handleAboutPreferenceClick(); } else if (preferenceKey.equals(getString(R.string.pref_key_oss_licenses))) { return handleOssPreferenceClick(); } else if (preference == mPrivacySettings) { return handlePrivacyClick(); } return false; }
Source:
private void pump(final SSEProcessor processor, final SseEventInputImpl input) { Map<Class<?>, Object> contextDataMap = ResteasyContext.getContextDataMap(); executor.execute(() -> { ResteasyContext.pushContextDataMap(contextDataMap); Type typeArgument; InboundSseEvent event; if (genericType instanceof ParameterizedType) { typeArgument = ((ParameterizedType) genericType).getActualTypeArguments()[0]; if (typeArgument.equals(InboundSseEvent.class)) { try { while ((event = input.read(providers)) != null) { processor.emit(event); } } catch (Exception e) { processor.onError(e); return; } processor.onCompletion(); } else { try { while ((event = input.read(providers)) != null) { processor.emit(event.readData((Class) typeArgument)); } } catch (Exception e) { processor.onError(e); return; } } processor.onCompletion(); } }); }

Target:
private void pump(final SSEProcessor processor, final SseEventInputImpl input) { Map<Class<?>, Object> contextDataMap = ResteasyContext.getContextDataMap(); Runnable readEventTask = new Runnable() { @Override public void run() { ResteasyContext.pushContextDataMap(contextDataMap); Type typeArgument; InboundSseEvent event; if (genericType instanceof ParameterizedType) { typeArgument = ((ParameterizedType) genericType).getActualTypeArguments()[0]; if (typeArgument.equals(InboundSseEvent.class)) { try { while ((event = input.read(providers)) != null) { processor.emit(event); } } catch (Exception e) { processor.onError(e); return; } processor.onCompletion(); } else { try { while ((event = input.read(providers)) != null) { processor.emit(event.readData((Class) typeArgument)); } } catch (Exception e) { processor.onError(e); return; } } processor.onCompletion(); } } }; try { executor.execute(readEventTask); } catch (RejectedExecutionException e) { LOGGER.warnf("Executor %s rejected emit event task", executor); new Thread(readEventTask, "SseClientPublisherNewThread").start(); } }
Source:
public void deleteUpload(final Contribution contribution) { ioThreadScheduler.scheduleDirect(() -> repository.deleteContributionFromDB(contribution)); }

Target:
public void deleteUpload(final Contribution contribution) { compositeDisposable.add(repository .deleteContributionFromDB(contribution) .subscribeOn(ioThreadScheduler) .subscribe()); }
Source:
public void writeTo(ParticipantStatus participantStatus, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException { entityStream.write(participantStatus.toString().getBytes()); }

Target:
public void writeTo(ParticipantStatus participantStatus, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException { entityStream.write(participantStatus.name().getBytes()); }
Source:
public final void removeSessionOnLogout(String sessionId) { removeSessionImpl(sessionId, Acct.ReportReason.PRINCIPAL_LOGOUT, "Prinicial has performed logout"); }

Target:
public final void removeSessionOnLogout(String sessionId) { removeSessionImpl(sessionId, Acct.ReportReason.PRINCIPAL_LOGOUT, "Prinicial %1$s has performed logout", getPrincipalName(sessionId)); }
Source:
protected Collection<StorageDomain> syncLunsForStorageDomains(Collection<StorageDomain> storageDomains) { List<Callable<Pair<Boolean, StorageDomain>>> syncLunsCommands = storageDomains.stream() .filter(storageDomain -> StorageDomainStatus.Active == storageDomain.getStatus()) .filter(storageDomain -> storageDomain.getStorageType().isBlockDomain()) .map(storageDomain -> (Callable<Pair<Boolean, StorageDomain>>) () -> syncDomainLuns(storageDomain)) .collect(Collectors.toList()); if (syncLunsCommands.isEmpty()) { return Collections.emptyList(); } return ThreadPoolUtil.invokeAll(syncLunsCommands).stream() .collect(Collectors.groupingBy( Pair::getFirst, Collectors.mapping(Pair::getSecond, Collectors.toList()))) .getOrDefault(false, Collections.emptyList()); }

Target:
protected Collection<Guid> syncLunsForStorageDomains(Collection<StorageDomain> storageDomains) { List<Callable<Pair<Boolean, Guid>>> syncLunsCommands = storageDomains.stream() .filter(storageDomain -> StorageDomainStatus.Active == storageDomain.getStatus()) .filter(storageDomain -> storageDomain.getStorageType().isBlockDomain()) .map(storageDomain -> (Callable<Pair<Boolean, Guid>>) () -> syncDomainLuns(storageDomain)) .collect(Collectors.toList()); if (syncLunsCommands.isEmpty()) { return Collections.emptyList(); } return ThreadPoolUtil.invokeAll(syncLunsCommands).stream() .filter(domainSyncedPair -> !domainSyncedPair.getFirst()) .map(Pair::getSecond) .collect(Collectors.toList()); }
Source:
public Iec61850MockServerMarkerWadden(final String serverName, final String icdFilename, final int port) { super(); this.serverName = serverName; this.icdFilename = icdFilename; this.port = port; }

Target:
public Iec61850MockServerMarkerWadden(final String serverName, final String icdFilename, final int port) { this.serverName = serverName; this.icdFilename = icdFilename; this.port = port; }