auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected void doStart() { try { if(datagram) { log.info("Starting Netty UDP server on port {}", port); Bootstrap boot = new Bootstrap(); boot.group(wrkr) .channel(NioDatagramChannel.class) <START> .option(ChannelOption.SO_BACKLOG, 128) <END> .option(ChannelOption.SO_KEEPALIVE, true) .handler(adapter); sock = boot.bind(port).sync(); } else { log.info("Starting Netty TCP server on port {}", port); ServerBootstrap boot = new ServerBootstrap(); boot.group(boss, wrkr) .channel(NioServerSocketChannel.class) .childHandler(adapter) .option(ChannelOption.SO_BACKLOG, 128) .option(ChannelOption.SO_KEEPALIVE, true); sock = boot.bind(port).sync(); } log.info("Netty server started"); notifyStarted(); } catch (InterruptedException e) { log.warn("Netty server start interrupted"); Thread.currentThread().interrupt(); notifyFailed(e); } }</code><technical_language>I BACKLOG KEEPALIVE useful for UDP..</technical_language>

Target:
protected void doStart() { try { if(datagram) { log.info("Starting Netty UDP server on port {}", port); Bootstrap boot = new Bootstrap(); boot.group(wrkr) .channel(NioDatagramChannel.class) .handler(adapter); sock = boot.bind(port).sync(); } else { log.info("Starting Netty TCP server on port {}", port); ServerBootstrap boot = new ServerBootstrap(); boot.group(boss, wrkr) .channel(NioServerSocketChannel.class) .childHandler(adapter) .option(ChannelOption.SO_BACKLOG, 128) .option(ChannelOption.SO_KEEPALIVE, true); sock = boot.bind(port).sync(); } log.info("Netty server started"); notifyStarted(); } catch (InterruptedException e) { log.warn("Netty server start interrupted"); Thread.currentThread().interrupt(); notifyFailed(e); } }
Source:
<code>private void openShareMenu() { ShareUtils.showShareMenu( ShareUtils.newShareIntent(courseData.getCertificateURL(), null), getActivity().findViewById(R.id.course_detail_share), new ShareUtils.ShareMenuItemListener() { @Override public void onMenuItemClick(@NonNull ComponentName componentName) { String shareText = ResourceUtil.getFormattedString( getResources(), R.string.share_course, "platform_name", getString(R.string.platform_name)).toString(); String shareLink = courseData.getCourse().getCourse_about(); String event_type = componentName.getPackageName().toString(); System.out.println("Share course event:" + event_type); <START> switch (event_type) { <END> case "com.facebook.katana": event_type = "facebook"; break; case "com.twitter.android": event_type = "twitter"; break; default: event_type = "other"; break; } segIO.courseDetailShared( courseData.getCourse().getId(), "social-sharing", shareLink, event_type); final Intent intent = ShareUtils.newShareIntent( shareText + "\n" + shareLink, null); intent.setComponent(componentName); startActivity(intent); } }); }</code><technical_language>@BenjiLee If pull changes master, pass ComponentName ISegment ISegmentImpl.getShareTypeFromComponentName(componentName)</technical_language>

Target:
private void openShareMenu() { final String shareText = ResourceUtil.getFormattedString( getResources(), R.string.share_course_message, "platform_name", getString(R.string.platform_name)).toString() + "\n" + courseData.getCourse().getCourse_about(); ShareUtils.showShareMenu( ShareUtils.newShareIntent(shareText), getActivity().findViewById(R.id.course_detail_share), new ShareUtils.ShareMenuItemListener() { @Override public void onMenuItemClick(@NonNull ComponentName componentName) { segIO.courseDetailShared(courseData.getCourse().getId(), shareText, componentName); final Intent intent = ShareUtils.newShareIntent(shareText); intent.setComponent(componentName); startActivity(intent); } }, R.string.share_course_popup_header); }
Source:
<code>public void stop() throws ConnectException { log.info("Stopping table monitoring thread"); tableMonitorThread.shutdown(); try { tableMonitorThread.join(MAX_TIMEOUT); } catch (InterruptedException e) { } finally { try { cachedConnectionProvider.close(); } finally { try { if (dialect != null) { dialect.close(); } } finally { <START> dialect = null; <END> } } } }</code><technical_language>required. collected connector object</technical_language>

Target:
public void stop() throws ConnectException { log.info("Stopping table monitoring thread"); tableMonitorThread.shutdown(); try { tableMonitorThread.join(MAX_TIMEOUT); } catch (InterruptedException e) { } finally { try { cachedConnectionProvider.close(); } finally { try { if (dialect != null) { dialect.close(); } } catch (Throwable t) { log.warn("Error while closing the dialect: ", dialect, t); } finally { dialect = null; } } } }
Source:
<code>protected void createColumns() { createColumn(Messages.LatencyTableViewer_startTime, new LatencyTableColumnLabelProvider() { @Override public String getTextForITimeRange(ISegment input) { return NonNullUtils.nullToEmptyString(TmfTimestampFormat.getDefaulTimeFormat().format(input.getStart())); } <START> }, new StartTimeColumnComparator()); <END> createColumn(Messages.LatencyTableViewer_endTime, new LatencyTableColumnLabelProvider() { @Override public String getTextForITimeRange(ISegment input) { return NonNullUtils.nullToEmptyString(TmfTimestampFormat.getDefaulTimeFormat().format(input.getEnd())); } }, new EndTimeColumComparator()); createColumn(Messages.LatencyTableViewer_duration, new LatencyTableColumnLabelProvider() { @Override public String getTextForITimeRange(ISegment input) { return NonNullUtils.nullToEmptyString(Long.toString(input.getLength())); } }, new DurationColumnComparator()); }</code><technical_language>comparators organized class in core plugin: SyscallComparators.START_TIME SyscallComparators.END_TIME etc</technical_language>

