auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private org.openmrs.module.emrapi.conditionslist.Condition convertCoreConditionToEmrapiCondition(org.openmrs.Condition coreCondition) { org.openmrs.module.emrapi.conditionslist.Condition cListCondition = new org.openmrs.module.emrapi.conditionslist.Condition(); Concept concept = Context.getConceptService().getConceptByUuid(coreCondition.getCondition().getCoded().getUuid()); if(coreCondition.getCondition().getSpecificName() == null) { coreCondition.getCondition().setSpecificName(coreCondition.getCondition().getCoded().getName(Context.getLocale())); } cListCondition.setUuid(coreCondition.getUuid()); cListCondition.setConcept(concept); cListCondition.setAdditionalDetail(coreCondition.getAdditionalDetail()); cListCondition.setPatient(coreCondition.getPatient()); cListCondition.setConditionNonCoded(coreCondition.getCondition().getNonCoded()); cListCondition.setOnsetDate(coreCondition.getOnsetDate()); cListCondition.setVoided(coreCondition.getVoided()); cListCondition.setVoidReason(coreCondition.getVoidReason()); cListCondition.setEndDate(coreCondition.getEndDate()); cListCondition.setCreator(coreCondition.getCreator()); cListCondition.setDateCreated(coreCondition.getDateCreated()); cListCondition.setStatus(convertClinicalStatus(coreCondition.getClinicalStatus())); <START> if (coreCondition.getPreviousVersion() != null) { <END> cListCondition.setPreviousCondition(convertCoreConditionToEmrapiCondition(coreCondition.getPreviousVersion())); } return cListCondition; }</code><technical_language>if condition coded</technical_language>

Target:
private org.openmrs.module.emrapi.conditionslist.Condition convertCoreConditionToEmrapiCondition(org.openmrs.Condition coreCondition) { org.openmrs.module.emrapi.conditionslist.Condition cListCondition = new org.openmrs.module.emrapi.conditionslist.Condition(); Concept concept; if (coreCondition.getCondition().getCoded() != null) { concept = Context.getConceptService() .getConceptByUuid(coreCondition.getCondition().getCoded().getUuid()); if(coreCondition.getCondition().getSpecificName() == null) { coreCondition.getCondition().setSpecificName(coreCondition.getCondition().getCoded().getName(Context.getLocale())); } } else { concept = new Concept(); } cListCondition.setUuid(coreCondition.getUuid()); cListCondition.setConcept(concept); cListCondition.setAdditionalDetail(coreCondition.getAdditionalDetail()); cListCondition.setPatient(coreCondition.getPatient()); cListCondition.setConditionNonCoded(coreCondition.getCondition().getNonCoded()); cListCondition.setOnsetDate(coreCondition.getOnsetDate()); cListCondition.setVoided(coreCondition.getVoided()); cListCondition.setVoidReason(coreCondition.getVoidReason()); cListCondition.setEndDate(coreCondition.getEndDate()); cListCondition.setCreator(coreCondition.getCreator()); cListCondition.setDateCreated(coreCondition.getDateCreated()); cListCondition.setStatus(convertClinicalStatus(coreCondition.getClinicalStatus())); if (coreCondition.getPreviousVersion() != null) { cListCondition.setPreviousCondition(convertCoreConditionToEmrapiCondition(coreCondition.getPreviousVersion())); } return cListCondition; }
Source:
<code>private void drawSelectedFilesSegments(Canvas canvas, RotatedTileBox tileBox, List<SelectedGpxFile> selectedGPXFiles, DrawSettings settings) { SelectedGpxFile currentTrack = null; for (SelectedGpxFile g : selectedGPXFiles) { if (g.isShowCurrentTrack()) { currentTrack = g; } else { <START> List<TrkSegment> segments = g.getPointsToDisplay(); <END> for (TrkSegment ts : segments) { GpxDataItem gpxDataItem = view.getApplication().getGpxDatabase().getItem(new File(g.getGpxFile().path)); int color = gpxDataItem != null ? gpxDataItem.getColor() : 0; if (color == 0) { color = ts.getColor(cachedColor); } if (ts.renders.isEmpty() && !ts.points.isEmpty()) { ts.renders.add(new Renderable.StandardTrack(ts.points, 17.2)); } updatePaints(color, g.isRoutePoints(), false, settings, tileBox); ts.drawRenderers(view.getZoom(), paint, canvas, tileBox); } } } if (currentTrack != null) { List<TrkSegment> segments = currentTrack.getPointsToDisplay(); for (TrkSegment ts : segments) { int color = currentTrackColor; if (color == 0) { color = ts.getColor(cachedColor); } if (ts.renders.isEmpty() && !ts.points.isEmpty()) { ts.renders.add(new Renderable.CurrentTrack(ts.points)); } updatePaints(color, currentTrack.isRoutePoints(), true, settings, tileBox); ts.drawRenderers(view.getZoom(), paint, canvas, tileBox); } } }</code><technical_language>Copy/ paste code? Whats' reason...</technical_language>

Target:
private void drawSelectedFilesSegments(Canvas canvas, RotatedTileBox tileBox, List<SelectedGpxFile> selectedGPXFiles, DrawSettings settings) { SelectedGpxFile currentTrack = null; for (SelectedGpxFile g : selectedGPXFiles) { if (g.isShowCurrentTrack()) { currentTrack = g; } else { drawSelectedFileSegments(g, false, canvas, tileBox, settings); } } if (currentTrack != null) { drawSelectedFileSegments(currentTrack, true, canvas, tileBox, settings); } }
Source:
<code>public Session performOpenSession(URI representationsFileURI, IProgressMonitor monitor) { Session session = null; try { monitor.beginTask(Messages.OpenRepresentationsFileJob_loadRepresentationsTask, 16); if (SiriusUtil.SESSION_RESOURCE_EXTENSION.equals(representationsFileURI.fileExtension())) { monitor.worked(1); session = trySessionOpening(representationsFileURI, monitor); monitor.worked(1); } } catch <START> (SiriusResourceVersionMismatchException e) <END> { UICallBack uiCallback = SiriusEditPlugin.getPlugin().getUiCallback(); if (uiCallback != null) { uiCallback.askSessionReopeningWithResourceVersionMismatch(e); try { MigrationUtil.ignoreVersionMismatch = true; session = trySessionOpening(representationsFileURI, monitor); monitor.worked(1); } catch (RuntimeException ex) { SiriusEditPlugin.getPlugin().log(ex); } finally { MigrationUtil.ignoreVersionMismatch = false; } } } catch (RuntimeException e) { SiriusEditPlugin.getPlugin().log(e); } finally { monitor.done(); } return session; }</code><technical_language>SiriusRepairProcess ExportRepresentationFromFileAction modified</technical_language>

