auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void addVersionRead(Object key, EntryVersion version) { if (version == null) { return; } if (versionsSeenMap == null) { versionsSeenMap = new EntryVersionsMap(); } if (!versionsSeenMap.containsKey(key)) { if (trace) { log.tracef("Transaction %s read %s with version %s", getGlobalTransaction().globalId(), key, version); } versionsSeenMap.put(key, (IncrementableEntryVersion) version); } else { if (trace) { log.tracef("Ignoring version read %s as already contains %s", version, versionsSeenMap.get(key)); } } }

Target:
public void addVersionRead(Object key, EntryVersion version) { if (version == null) { return; } if (versionsSeenMap == null) { versionsSeenMap = new EntryVersionsMap(); } Object prevVersion = versionsSeenMap.putIfAbsent(key, (IncrementableEntryVersion) version); if (trace) { if (prevVersion == null) { log.tracef("Transaction %s read %s with version %s", getGlobalTransaction().globalId(), key, version); } else { log.tracef("Ignoring version read %s as already contains %s", version, prevVersion); } } }
Source:
public RoutingSlipHeaderValueMessageProcessor(String... routingSlipPath) { Assert.noNullElements(routingSlipPath); this.routingSlipPath = Arrays.asList(routingSlipPath); }

Target:
public RoutingSlipHeaderValueMessageProcessor(String... routingSlipPath) { Assert.notNull(routingSlipPath); Assert.noNullElements(routingSlipPath); this.routingSlipPath = Arrays.asList(routingSlipPath); }
Source:
public final void request(long n) { if (n == 0) { return; } boolean mayDrain; long r; long u; do { r = requestedCount; mayDrain = r == 0; if (r == Long.MAX_VALUE) { mayDrain = true; break; } if (n == Long.MAX_VALUE) { u = n; mayDrain = true; } else { u = r + n; } } while (!REQUESTED_COUNT.compareAndSet(this, r, u)); if (mayDrain) { drain(); } }

Target:
public final void request(long n) { if (n == 0) { return; } boolean mayDrain; long r; long u; do { r = requestedCount; mayDrain = r == 0; if (r == Long.MAX_VALUE) { break; } if (n == Long.MAX_VALUE) { u = n; mayDrain = true; } else { if (r > Long.MAX_VALUE - n) { u = Long.MAX_VALUE; } else { u = r + n; } } } while (!REQUESTED_COUNT.compareAndSet(this, r, u)); if (mayDrain) { drain(); } }
Source:
private SavedState(Parcel in) { super(in); in.readList(mIds, List.class.getClassLoader()); }

Target:
SavedState(Parcel in) { super(in); in.readList(mIds, List.class.getClassLoader()); }
Source:
protected BackendOpenStackVolumeAuthenticationKeyResource(String providerId, String id) { super(id, OpenstackVolumeAuthenticationKey.class, LibvirtSecret.class); this.providerId = providerId; this.guid = asGuidOr404(id); }

Target:
protected BackendOpenStackVolumeAuthenticationKeyResource(String providerId, String id) { super(id, OpenstackVolumeAuthenticationKey.class, LibvirtSecret.class); this.providerId = providerId; }
Source:
public String getUrl(int requestId, CheckerInfo checkerInfo) { return URL.concat(checkerInfo.getCurrencyBaseLowerCase()) .concat("_") .concat(Currency.BRL.toLowerCase()); }

Target:
public String getUrl(int requestId, CheckerInfo checkerInfo) { return String.format(URL, checkerInfo.getCurrencyBaseLowerCase(), checkerInfo.getCurrencyCounterLowerCase()); }
Source:
private TableCellRenderer createCellRenderer(Class<?> columnClass) { if (Double.class.equals(columnClass)){ return new DecimalRenderer(); } else { return getTreeTable().getDefaultRenderer(columnClass); } }

Target:
private TableCellRenderer createCellRenderer(Class<?> columnClass) { return getTreeTable().getDefaultRenderer(columnClass); }
Source:
public TranslatedExpression<T> translate(FunctionMetadata functionMetadata, RowExpression original, List<TranslatedExpression<T>> translatedArguments) { if (!isFunctionPresent(functionMetadata)) { return untranslated(original); } try { return new TranslatedExpression<>(Optional.of((T) functionMapping.get(functionMetadata).invokeWithArguments(translatedArguments)), original, translatedArguments); } catch (Throwable t) { return untranslated(original); } }

Target:
public TranslatedExpression<T> translate(FunctionMetadata functionMetadata, RowExpression original, List<TranslatedExpression<T>> translatedArguments) throws Throwable { if (!functionMapping.containsKey(functionMetadata)) { return new TranslatedExpression<>(Optional.empty(), original, translatedArguments); } return new TranslatedExpression<>(Optional.of((T) functionMapping.get(functionMetadata).invokeWithArguments(translatedArguments)), original, translatedArguments); }
Source:
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.getCommitID() != null && workflowVersion.getCommitID().equals(workflowVersion.getCommitForJsonGeneration()) && 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); workflowVersion.setCommitForJsonGeneration(workflowVersion.getCommitID()); return toolTableJson; } return null; }

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:
private void startIconSpinningAnimation() { if (iconSpinningAnimator != null) { iconSpinningAnimator.cancel(); } iconSpinningAnimator = ValueAnimator.ofFloat(0, 360); iconSpinningAnimator.setDuration(DESIRED_SECONDS_PER_ONE_FULL_360_SPIN * 1000); 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(); }

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:
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(s -> true) .consistentHashChangeListener(consistentHashChangeListener) .build(); }

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:
public boolean equals(Object obj) { 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; }

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:
public SpecialAnonymizationUserPage submitAnonymization() { try { Thread.sleep(10000); } catch (Exception e) { } jsActions.scrollToElement(submitButton); submitButton.click(); return this; }

