auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public String getTableToolContent(@ApiParam(hidden = true) @Auth Optional<User> user, @ApiParam(value = "workflowId", required = true) @PathParam("workflowId") Long workflowId, @ApiParam(value = "workflowVersionId", required = true) @PathParam("workflowVersionId") Long workflowVersionId) { Workflow workflow = workflowDAO.findById(workflowId); checkEntry(workflow); checkOptionalAuthRead(user, workflow); WorkflowVersion workflowVersion = getWorkflowVersion(workflow, workflowVersionId); if (workflowVersion == null) { throw new CustomWebApplicationException("workflow version " + workflowVersionId + " does not exist", HttpStatus.SC_BAD_REQUEST); } <START> if (workflowVersion.getCommitID() != null && workflowVersion.getCommitID().equals(workflowVersion.getCommitForJsonGeneration()) && workflowVersion.getToolTableJson() != null) { <END> return workflowVersion.getToolTableJson(); } SourceFile mainDescriptor = getMainDescriptorFile(workflowVersion); if (mainDescriptor != null) { Set<SourceFile> secondaryDescContent = extractDescriptorAndSecondaryFiles(workflowVersion); LanguageHandlerInterface lInterface = LanguageHandlerFactory.getInterface(workflow.getFileType()); final String toolTableJson = lInterface.getContent(workflowVersion.getWorkflowPath(), mainDescriptor.getContent(), secondaryDescContent, LanguageHandlerInterface.Type.TOOLS, toolDAO); workflowVersion.setToolTableJson(toolTableJson); workflowVersion.setCommitForJsonGeneration(workflowVersion.getCommitID()); return toolTableJson; } return null; }</code><technical_language>Predicate (at part), method</technical_language>

Target:
public String getTableToolContent(@ApiParam(hidden = true) @Auth Optional<User> user, @ApiParam(value = "workflowId", required = true) @PathParam("workflowId") Long workflowId, @ApiParam(value = "workflowVersionId", required = true) @PathParam("workflowVersionId") Long workflowVersionId) { Workflow workflow = workflowDAO.findById(workflowId); checkEntry(workflow); checkOptionalAuthRead(user, workflow); WorkflowVersion workflowVersion = getWorkflowVersion(workflow, workflowVersionId); if (workflowVersion == null) { throw new CustomWebApplicationException("workflow version " + workflowVersionId + " does not exist", HttpStatus.SC_BAD_REQUEST); } if (workflowVersion.getToolTableJson() != null) { return workflowVersion.getToolTableJson(); } SourceFile mainDescriptor = getMainDescriptorFile(workflowVersion); if (mainDescriptor != null) { Set<SourceFile> secondaryDescContent = extractDescriptorAndSecondaryFiles(workflowVersion); LanguageHandlerInterface lInterface = LanguageHandlerFactory.getInterface(workflow.getFileType()); final String toolTableJson = lInterface.getContent(workflowVersion.getWorkflowPath(), mainDescriptor.getContent(), secondaryDescContent, LanguageHandlerInterface.Type.TOOLS, toolDAO); workflowVersion.setToolTableJson(toolTableJson); return toolTableJson; } return null; }
Source:
<code>private void startIconSpinningAnimation() { if (iconSpinningAnimator != null) { iconSpinningAnimator.cancel(); } iconSpinningAnimator = ValueAnimator.ofFloat(0, 360); <START> iconSpinningAnimator.setDuration(DESIRED_SECONDS_PER_ONE_FULL_360_SPIN * 1000); <END> iconSpinningAnimator.setInterpolator(new LinearInterpolator()); iconSpinningAnimator.setRepeatCount(ValueAnimator.INFINITE); iconSpinningAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override public void onAnimationUpdate(ValueAnimator valueAnimator) { Float newIconRotateValue = (Float) valueAnimator.getAnimatedValue(); mapboxMap.getStyle(new Style.OnStyleLoaded() { @Override public void onStyleLoaded(@NonNull Style style) { Layer iconSymbolLayer = style.getLayerAs(LAYER_ID); iconSymbolLayer.setProperties( iconRotate(newIconRotateValue), iconPitchAlignment(ICON_PITCH_ALIGNMENT_MAP) ); } }); } }); iconSpinningAnimator.start(); }</code><technical_language>name, multiplication hardcoded variable itself</technical_language>

Target:
private void startIconSpinningAnimation() { if (iconSpinningAnimator != null) { iconSpinningAnimator.cancel(); } iconSpinningAnimator = ValueAnimator.ofFloat(0, 360); iconSpinningAnimator.setDuration(desiredMillisecondsPerOneFull360Spin); iconSpinningAnimator.setInterpolator(new LinearInterpolator()); iconSpinningAnimator.setRepeatCount(ValueAnimator.INFINITE); iconSpinningAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override public void onAnimationUpdate(ValueAnimator valueAnimator) { Float newIconRotateValue = (Float) valueAnimator.getAnimatedValue(); mapboxMap.getStyle(new Style.OnStyleLoaded() { @Override public void onStyleLoaded(@NonNull Style style) { Layer iconSymbolLayer = style.getLayerAs(LAYER_ID); iconSymbolLayer.setProperties( iconRotate(newIconRotateValue) ); } }); } }); iconSpinningAnimator.start(); }
Source:
<code>private SpringCloudCommandRouter createRouterFor(String host) { Registration localServiceInstance = mock(Registration.class); when(localServiceInstance.getUri()).thenReturn(URI.create("http://" + host)); return SpringCloudCommandRouter.builder() .discoveryClient(discoveryClient) .localServiceInstance(localServiceInstance) .routingStrategy(routingStrategy) <START> .serviceInstanceFilter(s -> true) <END> .consistentHashChangeListener(consistentHashChangeListener) .build(); }</code><technical_language>Change s serviceInstance</technical_language>

Target:
private SpringCloudCommandRouter createRouterFor(String host) { Registration localServiceInstance = mock(Registration.class); when(localServiceInstance.getUri()).thenReturn(URI.create("http://" + host)); return SpringCloudCommandRouter.builder() .discoveryClient(discoveryClient) .localServiceInstance(localServiceInstance) .routingStrategy(routingStrategy) .serviceInstanceFilter(serviceInstance -> true) .consistentHashChangeListener(consistentHashChangeListener) .build(); }
Source:
<code><START> public boolean equals(Object obj) { <END> if (obj == this) return true; else if (obj instanceof Line) { Line other = (Line) obj; return startCommit.equals(other.startCommit) && Arrays.equals(numbers, other.numbers); } return false; }</code><technical_language>Missing @Override</technical_language>

