auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Object visitPutMapCommand(InvocationContext ctx, PutMapCommand command) { if (!ctx.isOriginLocal()) { return invokeNext(ctx, command); } final Map<Object, Object> map = command.getMap(); FileDescriptorSource source = new FileDescriptorSource(); for (Object key : map.keySet()) { final Object value = map.get(key); if (!(key instanceof String)) { throw log.keyMustBeString(key.getClass()); } if (!(value instanceof String)) { throw log.valueMustBeString(value.getClass()); } if (shouldIntercept(key)) { if (!((String) key).endsWith(PROTO_KEY_SUFFIX)) { throw log.keyMustBeStringEndingWithProto(key); } source.addProtoFile((String) key, (String) value); } } VisitableCommand cmd = commandsFactory.buildLockControlCommand(ERRORS_KEY_SUFFIX, command.getFlagsBitSet(), null); invoker.running().invoke(ctx, cmd); return invokeNextThenAccept(ctx, command, (rCtx, rCommand, rv) -> { <START> long flagsBitSet = copyFlags((rCommand)); <END> ProgressCallback progressCallback = null; if (rCtx.isOriginLocal()) { progressCallback = new ProgressCallback(rCtx, flagsBitSet); source.withProgressCallback(progressCallback); } else { source.withProgressCallback(EMPTY_CALLBACK); } try { serializationContext.registerProtoFiles(source); } catch (DescriptorParserException e) { throw log.failedToParseProtoFile(e); } if (progressCallback != null) { updateGlobalErrors(rCtx, progressCallback.getErrorFiles(), flagsBitSet); } }); }</code><technical_language>Double brackets</technical_language>

Target:
public Object visitPutMapCommand(InvocationContext ctx, PutMapCommand command) { if (!ctx.isOriginLocal()) { return invokeNext(ctx, command); } final Map<Object, Object> map = command.getMap(); FileDescriptorSource source = new FileDescriptorSource(); for (Object key : map.keySet()) { final Object value = map.get(key); if (!(key instanceof String)) { throw log.keyMustBeString(key.getClass()); } if (!(value instanceof String)) { throw log.valueMustBeString(value.getClass()); } if (shouldIntercept(key)) { if (!((String) key).endsWith(PROTO_KEY_SUFFIX)) { throw log.keyMustBeStringEndingWithProto(key); } source.addProtoFile((String) key, (String) value); } } VisitableCommand cmd = commandsFactory.buildLockControlCommand(ERRORS_KEY_SUFFIX, command.getFlagsBitSet(), null); invoker.running().invoke(ctx, cmd); return invokeNextThenAccept(ctx, command, (rCtx, rCommand, rv) -> { long flagsBitSet = copyFlags(rCommand); ProgressCallback progressCallback = null; if (rCtx.isOriginLocal()) { progressCallback = new ProgressCallback(rCtx, flagsBitSet); source.withProgressCallback(progressCallback); } else { source.withProgressCallback(EMPTY_CALLBACK); } try { serializationContext.registerProtoFiles(source); } catch (DescriptorParserException e) { throw log.failedToParseProtoFile(e); } if (progressCallback != null) { updateGlobalErrors(rCtx, progressCallback.getErrorFiles(), flagsBitSet); } }); }
Source:
<code>public LegalEntitySurvivalProbabilities survivalProbabilities(StandardId legalEntityId, Currency currency) { CreditDiscountFactors survivalProbabilities = creditCurves.get(Pair.of(legalEntityId, currency)); if (survivalProbabilities == null) { throw new IllegalArgumentException("Unable to find credit curve: " + legalEntityId + ", " + currency); } <START> return LegalEntitySurvivalProbabilities.of(survivalProbabilities, legalEntityId); <END> }</code><technical_language>map hold CreditDiscountFactors LegalEntitySurvivalProbabilities</technical_language>

Target:
public LegalEntitySurvivalProbabilities survivalProbabilities(StandardId legalEntityId, Currency currency) { LegalEntitySurvivalProbabilities survivalProbabilities = creditCurves.get(Pair.of(legalEntityId, currency)); if (survivalProbabilities == null) { throw new IllegalArgumentException("Unable to find credit curve: " + legalEntityId + ", " + currency); } return survivalProbabilities; }
Source:
<code>private void runOn(final String account, final String region) { try { log.info("Scanning EC2 instances to fetch AMIs {}/{}", account, region); final AmazonEC2Client ec2Client = clientProvider.getClient( AmazonEC2Client.class, account, getRegion(fromName(region))); Optional<String> nextToken = empty(); do { final DescribeInstancesRequest request = new DescribeInstancesRequest(); if (nextToken.isPresent()) { <START> request.withNextToken(nextToken.get()); <END> } else { request.withFilters(new Filter("instance-state-name").withValues("running")); } nextToken.ifPresent(request::setNextToken); final DescribeInstancesResult result = ec2Client.describeInstances(request); nextToken = Optional.ofNullable(result.getNextToken()); for (final Reservation reservation : result.getReservations()) { for (final Instance instance : reservation.getInstances()) { processInstance(ec2Client, account, region, instance); } } } while (nextToken.isPresent()); } catch (final AmazonServiceException a) { log.error(a.getMessage(), a); } }</code><technical_language>is difference request.withNextToken() request.setNextToken</technical_language>

Target:
private void runOn(final String account, final String region) { try { log.info("Scanning EC2 instances to fetch AMIs {}/{}", account, region); final AmazonEC2Client ec2Client = clientProvider.getClient( AmazonEC2Client.class, account, getRegion(fromName(region))); Optional<String> nextToken = empty(); do { final DescribeInstancesRequest request = new DescribeInstancesRequest(); if (nextToken.isPresent()) { request.withNextToken(nextToken.get()); } else { request.withFilters(new Filter("instance-state-name").withValues("running")); } final DescribeInstancesResult result = ec2Client.describeInstances(request); nextToken = Optional.ofNullable(trimToNull(result.getNextToken())); for (final Reservation reservation : result.getReservations()) { for (final Instance instance : reservation.getInstances()) { processInstance(ec2Client, account, region, instance); } } } while (nextToken.isPresent()); } catch (final AmazonServiceException a) { log.error(a.getMessage(), a); } }
Source:
<code>public List<String> getUntrackedFolders() { LinkedList<String> untracked = new LinkedList<String>(untrackedFolders); if (!untrackedParentFolders.isEmpty()) { String toBeAdded = untrackedParentFolders.getLast(); while (!untracked.isEmpty() && untracked.getLast().startsWith(toBeAdded)) untracked.removeLast(); untracked.addLast(toBeAdded); } LinkedList<String> ret = new LinkedList<String>(); for (String p: untracked) { boolean ignored = false; for (String i: ignoredPaths) { <START> if (p.startsWith(i)) { <END> ignored = true; break; } } if (!ignored) ret.add(p); } return ret; }</code><technical_language>abcde starts abc. ignoredPaths dot end / for directories, I think, need a bit more logic</technical_language>

