auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public int getOrCreateVertexNear(double lat, double lon, StreetMode streetMode) { Split split = findSplit(lat, lon, LINK_RADIUS_METERS, streetMode); if (split == null) { return -1; } Edge edge = edgeStore.getCursor(split.edge); if (split.distance0_mm < SNAP_RADIUS_MM || split.distance1_mm < SNAP_RADIUS_MM) { if (split.distance0_mm < split.distance1_mm) { return edge.getFromVertex(); } else { return edge.getToVertex(); } } int newVertexIndex = vertexStore.addVertexFixed((int) split.fixedLat, (int) split.fixedLon); int oldToVertex = edge.getToVertex(); ArrayList<int[]> geoms = new ArrayList<>(); if (edge.isMutable()) { edge.setLengthMm(split.distance0_mm); edge.setToVertex(newVertexIndex); geoms = edge.splitGeometryAfter(split.seg); edge.setGeometry(geoms.get(0)); } else { EdgeStore.Edge newEdge0 = edgeStore.addStreetPair(edge.getFromVertex(), newVertexIndex, split.distance0_mm, edge.getOSMID()); newEdge0.copyPairFlagsAndSpeeds(edge); temporaryEdgeIndex.insert(newEdge0.getEnvelope(), newEdge0.edgeIndex); edgeStore.temporarilyDeletedEdges.add(edge.edgeIndex); } EdgeStore.Edge newEdge1 = edgeStore.addStreetPair(newVertexIndex, oldToVertex, split.distance1_mm, edge.getOSMID()); newEdge1.copyPairFlagsAndSpeeds(edge); <START> if (geoms.size() > 1) newEdge1.setGeometry(geoms.get(1)); <END> if (!edgeStore.isExtendOnlyCopy()) { spatialIndex.insert(newEdge1.getEnvelope(), newEdge1.edgeIndex); } else { temporaryEdgeIndex.insert(newEdge1.getEnvelope(), newEdge1.edgeIndex); } return newVertexIndex; }</code><technical_language>I geoms defined, length 2 (hence suggestion a P2 type above). If in some branch geometry split happen, I expect uninitialized of geoms == null</technical_language>

Target:
public int getOrCreateVertexNear(double lat, double lon, StreetMode streetMode) { Split split = findSplit(lat, lon, LINK_RADIUS_METERS, streetMode); if (split == null) { return -1; } Edge edge = edgeStore.getCursor(split.edge); if (split.distance0_mm < SNAP_RADIUS_MM || split.distance1_mm < SNAP_RADIUS_MM) { if (split.distance0_mm < split.distance1_mm) { return edge.getFromVertex(); } else { return edge.getToVertex(); } } int newVertexIndex = vertexStore.addVertexFixed((int) split.fixedLat, (int) split.fixedLon); int oldToVertex = edge.getToVertex(); P2<int[]> geoms = edge.splitGeometryAfter(split.seg); if (edge.isMutable()) { edge.setLengthMm(split.distance0_mm); edge.setToVertex(newVertexIndex); edge.setGeometry(geoms.a); } else { EdgeStore.Edge newEdge0 = edgeStore.addStreetPair(edge.getFromVertex(), newVertexIndex, split.distance0_mm, edge.getOSMID()); newEdge0.copyPairFlagsAndSpeeds(edge); newEdge0.setGeometry(geoms.a); temporaryEdgeIndex.insert(newEdge0.getEnvelope(), newEdge0.edgeIndex); edgeStore.temporarilyDeletedEdges.add(edge.edgeIndex); } EdgeStore.Edge newEdge1 = edgeStore.addStreetPair(newVertexIndex, oldToVertex, split.distance1_mm, edge.getOSMID()); newEdge1.copyPairFlagsAndSpeeds(edge); newEdge1.setGeometry(geoms.b); if (!edgeStore.isExtendOnlyCopy()) { spatialIndex.insert(newEdge1.getEnvelope(), newEdge1.edgeIndex); } else { temporaryEdgeIndex.insert(newEdge1.getEnvelope(), newEdge1.edgeIndex); } return newVertexIndex; }
Source:
<code>public Optional<Path> getCompilerOutputPath(TargetNode<? extends JvmLibraryArg, ?> targetNode) { BuildTarget buildTarget = targetNode.getBuildTarget(); Path compilerOutputPath = DefaultJavaLibrary.getClassesDir(buildTarget, projectFilesystem); <START> return Optional.ofNullable(compilerOutputPath); <END> }</code><technical_language>This Optional.of()</technical_language>

Target:
public Optional<Path> getCompilerOutputPath(TargetNode<? extends JvmLibraryArg, ?> targetNode) { BuildTarget buildTarget = targetNode.getBuildTarget(); Path compilerOutputPath = DefaultJavaLibrary.getClassesDir(buildTarget, projectFilesystem); return Optional.of(compilerOutputPath); }
Source:
<code>public void init(final IEditorSite site, final IEditorInput input) { AbstractReviewTaskEditorPage.super.init(site, input); IReviewRemoteFactoryProvider factoryProvider = getFactoryProvider(); <START> if (factoryProvider != null) { <END> checkIfModelIsCached(); reviewConsumer = factoryProvider.getReviewFactory().getConsumerForLocalKey(factoryProvider.getRoot(), getTask().getTaskId()); reviewConsumer.addObserver(reviewObserver); reviewConsumer.open(); } }</code><technical_language>if null? log error something</technical_language>

Target:
public void init(final IEditorSite site, final IEditorInput input) { AbstractReviewTaskEditorPage.super.init(site, input); checkIfModelIsCached(); reviewConsumer = getFactoryProvider().getReviewFactory().getConsumerForLocalKey(getFactoryProvider().getRoot(), getTask().getTaskId()); reviewConsumer.addObserver(reviewObserver); reviewConsumer.open(); }
Source:
<code>public void testPerformAdd_Triple() { GraphWithPerform g = (GraphWithPerform) graphWith( producer.newInstance(), "S P O; S2 P2 O2"); g.getEventManager().register(GL); txnBegin(g); g.performAdd(triple("S3 P3 O3")); txnCommit(g); GL.assertEmpty(); <START> txnRun( g, new Runnable() { <END> @Override public void run() { assertTrue(g.contains(triple("S3 P3 O3"))); }}); }</code><technical_language>is need explicitly a Runnable in other uses: txnRun( g, ()->assertTrue(g.contains(triple("S3 P3 O3"))) ); tests shorter clearer</technical_language>