Target:
public boolean equals(Object obj) { if (obj == this) return true; else if (obj instanceof Line) { Line other = (Line) obj; return commit.equals(other.commit) && number == other.number; } return false; }
Source:
<code>public SpecialAnonymizationUserPage submitAnonymization() { try { Thread.sleep(10000); } catch (Exception e) { } jsActions.scrollToElement(submitButton); <START> submitButton.click(); <END> return this; }</code><technical_language>FYI, I a method scrollAndClick()</technical_language>

Target:
public SpecialAnonymizationUserPage submitAnonymization() { jsActions.scrollToElement(submitButton); submitButton.click(); return this; }
Source:
<code><START> public void findsDoc() throws IOException { <END> final Bucket bucket = this.mockBucket(); final Docs docs = new AwsDocs(bucket); MatcherAssert.assertThat( docs.doc(AwsDocsTest.EXISTS).exists(), Matchers.equalTo(true) ); MatcherAssert.assertThat( docs.doc(AwsDocsTest.INEXISTENT).exists(), Matchers.equalTo(false) ); }</code><technical_language>@pinaf Oh, sorry. I forgot 2 methods. OK for test. I precise users docs. I want is more test (at leas a puzzle for it) test AwsDocs. names() return hierarchical names if some files. modify existing test for that</technical_language>

Target:
public void findsDoc() throws IOException { final String label = "finds"; final String exists = "finds-exists"; final Bucket bucket = this.mockBucket(label, exists); final Docs docs = new AwsDocs(bucket, label); MatcherAssert.assertThat( docs.doc(exists).exists(), Matchers.equalTo(true) ); MatcherAssert.assertThat( docs.doc("xyz").exists(), Matchers.equalTo(false) ); }
Source:
<code>private void parseProperties() { for(String arg : getUsageArguments()) { ParserArgument argument = new ParserArgument(); argument.setName( getArgAttrValue(arg, "name") ); if (argument.getName() == null) { throw new IllegalArgumentException( String.format("Name of argument '%1$s' have to <START> specified", <END> arg) ); } argument.setMetavar( getArgAttrValue(arg, "metavar") ); argument.setHelp( getArgAttrValue(arg, "help") ); argument.setDefaultValue( getArgAttrValue(arg, "default") ); argument.setMutivalue( Boolean.parseBoolean( getArgAttrValue(arg, "multivalue") ) ); argument.setMandatory( Boolean.parseBoolean( getArgAttrValue(arg, "mandatory") ) ); argument.setType( ParametersParser.ArgumentType.valueOf( getArgAttrValue(arg, "type") ) ); argument.setMatcher( Pattern.compile( getArgAttrValue(arg, "matcher") ) ); try { argument.setConvert( Class.forName( getArgAttrValue(arg, "convert"), true, Thread.currentThread().getContextClassLoader() ) ); } catch (ClassNotFoundException ex) { throw new IllegalArgumentException( String.format("Can't convert argument: '%1$s'. Please check convert class in properties file.", arg) ); } if (argument.isMandatory()) { mandatory.add(argument.getName()); } if (argument.getDefaultValue() != null) { defaults.add(String.format("%1$s%2$s=%3$s", LONG_PREFIX, argument.getName(), argument.getDefaultValue())); } arguments.put(arg, argument); } }</code><technical_language>specified? argument '%1$s' name specified</technical_language>

Target:
private void parseProperties() { for(String arg : getUsageArguments()) { ParserArgument argument = new ParserArgument(); argument.setName( getArgAttrValue(arg, "name") ); if (argument.getName() == null) { throw new IllegalArgumentException( String.format("Invalid configuration. Parameter '%1$s' has no name", arg) ); } argument.setMetavar( getArgAttrValue(arg, "metavar") ); argument.setHelp( getArgAttrValue(arg, "help") ); argument.setDefaultValue( getArgAttrValue(arg, "default") ); argument.setMultivalue( Boolean.parseBoolean( getArgAttrValue(arg, "multivalue") ) ); argument.setMandatory( Boolean.parseBoolean( getArgAttrValue(arg, "mandatory") ) ); argument.setType( ParametersParser.ArgumentType.valueOf( getArgAttrValue(arg, "type") ) ); argument.setMatcher( Pattern.compile( getArgAttrValue(arg, "matcher") ) ); try { argument.setConvert( Class.forName( getArgAttrValue(arg, "convert"), true, Thread.currentThread().getContextClassLoader() ) ); } catch (ClassNotFoundException ex) { throw new IllegalArgumentException( String.format("Can't convert argument: '%1$s'. Please check convert class in properties file.", arg) ); } if (argument.isMandatory()) { mandatory.add(argument.getName()); } if (argument.getDefaultValue() != null) { defaults.add(String.format("%1$s%2$s=%3$s", LONG_PREFIX, argument.getName(), argument.getDefaultValue())); } arguments.put(argument.getName(), argument); } }
Source:
<code>public GradientDescent withConvergenceTol(double convergenceTol) { if (convergenceTol < 0) throw new IllegalArgumentException("Convergence tolerance must be non-negative but got " + convergenceTol); this.convergenceTol = convergenceTol; <START> return this; <END> }</code><technical_language>chain setters. discuss @ybabak @YuriBabak chain</technical_language>

Target:
public GradientDescent withConvergenceTol(double convergenceTol) { assert convergenceTol >= 0; this.convergenceTol = convergenceTol; return this; }
Source:
<code>public void testPutAllNull() throws Exception { final Map<String, String> originalStoreContent = getEntryMap(KEY_SET_A, KEY_SET_B); final FakeStore fakeStore = new FakeStore(originalStoreContent); this.store = spy(fakeStore); final Ehcache<String, String> ehcache = this.getEhcache(null); try { ehcache.putAll(null); fail(); } catch (NullPointerException e) { } <START> verify(testCacheEventListener,never()).onEvent(any(CacheEvent.class)); <END> }</code><technical_language>Please do for suppression of warnings, instead proper generic information away</technical_language>