Target:
public List<String> getUntrackedFolders() { LinkedList<String> ret = new LinkedList<String>(untrackedFolders); if (!untrackedParentFolders.isEmpty()) { String toBeAdded = untrackedParentFolders.getLast(); while (!ret.isEmpty() && ret.getLast().startsWith(toBeAdded)) ret.removeLast(); ret.addLast(toBeAdded); } return ret; }
Source:
<code>public RepositoryObjectDataLoader loadModel(RepositoryObject obj) throws FedoraException { PID pid = obj.getPid(); try (FcrepoResponse response = getClient().get(pid.getRepositoryUri()) <START> .accept("text/turtle") <END> .perform()) { Model model = ModelFactory.createDefaultModel(); model.read(response.getBody(), null, Lang.TURTLE.getName()); obj.setModel(model); } catch (IOException e) { throw new FedoraException("Failed to read model for " + pid.getRepositoryUri(), e); } catch (FcrepoOperationFailedException e) { throw ClientFaultResolver.resolve(e); } return this; }</code><technical_language>Store MIME-type in a constant</technical_language>

Target:
public RepositoryObjectDataLoader loadModel(RepositoryObject obj) throws FedoraException { URI metadataUri = obj.getMetadataUri(); try (FcrepoResponse response = getClient().get(metadataUri) .accept(TURTLE_MIMETYPE) .perform()) { Model model = ModelFactory.createDefaultModel(); model.read(response.getBody(), null, Lang.TURTLE.getName()); obj.setModel(model); } catch (IOException e) { throw new FedoraException("Failed to read model for " + metadataUri, e); } catch (FcrepoOperationFailedException e) { throw ClientFaultResolver.resolve(e); } return this; }
Source:
<code>private List<SiriusServerPageDto> getPages(ModelingProject modelingProject, Session session) { return WorkflowHelper.on(session).getPageDescriptions().map(page -> { DAnalysis self = <START> ((DAnalysisSessionImpl) session).getAnalyses().get(0); <END> Map<String, Object> variables = new HashMap<>(); variables.put(SELF, self); IEvaluationResult result = new SiriusBackendInterpreter(session).evaluateExpression(variables, page.getTitleExpression()); String identifier = page.getName(); String name = result.asString(); return new SiriusServerPageDto(identifier, name); }).collect(Collectors.toList()); }</code><technical_language>DAnalysisSession.allAnalyses</technical_language>

Target:
private List<SiriusServerPageDto> getPages(ModelingProject modelingProject, Session session) { return WorkflowHelper.on(session).getPageDescriptions().map(page -> { DAnalysis self = ((DAnalysisSessionImpl) session).allAnalyses().stream().findFirst().orElse(null); Map<String, Object> variables = new HashMap<>(); variables.put(SELF, self); IEvaluationResult result = new SiriusBackendInterpreter(session).evaluateExpression(variables, page.getTitleExpression()); String identifier = page.getName(); String name = result.asString(); return new SiriusServerPageDto(identifier, name); }).collect(Collectors.toList()); }
Source:
<code>private String getThreadName(LogRecord record) { String cacheKey = "" + record.getThreadID(); if (threadNameCache.containsKey(cacheKey)) { return threadNameCache.get(cacheKey); } long threadId = record.getThreadID(); String threadName = "" + record.getThreadID(); Set<Thread> threadSet = Thread.getAllStackTraces().keySet(); for (Thread thread : threadSet) { if (thread.getId() == threadId) { <START> threadName = thread.getName(); <END> break; } } threadNameCache.put(cacheKey, threadName); return threadName; }</code><technical_language>getAllStackTraces() is expensive. a cache in place, soften actual impact. able optimize for default logger arrangement. Typically, log handlers called thread logging happens. Therefore, call Thread.currentThread().getId() inspect need obtain threads resolve thread do</technical_language>

Target:
private String getThreadName(LogRecord record) { if (record.getThreadID() == Thread.currentThread().getId()) { return Thread.currentThread().getName(); } String cacheKey = "" + record.getThreadID(); if (threadNameCache.containsKey(cacheKey)) { return threadNameCache.get(cacheKey); } long threadId = record.getThreadID(); String threadName = "" + record.getThreadID(); Set<Thread> threadSet = Thread.getAllStackTraces().keySet(); for (Thread thread : threadSet) { if (thread.getId() == threadId) { threadName = thread.getName(); break; } } threadNameCache.put(cacheKey, threadName); return threadName; }
Source:
<code>public byte[] call(final byte[] memento) throws Exception { LOG.log(Level.INFO, String.format("%s starting...", taskId)); final TraceInfo taskTraceInfo = memento == null ? null : HTraceUtils.fromAvro(hTraceInfoCodec.decode(memento)); userComputeTask.initialize(); final ExecutorService executor = Executors.newSingleThreadExecutor(); <START> Future<?> result = executor.submit(new Runnable() { <END> @Override public void run() { try (final MetricsCollector collector = metricsCollector) { collector.registerTrackers(metricTrackerSet); while (!isTerminated()) { try (final TraceScope traceScope = Trace.startSpan("iter-" + iteration, taskTraceInfo)) { userTaskTrace.setParentTraceInfo(TraceInfo.fromSpan(traceScope.getSpan())); collector.start(); receiveData(); runUserComputeTask(); sendData(); collector.stop(); sendMetrics(); } iteration++; } userComputeTask.cleanup(); } catch (final Exception e) { throw new RuntimeException(e); } finally { terminated.countDown(); } } }); terminated.await(); executor.shutdownNow(); try { result.get(); } catch (final ExecutionException e) { if (!isClosing.get()) { throw new Exception(e); } else { LOG.log(Level.INFO, "Task closed by EM."); } } return null; }</code><technical_language>This final. checkstyle checker fail detect this</technical_language>