Target:
public void testPerformAdd_Triple() { GraphWithPerform g = (GraphWithPerform) graphWith( producer.newInstance(), "S P O; S2 P2 O2"); g.getEventManager().register(GL); txnBegin(g); g.performAdd(triple("S3 P3 O3")); txnCommit(g); GL.assertEmpty(); assertTrue(g.contains(triple("S3 P3 O3"))); }
Source:
<code>public void testPropagation() throws Exception { Span span = tracer.buildSpan("root").start(); JaegerSpanContext context = (JaegerSpanContext) span.context(); <START> String traceId = context.getTraceId(); <END> String baggage = "Baggage-" + System.currentTimeMillis(); span.setBaggageItem(BAGGAGE_KEY, baggage); span.setBaggageItem(CUSTOM_BAGGAGE_PARAM_KEY, customBaggage); if (!sampled) { Tags.SAMPLING_PRIORITY.set(span, 0); } tracingContext.pushSpan(span); try { TraceResponse response = callDownstream(forwardEncodings); assertEquals("Only requests with 'pass' baggage should pass", "pass", customBaggage); List<String> encodings = new ArrayList<>(Arrays.asList(forwardEncodings.split(","))); validate(encodings, traceId, baggage, response); if (sampled) { for (int i = 0; i < 100; i++) { if (reporter.getSpans().size() == 4) { break; } Thread.sleep(10); } assertEquals(4, reporter.getSpans().size()); } } catch (ErrorResponseException error) { if ("pass".equals(customBaggage)) { fail("Request with 'pass' baggage must pass but failed with: " + error); } } }</code><technical_language>I suggest toTraceId() consistently everywhere, mixing get- to-</technical_language>

Target:
public void testPropagation() throws Exception { Span span = tracer.buildSpan("root").start(); String traceId = span.context().toTraceId(); String baggage = "Baggage-" + System.currentTimeMillis(); span.setBaggageItem(BAGGAGE_KEY, baggage); span.setBaggageItem(CUSTOM_BAGGAGE_PARAM_KEY, customBaggage); if (!sampled) { Tags.SAMPLING_PRIORITY.set(span, 0); } tracingContext.pushSpan(span); try { TraceResponse response = callDownstream(forwardEncodings); assertEquals("Only requests with 'pass' baggage should pass", "pass", customBaggage); List<String> encodings = new ArrayList<>(Arrays.asList(forwardEncodings.split(","))); validate(encodings, traceId, baggage, response); if (sampled) { for (int i = 0; i < 100; i++) { if (reporter.getSpans().size() == 4) { break; } Thread.sleep(10); } assertEquals(4, reporter.getSpans().size()); } } catch (ErrorResponseException error) { if ("pass".equals(customBaggage)) { fail("Request with 'pass' baggage must pass but failed with: " + error); } } }
Source:
<code>private String initializeDeviceId() { Set<String> invalidIds = getInvalidDeviceIds(); String deviceId = dbHelper.getValue(DEVICE_ID_KEY); String sharedPrefDeviceId = Utils.getStringFromSharedPreferences(context, instanceName, DEVICE_ID_KEY); if (!(Utils.isEmptyString(deviceId) || invalidIds.contains(deviceId))) { if (!deviceId.equals(sharedPrefDeviceId)) { Utils.writeStringToSharedPreferences(context, instanceName, DEVICE_ID_KEY, deviceId); } return deviceId; } if (!(Utils.isEmptyString(sharedPrefDeviceId) || invalidIds.contains(sharedPrefDeviceId))) { dbHelper.insertOrReplaceKeyValue(DEVICE_ID_KEY, sharedPrefDeviceId); <START> return sharedPrefDeviceId; <END> } if (!newDeviceIdPerInstall && useAdvertisingIdForDeviceId && !deviceInfo.isLimitAdTrackingEnabled()) { String advertisingId = deviceInfo.getAdvertisingId(); if (!(Utils.isEmptyString(advertisingId) || invalidIds.contains(advertisingId))) { saveDeviceId(advertisingId); return advertisingId; } } String randomId = deviceInfo.generateUUID() + "R"; saveDeviceId(randomId); return randomId; }</code><technical_language>I cases correct, I kind of idea of paths of this method calling saveDeviceId easy verify put in inconsistent state</technical_language>

Target:
private String initializeDeviceId() { Set<String> invalidIds = getInvalidDeviceIds(); String deviceId = dbHelper.getValue(DEVICE_ID_KEY); String sharedPrefDeviceId = Utils.getStringFromSharedPreferences(context, instanceName, DEVICE_ID_KEY); if (!(Utils.isEmptyString(deviceId) || invalidIds.contains(deviceId))) { if (!deviceId.equals(sharedPrefDeviceId)) { saveDeviceId(deviceId); } return deviceId; } if (!(Utils.isEmptyString(sharedPrefDeviceId) || invalidIds.contains(sharedPrefDeviceId))) { saveDeviceId(sharedPrefDeviceId); return sharedPrefDeviceId; } if (!newDeviceIdPerInstall && useAdvertisingIdForDeviceId && !deviceInfo.isLimitAdTrackingEnabled()) { String advertisingId = deviceInfo.getAdvertisingId(); if (!(Utils.isEmptyString(advertisingId) || invalidIds.contains(advertisingId))) { saveDeviceId(advertisingId); return advertisingId; } } String randomId = deviceInfo.generateUUID() + "R"; saveDeviceId(randomId); return randomId; }
Source:
<code>public Xid[] recover(int flag) throws XAException { Xid toReturn = null; <START> if ((flag & XAResource.TMSTARTRSCAN) == XAResource.TMSTARTRSCAN) { <END> synchronized(this) { if (scanning) { try { this.wait(); } catch (InterruptedException e) { throw new XAException("Could not wait for in progress scanner"); } } else { scanning = true; } } System.out.println("[" + Thread.currentThread().getName() + "] DummyXAResource (" + serverId + ") RECOVER[XAResource.TMSTARTRSCAN]: " + serverId); if (xid != null) { toReturn = xid; System.out.println("[" + Thread.currentThread().getName() + "] DummyXAResource (" + serverId + ") RECOVERED: " + toReturn); } } if ((flag & XAResource.TMENDRSCAN) == XAResource.TMENDRSCAN) { System.out.println("[" + Thread.currentThread().getName() + "] DummyXAResource (" + serverId + ") RECOVER[XAResource.TMENDRSCAN]: " + serverId); synchronized(this) { if (scanning) { scanning = false; this.notify(); } } } if (flag == XAResource.TMNOFLAGS) { System.out.println("[" + Thread.currentThread().getName() + "] DummyXAResource (" + serverId + ") RECOVER[XAResource.TMENDRSCAN]: " + serverId); } return new Xid[] { toReturn }; }</code><technical_language>I this needs a complete implementation, return Xid[] xid null depending for recovery</technical_language>