Target:
public void testPutAllNull() throws Exception { final Map<String, String> originalStoreContent = getEntryMap(KEY_SET_A, KEY_SET_B); final FakeStore fakeStore = new FakeStore(originalStoreContent); this.store = spy(fakeStore); final Ehcache<String, String> ehcache = this.getEhcache(null); try { ehcache.putAll(null); fail(); } catch (NullPointerException e) { } verify(cacheEventListener,never()).onEvent(Matchers.<CacheEvent<String, String>>any()); try { ehcache.getRuntimeConfiguration().deregisterCacheEventListener(cacheEventListener); fail(); } catch (UnsupportedOperationException e){ } }
Source:
<code>public long getLastModified() throws IOException { <START> File file = new File(super.getLocalePath()); <END> if (file.exists()) { return file.lastModified(); } return 0; }</code><technical_language>I this call getExistedPath(url) (or equivalent if renamed). constructor call url.getPath() for parameter, this method to. constructor calls getExistedPath(url), _this method call too_ (for consistency)</technical_language>

Target:
public long getLastModified() throws IOException { if (file.exists()) { return file.lastModified(); } return 0; }
Source:
<code>static void appendIndented(StringBuilder builder, String value) { <START> for (String line : value.split("\\n")) { <END> builder.append(" ").append(line).append('\n'); } }</code><technical_language>\\n \n? Interesting</technical_language>

Target:
static void appendIndented(StringBuilder builder, String value) { for (String line : value.split("\n")) { builder.append(" ").append(line).append('\n'); } }
Source:
<code>public void collideCircles(Manifold manifold, CircleShape circle1, Transform xfA, CircleShape circle2, Transform xfB) { manifold.pointCount = 0; Vec2 circle1p = circle1.center; Vec2 circle2p = circle2.center; float pAx = (xfA.q.c * circle1p.x - xfA.q.s * circle1p.y) + xfA.p.x; <START> float pAy = xfA.q.s * circle1p.x + xfA.q.c * circle1p.y + xfA.p.y; <END> float pBx = (xfB.q.c * circle2p.x - xfB.q.s * circle2p.y) + xfB.p.x; float pBy = xfB.q.s * circle2p.x + xfB.q.c * circle2p.y + xfB.p.y; float dx = pBx - pAx; float dy = pBy - pAy; float distSqr = dx * dx + dy * dy; final float radius = circle1.getRadius() + circle2.getRadius(); if (distSqr > radius * radius) { return; } manifold.type = ManifoldType.CIRCLES; manifold.localPoint.set(circle1p); manifold.localNormal.setZero(); manifold.pointCount = 1; manifold.points[0].localPoint.set(circle2p); manifold.points[0].id.zero(); }</code><technical_language>need remove parentheses equations consistent. Please revert entire file. final keyword L69 removed though</technical_language>

Target:
public void collideCircles(Manifold manifold, CircleShape circle1, Transform xfA, CircleShape circle2, Transform xfB) { manifold.pointCount = 0; Vec2 circle1p = circle1.center; Vec2 circle2p = circle2.center; float pAx = (xfA.q.c * circle1p.x - xfA.q.s * circle1p.y) + xfA.p.x; float pAy = (xfA.q.s * circle1p.x + xfA.q.c * circle1p.y) + xfA.p.y; float pBx = (xfB.q.c * circle2p.x - xfB.q.s * circle2p.y) + xfB.p.x; float pBy = xfB.q.s * circle2p.x + xfB.q.c * circle2p.y + xfB.p.y; float dx = pBx - pAx; float dy = pBy - pAy; float distSqr = dx * dx + dy * dy; final float radius = circle1.getRadius() + circle2.getRadius(); if (distSqr > radius * radius) { return; } manifold.type = ManifoldType.CIRCLES; manifold.localPoint.set(circle1p); manifold.localNormal.setZero(); manifold.pointCount = 1; manifold.points[0].localPoint.set(circle2p); manifold.points[0].id.zero(); }
Source:
<code>public void enableButtons(){ reviewImageFragments[0].enableButtons(); <START> } <END></code><technical_language>null check beneficial</technical_language>

Target:
public void enableButtons(){ if (reviewImageFragments != null) reviewImageFragments[0].enableButtons(); }
Source:
<code>public StateChannelTypeBuilderImpl(ChannelTypeUID channelTypeUID, String label, String itemType) { super(channelTypeUID, label); <START> this.itemType = itemType; <END> }</code><technical_language>Is empty itemType allowed</technical_language>

Target:
StateChannelTypeBuilderImpl(ChannelTypeUID channelTypeUID, String label, String itemType) { super(channelTypeUID, label); if (StringUtils.isEmpty(itemType)) { throw new IllegalArgumentException("Supported itemType for a ChannelType must not be empty."); } this.itemType = itemType; }
Source:
<code>public MultiRowResult() { <START> this.results = new ArrayList<R>(); <END> }</code><technical_language>ArrayLists great for random reads, great for appending. I deafult allocates a length 10 array, reallocates copies data limit is hit. Feels a LinkedList work iterate it, right? Practically though, if difference is measurable</technical_language>

Target:
public MultiRowResult() { this.results = new LinkedList<R>(); }
Source:
<code>private BitSet getPatternsTouchedForStops(RaptorState state, int[] index) { BitSet patternsTouched = new BitSet(); for (int stop = state.bestStopsTouched.nextSetBit(0); stop >= 0; stop = state.bestStopsTouched.nextSetBit(stop + 1)) { final int finalStop = stop; transit.patternsForStop.get(stop).forEach(originalPattern -> { int filteredPattern = index[originalPattern]; <START> <END> int sourcePatternIndex = state.previousStop[finalStop] == -1 ? state.previousPatterns[finalStop] : state.previousPatterns[state.previousStop[finalStop]]; if (filteredPattern > -1 && sourcePatternIndex != originalPattern) { patternsTouched.set(filteredPattern); } return true; }); } return patternsTouched; }</code><technical_language>able return true immediately filteredPattern < 0, simplifying conditional below, avoiding sourcePatternIndex computation, making clearer iteration is skipped over</technical_language>

Target:
private BitSet getPatternsTouchedForStops(RaptorState state, int[] index) { BitSet patternsTouched = new BitSet(); for (int stop = state.bestStopsTouched.nextSetBit(0); stop >= 0; stop = state.bestStopsTouched.nextSetBit(stop + 1)) { final int finalStop = stop; transit.patternsForStop.get(stop).forEach(originalPattern -> { int filteredPattern = index[originalPattern]; if (filteredPattern < 0) { return true; } int sourcePatternIndex = state.previousStop[finalStop] == -1 ? state.previousPatterns[finalStop] : state.previousPatterns[state.previousStop[finalStop]]; if (sourcePatternIndex != originalPattern) { patternsTouched.set(filteredPattern); } return true; }); } return patternsTouched; }
Source:
<code>void nextPage() { currentPage++; <START> DataResultViewerTable.this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); <END> postPageChangeEvent(); DataResultViewerTable.this.setCursor(null); }</code><technical_language>is this included in this PR</technical_language>