Target:
public SpecialAnonymizationUserPage submitAnonymization() { jsActions.scrollToElement(submitButton); submitButton.click(); return this; }
Source:
public void findsDoc() throws IOException { 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) ); }

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:
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 specified", 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); } }

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:
public GradientDescent withConvergenceTol(double convergenceTol) { if (convergenceTol < 0) throw new IllegalArgumentException("Convergence tolerance must be non-negative but got " + convergenceTol); this.convergenceTol = convergenceTol; return this; }

Target:
public GradientDescent withConvergenceTol(double convergenceTol) { assert convergenceTol >= 0; this.convergenceTol = convergenceTol; return this; }
Source:
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(testCacheEventListener,never()).onEvent(any(CacheEvent.class)); }

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:
public long getLastModified() throws IOException { File file = new File(super.getLocalePath()); if (file.exists()) { return file.lastModified(); } return 0; }

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

Target:
static void appendIndented(StringBuilder builder, String value) { for (String line : value.split("\n")) { builder.append(" ").append(line).append('\n'); } }
Source:
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(); }

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:
public void enableButtons(){ reviewImageFragments[0].enableButtons(); }

Target:
public void enableButtons(){ if (reviewImageFragments != null) reviewImageFragments[0].enableButtons(); }
Source:
public StateChannelTypeBuilderImpl(ChannelTypeUID channelTypeUID, String label, String itemType) { super(channelTypeUID, label); this.itemType = itemType; }

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:
public MultiRowResult() { this.results = new ArrayList<R>(); }

Target:
public MultiRowResult() { this.results = new LinkedList<R>(); }
Source:
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]; 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; }

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:
void nextPage() { currentPage++; DataResultViewerTable.this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); postPageChangeEvent(); DataResultViewerTable.this.setCursor(null); }

Target:
void nextPage() { currentPage++; postPageChangeEvent(); }
Source:
private Matcher matcher(String uri) { uri = filterQueryParams(uri); Matcher m = matchers.get(uri); if (null == m) { m = uriPattern.matcher(uri); synchronized (matchers) { matchers.put(uri, m); } } return m; }

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

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:
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(Errors.ResultCode.INVALID_CAST, datum.type().name(), Type.TIMESTAMP.name()); } }

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:
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); uriBuilder.query("drilldown", drillDownArray); return this; }

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:
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); outputStream.close(); } } else if (Files.exists(output)) { Files.delete(output); } }

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:
private void readProperties() { prop = new Properties(); InputStream inputStream = getClass().getClassLoader().getResourceAsStream(PROPERTIES); if (inputStream != null) { try { prop.load(inputStream); } catch (IOException e) { new ExceptionDialog(e, "Error reading properties"); } } }

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:
private Set<List<Project.NameKey>> computeAncestorLines() { final Set<List<Project.NameKey>> lines = new HashSet<List<Project.NameKey>>(); 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); }

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:
public void testSendPingMessageQueue() throws IOException, InterruptedException { this.manager.pingMessageQueue( "TEST", 0L ); List<Message> sentMessages = this.msgClient.sentMessages; Assert.assertTrue( sentMessages.size() == 1 ); Message message = sentMessages.get( 0 ); Assert.assertTrue( message instanceof MsgEcho ); MsgEcho echo = (MsgEcho) message; Assert.assertTrue( echo.getContent().equals( "TEST" ) ); }

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:
public String toString() { return new StringBuilder(128) .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(); }

Target:
public String toString() { return StringUtil.simpleClassName(this) + "(type: " + type() + ", typeByteValue: " + typeByteValue() + ", client: " + client() + ", verify: " + verify() + ", numEncapsulatedTlvs: " + tlvs.size() + ')'; }
Source:
public void testRead() throws IOException { fixedLengthInputStream = new FixedLengthInputStream(new ByteArrayInputStream(string.getBytes()), LENGTH_LIMIT1); final int INDEX = 888; final int ARRAY_LEN = 10000; fixedLengthInputStream.read(new byte[ARRAY_LEN], 0, INDEX); int b = fixedLengthInputStream.read(); Assert.assertEquals(b, string.charAt(INDEX)); }

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:
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 = sasToken.startsWith(AbfsHttpConstants.QUESTION_MARK) ? sasToken.substring(1) : sasToken; if (first) { sb.append(AbfsHttpConstants.QUESTION_MARK); } else { sb.append(AbfsHttpConstants.AND_MARK); } sb.append(sasToken); } return sb.toString(); }

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:
public int hashCode() { return new Double(this.resolution).hashCode() + 31 * this.unit.hashCode(); }

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:
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); System.out.println(newPlayer.toString()); playerDao.savePlayer(newPlayer); }

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:
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(new 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; }

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:
public static void copyVmDevices(Guid srcId, Guid dstId) { Guid id; VmBase VmBase = DbFacade.getInstance().getVmStaticDAO().get(dstId); 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); } }

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:
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(), aggregation.isDistinct(), aggregation.getMask())); } } 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())); }

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:
public void waitForConfirmationModalAndClickOk() { waitForAndDismissAlertModal(); }