Target:
public Xid[] recover(int flag) throws XAException { return new Xid[]{xid}; }
Source:
<code>public void ack(Object messageId) { if (!isTestMessageId(messageId)) { delegateSpout.ack(messageId); } else { <START> tuplesToAck--; <END> LOG.info("Received an ack with MessageId: " + messageId + " tuplesToAck=" + tuplesToAck); handleAckedMessage(messageId, pendingMessages.get(messageId)); } emitTerminalIfNeeded(); }</code><technical_language>eliminate count-- in if branch</technical_language>

Target:
public void ack(Object messageId) { tuplesToAck--; LOG.info("Received an ack with MessageId: " + messageId + " tuplesToAck=" + tuplesToAck); if (!isTestMessageId(messageId)) { delegateSpout.ack(messageId); } else { handleAckedMessage(messageId, pendingMessages.get(messageId)); } emitTerminalIfNeeded(); }
Source:
<code>public Object execute(ExecutionEvent event) throws ExecutionException { IEditorInput editorInput = HandlerUtil.getActiveEditorInput(event); if (editorInput instanceof CompareEditorInput) { configuration = ((CompareEditorInput)editorInput).getCompareConfiguration(); <START> } <END> Shell parent = configuration.getContainer().getWorkbenchPart().getSite().getShell(); FileDialog fileDialog = new FileDialog(parent, SWT.SAVE); String filePath = fileDialog.open(); if (filePath != null) { File file = new File(filePath); if (file.exists()) { MessageDialog messageDialog = new MessageDialog(parent, "File already exists", null, "File \"" + file.toString() + "\" already exists. Do you want to replace the existing one?", MessageDialog.WARNING, DIALOG_BUTTON_LABELS.toArray(new String[0]), 1); int open = messageDialog.open(); if (open == DIALOG_BUTTON_LABELS.indexOf("Replace")) { saveComparison(file); } } else { saveComparison(file); } } return null; }</code><technical_language>This fail in NPE if editorInput is instanceof... do leave "else" unwritten: } else { throw new IllegalArgumentException("Could save comparison model"); } "return null" in "else" if case is problematic caller handle null itself</technical_language>

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { IEditorInput editorInput = HandlerUtil.getActiveEditorInput(event); if (editorInput instanceof CompareEditorInput) { configuration = ((CompareEditorInput)editorInput).getCompareConfiguration(); Shell parent = configuration.getContainer().getWorkbenchPart().getSite().getShell(); FileDialog fileDialog = new FileDialog(parent, SWT.SAVE); String filePath = fileDialog.open(); if (filePath != null) { File file = new File(filePath); if (file.exists()) { MessageDialog messageDialog = new MessageDialog(parent, "File already exists", null, "File \"" + file.toString() + "\" already exists. Do you want to replace the existing one?", MessageDialog.WARNING, DIALOG_BUTTON_LABELS.toArray(new String[0]), 1); int open = messageDialog.open(); if (open == DIALOG_BUTTON_LABELS.indexOf("Replace")) { saveComparison(file); } } else { saveComparison(file); } } } return null; }
Source:
<code>protected static MarkupParser createParserWithConfiguration(MarkupLanguageConfiguration configuration) { MarkupLanguage markupLanguage = new AsciiDocLanguage(); if (configuration != null) { markupLanguage.configure(configuration); } <START> MarkupParser parser = new <END> MarkupParser(markupLanguage); return parser; }</code><technical_language>inline return statement</technical_language>

Target:
protected static MarkupParser createParserWithConfiguration(MarkupLanguageConfiguration configuration) { MarkupLanguage markupLanguage = new AsciiDocLanguage(); if (configuration != null) { markupLanguage.configure(configuration); } return new MarkupParser(markupLanguage); }
Source:
<code>private void highlightViewOnUiThread() { hideHighlightOnUiThread(); <START> while (true) { <END> View viewToHighlight = mViewToHighlight.get(); if (viewToHighlight != null) { mHighlightDrawable.setBounds(0, 0, viewToHighlight.getWidth(), viewToHighlight.getHeight()); viewToHighlight.getOverlay().add(mHighlightDrawable); mHighlightedView = viewToHighlight; if (mViewToHighlight.compareAndSet(viewToHighlight, null)) { break; } } } }</code><technical_language>a simpler solution here: java mHandler = new Handler(Looper.getMainLooper()); synchronized void highlightView(...) { mHandle.removeCallbacks(mHighlightOnUiThreadRunnable); mHandle.postDelayed(mHighlight..., 50 /* millis */); }</technical_language>

Target:
private void highlightViewOnUiThread() { final View viewToHighlight = mViewToHighlight.getAndSet(null); if (viewToHighlight == mHighlightedView) { return; } if (mHighlightedView != null) { mHighlightedView.getOverlay().remove(mHighlightDrawable); } if (viewToHighlight != null) { mHighlightDrawable.setColor(mContentColor.get()); mHighlightDrawable.setBounds(0, 0, viewToHighlight.getWidth(), viewToHighlight.getHeight()); viewToHighlight.getOverlay().add(mHighlightDrawable); mHighlightedView = viewToHighlight; } }
Source:
<code>public String format(LogRecord record) { ZonedDateTime timestamp = ZonedDateTime.ofInstant(Instant.ofEpochMilli(record.getMillis()), SYSTEM_ZONE); StringWriter stringWriter = new StringWriter() .append(TIMESTAMP_FORMATTER.format(timestamp)) .append('\t') .append(Level.fromJulLevel(record.getLevel()).name()) .append('\t') .append(Thread.currentThread().getName()) .append('\t') .append(record.getLoggerName()) .append('\t') .append(record.getMessage()); if (record.getThrown() != null) { stringWriter.append('\n'); record.getThrown().printStackTrace(new PrintWriter(stringWriter)); stringWriter.append('\n'); } stringWriter.append('\n'); String message = stringWriter.toString(); <START> return message; <END> }</code><technical_language>Inline</technical_language>