Target:
void nextPage() { currentPage++; postPageChangeEvent(); }
Source:
<code>private Matcher matcher(String uri) { uri = filterQueryParams(uri); Matcher m = matchers.get(uri); if (null == m) { m = uriPattern.matcher(uri); synchronized (matchers) { <START> matchers.put(uri, m); <END> } } return m; }</code><technical_language>a concurrenthashmap</technical_language>

Target:
private Matcher matcher(String uri) { final String foundUri = filterQueryParams(uri); return matchers.computeIfAbsent(uri, __ -> uriPattern.matcher(foundUri)); }
Source:
<code>public static void finite(final double value, final String message, final Object... values) { <START> if (value != value || Double.isInfinite(value)) { <END> throw new IllegalArgumentException(String.format(message, values)); } }</code><technical_language>Double.isNaN(double) ;)</technical_language>

Target:
public static void finite(final double value, final String message, final Object... values) { if (Double.isNaN(value) || Double.isInfinite(value)) { throw new IllegalArgumentException(String.format(message, values)); } }
Source:
<code>public static TimestampDatum createTimestamp(Datum datum, @Nullable TimeZone tz) { switch (datum.type()) { case CHAR: case VARCHAR: case TEXT: return parseTimestamp(datum.asChars(), tz); case TIMESTAMP: return (TimestampDatum) datum; default: <START> throw new TajoRuntimeException(Errors.ResultCode.INVALID_CAST, datum.type().name(), Type.TIMESTAMP.name()); <END> } }</code><technical_language>new TajoRuntimeException(new InvalidCastException(...)</technical_language>

Target:
public static TimestampDatum createTimestamp(Datum datum, @Nullable TimeZone tz) { switch (datum.type()) { case CHAR: case VARCHAR: case TEXT: return parseTimestamp(datum.asChars(), tz); case TIMESTAMP: return (TimestampDatum) datum; default: throw new TajoRuntimeException(new InvalidCastException(datum.type(), Type.TIMESTAMP)); } }
Source:
<code>public Search drillDown(String fieldName, String fieldValue) { assertNotEmpty(fieldName, "fieldName"); assertNotEmpty(fieldValue, "fieldValue"); JsonArray drillDownArray = new JsonArray(); JsonPrimitive fieldNamePrimitive = new JsonPrimitive(fieldName); drillDownArray.add(fieldNamePrimitive); JsonPrimitive fieldValuePrimitive = new JsonPrimitive(fieldValue); drillDownArray.add(fieldValuePrimitive); <START> uriBuilder.query("drilldown", drillDownArray); <END> return this; }</code><technical_language>drilldown multiple times, previous code incorrect in this regard. uriBuilder.query("drilldown", drillDownArray, false) replace parameter. guessing this impacted #167 though. is worth moving this out another issue is a bit unrelated</technical_language>

Target:
public Search drillDown(String fieldName, String fieldValue) { assertNotEmpty(fieldName, "fieldName"); assertNotEmpty(fieldValue, "fieldValue"); JsonArray drillDownArray = new JsonArray(); JsonPrimitive fieldNamePrimitive = new JsonPrimitive(fieldName); drillDownArray.add(fieldNamePrimitive); JsonPrimitive fieldValuePrimitive = new JsonPrimitive(fieldValue); drillDownArray.add(fieldValuePrimitive); databaseHelper.query("drilldown", drillDownArray); return this; }
Source:
<code>private void setUpSourceJars(JavaLibraryBuildRequest build) throws IOException { Path sourcesDir = build.getTempDir(); cleanupDirectory(sourcesDir); if (build.getSourceJars().isEmpty()) { return; } final ByteArrayOutputStream protobufMetadataBuffer = new ByteArrayOutputStream(); for (Path sourceJar : build.getSourceJars()) { for (Path root : getJarFileSystem(sourceJar).getRootDirectories()) { Files.walkFileTree( root, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(Path path, BasicFileAttributes attrs) throws IOException { String fileName = path.getFileName().toString(); if (fileName.endsWith(".java")) { build.getSourceFiles().add(path); } else if (fileName.equals(PROTOBUF_META_NAME)) { Files.copy(path, protobufMetadataBuffer); } return FileVisitResult.CONTINUE; } }); } } Path output = build.getClassDir().resolve(PROTOBUF_META_NAME); if (protobufMetadataBuffer.size() > 0) { try (OutputStream outputStream = Files.newOutputStream(output)) { protobufMetadataBuffer.writeTo(outputStream); <START> outputStream.close(); <END> } } else if (Files.exists(output)) { Files.delete(output); } }</code><technical_language>try-with-resources close output stream, is this necessary</technical_language>