Target:
public Session performOpenSession(URI representationsFileURI, IProgressMonitor monitor) { Session session = null; try { monitor.beginTask(Messages.OpenRepresentationsFileJob_loadRepresentationsTask, 16); if (SiriusUtil.SESSION_RESOURCE_EXTENSION.equals(representationsFileURI.fileExtension())) { monitor.worked(1); session = trySessionOpening(representationsFileURI, monitor); monitor.worked(1); } } catch (SiriusResourceVersionMismatchException e) { UICallBack uiCallback = SiriusEditPlugin.getPlugin().getUiCallback(); if (uiCallback != null && uiCallback.askSessionReopeningWithResourceVersionMismatch(e)) { try { MigrationUtil.ignoreVersionMismatch = true; session = trySessionOpening(representationsFileURI, monitor); monitor.worked(1); } catch (RuntimeException ex) { SiriusEditPlugin.getPlugin().log(ex); } finally { MigrationUtil.ignoreVersionMismatch = false; } } } catch (RuntimeException e) { SiriusEditPlugin.getPlugin().log(e); } finally { monitor.done(); } return session; }
Source:
<code>public static String repeat(String s, int count) { if (count < 0) { throw new IllegalArgumentException("count is negative, " + count); } if (count == 1) { return s; } byte[] value = s.getBytes(StandardCharsets.UTF_8); final int len = value.length; if (len == 0 || count == 0) { return ""; } if (len == 1) { final byte[] single = new byte[count]; Arrays.fill(single, value[0]); return new String(single, StandardCharsets.UTF_8); } if (Integer.MAX_VALUE / count < len) { <START> throw new OutOfMemoryError(); <END> } final int limit = len * count; final byte[] multiple = new byte[limit]; System.arraycopy(value, 0, multiple, 0, len); int copied = len; for (; copied < limit - copied; copied <<= 1) { System.arraycopy(multiple, 0, multiple, copied, copied); } System.arraycopy(multiple, 0, multiple, copied, limit - copied); return new String(multiple, StandardCharsets.UTF_8); }</code><technical_language>I "there is a strong convention errors reserved for JVM resource deficiencies, invariant failures, other conditions impossible continue execution."</technical_language>

Target:
public static String repeat(String s, int count) { if (count < 0) { throw new IllegalArgumentException("count is negative, " + count); } if (count == 1) { return s; } byte[] value = s.getBytes(StandardCharsets.UTF_8); final int len = value.length; if (len == 0 || count == 0) { return ""; } if (len == 1) { final byte[] single = new byte[count]; Arrays.fill(single, value[0]); return new String(single, StandardCharsets.UTF_8); } if (Integer.MAX_VALUE / count < len) { throw new RuntimeException("The produced string is too large."); } final int limit = len * count; final byte[] multiple = new byte[limit]; System.arraycopy(value, 0, multiple, 0, len); int copied = len; for (; copied < limit - copied; copied <<= 1) { System.arraycopy(multiple, 0, multiple, copied, copied); } System.arraycopy(multiple, 0, multiple, copied, limit - copied); return new String(multiple, StandardCharsets.UTF_8); }
Source:
<code>private String buildUrl(String componentId) { <START> return String.join("/", GWT.getHostPageBaseURL(), COMPONENT_SERVER_PATH, componentId, "index.html"); <END> }</code><technical_language>suggestion return buildUrl(componentId, "");</technical_language>

Target:
private String buildUrl(String componentId) { return buildUrl(componentId, ""); }
Source:
<code>@Test public void testTwoClasses() throws IllegalArgumentException, CancelException, IOException { runTest(singleTestSrc(), rtJar, simpleTestEntryPoint(), Arrays.asList( <START> (IRAssertion) cg -> { <END> final String typeStr = singleInputForTest(); final TypeReference type = findOrCreateTypeReference("Source", typeStr, cg.getClassHierarchy()); final IClass iClass = cg.getClassHierarchy().lookupClass(type); Assert.assertNotNull("Could not find class " + typeStr, iClass); }), true); }</code><technical_language>@liblit do need (IRAssertion) cast here</technical_language>

Target:
@Test public void testTwoClasses() throws IllegalArgumentException, CancelException, IOException { runTest(singleTestSrc(), rtJar, simpleTestEntryPoint(), Arrays.asList( cg -> { final String typeStr = singleInputForTest(); final TypeReference type = findOrCreateTypeReference("Source", typeStr, cg.getClassHierarchy()); final IClass iClass = cg.getClassHierarchy().lookupClass(type); Assert.assertNotNull("Could not find class " + typeStr, iClass); }), true); }
Source:
<code><START> protected void addLastModifiedInfo(Layout layout, String caption, String lastModified, String lastModifiedBy) { <END> if (lastModified == null) { return; } StringBuilder sb = new StringBuilder(); sb.append("<span style=\"font-size:x-small\">"); sb.append(HSPACE); if (StringUtils.isNotBlank(caption)) { sb.append(caption).append(": "); } sb.append("last modified ").append(lastModified).append(" by ").append(lastModifiedBy); sb.append("</span>"); Label label = new Label(sb.toString(), Label.CONTENT_XHTML); label.setStyleName("light"); label.addStyleName(STYLE_LABEL); layout.addComponent(label); }</code><technical_language>1. I prefer rid of in allmost cases is null for user matter is lastModified timestamp of extension project 2. lastModified/lastModifiedBy properties of EntityBase I suggest collapse methods one: protected void addLastModifiedInfo(Layout layout, EntityBase entity)</technical_language>

Target:
protected void addLastModifiedInfo(Layout layout, String caption, String lastModified, String lastModifiedBy) { if (lastModified == null) { return; } StringBuilder sb = new StringBuilder(); sb.append("<span style=\"font-size:x-small\">"); sb.append(HSPACE); if (StringUtils.isNotBlank(caption)) { sb.append(caption).append(": "); } sb.append("last modified ").append(lastModified).append(" by ").append(lastModifiedBy); sb.append("</span>"); Label label = asLabel(sb.toString()); label.setStyleName("light"); label.addStyleName(STYLE_LABEL); layout.addComponent(label); }
Source:
<code>public List<IEventDeclaration> getEventDeclarations() { <START> return ImmutableList.copyOf(fEvents); <END> }</code><technical_language>is receiver supposed a blank hole is? CtfTmfTrace receive holes, is this ok? I think, for now, this method is called once. Surely filtering nulls worse redoing immutable list for added event</technical_language>