Target:
public String format(LogRecord record) { ZonedDateTime timestamp = ZonedDateTime.ofInstant(Instant.ofEpochMilli(record.getMillis()), SYSTEM_ZONE); StringWriter stringWriter = new StringWriter() .append(TIMESTAMP_FORMATTER.format(timestamp)) .append('\t') .append(Level.fromJulLevel(record.getLevel()).name()) .append('\t') .append(Thread.currentThread().getName()) .append('\t') .append(record.getLoggerName()) .append('\t') .append(record.getMessage()); if (record.getThrown() != null) { stringWriter.append('\n'); record.getThrown().printStackTrace(new PrintWriter(stringWriter)); stringWriter.append('\n'); } stringWriter.append('\n'); return stringWriter.toString(); }
Source:
<code>public void addLineItem() { <START> ProductFixtures.withTaxedProduct(client(), product -> { <END> final LineItemDraft lineItemDraft = LineItemDraft.of(product, 1, 5); final AddLineItem addLineItem = AddLineItem.of(lineItemDraft); testOrderEditStagedUpdateAction(addLineItem); }); }</code><technical_language>nice a static import, for consistency</technical_language>

Target:
public void addLineItem() { withTaxedProduct(client(), product -> { final LineItemDraft lineItemDraft = LineItemDraft.of(product, 1, 5); final AddLineItem addLineItem = AddLineItem.of(lineItemDraft); testOrderEditStagedUpdateAction(addLineItem); }); }
Source:
<code>private void testAsyncWritesToBuffer() { Buffer buffer = (Buffer) store; int count = TestData.getScaleCount(); for (int i = 0; i < count; ++i) { Write write = null; while (write == null ) { write = TestData.getWriteAdd(); } buffer.insert( write,true ); } <START> <END> }</code><technical_language>need assert here? ideal test write Buffer is BINARY_QUEUE. such, place a random number of writes in Buffer (see TestData.getScaleCount() for a random value)</technical_language>

Target:
private void testAsyncWritesToBuffer() { Buffer buffer = (Buffer) store; int count = TestData.getScaleCount(); for (int i = 0; i < count; ++i) { Write write = null; while (write == null) { write = TestData.getWriteAdd(); } buffer.insert(write, true); } Assert.assertEquals(count, GlobalState.BINARY_QUEUE.size()); }
Source:
<code><START> static <T> Future<T> ofSupplier(ExecutorService executorService, Supplier<? extends T> computation) { <END> return of(executorService, computation::get); }</code><technical_language>Please add a java Objects.requireNonNull(computation, "computation is null");</technical_language>

Target:
static <T> Future<T> ofSupplier(ExecutorService executorService, Supplier<? extends T> computation) { Objects.requireNonNull(computation, "computation is null"); return of(executorService, computation::get); }
Source:
<code>public void process(final Exchange exchange) throws Exception { final Message in = exchange.getIn(); final Model model = createDefaultModel(); String fcrepoBinaryUri = (String) in.getHeader("CamelFcrepoUri"); Model values = model.read(in.getBody(InputStream.class), null, "Turtle"); ResIterator resources = values.listResourcesWithProperty(RDF.type, Fcrepo4Repository.Binary); try { if (resources.hasNext()) { Resource resource = resources.next(); String binaryMimeType = resource.getProperty(hasMimeType).getObject().toString(); String binaryFcrepoChecksum = resource.getProperty(hasMessageDigest).getObject().toString(); String[] binaryFcrepoChecksumSplit = binaryFcrepoChecksum.split(":"); String binaryPath = idToPath(binaryFcrepoChecksumSplit[2], BINARY_PATH_DEPTH, HASHED_PATH_SIZE); String binaryFullPath = new StringJoiner("") .add(baseBinaryPath) .add(binaryPath) .add(binaryFcrepoChecksumSplit[2]) .toString(); if (Files.exists(Paths.get(binaryFullPath))) { in.setHeader(CdrBinaryPath, binaryFullPath); <START> in.setHeader(CdrBinarySubPath, idToPath(fcrepoBinaryUri, HASHED_PATH_DEPTH, HASHED_PATH_SIZE)); <END> } in.setHeader(CdrBinaryChecksum, binaryFcrepoChecksumSplit[2]); in.setHeader(CdrBinaryMimeType, binaryMimeType); in.setHeader(CdrBinaryUri, fcrepoBinaryUri); } } finally { resources.close(); } }</code><technical_language>Stepping test, appears this header is set "ht/tp/:///e/". want :) I need a PID out of fcrepoBinaryUri ask for id passing idToPath</technical_language>