Target:
public void waitForConfirmationModalAndClickOk() { waitForModalPresence(); WebElement okayButton = browser.driver.findElement(By.className("modal-btn-ok")); waitForElementToBeClickable(okayButton); okayButton.click(); waitForModalToDisappear(); }
Source:
private void pathChanged() { updateTrack(); lv.setAdapter(lv.getAdapter()); }

Target:
private void pathChanged() { updateTrack(); if (adapter != null) adapter.notifyDataSetChanged(); }
Source:
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(); reporter.shutdownOnFailure(); } 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); } }

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:
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 + "/")) return true; return false; }

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:
private byte[] getParticipantObjectQueryForRequest(AdhocQueryRequest request) throws JAXBException { StringWriter sw = new StringWriter(); if (request != null) { getMarshaller().marshal(request, sw); return sw.toString().getBytes(); } return null; }

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:
public static <SRC> KryoCloneUtils<SRC> createCloneUtils(SRC template) { return new KryoCloneUtils<SRC>(new Kryo(), template); }

Target:
public static <SRC> KryoCloneUtils<SRC> createCloneUtils(SRC template) { return createCloneUtils(new Kryo(), template); }
Source:
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 ); SwitchPreference pref = (SwitchPreference) findPreference(Constants.Pref.ENABLE_WIFI_SYNC_ONLY); pref.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { @Override public boolean onPreferenceChange(Preference preference, Object newValue) { Preferences prefs = Preferences.getPreferences(getContext()); prefs.setWifiOnlySync((Boolean) newValue); return true; } }); }

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:
public Object getDisplayValue(String object) { if(object.equalsIgnoreCase("Stats")){ return "Statistics"; } else if(object.equalsIgnoreCase("operationConst")){ return "Math operations with Constant"; }else if(object.equalsIgnoreCase("algebric")){ return "Math operations"; }else { return object; } }

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:
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) { LOG.info("Message does not exist on Outbox anymore, it could have already been sent {}", e.toString()); } catch (MailboxException e) { throw new MailQueueException(e.getMessage(), e); } } } }

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:
public int getMaxSeverityIncludingNestedProjects(IResource resource) { return cache.getOrDefault(resource, 0).intValue(); }

Target:
public Integer getMaxSeverityIncludingNestedProjects(IResource resource) { return cache.getOrDefault(resource, -1).intValue(); }
Source:
public void start() throws Exception { if (isStarted()) { return; } cleanupTemporaryFilesIfAnyBeforeStart(); server.start(); ActiveMQWebLogger.LOGGER.webserverStarted(webServerConfig.bind); if (consoleUrl != null) { ActiveMQWebLogger.LOGGER.jolokiaAvailable(consoleUrl + "/jolokia"); ActiveMQWebLogger.LOGGER.consoleAvailable(consoleUrl); } }

Target:
public void start() throws Exception { if (isStarted()) { return; } cleanupTmp(); server.start(); ActiveMQWebLogger.LOGGER.webserverStarted(webServerConfig.bind); if (consoleUrl != null) { ActiveMQWebLogger.LOGGER.jolokiaAvailable(consoleUrl + "/jolokia"); ActiveMQWebLogger.LOGGER.consoleAvailable(consoleUrl); } }
Source:
void applyMigration(I id, Migration<I, T, S> migration) { checkNotNull(id); checkNotNull(migration); checkEntityIsTransactional(); E entity = findOrThrow(id); migration.applyTo((T) entity, (RecordBasedRepository<I, T, S>) this); if (migration.physicallyRemoveRecord()) { delete(id); migration.finishCurrentOperation(); } else { store(entity); } }

Target:
void applyMigration(I id, Migration<I, T, S> migration) { checkNotNull(id); checkNotNull(migration); checkEntityIsTransactional(); E entity = findOrThrow(id); migration.applyTo((T) entity, (RecordBasedRepository<I, T, S>) this); if (migration.physicallyRemoveRecord()) { delete(id, migration); } else { store(entity); } migration.finishCurrentOperation(); }
Source:
void retrievePolicyForService(UUID serviceId) throws Throwable { ServicePolicy policy = client.getServicePolicy(serviceId); currentServicePolicyEntity = policy == null ? null : ServicePolicyEntity.fromServicePolicy(policy); }

Target:
void retrievePolicyForService(UUID serviceId) throws Throwable { ServicePolicy policy = client.getServicePolicy(serviceId); currentServicePolicyEntity = ServicePolicyEntity.fromServicePolicy(policy); }