Target:
public List<IEventDeclaration> getEventDeclarations() { ImmutableList.Builder<IEventDeclaration> builder = new ImmutableList.Builder<>(); for (IEventDeclaration ied : fEvents) { if (ied != UNASSIGNED) { builder.add(ied); } } return builder.build(); }
Source:
<code>private void setFollowing(boolean follow){ if (follow){ addFollow(); }else{ <START> removeFollow(); <END> } }</code><technical_language>Instead of add remove functions separately, code brought simplified like: java private void setFollowing(boolean follow) { threadFollowContainer.setSelected(follow); threadFollowTextView.setText(follow ? R.string.forum_follow : R.string.forum_unfollow); threadFollowIconImageView.setIconColorResource(follow ? R.color.edx_brand_primary_base : R.color.edx_brand_gray_base); }</technical_language>

Target:
private void setFollowing(boolean follow) { if (threadFollowContainer.isSelected() != follow) { threadFollowContainer.setSelected(follow); threadFollowTextView.setText(follow ? R.string.forum_unfollow : R.string.forum_follow); threadFollowIconImageView.setIconColorResource(follow ? R.color.edx_brand_primary_base : R.color.edx_brand_gray_base); } }
Source:
<code>public Set<String> prepareForDestroy() { <START> try { <END> PrepareForDestroy response = (PrepareForDestroy) invokeInternal(messageFactory.prepareForDestroy(), true); return response.getStores(); } catch (ClusterException | TimeoutException e) { } return null; }</code><technical_language>This timeout right? TimeoutException need caught here</technical_language>

Target:
public Set<String> prepareForDestroy() { try { PrepareForDestroy response = (PrepareForDestroy) invokeInternal(messageFactory.prepareForDestroy(), true); return response.getStores(); } catch (ClusterException e) { } return null; }
Source:
<code>public List<Project.NameKey> call() throws NoSuchProjectException { <START> List<Project.NameKey> ancestors = new ArrayList<Project.NameKey>(); <END> final ProjectControl pc = projectControlFactory.validateFor(projectName, ProjectControl.OWNER | ProjectControl.VISIBLE); ProjectState projectState = pc.getProjectState().getParentState(); Set<Project.NameKey> seen = new HashSet<Project.NameKey>(); Project.NameKey prj; while (projectState != null) { prj = projectState.getProject().getNameKey(); if (!seen.add(prj)) { break; } ancestors.add(prj); projectState = projectState.getParentState(); } return ancestors; }</code><technical_language>ancestors added times, a Set do? In case seen-logic re-factored away</technical_language>

Target:
public ArrayList<Project.NameKey> call() throws NoSuchProjectException { LinkedHashSet ancestors = new LinkedHashSet(); final ProjectControl pc = projectControlFactory.validateFor(projectName, ProjectControl.OWNER | ProjectControl.VISIBLE); ProjectState projectState = pc.getProjectState().getParentState(); Project.NameKey prj; while (projectState != null) { prj = projectState.getProject().getNameKey(); if (!ancestors.add(prj)) { break; } projectState = projectState.getParentState(); } return new ArrayList<Project.NameKey>(ancestors); }
Source:
<code>private static String toLegacyPathString(String moduleName) { final ModuleIdentifier moduleIdentifier = ModuleIdentifier.fromString(moduleName); <START> return moduleIdentifier.getName().replace('.', '/') + '/' + moduleIdentifier.getSlot() + '/'; <END> }</code><technical_language>problem slash here</technical_language>

Target:
private static String toLegacyPathString(String moduleName) { final ModuleIdentifier moduleIdentifier = ModuleIdentifier.fromString(moduleName); return moduleIdentifier.getName().replace('.', '/') + '/' + moduleIdentifier.getSlot(); }
Source:
<code>public void shouldReadFromQueueAndMakeAHttpCallForPost() throws IOException { MotechEvent motechEvent = new MotechEvent(EventSubjects.HTTP_REQUEST, new HashMap<String, Object>() {{ put(EventDataKeys.URL, url); put(EventDataKeys.DATA, data); put(EventDataKeys.METHOD, Method.POST); put(EventDataKeys.HEADERS, headers); }}); HttpHeaders httpHeaders = new HttpHeaders(); httpHeaders.add("key1", "value1"); httpHeaders.add("key2", "value2"); request = new HttpEntity<String>(data,httpHeaders); responseEntity = new ResponseEntity<String>(body,HttpStatus.OK); when(restTempate.exchange(eq(url),eq(HttpMethod.POST),eq(request), eq(String.class))).thenReturn((ResponseEntity<String>) responseEntity); httpClientEventListener.handle(motechEvent); <START> HTTPActionRecord httpActionRecord = new HTTPActionRecord(url, request.toString(), responseEntity.getBody().toString(), <END> responseEntity.getStatusCode().toString()); verify(httpActionService,times(1)).create(eq(httpActionRecord)); }</code><technical_language>a separate test checks logging</technical_language>

Target:
public void shouldReadFromQueueAndMakeAHttpCallForPost() throws IOException { MotechEvent motechEvent = new MotechEvent(EventSubjects.HTTP_REQUEST, new HashMap<String, Object>() {{ put(EventDataKeys.URL, url); put(EventDataKeys.DATA, data); put(EventDataKeys.METHOD, Method.POST); put(EventDataKeys.HEADERS, headers); }}); HttpHeaders httpHeaders = new HttpHeaders(); httpHeaders.add("key1", "value1"); httpHeaders.add("key2", "value2"); request = new HttpEntity<String>(data,httpHeaders); responseEntity = new ResponseEntity<String>(body, HttpStatus.OK); when(restTempate.exchange(eq(url),eq(HttpMethod.POST),eq(request), eq(String.class))).thenReturn((ResponseEntity<String>) responseEntity);; httpClientEventListener.handle(motechEvent); verify(restTempate).exchange(eq(url),eq(HttpMethod.POST),eq(request), eq(String.class)); }
Source:
<code>private void writeMappingTable(Map<String,String> mappings) { createMappingTable(); <START> StringBuffer buffer = new StringBuffer(); <END> buffer.append("BEGIN BATCH "); for (Map.Entry<String,String> entry: mappings.entrySet()) { buffer.append(" INSERT INTO openshift_metrics.metrics_mappings (project_id, project_name) VALUES('"+ entry.getKey() + "','" + entry.getValue() + "');"); } buffer.append(" APPLY BATCH;"); ResultSet resultset = session.execute(buffer.toString()); System.err.println("WRITE RESULT SET"); }</code><technical_language>StringBuilder ? I JVM optimizes this, still. This thread-safe in case</technical_language>