Target:
public void process(final Exchange exchange) throws Exception { final Message in = exchange.getIn(); final Model model = createDefaultModel(); String fcrepoBinaryUri = (String) in.getHeader("CamelFcrepoUri"); Model values = model.read(in.getBody(InputStream.class), null, "Turtle"); ResIterator resources = values.listResourcesWithProperty(RDF.type, Fcrepo4Repository.Binary); try { if (resources.hasNext()) { Resource resource = resources.next(); String binaryMimeType = resource.getProperty(hasMimeType).getObject().toString(); String binaryFcrepoChecksum = resource.getProperty(hasMessageDigest).getObject().toString(); String[] binaryFcrepoChecksumSplit = binaryFcrepoChecksum.split(":"); String binaryPath = RepositoryPaths .idToPath(binaryFcrepoChecksumSplit[2], BINARY_PATH_DEPTH, HASHED_PATH_SIZE); String binaryFullPath = new StringJoiner("") .add(baseBinaryPath) .add(binaryPath) .add(binaryFcrepoChecksumSplit[2]) .toString(); if (Files.exists(Paths.get(binaryFullPath))) { in.setHeader(CdrBinaryPath, binaryFullPath); } in.setHeader(CdrBinaryChecksum, binaryFcrepoChecksumSplit[2]); in.setHeader(CdrBinaryMimeType, binaryMimeType); in.setHeader(CdrBinaryUri, fcrepoBinaryUri); } } finally { resources.close(); } }
Source:
<code>public static FunctionMetadata removeTypeParameters(FunctionMetadata metadata) { ImmutableList.Builder<TypeSignature> argumentsBuilder = ImmutableList.builder(); for (TypeSignature typeSignature : metadata.getArgumentTypes()) { argumentsBuilder.add(removeTypeParameters(typeSignature)); } if (metadata.getOperatorType().isPresent()) { return new FunctionMetadata( metadata.getOperatorType().get(), argumentsBuilder.build(), metadata.getReturnType(), metadata.getFunctionKind(), metadata.isDeterministic(), metadata.isCalledOnNullInput()); } <START> else { <END> return new FunctionMetadata( metadata.getName(), argumentsBuilder.build(), metadata.getReturnType(), metadata.getFunctionKind(), metadata.isDeterministic(), metadata.isCalledOnNullInput()); } }</code><technical_language>else { is redundant</technical_language>

Target:
private static FunctionMetadata removeTypeParameters(FunctionMetadata metadata) { ImmutableList.Builder<TypeSignature> argumentsBuilder = ImmutableList.builder(); for (TypeSignature typeSignature : metadata.getArgumentTypes()) { argumentsBuilder.add(removeTypeParameters(typeSignature)); } if (metadata.getOperatorType().isPresent()) { return new FunctionMetadata( metadata.getOperatorType().get(), argumentsBuilder.build(), metadata.getReturnType(), metadata.getFunctionKind(), metadata.isDeterministic(), metadata.isCalledOnNullInput()); } return new FunctionMetadata( metadata.getName(), argumentsBuilder.build(), metadata.getReturnType(), metadata.getFunctionKind(), metadata.isDeterministic(), metadata.isCalledOnNullInput()); }
Source:
<code>public static String getPayloadAsString(CoreEvent event) { <START> return event.getMessage().getPayload().getValue().toString(); <END> }</code><technical_language>payload null? In case, get NPE executing toString</technical_language>

Target:
public static String getPayloadAsString(CoreEvent event) { TypedValue<?> payload= event.getMessage().getPayload(); if(payload != null && payload.getValue() != null) return payload.getValue().toString(); return null; }
Source:
<code>private String buildRetrieveClaimsUrlJsonBody(String code) throws JsonProcessingException { <START> Map<String, String> body = new HashMap<String, String>() {{ <END> put("grant_type", "authorization_code"); put("code", code); put("client_id", clientId); put("client_secret", clientSecret); put("redirect_uri", callbackURI); }}; ObjectMapper objectMapper = new ObjectMapper(); return objectMapper.writeValueAsString(body); }</code><technical_language>Map.of()</technical_language>

Target:
private String buildRetrieveClaimsUrlJsonBody(String code) throws JsonProcessingException { Map<String, String> body = Map.of( "grant_type", "authorization_code", "code", code, "client_id", clientId, "client_secret", clientSecret, "redirect_uri", callbackURI ); ObjectMapper objectMapper = new ObjectMapper(); return objectMapper.writeValueAsString(body); }
Source:
<code><START> public BoundedContextBuilder addCommandDispatcher(CommandDispatcher<?> commandDispatcher) { <END> checkNotNull(commandDispatcher); commandDispatchers.add(commandDispatcher); return this; }</code><technical_language>tricky business is repositories CommandDispatchers EventDispatchers. impossible [add | remove | ]...Dispatcher(...) API ...Repository-typed arguments</technical_language>

Target:
public BoundedContextBuilder addCommandDispatcher(CommandDispatcher<?> commandDispatcher) { checkNotNull(commandDispatcher); if (commandDispatcher instanceof Repository) { return add((Repository<?, ?>) commandDispatcher); } commandDispatchers.add(commandDispatcher); return this; }
Source:
<code>private CompletableFuture<CorfuInterClusterReplicationServerNode> startDiscoveryService(ServerContext serverContext) throws Exception { <START> log.info("Start Discovery Service."); <END> CompletableFuture<CorfuInterClusterReplicationServerNode> discoveryServiceCallback = new CompletableFuture<>(); this.clusterManagerAdapter = buildClusterManagerAdapter(serverContext.getPluginConfigFilePath()); replicationDiscoveryService = new CorfuReplicationDiscoveryService(serverContext, clusterManagerAdapter, discoveryServiceCallback); Thread replicationDiscoveryThread = new Thread(replicationDiscoveryService, "discovery-service"); replicationDiscoveryThread.start(); return discoveryServiceCallback; }</code><technical_language>exception type more specific</technical_language>

Target:
private CompletableFuture<CorfuInterClusterReplicationServerNode> startDiscoveryService(ServerContext serverContext) { log.info("Start Discovery Service."); CompletableFuture<CorfuInterClusterReplicationServerNode> discoveryServiceCallback = new CompletableFuture<>(); this.clusterManagerAdapter = buildClusterManagerAdapter(serverContext.getPluginConfigFilePath()); replicationDiscoveryService = new CorfuReplicationDiscoveryService(serverContext, clusterManagerAdapter, discoveryServiceCallback); Thread replicationDiscoveryThread = new Thread(replicationDiscoveryService, "discovery-service"); replicationDiscoveryThread.start(); return discoveryServiceCallback; }
Source:
<code>public LoginPasswordAuthentication(final String login, final String password) { <START> this.login = notEmpty(login, "login");; <END> this.password = notEmpty(password, "password");; }</code><technical_language>redundant semicolon</technical_language>

Target:
public LoginPasswordAuthentication(final String login, final String password) { this.login = notEmpty(login, "login"); this.password = notEmpty(password, "password"); }
Source:
<code>public HashCode buildHashCode() { final HashCode hc = Const.HASH_FUNCTION().newHasher() .putString(Strings.nullToEmpty(aggregator), Const.UTF8_CHARSET) .putBoolean(infectious_nan) .putBoolean(merge_ids) .putBoolean(full_merge) .hash(); final List<HashCode> hashes = Lists.newArrayListWithCapacity(4); hashes.add(super.buildHashCode()); hashes.add(hc); if (tag_keys != null) { final List<String> keys = Lists.newArrayList(tag_keys); Collections.sort(keys); final Hasher hasher = Const.HASH_FUNCTION().newHasher(); for (final String key : keys) { hasher.putString(key, net.opentsdb.core.Const.UTF8_CHARSET); } hashes.add(hasher.hash()); } <START> if (encoded_tag_keys != null) { <END> final List<byte[]> keys = Lists.newArrayList(encoded_tag_keys); final Hasher hasher = Const.HASH_FUNCTION().newHasher(); for (final byte[] key : keys) { hasher.putInt(key.hashCode()); } hashes.add(hasher.hash()); } return Hashing.combineOrdered(hashes); }</code><technical_language>skip encoded_tag_keys</technical_language>

Target:
public HashCode buildHashCode() { final HashCode hc = Const.HASH_FUNCTION().newHasher() .putString(Strings.nullToEmpty(aggregator), Const.UTF8_CHARSET) .putBoolean(infectious_nan) .putBoolean(merge_ids) .putBoolean(full_merge) .hash(); final List<HashCode> hashes = Lists.newArrayListWithCapacity(4); hashes.add(super.buildHashCode()); hashes.add(hc); if (tag_keys != null) { final List<String> keys = Lists.newArrayList(tag_keys); Collections.sort(keys); final Hasher hasher = Const.HASH_FUNCTION().newHasher(); for (final String key : keys) { hasher.putString(key, net.opentsdb.core.Const.UTF8_CHARSET); } hashes.add(hasher.hash()); } return Hashing.combineOrdered(hashes); }
Source:
<code>public void destroy() { <START> this.connectionFactoryMap.forEach((ldap, connectionFactory) -> { connectionFactory.close(); }); <END> }</code><technical_language>suggestion this.connectionFactoryMap.forEach((ldap, connectionFactory) -> connectionFactory.close(); );</technical_language>

Target:
public void destroy() { this.connectionFactoryMap.forEach((ldap, connectionFactory) -> connectionFactory.close()); }
Source:
<code>public void doesNotEscapeBase64() throws Exception { String name = secretBase64.getName(); when(aclDAO.getBatchSanitizedSecretsFor(client, ImmutableList.of(name))) .thenReturn(ImmutableList.of(SanitizedSecret.fromSecret(secretBase64))); when(secretController.getSecretsByName(ImmutableList.of(name))) .thenReturn(ImmutableList.of(secretBase64)); List<SecretDeliveryResponse> response = batchSecretDeliveryResource.getBatchSecret(client, BatchSecretRequest.create(ImmutableList.of(secretBase64.getName()))); assertThat(response.get(0).getSecret()).isEqualTo(secretBase64.getSecret()); <START> assertThat(response.size()).isEqualTo(1); <END> }</code><technical_language>nit: I assert list size retrieve items second, if empty assertion fails test throwing IndexOutOfBoundsException</technical_language>

Target:
public void doesNotEscapeBase64() throws Exception { String name = secretBase64.getName(); when(aclDAO.getBatchSanitizedSecretsFor(client, ImmutableList.of(name))) .thenReturn(ImmutableList.of(SanitizedSecret.fromSecret(secretBase64))); when(clientDAO.getClientByName(client.getName())).thenReturn(Optional.of(client)); when(secretController.getSecretsByName(ImmutableList.of(name))) .thenReturn(ImmutableList.of(secretBase64)); List<SecretDeliveryResponse> response = batchSecretDeliveryResource.getBatchSecret(client, BatchSecretRequest.create(ImmutableList.of(secretBase64.getName()))); assertThat(response.size()).isEqualTo(1); assertThat(response.get(0).getSecret()).isEqualTo(secretBase64.getSecret()); }
Source:
<code>public PantsCompileAllTargetsAction() { <START> super(new PantsGetAllTargets(), <END> new PantsExecuteCompile(), "Compile all targets in project"); }</code><technical_language>classes objects, methods perform objects, this sense. Here, PantsGetAllTargets is a 'verb' implying a method, object. is suited a class. do some renaming more consistent object/method concepts, reconsider this structure</technical_language>

Target:
public PantsCompileAllTargetsAction() { super("Compile all targets in project"); }
Source:
<code>public static synchronized SyncManager getInstance(UserAccount account, String communityId, SmartStore smartStore) { if (account == null) { account = SalesforceSDKManagerWithSmartStore.getInstance().getUserAccountManager().getCurrentUser(); } if (smartStore == null) { smartStore = SmartSyncSDKManager.getInstance().getSmartStore(account, communityId); } if (UserAccount.INTERNAL_COMMUNITY_ID.equals(communityId)) { communityId = null; } <START> String uniqueId = (account != null ? account.getUserId() : "") + ":" <END> + (communityId != null ? communityId : "") + ":" + smartStore.getDatabase().getPath(); SyncManager instance = INSTANCES.get(uniqueId); if (instance == null) { RestClient restClient = SalesforceSDKManager.getInstance().getClientManager().peekRestClient(account); instance = new SyncManager(smartStore, restClient); INSTANCES.put(uniqueId, instance); } return instance; }</code><technical_language>communityId out of this uniqueId computation, it, line sets communityId = null. DB path accounts for userId, orgId, communityId, need associate a user account is userId. If a portal user if logged a community, userId different. If internal user is logged org community, DB path different. Hence, uniqueId unique userId + dbPath</technical_language>

Target:
public static synchronized SyncManager getInstance(UserAccount account, String communityId, SmartStore smartStore) { if (account == null) { account = SalesforceSDKManagerWithSmartStore.getInstance().getUserAccountManager().getCurrentUser(); } if (smartStore == null) { smartStore = SmartSyncSDKManager.getInstance().getSmartStore(account, communityId); } String uniqueId = (account != null ? account.getUserId() : "") + ":" + smartStore.getDatabase().getPath(); SyncManager instance = INSTANCES.get(uniqueId); if (instance == null) { RestClient restClient = SalesforceSDKManager.getInstance().getClientManager().peekRestClient(account); instance = new SyncManager(smartStore, restClient); INSTANCES.put(uniqueId, instance); } return instance; }
Source:
<code>public DefaultTimeSourceService(TimeSourceConfiguration config) { if (config != null) { timeSource = config.getTimeSource(); } else { <START> timeSource = TickingTimeSource.INSTANCE; <END> } }</code><technical_language>convinced this default, configuring it</technical_language>

Target:
public DefaultTimeSourceService(TimeSourceConfiguration config) { if (config != null) { timeSource = config.getTimeSource(); } else { timeSource = SystemTimeSource.INSTANCE; } }
Source:
<code>public Set<String> addSenseBlackList(@Scope(OAuthScope.ADMINISTRATION_READ) final AccessToken accessToken) { Jedis jedis = null; try { jedis = jedisPool.getResource(); return jedis.smembers(BlackListDevicesConfiguration.SENSE_BLACK_LIST_KEY); } catch (JedisDataException e) { if (jedis != null) { jedisPool.returnBrokenResource(jedis); } throw new WebApplicationException(Response.status(Response.Status.INTERNAL_SERVER_ERROR) .entity(new JsonError(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), String.format("Failed to get data from redis - %s", e.getMessage()))).build()); } catch (Exception e) { if (jedis != null) { jedisPool.returnBrokenResource(jedis); } <START> throw new WebApplicationException(Response.status(Response.Status.INTERNAL_SERVER_ERROR) <END> .entity(new JsonError(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), String.format("Failed to retrieve sense black list because %s", e.getMessage()))).build()); } finally { if (jedis != null) { jedisPool.returnResource(jedis); } } }</code><technical_language>throw exception end - of try catch</technical_language>