Target:
public byte[] call(final byte[] memento) throws Exception { LOG.log(Level.INFO, String.format("%s starting...", taskId)); final TraceInfo taskTraceInfo = memento == null ? null : HTraceUtils.fromAvro(hTraceInfoCodec.decode(memento)); userComputeTask.initialize(); final ExecutorService executor = Executors.newSingleThreadExecutor(); final Future<?> result = executor.submit(new Runnable() { @Override public void run() { try (final MetricsCollector collector = metricsCollector) { collector.registerTrackers(metricTrackerSet); while (!isTerminated()) { try (final TraceScope traceScope = Trace.startSpan("iter-" + iteration, taskTraceInfo)) { userTaskTrace.setParentTraceInfo(TraceInfo.fromSpan(traceScope.getSpan())); collector.start(); receiveData(); runUserComputeTask(); sendData(); collector.stop(); sendMetrics(); } iteration++; } userComputeTask.cleanup(); } catch (final Exception e) { throw new RuntimeException(e); } finally { terminated.countDown(); } } }); terminated.await(); executor.shutdownNow(); try { result.get(); } catch (final ExecutionException e) { if (isClosing.get()) { LOG.log(Level.INFO, "Task closed by TaskCloseHandler."); } else { throw new Exception(e); } } return null; }
Source:
<code>public Object deserialize(ByteBuf b, CorfuRuntime rt) { try (ByteBufInputStream bbis = new ByteBufInputStream(b)) { MessageType type = MessageType.valueOf(bbis.readInt()); int size = bbis.readInt(); byte[] data = new byte[size]; bbis.readFully(data); Record record = Record.parseFrom(data); Any payload = record.getPayload(); if (!classMap.containsKey(payload.getTypeUrl())) { log.error("Deserialization error: Unknown type "+payload.getTypeUrl()+ " dumping map..\n"); for (String entry: classMap.keySet()) { log.error(entry + "=>" + classMap.get(entry)); <START> } <END> throw new SerializerException(payload.getTypeUrl()+" not in map!"); } Message value = payload.unpack(classMap.get(payload.getTypeUrl())); if (type.equals(MessageType.KEY)) { return value; } else { Message metadata = null; if (record.hasMetadata()) { Any anyMetadata = record.getMetadata(); metadata = anyMetadata.unpack(classMap.get(anyMetadata.getTypeUrl())); } return new CorfuRecord(value, metadata); } } catch (IOException ie) { log.error("Exception during deserialization!", ie); throw new SerializerException(ie); } }</code><technical_language>Okay, btw more descriptive</technical_language>

Target:
public Object deserialize(ByteBuf b, CorfuRuntime rt) { try (ByteBufInputStream bbis = new ByteBufInputStream(b)) { MessageType type = MessageType.valueOf(bbis.readInt()); int size = bbis.readInt(); byte[] data = new byte[size]; bbis.readFully(data); Record record = Record.parseFrom(data); Any payload = record.getPayload(); if (!classMap.containsKey(payload.getTypeUrl())) { log.error("Deserialization error: Encountered a log update for this class "+payload.getTypeUrl() +" but its corresponding class type cannot be found in in-memory type map. Dumping map..\n"); for (String entry: classMap.keySet()) { log.error(entry + "=>" + classMap.get(entry)); } throw new SerializerException(payload.getTypeUrl()+" not in map!"); } Message value = payload.unpack(classMap.get(payload.getTypeUrl())); if (type.equals(MessageType.KEY)) { return value; } else { Message metadata = null; if (record.hasMetadata()) { Any anyMetadata = record.getMetadata(); metadata = anyMetadata.unpack(classMap.get(anyMetadata.getTypeUrl())); } return new CorfuRecord(value, metadata); } } catch (IOException ie) { log.error("Exception during deserialization!", ie); throw new SerializerException(ie); } }
Source:
<code>private ApiFuture<?> offer(Mutation mutation) { ApiFuture<?> future = null; try { if (mutation == null) { future = ApiFutures.immediateFailedFuture( new IllegalArgumentException("Cannot perform a mutation on a null object.")); } else if (mutation instanceof Put) { future = bulkMutation.add(adapter.adaptEntry((Put) mutation)); } else if (mutation instanceof Delete) { future = bulkMutation.add(adapter.adaptEntry((Delete) mutation)); } else if (mutation instanceof Increment) { future = dataClient.readModifyWriteRowAsync(adapter.adapt((Increment) mutation)); <START> operationAccountant.registerOperation(new ApiFutureToListenableFuture<>(future)); <END> } else if (mutation instanceof Append) { future = dataClient.readModifyWriteRowAsync(adapter.adapt((Append) mutation)); operationAccountant.registerOperation(new ApiFutureToListenableFuture<>(future)); } else { future = ApiFutures.immediateFailedFuture( new IllegalArgumentException( "Encountered unknown mutation type: " + mutation.getClass())); } } catch (Exception e) { future = ApiFutures.immediateFailedFuture(e); } return future; }</code><technical_language>avoid wrapping altogether? OperationAccountant work ApiFutures</technical_language>

Target:
private ApiFuture<?> offer(Mutation mutation) { ApiFuture<?> future = null; try { if (mutation == null) { future = ApiFutures.immediateFailedFuture( new IllegalArgumentException("Cannot perform a mutation on a null object.")); } else if (mutation instanceof Put) { future = bulkMutation.add(adapter.adaptEntry((Put) mutation)); } else if (mutation instanceof Delete) { future = bulkMutation.add(adapter.adaptEntry((Delete) mutation)); } else if (mutation instanceof Increment) { future = dataClient.readModifyWriteRowAsync(adapter.adapt((Increment) mutation)); operationAccountant.registerOperation(future); } else if (mutation instanceof Append) { future = dataClient.readModifyWriteRowAsync(adapter.adapt((Append) mutation)); operationAccountant.registerOperation(future); } else { future = ApiFutures.immediateFailedFuture( new IllegalArgumentException( "Encountered unknown mutation type: " + mutation.getClass())); } } catch (Exception e) { future = ApiFutures.immediateFailedFuture(e); } return future; }
Source:
<code><T> void put(RegistrationType<T> registrationType, Handler<T> handler) <START> { <END> List<Handler<T>> handlers = get(registrationType); if (handlers == null) { handlers = new ArrayList<>(); registrationMap.put(registrationType, handlers); } handlers.add(handler); }</code><technical_language>In scenarios a single plugin register multiple handlers for type</technical_language>