Target:
private void setUpSourceJars(JavaLibraryBuildRequest build) throws IOException { Path sourcesDir = build.getTempDir(); cleanupDirectory(sourcesDir); if (build.getSourceJars().isEmpty()) { return; } final ByteArrayOutputStream protobufMetadataBuffer = new ByteArrayOutputStream(); for (Path sourceJar : build.getSourceJars()) { for (Path root : getJarFileSystem(sourceJar).getRootDirectories()) { Files.walkFileTree( root, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(Path path, BasicFileAttributes attrs) throws IOException { String fileName = path.getFileName().toString(); if (fileName.endsWith(".java")) { build.getSourceFiles().add(path); } else if (fileName.equals(PROTOBUF_META_NAME)) { Files.copy(path, protobufMetadataBuffer); } return FileVisitResult.CONTINUE; } }); } } Path output = build.getClassDir().resolve(PROTOBUF_META_NAME); if (protobufMetadataBuffer.size() > 0) { try (OutputStream outputStream = Files.newOutputStream(output)) { protobufMetadataBuffer.writeTo(outputStream); } } else if (Files.exists(output)) { Files.delete(output); } }
Source:
<code>private void readProperties() { prop = new Properties(); <START> InputStream inputStream = getClass().getClassLoader().getResourceAsStream(PROPERTIES); <END> if (inputStream != null) { try { prop.load(inputStream); } catch (IOException e) { new ExceptionDialog(e, "Error reading properties"); } } }</code><technical_language>This stream created [try-with-resources](<LINK_0></technical_language>

Target:
private void readProperties() { prop = new Properties(); try (InputStream in = getClass().getClassLoader().getResourceAsStream(PROPERTIES)) { prop.load(in); } catch (IOException e) { new ExceptionDialog(parent, e, "Error reading properties."); } }
Source:
<code>private Set<List<Project.NameKey>> computeAncestorLines() { final Set<List<Project.NameKey>> lines = <START> new HashSet<List<Project.NameKey>>(); <END> if (project.getParents() == null || project.getParents().size() == 0) { final List<Project.NameKey> line = new LinkedList(); line.add(getProject().getNameKey()); line.add(wildProject); lines.add(line); } else { for (final Project.NameKey p: project.getParents()) { final ProjectState s = projectCache.get(p); if (s != null) { final Set<List<Project.NameKey>> subLines = s.getAncestorLines(); for (final List<Project.NameKey> l: subLines) { final List<Project.NameKey> line = new LinkedList(l); line.add(0, getProject().getNameKey()); lines.add(line); } } } } return Collections.unmodifiableSet(lines); }</code><technical_language>Ordering is unpredictable. matter? might. I guess is OK it, database model store ordering. I if predictable sorting project name</technical_language>

Target:
private Set<List<Project.NameKey>> computeAncestorLines() { final Set<List<Project.NameKey>> lines = new HashSet<List<Project.NameKey>>(); if (getParents() == null || getParents().size() == 0) { final List<Project.NameKey> line = new LinkedList(); line.add(getProject().getNameKey()); line.add(wildProject); lines.add(line); } else { for (final Project.NameKey p: getParents()) { final ProjectState s = projectCache.get(p); if (s != null) { final Set<List<Project.NameKey>> subLines = s.getAncestorLines(); for (final List<Project.NameKey> l: subLines) { final List<Project.NameKey> line = new LinkedList(l); line.add(0, getProject().getNameKey()); lines.add(line); } } } } return Collections.unmodifiableSet(lines); }
Source:
<code>public void testSendPingMessageQueue() throws IOException, InterruptedException { this.manager.pingMessageQueue( "TEST", 0L ); List<Message> sentMessages = this.msgClient.sentMessages; <START> Assert.assertTrue( sentMessages.size() == 1 ); <END> Message message = sentMessages.get( 0 ); Assert.assertTrue( message instanceof MsgEcho ); MsgEcho echo = (MsgEcho) message; Assert.assertTrue( echo.getContent().equals( "TEST" ) ); }</code><technical_language>Assert.assertEquals instead</technical_language>

Target:
public void testSendPingMessageQueue() throws IOException, InterruptedException { this.manager.pingMessageQueue( "TEST", 0L ); List<Message> sentMessages = this.msgClient.sentMessages; Assert.assertEquals( 1, sentMessages.size()); Message message = sentMessages.get( 0 ); Assert.assertTrue( message instanceof MsgEcho ); MsgEcho echo = (MsgEcho) message; Assert.assertEquals( "TEST", echo.getContent() ); }
Source:
<code>public String toString() { <START> return new StringBuilder(128) <END> .append(StringUtil.simpleClassName(this)) .append("(type: ").append(type()) .append(", typeByteValue: ").append(typeByteValue()) .append(", client: ").append(client()) .append(", verify: ").append(verify()) .append(", numEncapsulatedTlvs: ").append(tlvs.size()) .append(')').toString(); }</code><technical_language>normal string concats..</technical_language>

Target:
public String toString() { return StringUtil.simpleClassName(this) + "(type: " + type() + ", typeByteValue: " + typeByteValue() + ", client: " + client() + ", verify: " + verify() + ", numEncapsulatedTlvs: " + tlvs.size() + ')'; }
Source:
<code>public void testRead() throws IOException { fixedLengthInputStream = new FixedLengthInputStream(new ByteArrayInputStream(string.getBytes()), LENGTH_LIMIT1); final int INDEX = 888; final int ARRAY_LEN = 10000; <START> fixedLengthInputStream.read(new byte[ARRAY_LEN], 0, INDEX); <END> int b = fixedLengthInputStream.read(); Assert.assertEquals(b, string.charAt(INDEX)); }</code><technical_language>Again, this guarantee INDEX bytes read. recommendation is okio reliably skip X bytes</technical_language>

Target:
public void testRead() throws IOException { FixedLengthInputStream fixedLengthInputStream = new FixedLengthInputStream(inputStream, UNDERSIZED_LIMIT); fixedLengthInputStream.skip(100); int b = fixedLengthInputStream.read(); assertEquals(string.charAt(100), b); }
Source:
<code>public String toString() { StringBuilder sb = new StringBuilder(); boolean first = true; for (Map.Entry<String, String> entry : parameters.entrySet()) { if (first) { sb.append(AbfsHttpConstants.QUESTION_MARK); first = false; } else { sb.append(AbfsHttpConstants.AND_MARK); } try { sb.append(entry.getKey()).append(AbfsHttpConstants.EQUAL).append(AbfsClient.urlEncode(entry.getValue())); } catch (AzureBlobFileSystemException ex) { throw new IllegalArgumentException("Query string param is not encode-able: " + entry.getKey() + "=" + entry.getValue()); } } if (sasToken != null) { sasToken = <START> sasToken.startsWith(AbfsHttpConstants.QUESTION_MARK) ? <END> sasToken.substring(1) : sasToken; if (first) { sb.append(AbfsHttpConstants.QUESTION_MARK); } else { sb.append(AbfsHttpConstants.AND_MARK); } sb.append(sasToken); } return sb.toString(); }</code><technical_language>style nit, preferred layout is predicate ? res1; : res2;</technical_language>

Target:
public String toString() { StringBuilder sb = new StringBuilder(); boolean first = true; for (Map.Entry<String, String> entry : parameters.entrySet()) { if (first) { sb.append(AbfsHttpConstants.QUESTION_MARK); first = false; } else { sb.append(AbfsHttpConstants.AND_MARK); } try { sb.append(entry.getKey()).append(AbfsHttpConstants.EQUAL).append(AbfsClient.urlEncode(entry.getValue())); } catch (AzureBlobFileSystemException ex) { throw new IllegalArgumentException("Query string param is not encode-able: " + entry.getKey() + "=" + entry.getValue()); } } if (sasToken != null) { if (first) { sb.append(AbfsHttpConstants.QUESTION_MARK); } else { sb.append(AbfsHttpConstants.AND_MARK); } sb.append(sasToken); } return sb.toString(); }
Source:
<code>public int hashCode() { <START> return new Double(this.resolution).hashCode() + <END> 31 * this.unit.hashCode(); }</code><technical_language>public static int hashCode(double value)</technical_language>

Target:
public int hashCode() { int result; long temp; temp = Double.doubleToLongBits(this.resolution); result = (int) (temp ^ (temp >>> 32)); result = 31 * result + (this.unit != null ? this.unit.hashCode() : 0); return result; }
Source:
<code>public @ResponseBody void registerSubmit( @RequestParam(value = "name") String name, @RequestParam(value = "username") String username, @RequestParam(value = "password") String password) { PlayerDao playerDao = new PlayerDao(); String genPassword = StringUtils.secureString(password); Player newPlayer = new Player(name, username, genPassword); <START> System.out.println(newPlayer.toString()); <END> playerDao.savePlayer(newPlayer); }</code><technical_language>remove this logging statement</technical_language>

Target:
public @ResponseBody void registerSubmit( @RequestParam(value = "name") String name, @RequestParam(value = "username") String username, @RequestParam(value = "password") String password) { PlayerDao playerDao = new PlayerDao(); String genPassword = StringUtils.secureString(password); Player newPlayer = new Player(name, username, genPassword); playerDao.savePlayer(newPlayer); }
Source:
<code>protected final HashMap<String, Object> doInBackground(ArrayList<DriveListItem>... params) { HashMap<String, Object> results = new HashMap<>(); ArrayList<DriveListItem> fileItems = params[0]; for (int k = 0; k < fileItems.size(); k++) { DriveListItem fileItem = fileItems.get(k); try { downloadFile(fileItem.getDriveId(), fileItem.getName()); results.put(fileItem.getName(), Collect.getInstance().getString(R.string.success)); String mediaDirName = FileUtils.constructMediaPath(fileItem.getName()); List<com.google.api.services.drive.model.File> mediaFileList; try { mediaFileList = getMediaFiles(fileItem); } catch (MultipleFoldersFoundException exception) { results.put(fileItem.getName(), getString(R.string.multiple_media_folders_detected_notification)); return results; } if (mediaFileList != null) { <START> FileUtils.createFolder(new StoragePathProvider().getDirPath(StorageSubdirectory.FORMS) + File.separator + mediaDirName); <END> for (com.google.api.services.drive.model.File mediaFile : mediaFileList) { String filePath = mediaDirName + File.separator + mediaFile.getName(); downloadFile(mediaFile.getId(), filePath); results.put(filePath, Collect.getInstance().getString(R.string.success)); } } } catch (Exception e) { Timber.e(e); results.put(fileItem.getName(), e.getMessage()); return results; } } return results; }</code><technical_language>Please check entire file injected storagePathProvider instead of new StoragePathProvider() here</technical_language>

Target:
protected final HashMap<String, Object> doInBackground(ArrayList<DriveListItem>... params) { HashMap<String, Object> results = new HashMap<>(); ArrayList<DriveListItem> fileItems = params[0]; for (int k = 0; k < fileItems.size(); k++) { DriveListItem fileItem = fileItems.get(k); try { downloadFile(fileItem.getDriveId(), fileItem.getName()); results.put(fileItem.getName(), Collect.getInstance().getString(R.string.success)); String mediaDirName = FileUtils.constructMediaPath(fileItem.getName()); List<com.google.api.services.drive.model.File> mediaFileList; try { mediaFileList = getMediaFiles(fileItem); } catch (MultipleFoldersFoundException exception) { results.put(fileItem.getName(), getString(R.string.multiple_media_folders_detected_notification)); return results; } if (mediaFileList != null) { FileUtils.createFolder(storagePathProvider.getDirPath(StorageSubdirectory.FORMS) + File.separator + mediaDirName); for (com.google.api.services.drive.model.File mediaFile : mediaFileList) { String filePath = mediaDirName + File.separator + mediaFile.getName(); downloadFile(mediaFile.getId(), filePath); results.put(filePath, Collect.getInstance().getString(R.string.success)); } } } catch (Exception e) { Timber.e(e); results.put(fileItem.getName(), e.getMessage()); return results; } } return results; }
Source:
<code>public static void copyVmDevices(Guid srcId, Guid dstId) { Guid id; <START> VmBase VmBase = DbFacade.getInstance().getVmStaticDAO().get(dstId); <END> List<image_vm_map> disks = DbFacade.getInstance().getImageVmMapDAO().getByVmId(dstId); List<VmNetworkInterface> ifaces; int diskCount=0; int ifaceCount=0; boolean isVm = (VmBase != null); if (isVm) { ifaces = DbFacade.getInstance().getVmNetworkInterfaceDAO().getAllForVm(dstId); } else { ifaces = DbFacade.getInstance().getVmNetworkInterfaceDAO().getAllForTemplate(dstId); } List<VmDevice> devices = dao.getVmDeviceByVmId(srcId); for (VmDevice device : devices) { id = Guid.NewGuid(); if (srcId.equals(Guid.Empty)) { if (VmBase.getvm_type() == VmType.Desktop) { updateNumOfMonitorsInVmDevice(null, VmBase); } continue; } if (device.getType().equalsIgnoreCase(VmDeviceType.DISK.name()) && device.getDevice().equalsIgnoreCase(VmDeviceType.DISK.name())) { if (diskCount < disks.size()) { id = DbFacade.getInstance().getDiskImageDAO().get(disks.get(diskCount++).getimage_id()).getimage_group_id(); } } else if (device.getType().equalsIgnoreCase(VmDeviceType.INTERFACE.name())) { if (ifaceCount < ifaces.size()) { id = ifaces.get(ifaceCount++).getId(); } } device.setId(new VmDeviceId(id, dstId)); dao.save(device); } if (isVm) { updateBootOrderInVmDevice(VmBase); } }</code><technical_language>retrieve disks for vm</technical_language>

Target:
public static void copyVmDevices(Guid srcId, Guid dstId) { Guid id; VmBase VmBase = DbFacade.getInstance().getVmStaticDAO().get(dstId); List<DiskImage> disks = DbFacade.getInstance().getDiskImageDAO().getAllForVm(dstId); List<VmNetworkInterface> ifaces; int diskCount=0; int ifaceCount=0; boolean isVm = (VmBase != null); if (isVm) { ifaces = DbFacade.getInstance().getVmNetworkInterfaceDAO().getAllForVm(dstId); } else { ifaces = DbFacade.getInstance().getVmNetworkInterfaceDAO().getAllForTemplate(dstId); } List<VmDevice> devices = dao.getVmDeviceByVmId(srcId); for (VmDevice device : devices) { id = Guid.NewGuid(); if (srcId.equals(Guid.Empty)) { if (VmBase.getvm_type() == VmType.Desktop) { updateNumOfMonitorsInVmDevice(null, VmBase); } continue; } if (device.getType().equalsIgnoreCase(VmDeviceType.DISK.name()) && device.getDevice().equalsIgnoreCase(VmDeviceType.DISK.name())) { if (diskCount < disks.size()) { id = (disks.get(diskCount++)).getimage_group_id(); } } else if (device.getType().equalsIgnoreCase(VmDeviceType.INTERFACE.name())) { if (ifaceCount < ifaces.size()) { id = ifaces.get(ifaceCount++).getId(); } } device.setId(new VmDeviceId(id, dstId)); dao.save(device); } if (isVm) { updateBootOrderInVmDevice(VmBase); } }
Source:
<code>public Result apply(AggregationNode node, Captures captures, Context context) { if (!node.hasOrderings()) { return Result.empty(); } boolean anyRewritten = false; ImmutableMap.Builder<Symbol, Aggregation> aggregations = ImmutableMap.builder(); for (Map.Entry<Symbol, Aggregation> entry : node.getAggregations().entrySet()) { Aggregation aggregation = entry.getValue(); if (!aggregation.getOrderBy().isPresent()) { aggregations.put(entry); } else if (functionManager.getAggregateFunctionImplementation(aggregation.getFunctionHandle()).isOrderSensitive()) { aggregations.put(entry); } else { anyRewritten = true; aggregations.put(entry.getKey(), new Aggregation( aggregation.getCall(), aggregation.getFilter(), Optional.empty(), <START> aggregation.isDistinct(), aggregation.getMask())); <END> } } if (!anyRewritten) { return Result.empty(); } return Result.ofPlanNode(new AggregationNode( node.getId(), node.getSource(), aggregations.build(), node.getGroupingSets(), node.getPreGroupedSymbols(), node.getStep(), node.getHashSymbol(), node.getGroupIdSymbol())); }</code><technical_language>param a line</technical_language>

Target:
public Result apply(AggregationNode node, Captures captures, Context context) { if (!node.hasOrderings()) { return Result.empty(); } boolean anyRewritten = false; ImmutableMap.Builder<VariableReferenceExpression, Aggregation> aggregations = ImmutableMap.builder(); for (Map.Entry<VariableReferenceExpression, Aggregation> entry : node.getAggregations().entrySet()) { Aggregation aggregation = entry.getValue(); if (!aggregation.getOrderBy().isPresent()) { aggregations.put(entry); } else if (functionManager.getAggregateFunctionImplementation(aggregation.getFunctionHandle()).isOrderSensitive()) { aggregations.put(entry); } else { anyRewritten = true; aggregations.put(entry.getKey(), new Aggregation( aggregation.getCall(), aggregation.getFilter(), Optional.empty(), aggregation.isDistinct(), aggregation.getMask())); } } if (!anyRewritten) { return Result.empty(); } return Result.ofPlanNode(new AggregationNode( node.getId(), node.getSource(), aggregations.build(), node.getGroupingSets(), node.getPreGroupedVariables(), node.getStep(), node.getHashVariable(), node.getGroupIdVariable())); }
Source:
<code>public void waitForConfirmationModalAndClickOk() { <START> waitForAndDismissAlertModal(); <END> }</code><technical_language>put content of waitForAndDismissAlertModal here, function call this instead. "click OK dismiss" relationship more sense compared "dismiss click OK"</technical_language>

Target:
public void waitForConfirmationModalAndClickOk() { waitForModalPresence(); WebElement okayButton = browser.driver.findElement(By.className("modal-btn-ok")); waitForElementToBeClickable(okayButton); okayButton.click(); waitForModalToDisappear(); }
Source:
<code>private void pathChanged() { updateTrack(); <START> lv.setAdapter(lv.getAdapter()); <END> }</code><technical_language>a hack indeed. a trigger a refresh of list view... (but I hand sorry)</technical_language>

Target:
private void pathChanged() { updateTrack(); if (adapter != null) adapter.notifyDataSetChanged(); }
Source:
<code>private void received(final String json) { try { LOGGER.finest("Receiving: " + json); final Object o = fromJSON(json); if (o instanceof WebWorkerLogMessage) { LOGGER.info("Web Worker log message: " + ((WebWorkerLogMessage) o).getMessage()); } else if (o instanceof WebWorkerException) { LOGGER.severe("Web Worker failed: " + ((WebWorkerException) o).getMessage()); shutdown(); <START> reporter.shutdownOnFailure(); <END> } else if (o instanceof Status) { reporter.sendStatus((Status) o); } else if (o instanceof Issues) { reporter.sendReport(new HashSet<>(((Issues) o).getSet())); } } catch (Exception e) { LOGGER.severe("Could not manage received json: " + e.getMessage() + " JSON: " + json); } }</code><technical_language>I add new method AnalysisReporter, call existing public sendReport do line 65, WDYT</technical_language>

Target:
private void received(final String json) { try { LOGGER.finest("Receiving: " + json); final Object o = fromJSON(json); if (o instanceof WebWorkerLogMessage) { LOGGER.info("Web Worker log message: " + ((WebWorkerLogMessage) o).getMessage()); } else if (o instanceof WebWorkerException) { LOGGER.severe("Web Worker failed: " + ((WebWorkerException) o).getMessage()); shutdown(); } else if (o instanceof Status) { reporter.sendStatus((Status) o); } else if (o instanceof Issues) { reporter.sendReport(new HashSet<>(((Issues) o).getSet())); } } catch (Exception e) { LOGGER.severe("Could not manage received json: " + e.getMessage() + " JSON: " + json); } }
Source:
<code>private boolean simpleMatch(String path, boolean assumeDirectory) { boolean hasSlash = path.indexOf(slash) == 0; if (beginning && !hasSlash) path = slash + path; if (!beginning && hasSlash) path = path.substring(1); if (path.equals(pattern)) if (dirOnly && !assumeDirectory) return false; else return true; if (path.startsWith(pattern + "/")) <START> return true; <END> return false; }</code><technical_language>"/" a variable/constant..</technical_language>

Target:
private boolean simpleMatch(String path, boolean assumeDirectory) { boolean hasSlash = path.indexOf(slash) == 0; if (beginning && !hasSlash) path = slash + path; if (!beginning && hasSlash) path = path.substring(1); if (path.equals(pattern)) if (dirOnly && !assumeDirectory) return false; else return true; if (path.startsWith(pattern + FastIgnoreRule.PATH_SEPARATOR)) return true; return false; }
Source:
<code>private byte[] getParticipantObjectQueryForRequest(AdhocQueryRequest request) throws JAXBException { <START> StringWriter sw = new StringWriter(); <END> if (request != null) { getMarshaller().marshal(request, sw); return sw.toString().getBytes(); } return null; }</code><technical_language>a ByteArrayOutputStream for other services (e.g., PD) -- reason a StringWriter here</technical_language>

Target:
private byte[] getParticipantObjectQueryForRequest(AdhocQueryRequest request) throws JAXBException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); if (request != null) { getMarshaller().marshal(request, baos); return baos.toByteArray(); } return null; }
Source:
<code>public static <SRC> KryoCloneUtils<SRC> createCloneUtils(SRC template) { <START> return new KryoCloneUtils<SRC>(new Kryo(), template); <END> }</code><technical_language>Delegate createCloneUtils(Kryo kryo, ...)</technical_language>