Target:
private void writeMappingTable(Map<String,String> mappings) { createMappingTable(); PreparedStatement pStatement = session.prepare("INSERT INTO openshift_metrics.metrics_mappings (project_id, project_name) VALUES(?,?);"); for (Map.Entry<String,String> entry: mappings.entrySet()) { int maxRetries = 3; int tries = 0; boolean succeeded = false; while (!succeeded && tries < maxRetries) { try { log.debugf("trying to write value to metrics_mapping table: %s %s", entry.getKey(), entry.getValue()); session.execute(pStatement.bind(entry.getKey(), entry.getValue())); log.debugf("wrote value to metrics_mapping table"); succeeded = true; } catch (Exception e) { log.errorf(e, "Error trying to insert entry into the openshift_metrics.metrics_mappings table (%s:%s). Will retry.", entry.getKey(), entry.getValue()); try { Thread.sleep(1000); } catch (InterruptedException ie) { break; } } tries++; } if (!succeeded) { throw new RuntimeException("Could not write all values to the openshift_metrics.metrics_mapping table. Aborting"); } } session.execute(pStatement.bind("%succeeded", "true")); }
Source:
<code><START> public List<ByteBuffer> readBlocks(SeekableInputStream f, long offset, int length) throws IOException { <END> f.seek(offset); int fullAllocations = length / options.getMaxAllocationSize(); int lastAllocationSize = length % options.getMaxAllocationSize(); int numAllocations = fullAllocations + (lastAllocationSize > 0 ? 1 : 0); List<ByteBuffer> buffers = new ArrayList<>(numAllocations); for (int i = 0; i < fullAllocations; i++) { buffers.add(options.getAllocator().allocate(options.getMaxAllocationSize())); } if (lastAllocationSize > 0) { buffers.add(options.getAllocator().allocate(lastAllocationSize)); } for (ByteBuffer buffer : buffers) { f.readFully(buffer); buffer.flip(); } return buffers; }</code><technical_language>visibility changed package private</technical_language>

Target:
List<ByteBuffer> readBlocks(SeekableInputStream f, long offset, int length) throws IOException { f.seek(offset); int fullAllocations = length / options.getMaxAllocationSize(); int lastAllocationSize = length % options.getMaxAllocationSize(); int numAllocations = fullAllocations + (lastAllocationSize > 0 ? 1 : 0); List<ByteBuffer> buffers = new ArrayList<>(numAllocations); for (int i = 0; i < fullAllocations; i++) { buffers.add(options.getAllocator().allocate(options.getMaxAllocationSize())); } if (lastAllocationSize > 0) { buffers.add(options.getAllocator().allocate(lastAllocationSize)); } for (ByteBuffer buffer : buffers) { f.readFully(buffer); buffer.flip(); } return buffers; }
Source:
<code>private void createSmallBam(final Path outputPath) { final SAMFileWriterFactory factory = new SAMFileWriterFactory(); factory.setCreateIndex(true); factory.setCreateMd5File(true); final SAMFileHeader header = new SAMFileHeader(); header.setSortOrder(SAMFileHeader.SortOrder.coordinate); header.addSequence(new SAMSequenceRecord("chr1", 123)); <START> final SAMFileWriter writer = factory.makeBAMWriter(header, false, outputPath); <END> fillSmallBam(writer); writer.close(); }</code><technical_language>this a try() resources</technical_language>

Target:
private void createSmallBam(final Path outputPath) { final SAMFileWriterFactory factory = new SAMFileWriterFactory(); factory.setCreateIndex(true); factory.setCreateMd5File(true); final SAMFileHeader header = new SAMFileHeader(); header.setSortOrder(SAMFileHeader.SortOrder.coordinate); header.addSequence(new SAMSequenceRecord("chr1", 123)); try (final SAMFileWriter writer = factory.makeBAMWriter(header, false, outputPath)) { fillSmallBam(writer); } }
Source:
<code>protected HashMap<String, Bitmap> doInBackground(FeatureCollection... params) { QueryFeatureActivity activity = activityRef.get(); HashMap<String, Bitmap> imagesMap = new HashMap<>(); if (activity != null) { LayoutInflater inflater = LayoutInflater.from(activity); featureAtMapClickPoint = params[0].features().get(0); StringBuilder stringBuilder = new StringBuilder(); BubbleLayout bubbleLayout = (BubbleLayout) inflater.inflate( R.layout.activity_query_feature_window_symbol_layer, null); TextView titleTextView = bubbleLayout.findViewById(R.id.info_window_title); titleTextView.setText(activity.getString(R.string.query_feature_marker_title)); for (Map.Entry<String, JsonElement> entry : featureAtMapClickPoint.properties().entrySet()) { stringBuilder.append(String.format("%s - %s", entry.getKey(), entry.getValue())); stringBuilder.append(System.getProperty("line.separator")); } TextView propertiesListTextView = bubbleLayout.findViewById(R.id.info_window_feature_properties_list); propertiesListTextView.setText(stringBuilder.toString()); int measureSpec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED); bubbleLayout.measure(measureSpec, measureSpec); int measuredWidth = bubbleLayout.getMeasuredWidth(); bubbleLayout.setArrowPosition(measuredWidth / 2 - 5); Bitmap bitmap = QueryFeatureActivity.SymbolGenerator.generate(bubbleLayout); imagesMap.put(CALLOUT_IMAGE_ID, bitmap); viewMap.put(CALLOUT_IMAGE_ID, bubbleLayout); } <START> return imagesMap; <END> }</code><technical_language>source need refreshed this point. Adding image update map if necessary</technical_language>