Target:
<T> void put(RegistrationType<T> registrationType, Handler<T> handler) { registrationMap.put(registrationType, handler); }
Source:
<code>public void testToMapWithProperties() throws Exception { when(propertiesMock.entrySet()).thenReturn(exampleMap.entrySet()); Map<?, ?> entries = PROPERTIES_LOADER.toMap(propertiesMock); <START> Assert.assertEquals("Returns a map of the properties", exampleMap, entries); <END> }</code><technical_language>it! <LINK_0></technical_language>

Target:
public void testToMapWithProperties() throws Exception { when(propertiesMock.entrySet()).thenReturn(EXAMPLE_MAP.entrySet()); Map<?, ?> entries = PROPERTIES_LOADER.toMap(propertiesMock); assertThat(entries, equalTo(EXAMPLE_MAP)); }
Source:
<code>protected boolean set(ItemStack itemStack, Text value) { if (itemStack.getTagCompound() == null) { itemStack.setTagCompound(new NBTTagCompound()); } <START> itemStack.getTagCompound().setString(NbtDataUtil.ITEM_BOOK_AUTHOR, ((IMixinText) value).toLegacy('\247', Locale.ENGLISH)); <END> return true; }</code><technical_language>Texts.legacy() instead</technical_language>

Target:
protected boolean set(ItemStack itemStack, Text value) { if (!itemStack.hasTagCompound()) { itemStack.setTagCompound(new NBTTagCompound()); } itemStack.getTagCompound().setString(NbtDataUtil.ITEM_BOOK_AUTHOR, Texts.legacy().to(value)); return true; }
Source:
<code>public void resolve(EObject view, TransformationCache cache) { if (view instanceof EEFViewDescription) { List<EEFPageDescription> pages = ((EEFViewDescription) view).getPages(); <START> for (EEFPageDescription page : pages) { List<EEFGroupDescription> groups = page.getGroups(); for (EEFGroupDescription group : groups) { List<EEFPropertyValidationRuleDescription> propertyValidationRules = group.getPropertyValidationRules(); for (EEFPropertyValidationRuleDescription eefPropertyValidationRule : propertyValidationRules) { <END> this.resolve(eefPropertyValidationRule, cache); } } } } }</code><technical_language>java8-isation [forEach][map|flatmap]</technical_language>

Target:
public void resolve(EObject view, TransformationCache cache) { if (view instanceof EEFViewDescription) { List<EEFPageDescription> pages = ((EEFViewDescription) view).getPages(); pages.forEach(page -> page.getGroups().forEach(group -> group.getPropertyValidationRules().forEach(propertyValidationRule -> this.resolve(propertyValidationRule, cache)))); } }
Source:
<code>public void shouldBeAbleToSubmitAPartialRefundAfterACaptureHasBeenSubmitted() throws InterruptedException { WorldpayPaymentProvider connector = getValidWorldpayPaymentProvider(); GatewayResponse<WorldpayOrderStatusResponse> response = successfulWorldpayCardAuth(connector); assertThat(response.getBaseResponse().isPresent(), is(true)); String transactionId = response.getBaseResponse().get().getTransactionId(); assertThat(response.isSuccessful(), is(true)); assertThat(transactionId, is(not(nullValue()))); chargeEntity.setGatewayTransactionId(transactionId); GatewayResponse<WorldpayCaptureResponse> captureResponse = connector.capture(CaptureGatewayRequest.valueOf(chargeEntity)); assertThat(captureResponse.isSuccessful(), is(true)); <START> RefundEntity refundEntity = new RefundEntity(chargeEntity, 1L, null); <END> GatewayResponse refundGatewayResponse = connector.refund(RefundGatewayRequest.valueOf(refundEntity)); assertTrue(refundGatewayResponse.isSuccessful()); }</code><technical_language>Again, want pass actual</technical_language>

Target:
public void shouldBeAbleToSubmitAPartialRefundAfterACaptureHasBeenSubmitted() throws InterruptedException { WorldpayPaymentProvider connector = getValidWorldpayPaymentProvider(); GatewayResponse<WorldpayOrderStatusResponse> response = successfulWorldpayCardAuth(connector); assertThat(response.getBaseResponse().isPresent(), is(true)); String transactionId = response.getBaseResponse().get().getTransactionId(); assertThat(response.isSuccessful(), is(true)); assertThat(transactionId, is(not(nullValue()))); chargeEntity.setGatewayTransactionId(transactionId); GatewayResponse<WorldpayCaptureResponse> captureResponse = connector.capture(CaptureGatewayRequest.valueOf(chargeEntity)); assertThat(captureResponse.isSuccessful(), is(true)); RefundEntity refundEntity = new RefundEntity(chargeEntity, 1L, userExternalId); GatewayResponse refundGatewayResponse = connector.refund(RefundGatewayRequest.valueOf(refundEntity)); assertTrue(refundGatewayResponse.isSuccessful()); }
Source:
<code>public List<RichGroup> getRichSubGroupsWithAttributesByNames(PerunSession sess, Group parentGroup, List<String> attrNames) throws InternalErrorException, GroupNotExistsException, VoNotExistsException, PrivilegeException { Utils.checkPerunSession(sess); this.getGroupsManagerBl().checkGroupExists(sess, parentGroup); Vo vo = perunBl.getVosManagerBl().getVoById(sess, parentGroup.getVoId()); if (!AuthzResolver.isAuthorized(sess, Role.VOADMIN, vo) && !AuthzResolver.isAuthorized(sess, Role.VOOBSERVER, vo) && !AuthzResolver.isAuthorized(sess, Role.GROUPADMIN)) { throw new PrivilegeException(sess, "getRichSubGroupsWithAttributesByNames"); } List<RichGroup> richGroups = getGroupsManagerBl().filterOnlyAllowedAttributes(sess, getGroupsManagerBl().getAllRichGroupsWithAttributesByNames(sess, vo, attrNames)); if (AuthzResolver.isAuthorized(sess, Role.VOADMIN, vo) || AuthzResolver.isAuthorized(sess, Role.VOOBSERVER, vo) || AuthzResolver.hasRole(sess.getPerunPrincipal(), Role.PERUNADMIN)) { return richGroups; } if (AuthzResolver.hasRole(sess.getPerunPrincipal(), Role.GROUPADMIN)) { Iterator<RichGroup> i = richGroups.iterator(); while (i.hasNext()) { if (!AuthzResolver.isAuthorized(sess, Role.GROUPADMIN, i.next())) { i.remove(); } } return richGroups; } <START> throw new PrivilegeException(sess, "getRichSubGroupsWithAttributesByNames"); <END> }</code><technical_language>in method before. Filtering removing groups. step returning of array</technical_language>