Target:
public static <SRC> KryoCloneUtils<SRC> createCloneUtils(SRC template) { return createCloneUtils(new Kryo(), template); }
Source:
<code>public void onResume() { super.onResume(); AccountManager manager = AccountManager.get(getActivity()); final Account account = manager.getAccountsByType(Constants.ACCOUNT_TYPE)[0]; initializeSyncCheckBox( (SwitchPreference) findPreference(Constants.Pref.SYNC_KEYSERVER), account, Constants.PROVIDER_AUTHORITY ); initializeSyncCheckBox( (SwitchPreference) findPreference(Constants.Pref.SYNC_CONTACTS), account, ContactsContract.AUTHORITY ); <START> SwitchPreference pref = (SwitchPreference) findPreference(Constants.Pref.ENABLE_WIFI_SYNC_ONLY); <END> pref.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { @Override public boolean onPreferenceChange(Preference preference, Object newValue) { Preferences prefs = Preferences.getPreferences(getContext()); prefs.setWifiOnlySync((Boolean) newValue); return true; } }); }</code><technical_language>entire onPreferenceChangeListener avoided set android:persistent=true</technical_language>

Target:
public void onResume() { super.onResume(); AccountManager manager = AccountManager.get(getActivity()); final Account account = manager.getAccountsByType(Constants.ACCOUNT_TYPE)[0]; initializeSyncCheckBox( (SwitchPreference) findPreference(Constants.Pref.SYNC_KEYSERVER), account, Constants.PROVIDER_AUTHORITY ); initializeSyncCheckBox( (SwitchPreference) findPreference(Constants.Pref.SYNC_CONTACTS), account, ContactsContract.AUTHORITY ); }
Source:
<code>public Object getDisplayValue(String object) { if(object.equalsIgnoreCase("Stats")){ <START> return "Statistics"; <END> } else if(object.equalsIgnoreCase("operationConst")){ return "Math operations with Constant"; }else if(object.equalsIgnoreCase("algebric")){ return "Math operations"; }else { return object; } }</code><technical_language>internationalized</technical_language>