Target:
protected HashMap<String, Bitmap> doInBackground(FeatureCollection... params) { QueryFeatureActivity activity = activityRef.get(); HashMap<String, Bitmap> imagesMap = new HashMap<>(); if (activity != null) { LayoutInflater inflater = LayoutInflater.from(activity); featureAtMapClickPoint = params[0].features().get(0); StringBuilder stringBuilder = new StringBuilder(); BubbleLayout bubbleLayout = (BubbleLayout) inflater.inflate( R.layout.activity_query_feature_window_symbol_layer, null); TextView titleTextView = bubbleLayout.findViewById(R.id.info_window_title); titleTextView.setText(activity.getString(R.string.query_feature_marker_title)); for (Map.Entry<String, JsonElement> entry : featureAtMapClickPoint.properties().entrySet()) { stringBuilder.append(String.format("%s - %s", entry.getKey(), entry.getValue())); stringBuilder.append(System.getProperty("line.separator")); } TextView propertiesListTextView = bubbleLayout.findViewById(R.id.info_window_feature_properties_list); propertiesListTextView.setText(stringBuilder.toString()); int measureSpec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED); bubbleLayout.measure(measureSpec, measureSpec); int measuredWidth = bubbleLayout.getMeasuredWidth(); bubbleLayout.setArrowPosition(measuredWidth / 2 - 5); Bitmap bitmap = QueryFeatureActivity.SymbolGenerator.generate(bubbleLayout); imagesMap.put(CALLOUT_IMAGE_ID, bitmap); } return imagesMap; }
Source:
<code>private List<AbstractNode> getFollowingSiblings() { final List<AbstractNode> siblings = new ArrayList<>(); <START> for (int i = positionAmongSiblings + 1; i < parent.getChildren().size(); i++) { <END> final AbstractNode following = parent.getChildren().get(i); siblings.add(following); } return siblings; }</code><technical_language>Is final List<AbstractNode> siblings = parent.getChildren(); return siblings.subList(positionAmongSiblings, siblings.size()); ? list returned parent.getChildren() is immutable, is safe sublist here</technical_language>

Target:
private List<AbstractNode> getFollowingSiblings() { final List<AbstractNode> siblings = parent.getChildren(); return siblings.subList(indexAmongSiblings + 1, siblings.size()); }
Source:
<code>private static boolean isUnderCurrentProjectBuildDir(File moduleRoot) { String buildDir = System.getProperty("project.build.directory"); <START> if (buildDir != null) { <END> File target = new File(buildDir); File parent = moduleRoot.getParentFile(); while (parent != null) { if (target.equals(parent)) { return true; } parent = parent.getParentFile(); } } return false; }</code><technical_language>CI errors related; this return null, project.build.directory is passed surefire maven plugin system.properties. alternative Paths.get(System.getProperty("basedir"), "target").toString() ${basedir} null is passed surefire retrieved pom ${basedir} (although is deprecated) If so, I bet this function return false</technical_language>

Target:
private static boolean isUnderCurrentProjectBuildDir(File moduleRoot) { String buildDir = System.getProperty("project.build.directory"); if (buildDir == null && System.getProperty("basedir") != null) { buildDir = Paths.get(System.getProperty("basedir"), "target").toString(); } if (buildDir != null) { File target = new File(buildDir); File parent = moduleRoot.getParentFile(); while (parent != null) { if (target.equals(parent)) { return true; } parent = parent.getParentFile(); } } return false; }
Source:
<code><START> public EventQueryNode(final EventStorage eventStore, final StatementPattern geoPattern, final StatementPattern temporalPattern, final Collection<IndexingExpr> geoFilters, final Collection<IndexingExpr> temporalFilters, final Collection<FunctionCall> usedFilters) throws IllegalStateException { <END> this.geoPattern = requireNonNull(geoPattern); this.temporalPattern = requireNonNull(temporalPattern); this.geoFilters = requireNonNull(geoFilters); this.temporalFilters = requireNonNull(temporalFilters); this.eventStore = requireNonNull(eventStore); this.usedFilters = requireNonNull(usedFilters); bindingNames = new HashSet<>(); verifySameSubjects(getPatterns()); verifyAllPredicatesAreConstants(getPatterns()); final Var subject = patterns.iterator().next().getSubjectVar(); subjectIsConstant = subject.isConstant(); if(subjectIsConstant) { subjectConstant = Optional.of( subject.getValue().toString() ); subjectVar = Optional.empty(); } else { subjectConstant = Optional.empty(); subjectVar = Optional.of( subject.getName() ); } }</code><technical_language>do a builder for this class</technical_language>

Target:
private EventQueryNode(final EventStorage eventStore, final StatementPattern geoPattern, final StatementPattern temporalPattern, final Collection<IndexingExpr> geoFilters, final Collection<IndexingExpr> temporalFilters, final Collection<FunctionCall> usedFilters) throws IllegalStateException { this.geoPattern = requireNonNull(geoPattern); this.temporalPattern = requireNonNull(temporalPattern); this.geoFilters = requireNonNull(geoFilters); this.temporalFilters = requireNonNull(temporalFilters); this.eventStore = requireNonNull(eventStore); this.usedFilters = requireNonNull(usedFilters); bindingNames = new HashSet<>(); verifySameSubjects(getPatterns()); verifyAllPredicatesAreConstants(getPatterns()); final Var subject = patterns.iterator().next().getSubjectVar(); subjectIsConstant = subject.isConstant(); if(subjectIsConstant) { subjectConstant = Optional.of( subject.getValue().toString() ); subjectVar = Optional.empty(); } else { subjectConstant = Optional.empty(); subjectVar = Optional.of( subject.getName() ); } }
Source:
<code>public Collection<AccountGroup.Id> createEntry(final AccountGroup.Id key) throws Exception { final ReviewDb db = schema.open(); try { final ResultSet<AccountGroupIncludedGroup> groups = db.accountGroupIncludedGroups().byIncludedGroup(key); ArrayList<AccountGroup.Id> groupArray = new ArrayList<AccountGroup.Id> (); <START> for (AccountGroupIncludedGroup agig : groups) { <END> groupArray.add(agig.getGroupId()); } return groupArray; } finally { db.close(); } }</code><technical_language>shorter code inline groups here: for (AccountGroupIncludedGroup agig : db.accountGroupIncludedGroups().byIncludedGroup(key))</technical_language>