Target:
public List<RichGroup> getRichSubGroupsWithAttributesByNames(PerunSession sess, Group parentGroup, List<String> attrNames) throws InternalErrorException, GroupNotExistsException, VoNotExistsException, PrivilegeException { Utils.checkPerunSession(sess); this.getGroupsManagerBl().checkGroupExists(sess, parentGroup); Vo vo = perunBl.getVosManagerBl().getVoById(sess, parentGroup.getVoId()); if (!AuthzResolver.isAuthorized(sess, Role.VOADMIN, vo) && !AuthzResolver.isAuthorized(sess, Role.VOOBSERVER, vo) && !AuthzResolver.isAuthorized(sess, Role.GROUPADMIN)) { throw new PrivilegeException(sess, "getRichSubGroupsWithAttributesByNames"); } List<RichGroup> richGroups = getGroupsManagerBl().getAllRichGroupsWithAttributesByNames(sess, vo, attrNames); if (AuthzResolver.hasRole(sess.getPerunPrincipal(), Role.GROUPADMIN)) { Iterator<RichGroup> i = richGroups.iterator(); while (i.hasNext()) { if (!AuthzResolver.isAuthorized(sess, Role.GROUPADMIN, i.next())) { i.remove(); } } } return getGroupsManagerBl().filterOnlyAllowedAttributes(sess, richGroups); }
Source:
<code>public CdsQuote pointsUpFrontFromQuotedSpread( ResolvedCdsTrade trade, CdsQuote quote, CreditRatesProvider ratesProvider, ReferenceData refData) { ArgChecker.notNull(trade, "trade"); ArgChecker.notNull(quote, "quote"); ArgChecker.notNull(ratesProvider, "ratesProvider"); ArgChecker.notNull(refData, "refData"); ArgChecker.isTrue(quote.getQuoteConvention().equals(CdsQuoteConvention.QUOTED_SPREAD), "quote must be quoted spread"); ResolvedCds product = trade.getProduct(); Currency currency = product.getCurrency(); StandardId legalEntityId = product.getLegalEntityId(); LocalDate valuationDate = ratesProvider.getValuationDate(); NodalCurve creditCurve = builder.calibrate( <START> new ResolvedCdsTrade[] {trade}, <END> new double[] {quote.getQuotedValue()}, new double[] {0d}, CurveName.of("temp"), valuationDate, ratesProvider.discountFactors(currency), ratesProvider.recoveryRates(legalEntityId), refData); CreditRatesProvider ratesProviderNew = ratesProvider.toBuilder() .creditCurves(ImmutableMap.of( Pair.of(legalEntityId, currency), LegalEntitySurvivalProbabilities.of( legalEntityId, IsdaCompliantZeroRateDiscountFactors.of(currency, valuationDate, creditCurve)))) .build(); double puf = pointsUpfront(trade, ratesProviderNew, refData); return CdsQuote.of(CdsQuoteConvention.POINTS_UPFRONT, puf); }</code><technical_language>this, calibrator a List<ResolvedCdsTrade> DoubleArray</technical_language>

Target:
public CdsQuote pointsUpFrontFromQuotedSpread( ResolvedCdsTrade trade, CdsQuote quote, CreditRatesProvider ratesProvider, ReferenceData refData) { ArgChecker.notNull(trade, "trade"); ArgChecker.notNull(quote, "quote"); ArgChecker.notNull(ratesProvider, "ratesProvider"); ArgChecker.notNull(refData, "refData"); ArgChecker.isTrue(quote.getQuoteConvention().equals(CdsQuoteConvention.QUOTED_SPREAD), "quote must be quoted spread"); ResolvedCds product = trade.getProduct(); Currency currency = product.getCurrency(); StandardId legalEntityId = product.getLegalEntityId(); LocalDate valuationDate = ratesProvider.getValuationDate(); NodalCurve creditCurve = calibrator.calibrate( ImmutableList.of(trade), DoubleArray.of(quote.getQuotedValue()), DoubleArray.of(0d), CurveName.of("temp"), valuationDate, ratesProvider.discountFactors(currency), ratesProvider.recoveryRates(legalEntityId), refData); CreditRatesProvider ratesProviderNew = ratesProvider.toBuilder() .creditCurves(ImmutableMap.of( Pair.of(legalEntityId, currency), LegalEntitySurvivalProbabilities.of( legalEntityId, IsdaCompliantZeroRateDiscountFactors.of(currency, valuationDate, creditCurve)))) .build(); double puf = pointsUpfront(trade, ratesProviderNew, refData); return CdsQuote.of(CdsQuoteConvention.POINTS_UPFRONT, puf); }
Source:
<code>public void deleteAll(String sessionId) { ArrayList<String> sessions = (ArrayList) getHibernateTemplate().find("Select distinct k.sessionId from KeyValue k ORDER by k.sessionId"); if (sessions.size() == 0) return; if (sessionLimit < 0) { log.warn("Session count can't be < 0; was get {}", sessionLimit); return; <START> } <END> if (sessionLimit == 0) { log.warn("Session count limit is equal '0', all temporary data about sessions will be delete"); getHibernateTemplate().bulkUpdate("delete from KeyValue"); return; } List<String> sessionForDelete = Lists.newArrayList(); sessionForDelete.add(sessionId); if (sessions.size() > sessionLimit) { sessionForDelete.addAll(sessions.subList(0, (sessions.size() - 1) - sessionLimit)); } getHibernateTemplate().bulkUpdate("delete from KeyValue where sessionId in (?)", sessionForDelete.toArray()); }</code><technical_language>please, move check of parameter setter care sessionLimit < 0</technical_language>