Target:
private void createColumns() { createColumn(Messages.LatencyTableViewer_startTime, new LatencyTableColumnLabelProvider() { @Override public String getTextForITimeRange(ISegment input) { return NonNullUtils.nullToEmptyString(TmfTimestampFormat.getDefaulTimeFormat().format(input.getStart())); } }, TreeMapStore.INTERVAL_START_COMPARATOR); createColumn(Messages.LatencyTableViewer_endTime, new LatencyTableColumnLabelProvider() { @Override public String getTextForITimeRange(ISegment input) { return NonNullUtils.nullToEmptyString(TmfTimestampFormat.getDefaulTimeFormat().format(input.getEnd())); } }, TreeMapStore.INTERVAL_END_COMPARATOR); createColumn(Messages.LatencyTableViewer_duration, new LatencyTableColumnLabelProvider() { @Override public String getTextForITimeRange(ISegment input) { return NonNullUtils.nullToEmptyString(Long.toString(input.getLength())); } }, TreeMapStore.INTERVAL_LENGTH_COMPARATOR); }
Source:
<code>public static void buildMiniDFS() throws Exception { File baseDir = folder.newFolder(); Configuration conf = new Configuration(); conf.set(MiniDFSCluster.HDFS_MINIDFS_BASEDIR, baseDir.getAbsolutePath()); <START> MiniDFSCluster.Builder builder = new MiniDFSCluster.Builder(conf); <END> dfsCluster = builder.build(); dfsCluster.waitActive(); fileSystem = FileSystem.newInstance(conf); }</code><technical_language>chain right? dfsCluster = new MiniDFSCluster.Builder(conf);</technical_language>

Target:
public static void buildMiniDFS() throws Exception { File baseDir = TEMP_FOLDER.newFolder(); Configuration conf = new Configuration(); conf.set(MiniDFSCluster.HDFS_MINIDFS_BASEDIR, baseDir.getAbsolutePath()); dfsCluster = new MiniDFSCluster.Builder(conf).build(); dfsCluster.waitActive(); fileSystem = FileSystem.newInstance(conf); sshServer = setupSSHDaemon(); sshServer.start(); }
Source:
<code>public long getLastInputActivityTime() throws IOException { <START> RTPConnectorInputStream in = getRTPConnector().getDataInputStream(false); <END> if (in != null) return in.getLastActivityTime(); else return -1; }</code><technical_language>This takes RTP account, right? Is this intentional</technical_language>

Target:
public long getLastInputActivityTime() throws IOException { RTPConnectorInputStream inData = getRTPConnector().getDataInputStream(false); long inDataActivity = -1; if (inData != null) { inDataActivity = inData.getLastActivityTime(); } RTPConnectorInputStream inControl = getRTPConnector().getControlInputStream(false); long inControlActivity = -1; if (inControl != null) { inControlActivity = inControl.getLastActivityTime(); } return Math.max(inControlActivity, inDataActivity); }
Source:
<code>public void testGenotypesSearchByNameKIT() throws InvalidProtocolBufferException, UnirestException, GAWrapperException { <START> final String phenotypeAssociationSetId = Utils.getPhenotypeAssociationSetId(client); <END> SearchFeaturesRequest request = SearchFeaturesRequest .newBuilder() .setFeatureSetId(Utils.getFeatureG2PSetId(client)) .setName(TestData.FEATURE_NAME) .build(); SequenceAnnotationServiceOuterClass.SearchFeaturesResponse response = client.sequenceAnnotations.searchFeatures(request); assertThat(response.getFeaturesList()).isNotNull() ; assertThat(response.getFeaturesList()).isNotEmpty() ; assertThat(response.getFeaturesList().size()).isEqualTo(3) ; }</code><technical_language>This appears unused</technical_language>

Target:
public void testGenotypesSearchByNameKIT() throws InvalidProtocolBufferException, UnirestException, GAWrapperException { SearchFeaturesRequest request = SearchFeaturesRequest .newBuilder() .setFeatureSetId(Utils.getFeatureG2PSetId(client)) .setName(TestData.FEATURE_NAME) .build(); SequenceAnnotationServiceOuterClass.SearchFeaturesResponse response = client.sequenceAnnotations.searchFeatures(request); assertThat(response.getFeaturesList()).isNotNull() ; assertThat(response.getFeaturesList()).isNotEmpty() ; assertThat(response.getFeaturesList().size()).isEqualTo(3) ; }
Source:
<code>protected void doExecute() { DiagramDescription diagramdesc = DescriptionFactory.eINSTANCE.createDiagramDescription(); diagramdesc.setName(BASE_ID + ".default.layer"); viewpoint.getOwnedRepresentations().add(diagramdesc); Layer layer = DescriptionFactory.eINSTANCE.createLayer(); diagramdesc.setDefaultLayer(layer); ToolSection toolSection = createToolSection(layer); <START> ContainerMapping packageMapping = packageCreation(layer, toolSection); <END> ContainerMapping classMapping = classCreation(layer, toolSection); createAttribute(classMapping, toolSection); EdgeMapping edgeMappingInheritance = createEdgeMappingInheritance(layer, toolSection, classMapping); EdgeMapping edgeMappingReference = createEdgeMappingReference(layer, toolSection, classMapping); createDeleteTool(toolSection, classMapping, packageMapping, edgeMappingInheritance, edgeMappingReference); createEditTool(toolSection, classMapping, packageMapping, edgeMappingInheritance, edgeMappingReference); }</code><technical_language>createPackageMapping a name</technical_language>

Target:
protected void doExecute() { DiagramDescription diagramdesc = DescriptionFactory.eINSTANCE.createDiagramDescription(); diagramdesc.setName(BASE_ID + ".default.layer"); viewpoint.getOwnedRepresentations().add(diagramdesc); Layer layer = DescriptionFactory.eINSTANCE.createLayer(); diagramdesc.setDefaultLayer(layer); ToolSection toolSection = createToolSection(layer); ContainerMapping packageMapping = createPackageMapping(layer, toolSection); ContainerMapping classMapping = createClassMapping(layer, toolSection); NodeMapping attribute = createAttribute(classMapping, toolSection); EdgeMapping edgeMappingInheritance = createEdgeMappingInheritance(layer, toolSection, classMapping); EdgeMapping edgeMappingReference = createEdgeMappingReference(layer, toolSection, classMapping); createDeleteTool(toolSection, classMapping, packageMapping, attribute, edgeMappingInheritance, edgeMappingReference); createEditTool(toolSection, classMapping, packageMapping, attribute, edgeMappingInheritance, edgeMappingReference); }
Source:
<code>public void setToolTipText(String string) { super.setToolTipText(string); for (Sash <START> sashe : <END> sashes) { sashe.setToolTipText(string); } }</code><technical_language>rename sash</technical_language>