Target:
public Object getDisplayValue(String object) { if(object.equalsIgnoreCase(STATS)){ return new ParamResourceModel("JAIEXTPanel." + STATS, null, "").getString(); } else if(object.equalsIgnoreCase(OPERATION_CONST)){ return new ParamResourceModel("JAIEXTPanel." + OPERATION_CONST, null, "").getString(); }else if(object.equalsIgnoreCase(ALGEBRIC)){ return new ParamResourceModel("JAIEXTPanel." + ALGEBRIC, null, "").getString(); }else { return object; } }
Source:
<code>public void done(boolean success) throws MailQueueException { mailQueueItem.done(success); if (success && mandatoryJmapMetaDataIsPresent()) { MessageId messageId = messageIdFactory.fromString((String) getMail().getAttribute(MailMetadata.MAIL_METADATA_MESSAGE_ID_ATTRIBUTE)); String username = (String) getMail().getAttribute(MailMetadata.MAIL_METADATA_USERNAME_ATTRIBUTE); if (getMail().getAttribute(IS_DELIVERED) == null) { try { MailboxSession mailboxSession = mailboxManager.createSystemSession(username); moveFromOutboxToSent(messageId, mailboxSession); getMail().setAttribute(IS_DELIVERED, IS_DELIVERED); } catch (MailShouldBeInOutboxException e) { <START> LOG.info("Message does not exist on Outbox anymore, it could have already been sent {}", e.toString()); <END> } catch (MailboxException e) { throw new MailQueueException(e.getMessage(), e); } } } }</code><technical_language>do add "toString()"</technical_language>