Target:
public Collection<AccountGroup.Id> createEntry(final AccountGroup.Id key) throws Exception { final ReviewDb db = schema.open(); try { ArrayList<AccountGroup.Id> groupArray = new ArrayList<AccountGroup.Id> (); for (AccountGroupIncludedGroup agig : db.accountGroupIncludedGroups().byIncludedGroup(key)) { groupArray.add(agig.getGroupId()); } return Collections.unmodifiableCollection(groupArray); } finally { db.close(); } }
Source:
<code>@Override public boolean equals(Object obj) { if (!(obj instanceof TimestampWithTimeZone)) { return false; } TimestampWithTimeZone that = (TimestampWithTimeZone) obj; <START> return this.millisecond == that.millisecond && this.timeZone == that.timeZone; <END> }</code><technical_language>this.timeZone.equals(that.timeZone)</technical_language>

Target:
@Override public boolean equals(Object obj) { if (!(obj instanceof TimestampWithTimeZone)) { return false; } TimestampWithTimeZone that = (TimestampWithTimeZone) obj; return this.millisecond == that.millisecond && this.timeZone.equals(that.timeZone); }
Source:
<code><START> boolean areRequiredNetworksAvailable(VDS vds) { <END> final List<VdsNetworkInterface> allInterfacesForVds = getInterfaceDAO().getAllInterfacesForVds(vds.getId()); final List<Network> clusterNetworks = getNetworkDAO().getAllForCluster(vds.getvds_group_id()); final Map<String, Network> networksByName = NetworkUtils.networksByName(clusterNetworks); boolean onlyRequiredNetworks = Config.<Boolean> GetValue(ConfigValues.OnlyRequiredNetworksMandatoryForVdsSelection); for (final VmNetworkInterface vmIf : getVmNICs()) { boolean found = false; for (final VdsNetworkInterface vdsIf : allInterfacesForVds) { if (!networkRequiredOnVds(vmIf, networksByName, onlyRequiredNetworks) || StringUtils.equals(vmIf.getNetworkName(), vdsIf.getNetworkName())) { found = true; break; } } if (!found) { return false; } } return true; }</code><technical_language>part of patch - please this method private, called elsewhere</technical_language>

Target:
private boolean areRequiredNetworksAvailable(VDS vds) { final List<VdsNetworkInterface> allInterfacesForVds = getInterfaceDAO().getAllInterfacesForVds(vds.getId()); final List<Network> clusterNetworks = getNetworkDAO().getAllForCluster(vds.getvds_group_id()); final Map<String, Network> networksByName = Entities.entitiesByName(clusterNetworks); boolean onlyRequiredNetworks = Config.<Boolean> GetValue(ConfigValues.OnlyRequiredNetworksMandatoryForVdsSelection); for (final VmNetworkInterface vmIf : getVmNICs()) { boolean found = false; for (final VdsNetworkInterface vdsIf : allInterfacesForVds) { if (!networkRequiredOnVds(vmIf, networksByName, onlyRequiredNetworks) || StringUtils.equals(vmIf.getNetworkName(), vdsIf.getNetworkName())) { found = true; break; } } if (!found) { return false; } } return true; }
Source:
<code>public void testResourceHeaders() throws Exception { MockHttpServletResponse response = getAsServletResponse("/rest/resource/mydir2/fake.png"); Assert.assertEquals(FORMAT_HEADER.format(myRes.lastmodified()), response.getHeader("Last-modified")); <START> Assert.assertEquals("/mydir2", response.getHeader("Resource-parent")); <END> Assert.assertEquals("resource", response.getHeader("Resource-type")); Assert.assertEquals("image/png", response.getHeader("Content-type")); }</code><technical_language>Conventional header capitalisation, please</technical_language>

Target:
public void testResourceHeaders() throws Exception { MockHttpServletResponse response = getAsServletResponse("/rest/resource/mydir2/fake.png"); Assert.assertEquals(FORMAT_HEADER.format(myRes.lastmodified()), response.getHeader("Last-Modified")); Assert.assertEquals("/mydir2", response.getHeader("Resource-Parent")); Assert.assertEquals("resource", response.getHeader("Resource-Type")); Assert.assertEquals("image/png", response.getHeader("Content-Type")); }
Source:
<code>public Obs getObs(Obs obs, String view) { File file = getComplexDataFile(obs); if (ComplexObsHandler.RAW_VIEW.equals(view)) { BufferedImage img = null; try { img = ImageIO.read(file); } catch (IOException e) { log.error("Trying to read file: " + file.getAbsolutePath(), e); } ComplexData complexData = new ComplexData(file.getName(), img); String mimeType = getMimeTypeFromFile(file); mimeType = mimeType != null ? mimeType : "application/octet-stream"; complexData.setMimeType(mimeType); <START> <END> obs.setComplexData(complexData); } else { return null; } return obs; }</code><technical_language>If mimeType is null, default this change</technical_language>

Target:
public Obs getObs(Obs obs, String view) { File file = getComplexDataFile(obs); if (ComplexObsHandler.RAW_VIEW.equals(view)) { BufferedImage img = null; try { img = ImageIO.read(file); } catch (IOException e) { log.error("Trying to read file: " + file.getAbsolutePath(), e); } ComplexData complexData = new ComplexData(file.getName(), img); String mimeType = null; try { FileImageInputStream imgStream = new FileImageInputStream(file); Iterator<ImageReader> imgReader = ImageIO.getImageReaders(imgStream); imgStream.close(); if (imgReader.hasNext()) { mimeType = "image/" + imgReader.next().getFormatName().toLowerCase(); } else { log.warn("MIME type of " + file.getAbsolutePath() + " is not known"); } } catch (FileNotFoundException e) { log.error("Image " + file.getAbsolutePath() + " was not found", e); } catch (IOException e) { log.error("Trying to determine MIME type of " + file.getAbsolutePath(), e); } mimeType = mimeType != null ? mimeType : OpenmrsUtil.getFileMimeType(file); complexData.setMimeType(mimeType); obs.setComplexData(complexData); } else { return null; } return obs; }
Source:
<code>private static Gson getTeammatesGson() { <START> return new GsonBuilder().registerTypeAdapter(Date.class, new StandardDateAdapter()) <END> .setPrettyPrinting() .disableHtmlEscaping() .create(); }</code><technical_language>this effect legacy data (i.e. existing this PR)</technical_language>