Target:
public void deleteAll(String sessionId) { ArrayList<String> sessions = (ArrayList) getHibernateTemplate().find("Select distinct k.sessionId from KeyValue k ORDER by k.sessionId"); if (sessions.size() == 0) return; if (sessionLimit == 0) { log.warn("Session count limit is equal '0', all temporary data about sessions will be delete"); getHibernateTemplate().bulkUpdate("delete from KeyValue"); return; } List<String> sessionForDelete = Lists.newArrayList(); sessionForDelete.add(sessionId); if (sessions.size() > sessionLimit) { sessionForDelete.addAll(sessions.subList(0, (sessions.size() - 1) - sessionLimit)); } getHibernateTemplate().bulkUpdate("delete from KeyValue where sessionId in (?)", sessionForDelete.toArray()); }
Source:
<code>private String getContributionOptionsColor(int points){ if(points == Const.POINTS_NOT_SURE || points == Const.POINTS_EQUAL_SHARE){ return "color_neutral"; <START> } else if ( points < 100){ <END> return "color-negative"; } else{ return "color-positive"; } }</code><technical_language>Const.POINTS_EQUAL_SHARE instead of 100 here</technical_language>

Target:
private String getContributionOptionsColor(int points){ if(points == Const.POINTS_NOT_SURE || points == Const.POINTS_EQUAL_SHARE){ return "color_neutral"; } else if ( points < Const.POINTS_EQUAL_SHARE){ return "color-negative"; } else{ return "color-positive"; } }
Source:
<code>private String getSuitablePathVariable(IPath commonPath) { String variableName = commonPath.lastSegment(); if (variableName == null) { variableName = commonPath.getDevice(); if (variableName == null) variableName = "ROOT"; else variableName = variableName.substring(0, variableName.length() -1); } StringBuilder buf = new StringBuilder(); for (int i = 0; i < variableName.length(); i++) { char c = variableName.charAt(i); if (Character.isLetterOrDigit(c) || (c == '_')) buf.append(c); else buf.append('_'); } int index = 1; <START> while (fProject.getPathVariableManager().isDefined(variableName)) { <END> buf.append(index); index++; } return buf.toString(); }</code><technical_language>This do before, if this loop is entered loop OOME</technical_language>

Target:
private String getSuitablePathVariable(IPath commonPath) { String variableName = commonPath.lastSegment(); if (variableName == null) { variableName = commonPath.getDevice(); if (variableName == null) variableName = "ROOT"; else variableName = variableName.substring(0, variableName.length() -1); } StringBuilder buf = new StringBuilder(); for (int i = 0; i < variableName.length(); i++) { char c = variableName.charAt(i); if (Character.isLetterOrDigit(c) || (c == '_')) buf.append(c); else buf.append('_'); } int index = 1; while (fProject.getPathVariableManager().isDefined(buf.toString())) { buf.append(index); index++; } return buf.toString(); }
Source:
<code>private void startAccountCreation() { <START> if (PreferencesHelper.getCreateAccountStatus() == CreateAccountStatus.WAITING_FOR_SMS) { <END> startActivity(new Intent(this, VerifyNumberActivity.class).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP)); } else { startActivity(new Intent(this, AgreeActivity.class).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP)); } finish(); }</code><technical_language>I try reduce code duplication final Class... activity; if (PreferencesHelper.getCreateAccountStatus() == CreateAccountStatus.WAITING_FOR_SMS) { activity = VerifyNumberActivity.class; } else { activity = AgreeActivity.class; } startActivity(new Intent(this, activity).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP));</technical_language>

Target:
private void startAccountCreation() { final Class<?> activity = PreferencesHelper.getCreateAccountStatus() == CreateAccountStatus.WAITING_FOR_SMS ? VerifyNumberActivity.class : AgreeActivity.class; startActivity(new Intent(this, activity).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP)); finish(); }
Source:
<code>private static HttpServer createServer(NodeInfo nodeInfo, HttpServerInfo httpServerInfo, HttpServerConfig config) { <START> return createServer(new DummyServlet(Optional.empty()), nodeInfo, httpServerInfo, config); <END> }</code><technical_language>This is default constructor does</technical_language>