Target:
public void done(boolean success) throws MailQueueException { mailQueueItem.done(success); if (success && mandatoryJmapMetaDataIsPresent()) { MessageId messageId = messageIdFactory.fromString((String) getMail().getAttribute(MailMetadata.MAIL_METADATA_MESSAGE_ID_ATTRIBUTE)); String username = (String) getMail().getAttribute(MailMetadata.MAIL_METADATA_USERNAME_ATTRIBUTE); if (getMail().getAttribute(IS_DELIVERED) == null) { try { MailboxSession mailboxSession = mailboxManager.createSystemSession(username); moveFromOutboxToSentWithSeenFlag(messageId, mailboxSession); getMail().setAttribute(IS_DELIVERED, IS_DELIVERED); } catch (MailShouldBeInOutboxException e) { LOG.info("Message does not exist on Outbox anymore, it could have already been sent", e); } catch (MailboxException e) { throw new MailQueueException(e.getMessage(), e); } } } }
Source:
<code>public <START> int getMaxSeverityIncludingNestedProjects(IResource <END> resource) { return cache.getOrDefault(resource, 0).intValue(); }</code><technical_language>nice add @return kind of values expected</technical_language>

Target:
public Integer getMaxSeverityIncludingNestedProjects(IResource resource) { return cache.getOrDefault(resource, -1).intValue(); }