Target:
private static Gson getTeammatesGson() { return new GsonBuilder().registerTypeAdapter(Date.class, new TeammatesDateAdapter()) .setPrettyPrinting() .disableHtmlEscaping() .create(); }
Source:
<code>@Nullable @Override protected MetadataMarshalled reduce0(List<ComputeJobResult> results) { <START> if (results.isEmpty()) <END> throw new IgniteException("Empty job results"); if (results.size() > 1) throw new IgniteException("Invalid job results: " + results); if (results.get(0).getException() != null) throw results.get(0).getException(); else return results.get(0).getData(); }</code><technical_language>merge validation message "Invalid job results. Expected 1 result, " + results</technical_language>

Target:
@Nullable @Override protected MetadataMarshalled reduce0(List<ComputeJobResult> results) { if (results.size() != 1) throw new IgniteException("Invalid job results. Expected exactly 1 result, but was: " + results); if (results.get(0).getException() != null) throw results.get(0).getException(); else return results.get(0).getData(); }
Source:
<code>public boolean onOptionsItemSelected(MenuItem item) { boolean retval = true; switch (item.getItemId()) { case R.id.action_create_dir: { CreateFolderDialogFragment dialog = CreateFolderDialogFragment.newInstance(getCurrentDir()); dialog.show(getSupportFragmentManager(), "createdirdialog"); break; } case R.id.action_sync_account: { startSynchronization(); break; } case R.id.action_upload: { showDialog(DIALOG_CHOOSE_UPLOAD_SOURCE); break; } case R.id.action_settings: { Intent settingsIntent = new Intent(this, Preferences.class); startActivity(settingsIntent); break; } case android.R.id.home: { FileFragment second = getSecondFragment(); OCFile currentDir = getCurrentDir(); if((currentDir != null && currentDir.getParentId() != 0) || (second != null && second.getFile() != null)) { onBackPressed(); } break; } case R.id.action_sort: { SharedPreferences appPreferences = PreferenceManager <START> .getDefaultSharedPreferences(getApplicationContext()); <END> Integer sortOrder = appPreferences .getInt("sortOrder", 0); AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(R.string.actionbar_sort_title) .setSingleChoiceItems(R.array.actionbar_sortby, sortOrder , new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { switch (which){ case 0: sortByName(true); break; case 1: sortByDate(false); break; } dialog.dismiss(); } }); builder.create().show(); break; } default: retval = super.onOptionsItemSelected(item); } return retval; }</code><technical_language>Is specific reason pass getApplicationContext() instead of 'this' ? If answer is 'no', 'this' prefered</technical_language>

Target:
public boolean onOptionsItemSelected(MenuItem item) { boolean retval = true; switch (item.getItemId()) { case R.id.action_create_dir: { CreateFolderDialogFragment dialog = CreateFolderDialogFragment.newInstance(getCurrentDir()); dialog.show(getSupportFragmentManager(), "createdirdialog"); break; } case R.id.action_sync_account: { startSynchronization(); break; } case R.id.action_upload: { showDialog(DIALOG_CHOOSE_UPLOAD_SOURCE); break; } case R.id.action_settings: { Intent settingsIntent = new Intent(this, Preferences.class); startActivity(settingsIntent); break; } case android.R.id.home: { FileFragment second = getSecondFragment(); OCFile currentDir = getCurrentDir(); if((currentDir != null && currentDir.getParentId() != 0) || (second != null && second.getFile() != null)) { onBackPressed(); } break; } case R.id.action_sort: { SharedPreferences appPreferences = PreferenceManager .getDefaultSharedPreferences(this); Integer sortOrder = appPreferences .getInt("sortOrder", FileListListAdapter.SORT_NAME); AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(R.string.actionbar_sort_title) .setSingleChoiceItems(R.array.actionbar_sortby, sortOrder , new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { switch (which){ case 0: sortByName(true); break; case 1: sortByDate(false); break; } dialog.dismiss(); } }); builder.create().show(); break; } default: retval = super.onOptionsItemSelected(item); } return retval; }
Source:
<code>public boolean processRow(ExportRow rd) throws ExportDecoderBase.RestartBlockException { try { if (haplist.isEmpty()) { connect(haplist); } if (haplist.isEmpty()) { m_logger.rateLimitedLog(120, Level.ERROR, null, "Failed to connect to export socket endpoint %s, some servers may be down.", host); throw new RestartBlockException(true); } if (m_logger.isDebugEnabled()) { <START> m_logger.warn(m_source.tableName + ":P" + m_source.partitionId + " sending seqNum: " + rd.values[2]); <END> } String decoded = m_decoder.decode(rd.generation, rd.tableName, rd.types, rd.names,null, rd.values).concat("\n"); byte b[] = decoded.getBytes(); ByteBuffer buf = ByteBuffer.allocate(b.length); buf.put(b); buf.flip(); for (OutputStream hap : haplist.values()) { hap.write(buf.array()); hap.flush(); } } catch (Exception e) { m_logger.error(e.getLocalizedMessage()); haplist.clear(); throw new RestartBlockException(true); } return true; }</code><technical_language>log-level: warn -> debug</technical_language>

Target:
public boolean processRow(ExportRow rd) throws ExportDecoderBase.RestartBlockException { try { if (haplist.isEmpty()) { connect(haplist); } if (haplist.isEmpty()) { m_logger.rateLimitedLog(120, Level.ERROR, null, "Failed to connect to export socket endpoint %s, some servers may be down.", host); throw new RestartBlockException(true); } if (m_logger.isDebugEnabled()) { m_logger.debug(m_source.tableName + ":P" + m_source.partitionId + " sending seqNum: " + rd.values[2]); } String decoded = m_decoder.decode(rd.generation, rd.tableName, rd.types, rd.names,null, rd.values).concat("\n"); byte b[] = decoded.getBytes(); ByteBuffer buf = ByteBuffer.allocate(b.length); buf.put(b); buf.flip(); for (OutputStream hap : haplist.values()) { hap.write(buf.array()); hap.flush(); } } catch (Exception e) { m_logger.error(e.getLocalizedMessage()); haplist.clear(); throw new RestartBlockException(true); } return true; }
Source:
<code>private boolean checkInstanceLocation(Location instanceLocation, Shell shell, IEclipseContext context) { <START> if (Boolean.FALSE.equals(context.get(IWorkbench.PERSIST_STATE))) { <END> return true; } if (instanceLocation == null) { MessageDialog .openError( shell, WorkbenchSWTMessages.IDEApplication_workspaceMandatoryTitle, WorkbenchSWTMessages.IDEApplication_workspaceMandatoryMessage); return false; } if (instanceLocation.isSet()) { if (!checkValidWorkspace(shell, instanceLocation.getURL())) { return false; } try { if (instanceLocation.lock()) { writeWorkspaceVersion(); return true; } File workspaceDirectory = new File(instanceLocation.getURL() .getFile()); if (workspaceDirectory.exists()) { MessageDialog .openError( shell, WorkbenchSWTMessages.IDEApplication_workspaceCannotLockTitle, WorkbenchSWTMessages.IDEApplication_workspaceCannotLockMessage); } else { MessageDialog .openError( shell, WorkbenchSWTMessages.IDEApplication_workspaceCannotBeSetTitle, WorkbenchSWTMessages.IDEApplication_workspaceCannotBeSetMessage); } } catch (IOException e) { Logger logger = new WorkbenchLogger(PLUGIN_ID); logger.error(e); MessageDialog.openError(shell, WorkbenchSWTMessages.InternalError, e.getMessage()); } return false; } return false; }</code><technical_language>is run a workspace (and need workspace locking) bother persist model state. I need modify condition slightly</technical_language>