Target:
public Set<String> addSenseBlackList(@Scope(OAuthScope.ADMINISTRATION_READ) final AccessToken accessToken) { Jedis jedis = null; try { jedis = jedisPool.getResource(); return jedis.smembers(BlackListDevicesConfiguration.SENSE_BLACK_LIST_KEY); } catch (JedisDataException e) { if (jedis != null) { jedisPool.returnBrokenResource(jedis); jedis = null; } throw new WebApplicationException(Response.status(Response.Status.INTERNAL_SERVER_ERROR) .entity(new JsonError(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), String.format("Failed to get data from redis - %s", e.getMessage()))).build()); } catch (Exception e) { if (jedis != null) { jedisPool.returnBrokenResource(jedis); jedis = null; } throw new WebApplicationException(Response.status(Response.Status.INTERNAL_SERVER_ERROR) .entity(new JsonError(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), String.format("Failed to retrieve sense black list because %s", e.getMessage()))).build()); } finally { if (jedis != null) { jedisPool.returnResource(jedis); } } }
Source:
<code>private void testJBossWSRuntimeDeletion() { jbossWSRuntimePreferencePage.select(0); jbossWSRuntimePreferencePage.remove(); <START> new WaitUntil(new ShellIsActive("Confirm Runtime Delete")); <END> new PushButton("OK").click(); new WaitWhile(new ShellIsActive("Confirm Runtime Delete")); assertThat(jbossWSRuntimePreferencePage.getAllJBossWSRuntimes().size(), Is.is(0)); }</code><technical_language>new DefaultShell("Confirm Runtime Delete")</technical_language>