Target:
public void setToolTipText(String string) { super.setToolTipText(string); for (Sash sash : sashes) { sash.setToolTipText(string); } }
Source:
<code>SubscribableQuerySubscription(Type responseType, Type updateType, SubscriptionQueryMessageHandler<? super QueryMessage<?, I>, I, U> queryHandler) { super(responseType, m -> { <START> QueryUpdateEmitter<U> emitter = new QueryUpdateEmitter<U>() { <END> @Override public void emit(U update) { } @Override public void complete() { } @Override public void error(Throwable error) { } }; return queryHandler.handle(m, emitter); }); this.updateType = updateType; this.subscriptionQueryMessageHandler = queryHandler; }</code><technical_language>Suggestion: introduce a NoOpQueryUpdateEmitter for this purpose</technical_language>

Target:
SubscribableQuerySubscription(Type responseType, Type updateType, SubscriptionQueryMessageHandler<? super QueryMessage<?, I>, I, U> queryHandler) { super(responseType, m -> queryHandler.handle(m, new NoOpQueryUpdateEmitter<>())); this.updateType = updateType; this.subscriptionQueryMessageHandler = queryHandler; }
Source:
<code>public Response update(MultipartBody multipartBody, @Context UriInfo requestUriInfo) { LOGGER.trace("ENTERING: update"); Response response; List<Attachment> attachmentList = multipartBody.getAllAttachments(); File newFile = null; for (Attachment attachment : attachmentList) { newFile = createFileFromAttachement(attachment); } try { if (newFile == null) { throw new ApplicationServiceException("No file attachment provided."); } ZipFileApplicationDetails appDetails = ApplicationFileInstaller.getAppDetails(newFile); if (appDetails == null) { throw new ApplicationServiceException( "No Application details could be extracted from the provided file."); } Application existingApplication = appService.getApplication(appDetails.getName()); boolean wasExistingAppStarted = false; if (existingApplication != null) { wasExistingAppStarted = appService.isApplicationStarted(existingApplication); appService.removeApplication(existingApplication); } appService.addApplication(newFile.toURI()); if (wasExistingAppStarted) { appService.startApplication(appDetails.getName()); } Response.ResponseBuilder responseBuilder = Response.ok("{\"status\":\"success\"}").type("application/json"); response = responseBuilder.build(); } catch (ApplicationServiceException e) { LOGGER.warn("Unable to update an application on the server: {}", newFile, e); Response.ResponseBuilder responseBuilder = Response.serverError(); <START> response = responseBuilder.build(); <END> } return response; }</code><technical_language>Thank you, I hate traces. confusing hell trace exit paths. Based below, remove entry traces beginning of this method</technical_language>