Target:
private boolean checkInstanceLocation(Location instanceLocation, Shell shell, IEclipseContext context) { if (instanceLocation == null && Boolean.FALSE.equals(context.get(IWorkbench.PERSIST_STATE))) { return true; } if (instanceLocation == null) { MessageDialog .openError( shell, WorkbenchSWTMessages.IDEApplication_workspaceMandatoryTitle, WorkbenchSWTMessages.IDEApplication_workspaceMandatoryMessage); return false; } if (instanceLocation.isSet()) { if (!checkValidWorkspace(shell, instanceLocation.getURL())) { return false; } try { if (instanceLocation.lock()) { writeWorkspaceVersion(); return true; } File workspaceDirectory = new File(instanceLocation.getURL() .getFile()); if (workspaceDirectory.exists()) { MessageDialog .openError( shell, WorkbenchSWTMessages.IDEApplication_workspaceCannotLockTitle, WorkbenchSWTMessages.IDEApplication_workspaceCannotLockMessage); } else { MessageDialog .openError( shell, WorkbenchSWTMessages.IDEApplication_workspaceCannotBeSetTitle, WorkbenchSWTMessages.IDEApplication_workspaceCannotBeSetMessage); } } catch (IOException e) { Logger logger = new WorkbenchLogger(PLUGIN_ID); logger.error(e); MessageDialog.openError(shell, WorkbenchSWTMessages.InternalError, e.getMessage()); } return false; } return false; }
Source:
<code>@Override public void init(StreamGraph graph, Config config) { MessageStream<PageViewEvent> pageViewEvents = graph.getInputStream("pageViewEventStream", (k, m) -> (PageViewEvent) m); OutputStream<String, PageViewCount, PageViewCount> pageViewEventPerMemberStream = graph .getOutputStream("pageViewEventPerMemberStream", m -> m.memberId, m -> m); <START> <END> Supplier<Integer> initialValue = () -> 0; pageViewEvents .window(Windows.<PageViewEvent, String, Integer>keyedTumblingWindow(m -> m.memberId, Duration.ofSeconds(10), initialValue, (m, c) -> c + 1) .setEarlyTrigger(Triggers.repeat(Triggers.count(5))) .setAccumulationMode(AccumulationMode.DISCARDING)) .map(PageViewCount::new) .sendTo(pageViewEventPerMemberStream); }</code><technical_language>minor: if is a single pattern want advocate. inlining OutputStreams pre-declared. If so, nice consistently</technical_language>

Target:
@Override public void init(StreamGraph graph, Config config) { MessageStream<PageViewEvent> pageViewEvents = graph.getInputStream("pageViewEventStream", (k, m) -> (PageViewEvent) m); OutputStream<String, PageViewCount, PageViewCount> pageViewEventPerMemberStream = graph .getOutputStream("pageViewEventPerMemberStream", m -> m.memberId, m -> m); Supplier<Integer> initialValue = () -> 0; FoldLeftFunction<PageViewEvent, Integer> foldLeftFn = (m, c) -> c + 1; pageViewEvents .window(Windows.keyedTumblingWindow(m -> m.memberId, Duration.ofSeconds(10), initialValue, foldLeftFn) .setEarlyTrigger(Triggers.repeat(Triggers.count(5))) .setAccumulationMode(AccumulationMode.DISCARDING)) .map(PageViewCount::new) .sendTo(pageViewEventPerMemberStream); }
Source:
<code>public Response createIssue( @FormParam("title") String title, @FormParam("description") String description, @FormParam("assignee") String assigneeNetID, @FormParam("labels") List<Long> labels) throws IOException{ Issue issue = new Issue(); issue.setTitle(title); issue.setDescription(description); issue.setOpen(true); User assignee = users.findByNetId(assigneeNetID); checkCollaborator(assignee); issue.setAssignee(assignee); issue.setRepository(getRepositoryEntity()); issue.getLabels().clear(); <START> issue.getLabels().addAll(getRepositoryEntity().getLabels().stream().filter( <END> x -> labels.contains(x.getLabelId())) .collect(Collectors.toSet())); issueBackend.createIssue(getRepositoryApi(getRepositoryEntity()), issue); return redirect(issue.getURI().toString()); }</code><technical_language>issue.setLabels work, a merge fix that. try tomorrow</technical_language>

Target:
public Response createIssue( @FormParam("title") String title, @FormParam("description") String description, @FormParam("assignee") String assigneeNetID, @FormParam("labels") List<Long> labels) throws IOException{ Issue issue = new Issue(); issue.setTitle(title); issue.setDescription(description); issue.setOpen(true); if (!Strings.isNullOrEmpty(assigneeNetID)) { User assignee = users.findByNetId(assigneeNetID); checkCollaborator(assignee); issue.setAssignee(assignee); } else { issue.setAssignee(null); } issue.setRepository(getRepositoryEntity()); issue.setLabels(getRepositoryEntity().getLabels().stream().filter( x -> labels.contains(x.getLabelId())) .collect(Collectors.toSet())); issueBackend.createIssue(getRepositoryApi(getRepositoryEntity()), issue); return redirect(issue.getURI().toString()); }