Target:
private void testJBossWSRuntimeDeletion() { jbossWSRuntimePreferencePage.select(0); jbossWSRuntimePreferencePage.remove(); new DefaultShell("Confirm Runtime Delete"); new PushButton("OK").click(); new WaitWhile(new ShellIsAvailable("Confirm Runtime Delete")); assertThat(jbossWSRuntimePreferencePage.getAllJBossWSRuntimes().size(), Is.is(0)); }
Source:
<code>public Queue<Selectable> createFlowTriggerEventQueue(DatabaseBackupTriggerEvent event) { Queue<Selectable> chain = new ConcurrentLinkedQueue<>(); <START> String selector = DATABASE_BACKUP_EVENT.event(); <END> chain.add(new StackEvent(SaltUpdateEvent.SALT_UPDATE_EVENT.event(), event.getResourceId(), event.accepted())); chain.add(new DatabaseBackupTriggerEvent(selector, event.getResourceId(), event.getBackupLocation(), event.getBackupId())); return chain; }</code><technical_language>Nit: is benefit of explicit variable instead of inlining in line 27 below</technical_language>

Target:
public Queue<Selectable> createFlowTriggerEventQueue(DatabaseBackupTriggerEvent event) { Queue<Selectable> chain = new ConcurrentLinkedQueue<>(); chain.add(new StackEvent(SaltUpdateEvent.SALT_UPDATE_EVENT.event(), event.getResourceId(), event.accepted())); chain.add(new DatabaseBackupTriggerEvent(DATABASE_BACKUP_EVENT.event(), event.getResourceId(), event.getBackupLocation(), event.getBackupId())); return chain; }
Source:
<code>public PatchSetAttribute asPatchSetAttribute(final PatchSet patchSet) { PatchSetAttribute p = new PatchSetAttribute(); p.revision = patchSet.getRevision().get(); p.number = Integer.toString(patchSet.getPatchSetId()); p.ref = patchSet.getRefName(); p.uploader = asAccountAttribute(patchSet.getUploader()); p.createdOn = patchSet.getCreatedOn().getTime() / 1000L; try { final ReviewDb db = schema.open(); try { p.parents = new ArrayList<String>(); for (PatchSetAncestor a : db.patchSetAncestors().ancestorsOf( patchSet.getId())) { p.parents.add(a.getAncestorRevision().get()); } p.author = asAccountAttribute(psInfoFactory.get(db, patchSet.getId()) .getAuthor().getAccount()); Change change = db.changes().get(patchSet.getId().getParentKey()); List<Patch> list = patchListCache.get(change, patchSet).toPatchList(patchSet.getId()); for (Patch pe : list) { if (!Patch.COMMIT_MSG.equals(pe.getFileName())) { p.sizeDeletions -= pe.getDeletions(); p.sizeInsertions += pe.getInsertions(); } } } finally { db.close(); } } catch (OrmException e) { log.error("Cannot load patch set data for " + patchSet.getId(), e); } catch (PatchSetInfoNotAvailableException e) { log.error( <START> String.format("Cannot get authorEmail for %s ", patchSet.getId()), e); <END> } catch (PatchListNotAvailableException e) { log.error( String.format("Cannot get deletions and insertions for %s ", patchSet.getId()), e); } return p; }</code><technical_language>trailing space end of template string</technical_language>