Target:
public Response update(MultipartBody multipartBody, @Context UriInfo requestUriInfo) { List<Attachment> attachmentList = multipartBody.getAllAttachments(); File newFile = null; for (Attachment attachment : attachmentList) { newFile = createFileFromAttachement(attachment); } try { if (newFile == null) { throw new ApplicationServiceException("No file attachment provided."); } ZipFileApplicationDetails appDetails = ApplicationFileInstaller.getAppDetails(newFile); if (appDetails == null) { throw new ApplicationServiceException( "No Application details could be extracted from the provided file."); } Application existingApplication = appService.getApplication(appDetails.getName()); boolean wasExistingAppStarted = false; if (existingApplication != null) { wasExistingAppStarted = appService.isApplicationStarted(existingApplication); appService.removeApplication(existingApplication); } appService.addApplication(newFile.toURI()); if (wasExistingAppStarted) { appService.startApplication(appDetails.getName()); } Response.ResponseBuilder responseBuilder = Response.ok("{\"status\":\"success\"}").type("application/json"); return responseBuilder.build(); } catch (ApplicationServiceException e) { LOGGER.warn("Unable to update an application on the server: {}", newFile, e); Response.ResponseBuilder responseBuilder = Response.serverError(); return responseBuilder.build(); } }
Source:
<code>public List<NamedArrayList<? extends SCMTraitDescriptor<?>>> getTraitsDescriptorLists() { List<SCMTraitDescriptor<?>> all = new ArrayList<>(); all.addAll(SCMSourceTrait._for(this, GitHubSCMSourceContext.class, null)); all.addAll(SCMSourceTrait._for(this, null, GitHubSCMBuilder.class)); Set<SCMTraitDescriptor<?>> dedup = new HashSet<>(); for (Iterator<SCMTraitDescriptor<?>> iterator = all.iterator(); iterator.hasNext(); ) { SCMTraitDescriptor<?> d = iterator.next(); if (dedup.contains(d) || d instanceof GitBrowserSCMSourceTrait.DescriptorImpl) { iterator.remove(); } else { dedup.add(d); } } List<NamedArrayList<? extends SCMTraitDescriptor<?>>> result = new ArrayList<>(); <START> NamedArrayList.select(all, Messages.within_repository(), NamedArrayList <END> .anyOf(NamedArrayList.withAnnotation(Discovery.class), NamedArrayList.withAnnotation(Selection.class)), true, result); NamedArrayList.select(all, Messages.general(), null, true, result); return result; }</code><technical_language>suggestion NamedArrayList.select(all, Messages.GitHubSCMNavigator_withinRepository(), NamedArrayList</technical_language>

Target:
public List<NamedArrayList<? extends SCMTraitDescriptor<?>>> getTraitsDescriptorLists() { List<SCMTraitDescriptor<?>> all = new ArrayList<>(); all.addAll(SCMSourceTrait._for(this, GitHubSCMSourceContext.class, null)); all.addAll(SCMSourceTrait._for(this, null, GitHubSCMBuilder.class)); Set<SCMTraitDescriptor<?>> dedup = new HashSet<>(); for (Iterator<SCMTraitDescriptor<?>> iterator = all.iterator(); iterator.hasNext(); ) { SCMTraitDescriptor<?> d = iterator.next(); if (dedup.contains(d) || d instanceof GitBrowserSCMSourceTrait.DescriptorImpl) { iterator.remove(); } else { dedup.add(d); } } List<NamedArrayList<? extends SCMTraitDescriptor<?>>> result = new ArrayList<>(); NamedArrayList.select(all, Messages.GitHubSCMNavigator_withinRepository(), NamedArrayList .anyOf(NamedArrayList.withAnnotation(Discovery.class), NamedArrayList.withAnnotation(Selection.class)), true, result); NamedArrayList.select(all, Messages.GitHubSCMNavigator_general(), null, true, result); return result; }
Source:
<code>private static void reportAppUpdate() { try { String username = CommCareApplication.instance().getRecordForCurrentUser().getUsername(); String updateLogMessage = "User " + username + " updated to app version " + ReportingUtils.getAppBuildNumber(); <START> Logger.log(AndroidLogger.TYPE_USER, updateLogMessage); <END> } catch (SessionUnavailableException e) { } }</code><technical_language>Traditionally "TYPE_RESOURCES" for logs related app installs/updates/etc</technical_language>

Target:
private static void reportAppUpdate() { String updateLogMessage = "Update to app version " + ReportingUtils.getAppBuildNumber(); try { String username = CommCareApplication.instance().getRecordForCurrentUser().getUsername(); updateLogMessage += " by user " + username; } catch (SessionUnavailableException e) { } Logger.log(AndroidLogger.TYPE_RESOURCES, updateLogMessage); }
Source:
<code>private static boolean isApiKey(String value) { <START> if (Strings.isNullOrEmpty(value)) { <END> return false; } try { UUID.fromString(value); } catch (IllegalArgumentException e) { return false; } return true; }</code><technical_language>static import</technical_language>

Target:
private static boolean isApiKey(String value) { if (isNullOrEmpty(value)) { return false; } try { UUID.fromString(value); } catch (IllegalArgumentException e) { return false; } return true; }
Source:
<code>@Override protected void onFinishInflate() { super.onFinishInflate(); ButterKnife.inject(this); File filesDir = getContext().getExternalFilesDir(null); final File file = new File(filesDir, "shakespeare.txt"); FileOutputStream out = null; try { out = new FileOutputStream(file); out.write(SHAKESPEARE.getBytes()); } catch (java.io.IOException e) { throw new RuntimeException(e); } finally { if (out != null) { try { out.close(); } catch (IOException ignored) { } } } telescopeView.setLens( new EmailLens(getContext(), new String[] { "bugs@blackhole.io" }, "Bug report") { @Override protected Set<Uri> getAdditionalAttachments() { HashSet<Uri> attachments = new HashSet<>(); attachments.add(Uri.fromFile(file)); <START> return attachments; <END> } } ); }</code><technical_language>Collections.singleton(Uri.fromFile(file))</technical_language>

Target:
@Override protected void onFinishInflate() { super.onFinishInflate(); ButterKnife.inject(this); File filesDir = getContext().getExternalFilesDir(null); final File file = new File(filesDir, "shakespeare.txt"); FileOutputStream out = null; try { out = new FileOutputStream(file); out.write(SHAKESPEARE.getBytes()); } catch (java.io.IOException e) { throw new RuntimeException(e); } finally { if (out != null) { try { out.close(); } catch (IOException ignored) { } } } telescopeView.setLens( new EmailLens(getContext(), new String[] { "bugs@blackhole.io" }, "Bug report") { @Override protected Set<Uri> getAdditionalAttachments() { return Collections.singleton(Uri.fromFile(file)); } } ); }
Source:
<code>protected void setBlobStorageService(BlobStorageService blobStorageService) { if (blobStorageService == null) { throw new IllegalArgumentException("BlobStorageService cannot be null"); <START> } else { <END> this.blobStorageService = blobStorageService; logger.trace("BlobStorage service set to {}", blobStorageService.getClass()); } }</code><technical_language>"else" unnecessary</technical_language>

Target:
protected void setBlobStorageService(BlobStorageService blobStorageService) { if (blobStorageService == null) { throw new IllegalArgumentException("BlobStorageService cannot be null"); } this.blobStorageService = blobStorageService; logger.trace("BlobStorage service set to {}", blobStorageService.getClass()); }
Source:
<code>ServiceBusReceiverAsyncClient buildAsyncClient(boolean isAutoCompleteAllowed) { final MessagingEntityType entityType = validateEntityPaths(logger, connectionStringEntityName, topicName, queueName); final String entityPath = getEntityPath(logger, entityType, queueName, topicName, subscriptionName, subQueue); <START> validateAndThrow(prefetchCount); <END> if (!isAutoCompleteAllowed && enableAutoComplete) { throw new IllegalStateException("'enableAutoComplete' is not support in synchronous client."); } final ServiceBusConnectionProcessor connectionProcessor = getOrCreateConnectionProcessor(messageSerializer); final ReceiverOptions receiverOptions = new ReceiverOptions(receiveMode, prefetchCount, enableAutoComplete); return new ServiceBusReceiverAsyncClient(connectionProcessor.getFullyQualifiedNamespace(), entityPath, entityType, receiverOptions, connectionProcessor, ServiceBusConstants.OPERATION_TIMEOUT, tracerProvider, messageSerializer, ServiceBusClientBuilder.this::onClientClose); }</code><technical_language>This validateAndThrow(prefetch) , in other PR validating earlier user is setting prefetch . Should't this there</technical_language>

Target:
ServiceBusReceiverAsyncClient buildAsyncClient(boolean isAutoCompleteAllowed) { final MessagingEntityType entityType = validateEntityPaths(logger, connectionStringEntityName, topicName, queueName); final String entityPath = getEntityPath(logger, entityType, queueName, topicName, subscriptionName, subQueue); if (!isAutoCompleteAllowed && enableAutoComplete) { logger.warning( "'enableAutoComplete' is not supported in synchronous client except through callback receive."); enableAutoComplete = false; } else if (enableAutoComplete && receiveMode == ReceiveMode.RECEIVE_AND_DELETE) { throw logger.logExceptionAsError(new IllegalStateException( "'enableAutoComplete' is not valid for RECEIVE_AND_DELETE mode.")); } if (receiveMode == ReceiveMode.RECEIVE_AND_DELETE) { maxAutoLockRenewDuration = Duration.ZERO; } final ServiceBusConnectionProcessor connectionProcessor = getOrCreateConnectionProcessor(messageSerializer); final ReceiverOptions receiverOptions = new ReceiverOptions(receiveMode, prefetchCount, maxAutoLockRenewDuration, enableAutoComplete); return new ServiceBusReceiverAsyncClient(connectionProcessor.getFullyQualifiedNamespace(), entityPath, entityType, receiverOptions, connectionProcessor, ServiceBusConstants.OPERATION_TIMEOUT, tracerProvider, messageSerializer, ServiceBusClientBuilder.this::onClientClose); }
Source:
<code><START> private static LinkedHashMap<Object, ArrayList<ITestNGMethod>> sortMethodsByInstance(ITestNGMethod[] methods) { <END> LinkedHashMap<Object, ArrayList<ITestNGMethod>> result = new LinkedHashMap<>(); for (ITestNGMethod method : methods) { Object methodClass = method.getInstance(); if (result.containsKey(methodClass)) { ArrayList<ITestNGMethod> methodList = result.get(methodClass); methodList.add(method); result.put(methodClass, methodList); } else { ArrayList<ITestNGMethod> methodList = new ArrayList<>(); methodList.add(method); result.put(methodClass, methodList); } } return result; }</code><technical_language>Map<Object, List<ITestNGMethod>> instead of LinkedHashMap<Object, ArrayList<ITestNGMethod>></technical_language>

Target:
private static Map<Object, List<ITestNGMethod>> sortMethodsByInstance(ITestNGMethod[] methods) { LinkedHashMap<Object, List<ITestNGMethod>> result = new LinkedHashMap<>(); for (ITestNGMethod method : methods) { Object methodInstance = method.getInstance(); List<ITestNGMethod> methodList = result.get(methodInstance); if (methodList == null) { methodList = new ArrayList<>(); } methodList.add(method); result.put(methodInstance, methodList); } return result; }
Source:
<code>public void processWithChildContextBlockingErrorInChainRegainsParentContext() throws Exception { try { processWithChildContextBlocking(input, createChain(error), Optional.empty()); fail("Exception expected"); } catch (Throwable t) { assertThat(t, is(instanceOf(MessagingException.class))); assertThat(t.getCause(), is(exception)); <START> assertThat(((MessagingException) t).getEvent().getContext(), is((instanceOf(DefaultEventContext.class)))); <END> } }</code><technical_language>Assert instance of parent instead o class</technical_language>

Target:
public void processWithChildContextBlockingErrorInChainRegainsParentContext() throws Exception { try { processWithChildContextBlocking(input, createChain(error), Optional.empty()); fail("Exception expected"); } catch (Throwable t) { assertThat(t, is(instanceOf(MessagingException.class))); assertThat(t.getCause(), is(exception)); assertThat(((MessagingException) t).getEvent().getContext(), sameInstance(input.getContext())); } }
Source:
<code>public MergingEquivalentsResolverBackedContainerSummaryResolver(MergingEquivalentsResolver<Content> contentResolver) { <START> this.contentResolver = contentResolver; <END> }</code><technical_language>checkit</technical_language>

Target:
public MergingEquivalentsResolverBackedContainerSummaryResolver(MergingEquivalentsResolver<Content> contentResolver) { this.contentResolver = checkNotNull(contentResolver); }
Source:
<code>protected void run() throws Exception { <START> if (list) { <END> list(); } else { throw new NotSupportedException( "only --list option is currently supported"); } }</code><technical_language>style nit: braces single line blocks</technical_language>

Target:
protected void run() throws Exception { if (list) list(); else throw new NotSupportedException( "only --list option is currently supported"); }
Source:
<code>public RemovrCompositeSpec(String rawKey, Map<String, Object> spec ) { super( rawKey ); ArrayList<RemovrSpec> all = new ArrayList<RemovrSpec>(); for ( String rawLhsStr : spec.keySet() ) { Object rawRhs = spec.get( rawLhsStr ); <START> String[] keyStrings = rawLhsStr.split( "\\|" ); <END> for ( String keyString : keyStrings ) { RemovrSpec childSpec; if( rawRhs instanceof Map ) { childSpec = new RemovrCompositeSpec(keyString, (Map<String, Object>) rawRhs ); } else { childSpec = new RemovrLeafSpec(keyString); } all.add(childSpec); } } allChildren = Collections.unmodifiableList( all ); }</code><technical_language>Do a test of a Remover spec or</technical_language>

Target:
public RemovrCompositeSpec(String rawKey, Map<String, Object> spec ) { super( rawKey ); ArrayList<RemovrSpec> all = new ArrayList<RemovrSpec>(); for ( String rawLhsStr : spec.keySet() ) { Object rawRhs = spec.get( rawLhsStr ); String[] keyStrings = rawLhsStr.split( "\\|" ); for ( String keyString : keyStrings ) { RemovrSpec childSpec; if( rawRhs instanceof Map ) { childSpec = new RemovrCompositeSpec(keyString, (Map<String, Object>) rawRhs ); } else if (rawRhs instanceof String && ((String)rawRhs).trim().length() == 0) { childSpec = new RemovrLeafSpec(keyString); } else{ throw new SpecException("Invalid Removr spec RHS. Should be a non-empty string or Map"); } all.add(childSpec); } } allChildren = Collections.unmodifiableList( all ); }
Source:
<code>public ResponseEntity<?> commitCursors(@PathVariable("subscriptionId") final String subscriptionId, @Valid @RequestBody final ItemsWrapper<SubscriptionCursor> cursors, final Errors errors, @NotNull @RequestHeader("X-Nakadi-StreamId") final String streamId, final NativeWebRequest request, final Client client) { <START> LOG.debug("[COMMIT_CURSORS] committing cursor(s) for subscription {}", cursors.getItems().size(), <END> subscriptionId); if (!featureToggleService.isFeatureEnabled(HIGH_LEVEL_API)) { return new ResponseEntity<>(NOT_IMPLEMENTED); } if (errors.hasErrors()) { return Responses.create(new ValidationProblem(errors), request); } try { validateSubscriptionReadScopes(client, subscriptionId); LOG.debug("[COMMIT_CURSORS] scopes validation finished"); final Map<SubscriptionCursor, Boolean> result = cursorsService.commitCursors(streamId, subscriptionId, cursors.getItems()); LOG.debug("[COMMIT_CURSORS] commit finished"); final List<CursorCommitResult> items = result.entrySet().stream() .map(entry -> new CursorCommitResult(entry.getKey(), entry.getValue())) .collect(Collectors.toList()); final boolean allCommited = result.values() .stream() .reduce(Boolean::logicalAnd) .orElseGet(() -> true); final ItemsWrapper<CursorCommitResult> body = new ItemsWrapper<>(items); return allCommited ? noContent().build() : ok(body); } catch (final NakadiException e) { return create(e.asProblem(), request); } catch (final InvalidCursorException e) { return create(Problem.valueOf(UNPROCESSABLE_ENTITY, e.getMessage()), request); } }</code><technical_language>add [COMMIT_CURSORS] a part of logger definition</technical_language>

Target:
public ResponseEntity<?> commitCursors(@PathVariable("subscriptionId") final String subscriptionId, @Valid @RequestBody final ItemsWrapper<SubscriptionCursor> cursors, final Errors errors, @NotNull @RequestHeader("X-Nakadi-StreamId") final String streamId, final NativeWebRequest request, final Client client) { LOG.debug("[COMMIT_CURSORS] committing cursor(s) for subscription {}", cursors.getItems().size(), subscriptionId); if (!featureToggleService.isFeatureEnabled(HIGH_LEVEL_API)) { return new ResponseEntity<>(NOT_IMPLEMENTED); } if (errors.hasErrors()) { return Responses.create(new ValidationProblem(errors), request); } try { validateSubscriptionReadScopes(client, subscriptionId); LOG.debug("[COMMIT_CURSORS] scopes validation finished"); final List<CursorCommitResult> items = cursorsService.commitCursors(streamId, subscriptionId, cursors.getItems()); LOG.debug("[COMMIT_CURSORS] commit finished"); final boolean allCommited = items.stream() .allMatch(cursor -> CursorCommitResult.COMMITTED.equals(cursor.getResult())); final ItemsWrapper<CursorCommitResult> body = new ItemsWrapper<>(items); return allCommited ? noContent().build() : ok(body); } catch (final NoSuchEventTypeException e) { return create(Problem.valueOf(UNPROCESSABLE_ENTITY, e.getMessage()), request); } catch (final NakadiException e) { return create(e.asProblem(), request); } catch (final InvalidCursorException e) { return create(Problem.valueOf(UNPROCESSABLE_ENTITY, e.getMessage()), request); } }
Source:
<code>public boolean isMatch(String relativeTarget, boolean isDirectory) { if (relativeTarget == null) { return false; } relativeTarget = <START> stripTrailing(relativeTarget, <END> FastIgnoreRule.PATH_SEPARATOR); if (relativeTarget.length() == 0) { return false; } boolean match = matcher.matches(relativeTarget, isDirectory); return match; }</code><technical_language>I decided strip trailing slashes here. caller care if is "dir" "dir/", get "native git" behavior. I decided do this in PathMatcher, is more generic this implications ignore rules, I overlook right now</technical_language>

Target:
public boolean isMatch(String relativeTarget, boolean isDirectory) { if (relativeTarget == null) return false; if (relativeTarget.length() == 0) return false; boolean match = matcher.matches(relativeTarget, isDirectory); return match; }
Source:
<code>void findFormTypes1099FromFormCodeMisc() { FormTypes1099 expectedType = FormTypes1099.MISC; FormTypes1099 actualType = FormTypes1099.findFormTypes1099FromFormCode(FormTypes1099.MISC.formCode); <START> assertEquals(expectedType.formDescription, actualType.formDescription); <END> }</code><technical_language>In this test method it, I suggest including assertion checks formCode field</technical_language>

Target:
void findFormTypes1099FromFormCodeMisc() { FormTypes1099 expectedType = FormTypes1099.MISC; FormTypes1099 actualType = FormTypes1099.findFormTypes1099FromFormCode(FormTypes1099.MISC.formCode); assertEquals(expectedType.formDescription, actualType.formDescription); assertEquals(expectedType.formCode, actualType.formCode); }
Source:
<code>private void updateDefinitionByCannedExpresssion(CannedGroupExpression cge) { Query query = entityManager.createNamedQuery(GroupDefinition.QUERY_FIND_BY_CANNED_EXPR_NAME); query.setParameter("cannedExpression", cge.getGroupDefinitionReferenceKey()); @SuppressWarnings("unchecked") List<GroupDefinition> result = query.getResultList(); if (cge.isCreateByDefault()) { if (result.isEmpty()) { log.info("Creating dynaGroup based on +cge.getPlugin()+ "+cge); GroupDefinition gd = new GroupDefinition(cge.getName()); updateGroupProperties(gd, cge); try { createGroupDefinition(subjectManager.getOverlord(), gd); } catch (Exception ex) { log.error(ex); } } else { log.info("Updating dynaGroup based on +cge.getPlugin()+ "+cge); GroupDefinition gd = result.get(0); updateGroupProperties(gd, cge); try { updateGroupDefinition(subjectManager.getOverlord(), gd); } catch (Exception ex) { log.error(ex); } } } else { if (!result.isEmpty()) { <START> log.info("Purging "+result.get(0)+" because CannedExpression was upgraded in plugin with createByDefault=false"); <END> try { removeGroupDefinition(subjectManager.getOverlord(), result.get(0).getId()); } catch (Exception ex) { log.error(ex); } } } }</code><technical_language>Do want that? Needs discussed demo</technical_language>

Target:
private void updateDefinitionByCannedExpresssion(CannedGroupExpression cge) { Query query = entityManager.createNamedQuery(GroupDefinition.QUERY_FIND_BY_CANNED_EXPR_NAME); query.setParameter("cannedExpression", cge.getGroupDefinitionReferenceKey()); @SuppressWarnings("unchecked") List<GroupDefinition> result = query.getResultList(); if (cge.isCreateByDefault()) { if (result.isEmpty()) { GroupDefinition sameName = getByName(cge.getName()); if (sameName != null) { log.info("Not creating DynaGroup based on +cge.getPlugin()+ "+cge+" DynaGroup with same name already exists"); return; } log.info("Creating dynaGroup based on +cge.getPlugin()+ "+cge); GroupDefinition gd = new GroupDefinition(cge.getName()); updateGroupProperties(gd, cge); try { createGroupDefinition(subjectManager.getOverlord(), gd); } catch (Exception ex) { log.error(ex); } } else { log.info("Updating dynaGroup based on +cge.getPlugin()+ "+cge); GroupDefinition gd = result.get(0); updateGroupProperties(gd, cge); try { updateGroupDefinition(subjectManager.getOverlord(), gd, false); } catch (Exception ex) { log.error(ex); } } } else { if (!result.isEmpty()) { log.info("Purging "+result.get(0)+" because CannedExpression was upgraded in plugin with createByDefault=false"); try { removeGroupDefinition(subjectManager.getOverlord(), result.get(0).getId()); } catch (Exception ex) { log.error(ex); } } } }
Source:
<code>public void getYamlsExposesSingleYamlField() { PodTemplate podTemplate = new PodTemplate(); assertThat(podTemplate.getYamls(), empty()); podTemplate.setYamls(null); assertThat(podTemplate.getYamls(), empty()); podTemplate.setYaml("yaml"); List<String> yamls = podTemplate.getYamls(); assertThat(yamls, hasSize(1)); <START> assertEquals("yaml", yamls.get(0)); <END> podTemplate.setYaml(null); assertThat(podTemplate.getYamls(), empty()); }</code><technical_language>assert equality singleton list, Matchers</technical_language>

Target:
public void getYamlsExposesSingleYamlField() { PodTemplate podTemplate = new PodTemplate(); assertThat(podTemplate.getYamls(), empty()); podTemplate.setYamls(null); assertThat(podTemplate.getYamls(), empty()); podTemplate.setYaml("yaml"); assertThat(podTemplate.getYamls(), contains("yaml")); podTemplate.setYaml(null); assertThat(podTemplate.getYamls(), empty()); }
Source:
<code><START> private void writeUserMapToDisk(String prefix, byte[] userMapBytes) throws Exception <END> { File cacheDir = new File(commonCacheConfig.getCacheDirectory()); cacheDir.mkdirs(); File userMapFile = new File(commonCacheConfig.getCacheDirectory(), getUserMapFilename(prefix)); Files.write(userMapBytes, userMapFile); }</code><technical_language>throws Exception reduced throws IOException</technical_language>

Target:
private void writeUserMapToDisk(String prefix, byte[] userMapBytes) throws IOException { File cacheDir = new File(commonCacheConfig.getCacheDirectory()); cacheDir.mkdirs(); File userMapFile = new File(commonCacheConfig.getCacheDirectory(), getUserMapFilename(prefix)); Files.write(userMapBytes, userMapFile); }
Source:
<code>public AnnotationValueReader(@Nonnull DexBuffer dex, @Nonnull ByteInput in) { <START> super(dex, in); this.dex = dex; <END> }</code><technical_language>"super" dex field protected remove this one? a protected getDexBuffer() method</technical_language>

Target:
public AnnotationValueReader(@Nonnull DexBuffer dex, @Nonnull ByteInput in) { super(dex, in); }
Source:
<code>public void deleteMailById(PerunSession sess, ApplicationForm form, Integer id) throws PerunException { if (form.getGroup() != null) { if (!AuthzResolver.isAuthorized(sess, Role.VOADMIN, form.getVo()) && !AuthzResolver.isAuthorized(sess, Role.GROUPADMIN, form.getGroup())) { throw new PrivilegeException(sess, "deleteMail"); } } else { if (!AuthzResolver.isAuthorized(sess, Role.VOADMIN, form.getVo())) { throw new PrivilegeException(sess, "deleteMail"); } } ApplicationMail mail = getMailById(sess, id); int result = jdbc.update("delete from application_mails where id=?", id); <START> if (result == 0) throw new ApplicationMailAlreadyRemovedException("Mail notification with id="+id+" doesn't exists!"); <END> if (result == 1) log.info("[MAIL MANAGER] Mail notification with id={} deleted", id); if (result > 1) throw new ConsistencyErrorException("There is more than one mail notification with id="+id); if (form.getGroup() != null) { perun.getAuditer().log(sess, new MailForGroupIdRemoved(mail, form.getGroup())); } else { perun.getAuditer().log(sess, new MailForVoIdRemoved(mail, form.getVo())); } }</code><technical_language>please specific exceptions in method definition instead of PerunException ? Thank you</technical_language>

Target:
public void deleteMailById(PerunSession sess, ApplicationForm form, Integer id) throws ApplicationMailAlreadyRemovedException, PrivilegeException, ApplicationMailNotExistsException { if (form.getGroup() != null) { if (!AuthzResolver.isAuthorized(sess, Role.VOADMIN, form.getVo()) && !AuthzResolver.isAuthorized(sess, Role.GROUPADMIN, form.getGroup())) { throw new PrivilegeException(sess, "deleteMail"); } } else { if (!AuthzResolver.isAuthorized(sess, Role.VOADMIN, form.getVo())) { throw new PrivilegeException(sess, "deleteMail"); } } ApplicationMail mail = getMailById(sess, id); int result = jdbc.update("delete from application_mails where id=?", id); if (result == 0) throw new ApplicationMailAlreadyRemovedException("Mail notification with id="+id+" doesn't exists!"); if (result == 1) log.info("[MAIL MANAGER] Mail notification with id={} deleted", id); if (result > 1) throw new ConsistencyErrorException("There is more than one mail notification with id="+id); if (form.getGroup() != null) { perun.getAuditer().log(sess, new MailForGroupIdRemoved(mail, form.getGroup())); } else { perun.getAuditer().log(sess, new MailForVoIdRemoved(mail, form.getVo())); } }
Source:
<code>public void testCheckoutPath() throws Exception { Git git = new Git(db); writeTrashFile("a", "Hello world a"); git.add().addFilepattern(".").call(); git.commit().setMessage("commit file a").call(); git.branchCreate().setName("branch_1").call(); writeTrashFile("b", "Hello world b"); git.add().addFilepattern("b").call(); git.commit().setMessage("commit file b").call(); File a = writeTrashFile("a", "New Hello world a"); git.add().addFilepattern(".").call(); git.commit().setMessage("modified a").call(); assertArrayEquals(new String[] { "" }, execute("git checkout HEAD~2 -- a")); <START> assertEquals("Hello world a", read(a)); <END> }</code><technical_language>check branch_1 file b exists/has right content. checkout completely path</technical_language>

Target:
public void testCheckoutPath() throws Exception { Git git = new Git(db); writeTrashFile("a", "Hello world a"); git.add().addFilepattern(".").call(); git.commit().setMessage("commit file a").call(); git.branchCreate().setName("branch_1").call(); git.checkout().setName("branch_1").call(); File b = writeTrashFile("b", "Hello world b"); git.add().addFilepattern("b").call(); git.commit().setMessage("commit file b").call(); File a = writeTrashFile("a", "New Hello world a"); git.add().addFilepattern(".").call(); git.commit().setMessage("modified a").call(); assertArrayEquals(new String[] { "" }, execute("git checkout HEAD~2 -- a")); assertEquals("Hello world a", read(a)); assertArrayEquals(new String[] { "* branch_1", " master", "" }, execute("git branch")); assertEquals("Hello world b", read(b)); }
Source:
<code><START> public Table<Locator, Long, String> getEnumHashValuesForLocators(final List<Locator> locators) { <END> Timer.Context ctx = Instrumentation.getReadTimerContext(CassandraModel.CF_METRICS_ENUM_NAME); Session session = DatastaxIO.getSession(); Table<Locator, Long, String> locatorEnumHashValues = HashBasedTable.create(); List<ResultSetFuture> resultsFuture = new ArrayList<ResultSetFuture>(); try { for (String locatorStr : Locators.toStringList(locators)) { resultsFuture.add(session.executeAsync(selectFromMetricsEnumStatement.bind(locatorStr))); } for (ResultSetFuture future : resultsFuture) { try { List<Row> results = future.get().all(); for (Row row : results) { String key = row.getString(AbstractMetricsIO.KEY); Locator locator = Locator.createLocatorFromDbKey(key); Long hash = row.getLong(AbstractMetricsIO.COLUMN1); String enumValue = row.getString(AbstractMetricsIO.VALUE); locatorEnumHashValues.put(locator, hash, enumValue); } } catch (InterruptedException ex) { Instrumentation.markReadError(); LOG.error("Interrupted error querying enum from " + CassandraModel.CF_METRICS_ENUM_NAME, ex); } catch (ExecutionException ex) { Instrumentation.markReadError(); LOG.error("Execution error querying enum from " + CassandraModel.CF_METRICS_ENUM_NAME, ex); } } } finally { ctx.stop(); } return locatorEnumHashValues; }</code><technical_language>Stick @Override this</technical_language>

Target:
public Table<Locator, Long, String> getEnumHashValuesForLocators(final List<Locator> locators) { Timer.Context ctx = Instrumentation.getReadTimerContext(CassandraModel.CF_METRICS_ENUM_NAME); Session session = DatastaxIO.getSession(); Table<Locator, Long, String> locatorEnumHashValues = HashBasedTable.create(); List<ResultSetFuture> resultsFuture = new ArrayList<ResultSetFuture>(); try { for (String locatorStr : LocatorsUtils.toStringList(locators)) { resultsFuture.add(session.executeAsync(selectFromMetricsEnumStatement.bind(locatorStr))); } for (ResultSetFuture future : resultsFuture) { try { List<Row> results = future.get().all(); for (Row row : results) { String key = row.getString(AbstractMetricsRW.KEY); Locator locator = Locator.createLocatorFromDbKey(key); Long hash = row.getLong(AbstractMetricsRW.COLUMN1); String enumValue = row.getString(AbstractMetricsRW.VALUE); locatorEnumHashValues.put(locator, hash, enumValue); } } catch (InterruptedException ex) { Instrumentation.markReadError(); LOG.error("Interrupted error querying enum from " + CassandraModel.CF_METRICS_ENUM_NAME, ex); } catch (ExecutionException ex) { Instrumentation.markReadError(); LOG.error("Execution error querying enum from " + CassandraModel.CF_METRICS_ENUM_NAME, ex); } } } finally { ctx.stop(); } return locatorEnumHashValues; }
Source:
<code><START> public static void setUpClass() throws Exception { <END> PopulateDB.recreateDB("prosub", "root", ""); PopulateDB.populateUseCaseTest(); }</code><technical_language>![Codacy](<LINK_0> Issue found: [A method/constructor shouldnt explicitly throw java.lang.Exception](<LINK_1></technical_language>

Target:
public static void setUpClass() throws Exception { PopulateDB.recreateDB("pro_subPU", "root", ""); PopulateDB.populateUseCaseTest(); }
Source:
<code>public void deleteCollectionDefaultBitstreamReadGroupUnAuthorizedTest() throws Exception { context.turnOffAuthorisationSystem(); String bitstreamGroupString = "BITSTREAM"; int defaultBitstreamRead = Constants.DEFAULT_BITSTREAM_READ; Group role = createDefaultReadGroup(bitstreamGroupString, defaultBitstreamRead); context.restoreAuthSystemState(); <START> getClient().perform(delete("/api/core/collections/" + collection.getID() + "/bitstreamReadGroup")) <END> .andExpect(status().isUnauthorized()); }</code><technical_language>double check group is</technical_language>

Target:
public void deleteCollectionDefaultBitstreamReadGroupUnAuthorizedTest() throws Exception { context.turnOffAuthorisationSystem(); String bitstreamGroupString = "BITSTREAM"; int defaultBitstreamRead = Constants.DEFAULT_BITSTREAM_READ; Group role = collectionService.createDefaultReadGroup(context, collection, bitstreamGroupString, defaultBitstreamRead); context.restoreAuthSystemState(); getClient().perform(delete("/api/core/collections/" + collection.getID() + "/bitstreamReadGroup")) .andExpect(status().isUnauthorized()); String token = getAuthToken(admin.getEmail(), password); getClient(token).perform(get("/api/core/collections/" + collection.getID() + "/bitstreamReadGroup")) .andExpect(status().isOk()) .andExpect( jsonPath("$", GroupMatcher.matchGroupEntry(role.getID(), role.getName()))); }
Source:
<code>protected long getCurrentMillis() { checkEmptyText(); int day = Integer.parseInt(dayTxt.getText().toString()); <START> int month = monthArrayPointer + 1; <END> int year = Integer.parseInt(yearTxt.getText().toString()); if(day > selectedDate.getActualMaximum(Calendar.DAY_OF_MONTH)){ dayTxt.setText(String.valueOf(selectedDate.getActualMaximum(Calendar.DAY_OF_MONTH))); day = Integer.parseInt(dayTxt.getText().toString()); } return toMillisFromJavaEpoch(year, month, day, millisOfDayOffset); }</code><technical_language>Wrap this function in a method</technical_language>

Target:
protected long getCurrentMillis() { autoFillEmptyTextFields(); validateTextOnButtonPress(); int day = Integer.parseInt(dayText.getText().toString()); int month = monthArrayPointer + 1; int year = Integer.parseInt(yearText.getText().toString()); return toMillisFromJavaEpoch(year, month, day, millisOfDayOffset); }
Source:
<code>public String getRawContent(D diagram) { try { <START> return serizalize(diagram)[0]; <END> } catch (java.io.IOException e) { LOG.error("Error while getting raw content for diagram with UUID [" + diagram.getName() + "].", e); throw new RuntimeException(e); } }</code><technical_language>typo in serizalize</technical_language>

Target:
public String getRawContent(D diagram) { try { return serialize(diagram)[0]; } catch (java.io.IOException e) { LOG.error("Error while getting raw content for diagram with UUID [" + diagram.getName() + "].", e); throw new RuntimeException(e); } }