Target:
private static HttpServer createServer(NodeInfo nodeInfo, HttpServerInfo httpServerInfo, HttpServerConfig config) { return createServer(new DummyServlet(), nodeInfo, httpServerInfo, config); }
Source:
<code><START> private String readFile(File directory, String fileName) throws IOException { <END> File file = new File(directory, fileName); FileReader fr = new FileReader(file); StringBuilder sb = new StringBuilder(); char[] chars = new char[100]; int read = fr.read(chars); while (read > -1) { sb.append(chars, 0, read); read = fr.read(chars); } return sb.toString(); }</code><technical_language>instead use: RawParseUtils.decode(IO.readFully(new File(directory, fileName));</technical_language>

Target:
private String readFile(File directory, String fileName) throws IOException { return RawParseUtils .decode(IO.readFully(new File(directory, fileName))); }
Source:
<code><START> private static Number compare(Object a, Object b) { <END> Number compareResult = null; if (a instanceof Number && b instanceof Number) { compareResult = Numbers.compare((Number) a, (Number) b); } else if (a instanceof Number) { compareResult = -1; } else if (b instanceof Number) { compareResult = 1; } else { compareResult = a.toString().compareTo(b.toString()); } return compareResult; }</code><technical_language>return int. trust compare functions return int</technical_language>

Target:
private static int compare(Object a, Object b) { return Value.Sorter.INSTANCE .compare(Value.wrap(Convert.javaToThrift(a)), Value.wrap(Convert.javaToThrift(b))); }
Source:
<code>static org.ovirt.engine.api.model.Event getModel(int index) { org.ovirt.engine.api.model.Event model = new org.ovirt.engine.api.model.Event(); model.setId(String.valueOf(LOG_IDS[index])); <START> model.setSeverity(AuditLogSeverity.ALERT.name()); <END> model.setDescription(MESSAGES[index]); model.setOrigin(ORIGIN_NAMES[index]); model.setCustomId(CUSTOMER_EVENT_IDS[index]); model.setFloodRate(30); return model; }</code><technical_language>change LogSeverity.ALERT.value()</technical_language>

Target:
static org.ovirt.engine.api.model.Event getModel(int index) { org.ovirt.engine.api.model.Event model = new org.ovirt.engine.api.model.Event(); model.setId(String.valueOf(LOG_IDS[index])); model.setSeverity( LogSeverity.ALERT.value()); model.setDescription(MESSAGES[index]); model.setOrigin(ORIGIN_NAMES[index]); model.setCustomId(CUSTOMER_EVENT_IDS[index]); model.setFloodRate(30); return model; }
Source:
<code><START> public static Set<Bundle> getBundlesBySymbolicName(BundleContext bundleContext, String symbolicName) { return Arrays.stream(bundleContext.getBundles()) .filter(bundle -> bundle.adapt(BundleRevision.class).getSymbolicName().equals(symbolicName)) .collect(toSet()); } <END></code><technical_language>This NPE if BundleRevision.getSymbolicName() returns null, I reverse equals target symbolicName.equals(bundle.adapt(BundleRevision.class).getSymbolicName()) This scale if large numbers of bundles. If this is a hotspot of code consider org.osgi.framework.wiring.FrameworkWiring.findProviders(Requirement) "osgi.identity" namespace requirement. If I recall correctly virgo Equinox regions. end hiding bundles a BundleContext perspective. FrameworkWiring.findProviders bypass equinox region hooks need aware of that</technical_language>

Target:
public static Set<Bundle> getBundlesBySymbolicName(BundleContext bundleContext, String symbolicName) { return Arrays.stream(bundleContext.getBundles()) .filter(bundle -> symbolicName.equals(bundle.adapt(BundleRevision.class).getSymbolicName())) .collect(toSet()); }
Source:
<code>private void checkPermission(String userId) throws ForbiddenException { <START> Preconditions.checkNotNull(userId); <END> final Set<String> teams = teamOperations.getTeamIdsByUser(userId); final List<String> allowedTeams = ruleControllerProperties.getAllowedTeams(); if (allowedTeams.stream().noneMatch(teams::contains)){ throw new ForbiddenException(format("%s has no permission! Found Teams: %s; required teams %s", userId, teams, allowedTeams)); } }</code><technical_language>please add a message (second argument) "NullPointerException: null" in logs</technical_language>

Target:
private void checkPermission(String userId) throws ForbiddenException { Preconditions.checkNotNull(userId, "userId must not be null!"); final Set<String> teams = teamOperations.getTeamIdsByUser(userId); final List<String> allowedTeams = ruleControllerProperties.getAllowedTeams(); if (allowedTeams.stream().noneMatch(teams::contains)){ throw new ForbiddenException(format("%s has no permission! Found Teams: %s; required teams %s", userId, teams, allowedTeams)); } }
Source:
<code><START> public void refresh(boolean refreshGlobal, boolean refreshSelection) { <END> if(fModel == null){ reinitializeCharts(); } else { if(refreshGlobal){ getCurrentState().newGlobalEntries(this); } if(refreshSelection){ long Tot = 0; int nbEventsType = 0; Map<String, Long> selectionModel = getTotalEventCountForChart(false); for (Long l : selectionModel.values()) { if(l != 0){ nbEventsType++; Tot += l; } } if (Tot == 0 || nbEventsType < 2) { getCurrentState().newEmptySelection(this); } else { getCurrentState().newSelection(this); } } } }</code><technical_language>needs synchronized</technical_language>

Target:
public synchronized void refresh(boolean refreshGlobal, boolean refreshSelection) { if(fModel == null){ reinitializeCharts(); } else { if(refreshGlobal){ getCurrentState().newGlobalEntries(this); } if(refreshSelection){ int nbEventsType = 0; Map<String, Long> selectionModel = getTotalEventCountForChart(false); for (Long l : selectionModel.values()) { if(l != 0){ nbEventsType++; } } if (nbEventsType < 2) { getCurrentState().newEmptySelection(this); } else { getCurrentState().newSelection(this); } } } }
Source:
<code>public int hashCode() { if (isEmpty()) { return <START> Objects.hash(comparer); <END> } int r; if (comparer != null) { r = 31 + comparer.hashCode(); for (Object e : elements) { r = 31 * r + (e == null ? 0 : comparer.hashCode(e)); } } else { r = Arrays.hashCode(elements); } return r; }</code><technical_language>if isEmpty() comparer==null, this return hash code of a null Object. - Is this intended behavior? - getClass().hashCode() instead</technical_language>

Target:
public int hashCode() { if (isEmpty()) { return Objects.hashCode(comparer); } int r; if (comparer != null) { r = 31 + comparer.hashCode(); for (Object e : elements) { r = 31 * r + (e == null ? 0 : comparer.hashCode(e)); } } else { r = Arrays.hashCode(elements); } return r; }
Source:
<code>private Map<String, String> envVars() { Map<String, String> env = new HashMap<>(); env.put("P4PORT", material.getServerAndPort()); env.put("P4CLIENT", clientName); if (!StringUtil.isBlank(material.getUserName())) { env.put("P4USER", material.getUserName()); } <START> if (material.getUseTickets() && !StringUtil.isBlank(material.getPassword())) { <END> env.put("P4PASSWD", material.getPassword()); } return env; }</code><technical_language>this works, I plan check scenarios URL is changed, etc</technical_language>

Target:
private Map<String, String> envVars() { Map<String, String> env = new HashMap<>(); env.put("P4PORT", material.getServerAndPort()); env.put("P4CLIENT", clientName); if (!StringUtil.isBlank(material.getUserName())) { env.put("P4USER", material.getUserName()); } if (!material.getUseTickets() && !StringUtil.isBlank(material.getPassword())) { env.put("P4PASSWD", material.getPassword()); } return env; }
Source:
<code>public void openContainer(Container container) { <START> if (openContainer != inventoryContainer) { <END> closeScreen(); } IInventory containerInventory = ((MinecraftInventoryAdapter) container).getInventory().get(0); String guiId = containerInventory instanceof IInteractionObject ? ((IInteractionObject) containerInventory).getGuiID() : "minecraft:chest"; this.getNextWindowId(); this.connection.sendPacket(new SPacketOpenWindow(this.currentWindowId, guiId, containerInventory.getDisplayName(), containerInventory.getSizeInventory())); this.openContainer = (net.minecraft.inventory.Container) container; this.openContainer.windowId = this.currentWindowId; this.openContainer.addListener(this$); }</code><technical_language>this</technical_language>

Target:
public void openContainer(Container container) { if (this.openContainer != this.inventoryContainer) { closeScreen(); } IInventory containerInventory = ((MinecraftInventoryAdapter) container).getInventory().get(0); String guiId = containerInventory instanceof IInteractionObject ? ((IInteractionObject) containerInventory).getGuiID() : "minecraft:chest"; getNextWindowId(); this.connection.sendPacket(new SPacketOpenWindow(this.currentWindowId, guiId, containerInventory.getDisplayName(), containerInventory.getSizeInventory())); this.openContainer = (net.minecraft.inventory.Container) container; this.openContainer.windowId = this.currentWindowId; this.openContainer.addListener(this.this$); }
Source:
<code>protected ViewModel onValidSubmit(HttpServletRequest request, HttpServletResponse response, Form form) throws Exception { String password = form.getFieldValue("password"); Application application = (Application) request.getAttribute(Application.class.getName()); String sptoken = form.getFieldValue("sptoken"); if (isJsonPreferred(request, response)) { Map<String, Object> model = new HashMap<String, Object>(); try { Account account = application.resetPassword(sptoken, password); if (autoLogin){ <START> model.put("status", "200"); <END> model.put("account", accountModelFactory.toMap(account, Collections.EMPTY_LIST)); } else { model.put("status", "200"); model.put("message", "OK"); } } catch (ResourceException re) { model = errorMap.toErrorMap(re.getStormpathError()); } catch (Exception e) { Map<String, Object> exceptionErrorMap = new HashMap<String, Object>(); exceptionErrorMap.put("message", e.getMessage()); exceptionErrorMap.put("status", 400); DefaultError error = new DefaultError(exceptionErrorMap); model = errorMap.toErrorMap(error); } return new DefaultViewModel("stormpathJsonView", model); } application.resetPassword(sptoken, password); String next; if (autoLogin){ next = loginNextUri; } else{ next = this.nextUri; } return new DefaultViewModel(next).setRedirect(true); }</code><technical_language>status key in JSON body account</technical_language>

Target:
protected ViewModel onValidSubmit(HttpServletRequest request, HttpServletResponse response, Form form) throws Exception { String password = form.getFieldValue("password"); Application application = (Application) request.getAttribute(Application.class.getName()); String sptoken = form.getFieldValue("sptoken"); if (isJsonPreferred(request, response)) { Map<String, Object> model = new HashMap<String, Object>(); try { Account account = application.resetPassword(sptoken, password); if (autoLogin){ final AuthenticationResult result = new TransientAuthenticationResult(account); this.authenticationResultSaver.set(request, response, result); model.put("account", accountModelFactory.toMap(account, Collections.EMPTY_LIST)); } else { response.setContentType(MediaType.APPLICATION_JSON_VALUE); return null; } } catch (Exception e) { model = errorModelFactory.toError(request, e).toMap(); response.setStatus(errorModelFactory.toError(request, e).getStatus()); } return new DefaultViewModel("stormpathJsonView", model); } String next; try { Account account = application.resetPassword(sptoken, password); if (autoLogin){ final AuthenticationResult result = new TransientAuthenticationResult(account); this.authenticationResultSaver.set(request, response, result); next = loginNextUri; } else{ next = this.nextUri; } } catch (Exception e) { next = errorUri; } return new DefaultViewModel(next).setRedirect(true); }
Source:
<code>private void addVideoCardByDisplayType(DisplayType displayType, int numOfMonitors) { Map<String, Object> struct = new HashMap<String, Object>(); <START> VmDeviceType vmDeviceType = getOsRepository().getDisplayDevice(vm.getOs(), vm.getVdsGroupCompatibilityVersion(), vm.getDefaultDisplayType()); <END> struct.put(VdsProperties.Type, VmDeviceGeneralType.VIDEO.getValue()); struct.put(VdsProperties.Device, vmDeviceType); struct.put(VdsProperties.SpecParams, getNewMonitorSpecParams(displayType, numOfMonitors)); struct.put(VdsProperties.DeviceId, String.valueOf(Guid.newGuid())); devices.add(struct); }</code><technical_language>display in parameters</technical_language>

Target:
private void addVideoCardByDisplayType(DisplayType displayType, int numOfMonitors) { Map<String, Object> struct = new HashMap<String, Object>(); VmDeviceType vmDeviceType = getOsRepository().getDisplayDevice(vm.getOs(), vm.getVdsGroupCompatibilityVersion(), displayType); struct.put(VdsProperties.Type, VmDeviceGeneralType.VIDEO.getValue()); struct.put(VdsProperties.Device, vmDeviceType); struct.put(VdsProperties.SpecParams, getNewMonitorSpecParams(displayType, numOfMonitors)); struct.put(VdsProperties.DeviceId, String.valueOf(Guid.newGuid())); devices.add(struct); }
Source:
<code>public PaymentState(String status, boolean finished) { <START> this(status, finished, null, null, null); <END> }</code><technical_language>I worthwhile a subclass for direct debit payments states add "details" field clear this is for direct debits</technical_language>

Target:
public PaymentState(String status, boolean finished) { this(status, finished, null, null); }
Source:
<code>protected VDSBrokerFrontend getVdsBroker() { <START> return Backend.getInstance().getResourceManager(); <END> }</code><technical_language>getBackend() instead of Backend.getInstance(). Moreover, consider externalizing a runVdsCommand() in QueriesCommandBase method completely remove Backend/VdsManager references this class</technical_language>

Target:
protected VDSBrokerFrontend getVdsBroker() { return getBackend().getResourceManager(); }
Source:
<code>public Module getProgramsGrammar(Module mod) { scala.collection.Set<Module> modules = org.kframework.Collections.Set(mod, baseK.getModule(PROGRAM_LISTS).get()); Option<Module> idOpt = baseK.getModule(ID); if(idOpt.isDefined() && !mod.equals(idOpt.get())) <START> modules = org.kframework.Collections.add(idOpt.get(), modules); <END> return Module.apply(mod.name() + POSTFIX, modules, Set(), Att()); }</code><technical_language>allowed include ID default in single program parser. languages, definition of Id differs. languages Ids (see BF in repository). I personally struggle understand solve this problem 2 modules. this clarified, this PR merged</technical_language>

Target:
public Module getProgramsGrammar(Module mod) { if(mod.name().endsWith(POSTFIX)) { return mod; } else { scala.collection.Set<Module> modules = Set(mod, baseK.getModule(PROGRAM_LISTS).get()); if (stream(mod.importedModules()).anyMatch(m -> m.name().equals(ID))) { Module idProgramParsingModule = baseK.getModule(ID_PROGRAM_PARSING).get(); modules = add(idProgramParsingModule, modules); } return Module.apply(mod.name() + POSTFIX, modules, Set(), Att()); } }