Target:
public PatchSetAttribute asPatchSetAttribute(final PatchSet patchSet) { PatchSetAttribute p = new PatchSetAttribute(); p.revision = patchSet.getRevision().get(); p.number = Integer.toString(patchSet.getPatchSetId()); p.ref = patchSet.getRefName(); p.uploader = asAccountAttribute(patchSet.getUploader()); p.createdOn = patchSet.getCreatedOn().getTime() / 1000L; final PatchSet.Id pId = patchSet.getId(); try { final ReviewDb db = schema.open(); try { p.parents = new ArrayList<String>(); for (PatchSetAncestor a : db.patchSetAncestors().ancestorsOf( patchSet.getId())) { p.parents.add(a.getAncestorRevision().get()); } p.author = asAccountAttribute( psInfoFactory.get(db, pId).getAuthor().getAccount()); Change change = db.changes().get(pId.getParentKey()); List<Patch> list = patchListCache.get(change, patchSet).toPatchList(pId); for (Patch pe : list) { if (!Patch.COMMIT_MSG.equals(pe.getFileName())) { p.sizeDeletions -= pe.getDeletions(); p.sizeInsertions += pe.getInsertions(); } } } finally { db.close(); } } catch (OrmException e) { log.error("Cannot load patch set data for " + patchSet.getId(), e); } catch (PatchSetInfoNotAvailableException e) { log.error(String.format("Cannot get authorEmail for %s.", pId), e); } catch (PatchListNotAvailableException e) { log.error(String.format("Cannot get size information for %s.", pId), e); } return p; }
Source:
<code>protected RefundsResponse executeFutureBehaviourStrategy() { <START> return getPaymentRefundsService.getLedgerTransactionTransactions(account, paymentId); <END> }</code><technical_language>more obvious while reading code if was: suggestion return executeLedgerOnlyStrategy();</technical_language>

Target:
protected RefundsResponse executeFutureBehaviourStrategy() { return executeLedgerOnlyStrategy(); }
Source:
<code>public GuiltyConscience(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{W}"); this.subtype.add("Aura"); TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); <START> this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); <END> Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); this.addAbility(new DealsDamageAttachedTriggeredAbility(Zone.BATTLEFIELD, new DamageAttachedEffect(new NumericSetToEffectValues("that much", "damage")), false)); }</code><technical_language>more unboost enchantement. AI Outcome for some target decisions. Boost is positive means cast creatures. Unboost opposite</technical_language>

Target:
public GuiltyConscience(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{W}"); this.subtype.add("Aura"); TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Outcome.UnboostCreature)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); this.addAbility(new DealsDamageAttachedTriggeredAbility(Zone.BATTLEFIELD, new DamageAttachedEffect(new NumericSetToEffectValues("that much", "damage")), false)); }
Source:
<code>public void testFields() { assertNotNull(mapMetaDataModel.getFields()); assertEquals(2, mapMetaDataModel.getFields().size()); final List<DataType> list = new ArrayList<DataType>(); for (int i = mapMetaDataModel.getFields().size(); --i >= 0;) { list.add(mapMetaDataModel.getFields().get(i).getMetaDataModel().getDataType()); } Collections.sort(list); assertTrue(list.get(1).equals(DataType.STRING)); assertTrue(list.get(0).equals(DataType.NUMBER)); <START> } <END></code><technical_language>Hi! Thanks a lot for contribution! java 8 map implementation changed elements order in entrySet().iterator (used in DefaultDefinedMapMetaDataModel constructor), this test fails, expects item 1 STRING, item 0 NUMBER. fix this test is requiere map size 2, exists STRING field, NUMBER field, matter positions. A good approach do this is using: org.apache.commons.collections.CollectionUtils.exists(<collection>, <predicate>) This test clearer! please perform this change? Thanks</technical_language>

Target:
public void testFields() { assertNotNull(mapMetaDataModel.getFields()); assertEquals(2, mapMetaDataModel.getFields().size()); Assertions.assertThat(mapMetaDataModel.getFields()).extracting("metaDataModel").extracting("dataType").contains(DataType.STRING); Assertions.assertThat(mapMetaDataModel.getFields()).extracting("metaDataModel").extracting("dataType").contains(DataType.NUMBER); }
Source:
<code>public Boolean getResultAsBoolean() { <START> return JsFunction.RESULT_TYPE_BOOLEAN.equals(resultType) ? (Boolean) resultValue : Boolean.FALSE; <END> }</code><technical_language>place this function is org.ovirt.engine.ui.webadmin.plugin.jsni.JsFunctionResultHelper.invokeAndGetResultAsBoolean(JsFunction, JsArray<?>, ErrorHandler, boolean) tracking call stack updateActionButtonCommand, if null is returned getResultAsBoolean, return true false</technical_language>

Target:
public Boolean getResultAsBoolean() { return JsFunction.RESULT_TYPE_BOOLEAN.equals(resultType) ? (Boolean) resultValue : Boolean.TRUE; }
Source:
<code>public RemoteOutcomeParams() { <START> new RemoteOutcomeParams(true, true, true); <END> }</code><technical_language>replace this(true, true, true);</technical_language>

Target:
public RemoteOutcomeParams() { this(true, true, true); }
Source:
<code>public Group createGroup(PerunSession sess, Group parentGroup, Group group) throws GroupExistsException, InternalErrorException, GroupRelationNotAllowed, GroupRelationAlreadyExists { Vo vo = this.getVo(sess, parentGroup); group = getGroupsManagerImpl().createGroup(sess, vo, parentGroup, group); try { parentGroup = createGroupUnion(sess, parentGroup, group, true); } catch (WrongAttributeValueException | WrongReferenceAttributeValueException e) { <START> log.debug("Exception thrown in createGroup method, while it shouldn't be thrown. Cause:{}",e); <END> } catch (GroupNotExistsException e) { throw new ConsistencyErrorException("Database consistency error while creating group: {}",e); } getPerunBl().getAuditer().log(sess, "{} created in as subgroup of {}", group, vo, parentGroup); return group; }</code><technical_language>If all, debug level. error level</technical_language>

Target:
public Group createGroup(PerunSession sess, Group parentGroup, Group group) throws GroupExistsException, InternalErrorException, GroupRelationNotAllowed, GroupRelationAlreadyExists { Vo vo = this.getVo(sess, parentGroup); group = getGroupsManagerImpl().createGroup(sess, vo, parentGroup, group); try { parentGroup = createGroupUnion(sess, parentGroup, group, true); } catch (WrongAttributeValueException | WrongReferenceAttributeValueException e) { log.error("Exception thrown in createGroup method, while it shouldn't be thrown. Cause:{}",e); } catch (GroupNotExistsException e) { throw new ConsistencyErrorException("Database consistency error while creating group: {}",e); } getPerunBl().getAuditer().log(sess, "{} created in as subgroup of {}", group, vo, parentGroup); return group; }