auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
static public GaussianDistribution GetInferredDistribution(final GaussianDistribution prior, final double x, final double conjugate_prior_sigma, final double sigma_floor) { GaussianDistribution posterior = prior; switch (prior.model_type) { case RANDOM_MEAN: double variance = prior.sigma*prior.sigma; double conjugate_prior_variance = conjugate_prior_sigma * conjugate_prior_sigma; if (variance < k_minimum_variance) { variance = k_minimum_variance; } if (conjugate_prior_variance < k_minimum_conj_prior_variance) { conjugate_prior_variance = k_minimum_conj_prior_variance; } final double total_variance = conjugate_prior_variance + variance; final double w1 = variance / total_variance; final double w2 = conjugate_prior_variance / total_variance; final double conj_prior_information = 1.0 / conjugate_prior_variance; final double prior_information = 1.0 / variance; final double new_mean = w1 * x + w2 * prior.mean; final double new_variance = 1.0 / (conj_prior_information + prior_information); double new_sigma = Math.sqrt(new_variance); if (new_sigma < sigma_floor) { new_sigma = sigma_floor; } posterior = new GaussianDistribution(new_mean,new_sigma,prior.alpha,prior.beta,prior.model_type); break; case RANDOM_VARIANCE: break; case RANDOM_MEAN_AND_VARIANCE: break; } return posterior; }

Target:
static public GaussianDistribution GetInferredDistribution(final GaussianDistribution prior, final double x, final double conjugate_prior_sigma, final double sigma_floor) { GaussianDistribution posterior = prior; switch (prior.modelType) { case RANDOM_MEAN: { double variance = prior.sigma * prior.sigma; double conjugate_prior_variance = conjugate_prior_sigma * conjugate_prior_sigma; if (variance < k_minimum_variance) { variance = k_minimum_variance; } if (conjugate_prior_variance < k_minimum_conj_prior_variance) { conjugate_prior_variance = k_minimum_conj_prior_variance; } final double total_variance = conjugate_prior_variance + variance; final double w1 = variance / total_variance; final double w2 = conjugate_prior_variance / total_variance; final double conj_prior_information = 1.0 / conjugate_prior_variance; final double prior_information = 1.0 / variance; final double new_mean = w1 * x + w2 * prior.mean; final double new_variance = 1.0 / (conj_prior_information + prior_information); double new_sigma = Math.sqrt(new_variance); if (new_sigma < sigma_floor) { new_sigma = sigma_floor; } posterior = new GaussianDistribution(new_mean, new_sigma); break; } case RANDOM_VARIANCE: break; case RANDOM_MEAN_AND_VARIANCE: { final double n = 1; final double mu = (prior.kappa * prior.mean + n * x) / (prior.kappa + n); final double kappa = prior.kappa + n; final double alpha = prior.alpha + n / 2.0; final double beta = prior.beta + 0.5 * prior.kappa * n * (x - prior.mean) * (x - prior.mean) / (prior.kappa + n); posterior = new GaussianDistribution(mu, 0.0, alpha, beta, kappa, GaussianDistribution.DistributionModel.RANDOM_MEAN_AND_VARIANCE); break; } } return posterior; }
Source:
private static boolean pathContainsWindowsDrivePattern(String featureIdentifier) { return featureIdentifier.matches("^(?:[a-zA-Z]:.*)$"); }

Target:
private static boolean pathContainsWindowsDrivePattern(String featureIdentifier) { return featureIdentifier.matches("^[a-zA-Z]:.*$"); }
Source:
public Builder<?> read(Role template) { permissions.clear(); for(CachePermission perm : template.getPermissions()) { permissions.add(perm); } return this; }

Target:
public Builder<?> read(Role template) { permissions.clear(); permissions.addAll(template.getPermissions()); return this; }
Source:
public static SynthesizedPlanFragment[] createFragmentAndAggregator(long fragmentId, long aggFragmentId, Object... params) { SynthesizedPlanFragment pfs[] = new SynthesizedPlanFragment[2]; pfs[0] = new SynthesizedPlanFragment(); pfs[0].fragmentId = fragmentId; pfs[0].inputDepIds = new int[] {}; pfs[0].outputDepId = (int) fragmentId; pfs[0].multipartition = true; pfs[0].parameters = ParameterSet.fromArrayNoCopy(params); pfs[1] = new SynthesizedPlanFragment(); pfs[1].fragmentId = aggFragmentId; pfs[1].inputDepIds = new int[]{ (int) fragmentId }; pfs[1].outputDepId = (int) aggFragmentId; pfs[1].multipartition = false; pfs[1].parameters = ParameterSet.emptyParameterSet(); return pfs; }

Target:
public static SynthesizedPlanFragment[] createFragmentAndAggregator(long fragmentId, long aggFragmentId, Object... params) { return createFragmentAndAggregatorFromParameterSet(fragmentId, aggFragmentId, ParameterSet.fromArrayNoCopy(params)); }
Source:
public static byte[] uncompressBytes(byte zippedBytes) { GZIPInputStream zipInputStream = null; try { zipInputStream = new GZIPInputStream(new ByteArrayInputStream(zippedBytes)); return IOUtils.toByteArray(zipInputStream); } catch (IOException e) { e.printStackTrace(); return null; } finally { IOUtils.closeQuietly(zipInputStream); } }

Target:
public static byte[] uncompressBytes(byte zippedBytes) { GZIPInputStream zipInputStream = null; try { zipInputStream = new GZIPInputStream(new ByteArrayInputStream(zippedBytes)); return IOUtils.toByteArray(zipInputStream); } catch (IOException e) { logger.error("Unable to uncompress session cookie", e); return null; } finally { IOUtils.closeQuietly(zipInputStream); } }
Source:
public DimensionSelector decorate(final DimensionSelector selector) { if (selector == null) { return selector; } if (matched == null) { matched = new HashSet<>(values.size()); for (String value : values) { int i = selector.lookupId(value); if (i >= 0) { matched.add(i); } } } return new DimensionSelector() { @Override public IndexedInts getRow() { IndexedInts baseRow = selector.getRow(); List<Integer> result = new ArrayList<>(baseRow.size()); for (int i : baseRow) { if (matched.contains(i)) { result.add(i); } } return new ListBasedIndexedInts(result); } @Override public int getValueCardinality() { return matched.size(); } @Override public String lookupName(int id) { return selector.lookupName(id); } @Override public int lookupId(String name) { return selector.lookupId(name); } }; }

Target:
public DimensionSelector decorate(final DimensionSelector selector) { if (selector == null) { return selector; } final Set<Integer> matched = new HashSet<>(values.size()); for (String value : values) { int i = selector.lookupId(value); if (i >= 0) { matched.add(i); } }; return new DimensionSelector() { @Override public IndexedInts getRow() { IndexedInts baseRow = selector.getRow(); List<Integer> result = new ArrayList<>(baseRow.size()); for (int i : baseRow) { if (matched.contains(i)) { if (isWhitelist) { result.add(i); } } else { if (!isWhitelist) { result.add(i); } } } return new ListBasedIndexedInts(result); } @Override public int getValueCardinality() { return matched.size(); } @Override public String lookupName(int id) { return selector.lookupName(id); } @Override public int lookupId(String name) { return selector.lookupId(name); } }; }
Source:
public int getUIDForPackage(final String packagename) { int callingUID = 0; try { ApplicationInfo info = mContext.getPackageManager().getApplicationInfo(packagename, 0); callingUID = info.uid; } catch (NameNotFoundException e) { Logger.e(TAG, "Package " + packagename + " is not found", "", ADALError.PACKAGE_NAME_NOT_FOUND, e); } return callingUID; }

Target:
public int getUIDForPackage(final String packagename) { int callingUID = 0; try { ApplicationInfo info = mContext.getPackageManager().getApplicationInfo(packagename, 0); if (info != null) { callingUID = info.uid; } } catch (NameNotFoundException e) { Logger.e(TAG, "Package " + packagename + " is not found", "", ADALError.PACKAGE_NAME_NOT_FOUND, e); } return callingUID; }
Source:
public void bind(ImageEntry entry) { PicassoScreens.load(entry.getImageUrl()).placeholder(R.drawable.default_placeholder_image).resize(900, 900).centerInside().into(_imageView); }

Target:
public void bind(ImageEntry entry) { PicassoScreens.load(entry.getImageUrl()) .placeholder(R.drawable.default_placeholder_image) .resize(resizedWidth, resizedHeight) .centerInside() .into(_imageView); }
Source:
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { HttpServletRequest request = (HttpServletRequest) servletRequest; HttpServletResponse response = (HttpServletResponse) servletResponse; Object respondObject = dispatcher.dispatch(this.requestProvider.get(), Events.DURING); if (null != respondObject && null == request.getAttribute(Reply.NO_REPLY_ATTR)) { if (respondObject instanceof Respond) { Respond respond = (Respond) respondObject; final String redirect = respond.getRedirect(); if (null != redirect) { String redirectEncoded = URLEncoder.encode(redirect, "UTF-8").replaceAll("%2F", "/"); response.sendRedirect(redirectEncoded); } else { if (null == response.getContentType()) { response.setContentType(respond.getContentType()); } response.getWriter().write(respond.toString()); } } else { headlessRenderer.render(response, respondObject); } } else { filterChain.doFilter(request, response); } }

Target:
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { HttpServletRequest request = (HttpServletRequest) servletRequest; HttpServletResponse response = (HttpServletResponse) servletResponse; Object respondObject = dispatcher.dispatch(this.requestProvider.get(), Events.DURING); if (null != respondObject && null == request.getAttribute(Reply.NO_REPLY_ATTR)) { if (respondObject instanceof Respond) { Respond respond = (Respond) respondObject; final String redirect = respond.getRedirect(); if (null != redirect) { response.sendRedirect(redirect); } else { if (null == response.getContentType()) { response.setContentType(respond.getContentType()); } response.getWriter().write(respond.toString()); } } else { headlessRenderer.render(response, respondObject); } } else { filterChain.doFilter(request, response); } }
Source:
public List<String> reImportMavenProjects(ReImportMavenProjectsCommandParameters parameters) { final List<String> projectsToReImport = parameters.getProjectsToUpdate(); if (projectsToReImport.isEmpty()) { return emptyList(); } ListIterator<String> iterator = projectsToReImport.listIterator(); while (iterator.hasNext()) { iterator.set(prefixURI(iterator.next())); } CompletableFuture<Object> requestResult = executeCommand(REIMPORT_MAVEN_PROJECTS_COMMAND, singletonList(parameters)); final List<String> result; Type targetClassType = new TypeToken<ArrayList<String>>() {}.getType(); try { result = gson.fromJson( gson.toJson( requestResult.get(REIMPORT_MAVEN_PROJECTS_REQUEST_TIMEOUT, TimeUnit.SECONDS)), targetClassType); } catch (JsonSyntaxException | InterruptedException | ExecutionException | TimeoutException e) { throw new JsonRpcException(-27000, e.getMessage()); } iterator = result.listIterator(); while (iterator.hasNext()) { iterator.set(removePrefixUri(iterator.next())); } return result; }

Target:
public List<String> reImportMavenProjects(ReImportMavenProjectsCommandParameters parameters) { final List<String> projectsToReImport = parameters.getProjectsToUpdate(); if (projectsToReImport.isEmpty()) { return emptyList(); } ListIterator<String> iterator = projectsToReImport.listIterator(); while (iterator.hasNext()) { iterator.set(prefixURI(iterator.next())); } CompletableFuture<Object> requestResult = executeCommand(REIMPORT_MAVEN_PROJECTS_COMMAND, singletonList(parameters)); final List<String> result; Type targetClassType = new TypeToken<ArrayList<String>>() {}.getType(); try { result = gson.fromJson( gson.toJson( requestResult.get( REIMPORT_MAVEN_PROJECTS_REQUEST_TIMEOUT, TimeUnit.MILLISECONDS)), targetClassType); } catch (JsonSyntaxException | InterruptedException | ExecutionException | TimeoutException e) { throw new JsonRpcException(-27000, e.getMessage()); } iterator = result.listIterator(); while (iterator.hasNext()) { iterator.set(removePrefixUri(iterator.next())); } return result; }
Source:
public AutomationPanel(AutomationPanelForm view, TransferForms forms, BriefcasePreferences tabPreferences, BriefcasePreferences appPreferences, FormCache formCache) { AnnotationProcessor.process(this); this.view = view; this.forms = forms; this.formCache = formCache; this.appPreferences = appPreferences; this.pullSource = RemoteServer.readPreferences(tabPreferences).flatMap(view::preloadPullSource); this.pullSource.ifPresent(source -> { forms.load(source.getFormList()); view.refresh(); }); view.onPullSource(pullSource -> { this.pullSource = Optional.of(pullSource); Source.clearAllPreferences(tabPreferences); pullSource.storePreferences(tabPreferences, getStorePasswordsConsentProperty()); forms.load(pullSource.getFormList()); view.refresh(); }); view.onPushSource(pushSource -> { Source.clearAllPreferences(tabPreferences); pushSource.storePreferences(tabPreferences, getStorePasswordsConsentProperty()); forms.load(pushSource.getFormList()); view.refresh(); }); this.pushSource = RemoteServer.readPreferences(tabPreferences).flatMap(view::preloadPushSource); this.pushSource.ifPresent(source -> { forms.load(source.getFormList()); view.refresh(); }); view.onGenerate(config -> generateScript(isWindows() ? "automation.bat" : "automation.sh", config)); }

Target:
public AutomationPanel(AutomationPanelForm view, TransferForms forms, BriefcasePreferences tabPreferences, BriefcasePreferences appPreferences, FormCache formCache) { AnnotationProcessor.process(this); this.view = view; this.forms = forms; this.formCache = formCache; this.appPreferences = appPreferences; view.onPullSource(pullSource -> this.pullSource = Optional.of(pullSource)); view.onPushSource(pushSource -> this.pushSource = Optional.of(pushSource)); view.onGenerate(config -> generateScript(isWindows() ? "automation.bat" : "automation.sh", config)); }
Source:
public void visitNode(Tree tree) { if(!hasSemantic()) { return; } TypeCastTree typeCastTree = (TypeCastTree) tree; Type cast = typeCastTree.type().symbolType(); Type target = targetType(typeCastTree); if(target != null && (isRedundantNumericalCast(cast, typeCastTree.expression().symbolType()) || isSubtype(typeCastTree.expression().symbolType(), target))) { reportIssue(typeCastTree.type(), "Remove this unnecessary cast to \"" + cast + "\"."); } }

Target:
public void visitNode(Tree tree) { if(!hasSemantic()) { return; } TypeCastTree typeCastTree = (TypeCastTree) tree; Type cast = typeCastTree.type().symbolType(); Type target = targetType(typeCastTree); Type expressionType = typeCastTree.expression().symbolType(); if(target != null && (isRedundantNumericalCast(cast, expressionType) || isSubtype(expressionType, target))) { reportIssue(typeCastTree.type(), "Remove this unnecessary cast to \"" + cast + "\"."); } }
Source:
char[] getExplorerTheme() { return getData(Display.ENABLE_DARK_SCROLLBARS) != null ? DARKMODE_EXPLORER : EXPLORER; }

Target:
char[] getExplorerTheme() { Boolean data = (Boolean) getData(Display.ENABLE_DARK_SCROLLBARS); return data != null && data.booleanValue () ? DARKMODE_EXPLORER : EXPLORER; }
Source:
public void removeQuotaFromCache(Guid storagePoolId, Guid quotaId) { lock.readLock().lock(); try { if (!storagePoolQuotaMap.containsKey(storagePoolId)) { return; } synchronized (storagePoolQuotaMap.get(storagePoolId)) { storagePoolQuotaMap.get(storagePoolId).remove(quotaId); } } finally { lock.readLock().unlock(); } }

Target:
public void removeQuotaFromCache(Guid storagePoolId, Guid quotaId) { removeQuotaFromCache(storagePoolId, Arrays.asList(quotaId)); }
Source:
public static ArrayList<String> splitString(String data, String delimiter) { if (data == null) { throw new IllegalArgumentException("Passed in string is null "); } return data.isEmpty() ? new ArrayList<>() : new ArrayList<>(Arrays.asList(data.split(delimiter))); }

Target:
public static ArrayList<String> splitString(String data, String delimiter) { if (data == null) { throw new IllegalArgumentException("Passed in string is null "); } return Arrays.stream(data.split(delimiter)) .filter(s -> !s.isEmpty()) .collect(Collectors.toCollection(ArrayList::new)); }
Source:
protected <T> ObjectAssert<T> assertThat(T actual) { return new ObjectAssert<T>(actual) { @Override public ObjectAssert<T> isEqualTo(Object expected) { if (actual instanceof Tuple2) { final Tuple2<?, ?> t1 = (Tuple2<?, ?>) actual; final Tuple2<?, ?> t2 = (Tuple2<?, ?>) expected; assertThat((Iterable<?>) t1._1).isEqualTo(t2._1); assertThat((Iterable<?>) t1._2).isEqualTo(t2._2); return this; } else if (actual instanceof Tuple3) { final Tuple3<?, ?, ?> t1 = (Tuple3<?, ?, ?>) actual; final Tuple3<?, ?, ?> t2 = (Tuple3<?, ?, ?>) expected; assertThat((Iterable<?>) t1._1).isEqualTo(t2._1); assertThat((Iterable<?>) t1._2).isEqualTo(t2._2); return this; } else { return super.isEqualTo(expected); } } }; }

Target:
protected <T> ObjectAssert<T> assertThat(T actual) { return new ObjectAssert<T>(actual) { @Override public ObjectAssert<T> isEqualTo(Object expected) { if (actual instanceof Tuple2) { final Tuple2<?, ?> t1 = (Tuple2<?, ?>) actual; final Tuple2<?, ?> t2 = (Tuple2<?, ?>) expected; assertThat((Iterable<?>) t1._1).isEqualTo(t2._1); assertThat((Iterable<?>) t1._2).isEqualTo(t2._2); return this; } else if (actual instanceof Tuple3) { final Tuple3<?, ?, ?> t1 = (Tuple3<?, ?, ?>) actual; final Tuple3<?, ?, ?> t2 = (Tuple3<?, ?, ?>) expected; assertThat((Iterable<?>) t1._1).isEqualTo(t2._1); assertThat((Iterable<?>) t1._2).isEqualTo(t2._2); assertThat((Iterable<?>) t1._3).isEqualTo(t2._3); return this; } else { return super.isEqualTo(expected); } } }; }
Source:
public void testIncrementalDumpEmptyDumpDirectory() throws Throwable { WarehouseInstance.Tuple tuple = primary.run("use " + primaryDbName) .run("create external table t1 (id int)") .run("insert into table t1 values (1)") .run("insert into table t1 values (2)") .dump(primaryDbName, null); replica.load(replicatedDbName, tuple.dumpLocation) .status(replicatedDbName) .verifyResult(tuple.lastReplicationId); WarehouseInstance.Tuple incTuple = primary.dump(primaryDbName, tuple.lastReplicationId); replica.load(replicatedDbName, incTuple.dumpLocation) .status(replicatedDbName) .verifyResult(incTuple.lastReplicationId); primary.run("create database " + extraPrimaryDb + " WITH DBPROPERTIES ( '" + SOURCE_OF_REPLICATION + "' = '1,2,3')"); WarehouseInstance.Tuple inc2Tuple = primary.run("use " + extraPrimaryDb) .run("create table tbl (fld int)") .run("use " + primaryDbName) .dump(primaryDbName, incTuple.lastReplicationId); replica.load(replicatedDbName, inc2Tuple.dumpLocation) .status(replicatedDbName) .verifyResult(inc2Tuple.lastReplicationId); }

Target:
public void testIncrementalDumpEmptyDumpDirectory() throws Throwable { List<String> loadWithClause = externalTableBasePathWithClause(); List<String> dumpWithClause = Collections.singletonList( "'" + HiveConf.ConfVars.REPL_INCLUDE_EXTERNAL_TABLES.varname + "'='true'" ); WarehouseInstance.Tuple tuple = primary.run("use " + primaryDbName) .run("create external table t1 (id int)") .run("insert into table t1 values (1)") .run("insert into table t1 values (2)") .dump(primaryDbName, null, dumpWithClause); replica.load(replicatedDbName, tuple.dumpLocation) .status(replicatedDbName) .verifyResult(tuple.lastReplicationId); WarehouseInstance.Tuple incTuple = primary.dump(primaryDbName, tuple.lastReplicationId, dumpWithClause); replica.load(replicatedDbName, incTuple.dumpLocation, loadWithClause) .status(replicatedDbName) .verifyResult(incTuple.lastReplicationId); primary.run("create database " + extraPrimaryDb + " WITH DBPROPERTIES ( '" + SOURCE_OF_REPLICATION + "' = '1,2,3')"); WarehouseInstance.Tuple inc2Tuple = primary.run("use " + extraPrimaryDb) .run("create table tbl (fld int)") .run("use " + primaryDbName) .dump(primaryDbName, incTuple.lastReplicationId, dumpWithClause); Assert.assertEquals(primary.getCurrentNotificationEventId().getEventId(), Long.valueOf(inc2Tuple.lastReplicationId).longValue()); replica.load(replicatedDbName, inc2Tuple.dumpLocation, loadWithClause) .status(replicatedDbName) .verifyResult(inc2Tuple.lastReplicationId); }
Source:
public void onPageLoadComplete() { showToCButton(); refreshView.setEnabled(true); editHandler.setPage(model.getPage()); initPageScrollFunnel(); checkAndShowSelectTextOnboarding(); updateNavDrawerSelection(); if (getActivity() != null && getPageLoadCallbacks() != null) { getPageLoadCallbacks().onLoadComplete(); } }

Target:
public void onPageLoadComplete() { showToCButton(); refreshView.setEnabled(true); editHandler.setPage(model.getPage()); initPageScrollFunnel(); checkAndShowSelectTextOnboarding(); updateNavDrawerSelection(); if (getPageLoadCallbacks() != null) { getPageLoadCallbacks().onLoadComplete(); } }
Source:
public ValidationResult canRemoveBrick(List<GlusterBrickEntity> bricks, GlusterVolumeEntity volumeEntity, int replicaCount, boolean forceRemove) { if (bricks.isEmpty()) { return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_BRICKS_REQUIRED); } if (volumeEntity.getBricks().size() == 1 || volumeEntity.getBricks().size() <= bricks.size()) { return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_CAN_NOT_REMOVE_ALL_BRICKS_FROM_VOLUME); } if (volumeEntity.getVolumeType().isReplicatedType()) { if (replicaCount < volumeEntity.getReplicaCount() - 1) { return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_CAN_NOT_REDUCE_REPLICA_COUNT_MORE_THAN_ONE); } else if (replicaCount > volumeEntity.getReplicaCount()) { return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_CAN_NOT_INCREASE_REPLICA_COUNT); } } for (GlusterBrickEntity brick : bricks) { if (brick.getId(false) == null && brick.getQualifiedName() == null) { return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_BRICKS_REQUIRED); } GlusterBrickEntity brickFromVolume = volumeEntity.getBrickWithId(brick.getId()); if (brickFromVolume == null) { brickFromVolume = volumeEntity.getBrickWithQualifiedName(brick.getQualifiedName()); } if (brickFromVolume == null) { return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_BRICK_INVALID); } else { brick.setServerName(brickFromVolume.getServerName()); brick.setBrickDirectory(brickFromVolume.getBrickDirectory()); } } if (!forceRemove) { return canRebalance(volumeEntity); } else { return ValidationResult.VALID; } }

Target:
public ValidationResult canRemoveBrick(List<GlusterBrickEntity> bricks, GlusterVolumeEntity volumeEntity, int replicaCount, boolean forceRemove) { if (bricks.isEmpty()) { return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_BRICKS_REQUIRED); } if (volumeEntity.getBricks().size() == 1 || volumeEntity.getBricks().size() <= bricks.size()) { return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_CAN_NOT_REMOVE_ALL_BRICKS_FROM_VOLUME); } if (volumeEntity.getVolumeType().isReplicatedType()) { if (replicaCount < volumeEntity.getReplicaCount() - 1) { return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_CAN_NOT_REDUCE_REPLICA_COUNT_MORE_THAN_ONE); } else if (replicaCount > volumeEntity.getReplicaCount()) { return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_CAN_NOT_INCREASE_REPLICA_COUNT); } } for (GlusterBrickEntity brick : bricks) { if (brick.getId(false) == null && brick.getQualifiedName() == null) { return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_BRICKS_REQUIRED); } GlusterBrickEntity brickFromVolume = volumeEntity.getBrickWithId(brick.getId()); if (brickFromVolume == null) { brickFromVolume = volumeEntity.getBrickWithQualifiedName(brick.getQualifiedName()); } if (brickFromVolume == null) { return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_BRICK_INVALID); } else { brick.setId(brickFromVolume.getId()); brick.setServerName(brickFromVolume.getServerName()); brick.setBrickDirectory(brickFromVolume.getBrickDirectory()); } } if (!forceRemove) { return canRebalance(volumeEntity); } else { return ValidationResult.VALID; } }
Source:
private static long convertNanosToMillis(long nanos) { long millis = NANOSECONDS.toMillis(nanos); if (millis == 0 && nanos > 0) { millis = 1; } return millis; }

Target:
private static long convertNanosToMillis(long nanos) { return timeInMsOrOneIfResultIsZero(nanos, NANOSECONDS); }
Source:
private void buildStreamsJoinThatShouldThrow(final StreamJoined<String, Integer, Integer> streamJoined, final JoinWindows joinWindows, final String expectedExceptionMessagePrefix) { final StreamsBuilder builder = new StreamsBuilder(); final KStream<String, Integer> left = builder.stream("left", Consumed.with(Serdes.String(), Serdes.Integer())); final KStream<String, Integer> right = builder.stream("right", Consumed.with(Serdes.String(), Serdes.Integer())); try { left.join( right, (value1, value2) -> value1 + value2, joinWindows, streamJoined); fail("Should throw SteamsException"); } catch (final StreamsException se) { assertTrue(se.getMessage().startsWith(expectedExceptionMessagePrefix)); } }

Target:
private void buildStreamsJoinThatShouldThrow(final StreamJoined<String, Integer, Integer> streamJoined, final JoinWindows joinWindows, final String expectedExceptionMessagePrefix) { final StreamsBuilder builder = new StreamsBuilder(); final KStream<String, Integer> left = builder.stream("left", Consumed.with(Serdes.String(), Serdes.Integer())); final KStream<String, Integer> right = builder.stream("right", Consumed.with(Serdes.String(), Serdes.Integer())); final StreamsException streamsException = assertThrows(StreamsException.class, () -> left.join( right, (value1, value2) -> value1 + value2, joinWindows, streamJoined)); assertTrue(streamsException.getMessage().startsWith(expectedExceptionMessagePrefix)); }
Source:
private void connect() throws Exception { SSLContext sc = SSLContext.getInstance("TLS"); sc.init(new KeyManager[]{}, new TrustManager[]{new ProxyClient.MyTrustManager()}, new SecureRandom()); SSLSocketFactory sf = sc.getSocketFactory(); this.socket = (SSLSocket) sf.createSocket( Server.getInstance().getMyProxyHost(), Server.getInstance().getMyProxyPort()); this.socket.setEnabledProtocols(new String[]{"TLSv1", "TLSv1.1", "TLSv1.2"}); this.socket.startHandshake(); this.socketIn = new BufferedInputStream(this.socket.getInputStream()); this.socketOut = new BufferedOutputStream(this.socket.getOutputStream()); }

Target:
private void connect() throws Exception { SSLContext sc = SSLContext.getInstance("TLS"); sc.init(new KeyManager[]{}, new TrustManager[]{new ProxyClient.MyTrustManager()}, new SecureRandom()); SSLSocketFactory sf = sc.getSocketFactory(); this.socket = (SSLSocket) sf.createSocket( Server.getInstance().getMyProxyHost(), Server.getInstance().getMyProxyPort()); this.socket.setEnabledProtocols(new String[]{"TLSv1.2"}); this.socket.startHandshake(); this.socketIn = new BufferedInputStream(this.socket.getInputStream()); this.socketOut = new BufferedOutputStream(this.socket.getOutputStream()); }
Source:
public void test() { AjaxLazyLoadPanel<Component> panel = new AjaxLazyLoadPanel<Component>("panel") { private static final long serialVersionUID = 1L; @Override protected Component getLazyLoadComponent(String markupId) { return new Label(markupId, "lazy panel test").setRenderBodyOnly(true); } }; tester.startComponentInPage(panel); tester.assertLabel( "panel:content", "<img alt=\"Loading...\" src=\"./resource/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/indicator.gif\"/>"); AjaxLazyLoadPanelTester.executeAjaxLazyLoadPanel(tester); tester.debugComponentTrees(); tester.assertLabel("panel:content", "lazy panel test"); String doc = tester.getLastResponseAsString(); assertNotNull(doc); }

Target:
public void test() { AjaxLazyLoadPanel<Component> panel = new AjaxLazyLoadPanel<Component>("panel") { private static final long serialVersionUID = 1L; @Override public Component getLazyLoadComponent(final String markupId) { return new Label(markupId, "lazy panel test").setRenderBodyOnly(true); } }; tester.startComponentInPage(panel); tester.assertLabel( "panel:content", "<img alt=\"Loading...\" src=\"./resource/org.apache.wicket.ajax.AbstractDefaultAjaxBehavior/indicator.gif\"/>"); AjaxLazyLoadPanelTester.executeAjaxLazyLoadPanel(tester); tester.debugComponentTrees(); tester.assertLabel("panel:content", "lazy panel test"); String doc = tester.getLastResponseAsString(); assertNotNull(doc); }
Source:
public static IBiomeBlockReplacerProvider provider() { return new IBiomeBlockReplacerProvider() { private final ResourceLocation OCEAN_LEVEL = CubicChunks.location("water_level"); @Override public IBiomeBlockReplacer create(ICubicWorld world, CubicBiome biome, BiomeBlockReplacerConfig conf) { return new SwampWaterWithLilypadReplacer(Biome.GRASS_COLOR_NOISE, MathHelper.floor(conf.getDouble(OCEAN_LEVEL))); } @Override public Set<ConfigOptionInfo> getPossibleConfigOptions() { return new HashSet<>(); } }; }

Target:
public static IBiomeBlockReplacerProvider provider() { return IBiomeBlockReplacerProvider.of((world, biome, conf) -> new SwampWaterWithLilypadReplacer(Biome.GRASS_COLOR_NOISE, MathHelper.floor(conf.getDouble(OCEAN_LEVEL))) ); }
Source:
private String removeTag(String target, String tagStart, String tagEnd) { String taglessResult = ""; int tagStartPosition = -1; int tagEndPosition = -1; for (int i = 0; i < target.length(); i++) { char c = target.charAt(i); if (-1 == tagStartPosition && c == tagStart.charAt(0)) { if (target.substring(i, i + tagStart.length()).equals(tagStart)) { tagStartPosition = i; i = i + tagStart.length() - 1; } } if (-1 != tagStartPosition && c == tagEnd.charAt(0)) { if (target.substring(i, i + tagEnd.length()).equals(tagEnd)) tagEndPosition = i + tagEnd.length() - 1; } } if (-1 == tagStartPosition) return target; taglessResult = target.substring(0, tagStartPosition); taglessResult += target.substring(tagEndPosition + 1, target.length()); return taglessResult; }

Target:
private String removeTag(String target, String tagStart, String tagEnd) { int tagStartPosition = tagStartPosition = target.indexOf(tagStart); int tagEndPosition = tagEndPosition = target.indexOf(tagEnd, tagStartPosition + tagStart.length()); if (-1 == tagStartPosition || -1 == tagEndPosition) return target; String taglessResult = target.substring(0, tagStartPosition); taglessResult += target.substring(tagEndPosition + 1, target.length()); return taglessResult; }
Source:
@Test public void testCreateRootSchemaWithNoMetadataSchema() { SchemaPlus rootSchema = Frameworks.createRootSchema(false); assertTrue(rootSchema.getSubSchemaNames().size() == 0); }

Target:
@Test public void testCreateRootSchemaWithNoMetadataSchema() { SchemaPlus rootSchema = Frameworks.createRootSchema(false); assertThat(rootSchema.getSubSchemaNames().size(), equalTo(0)); }
Source:
public boolean updateConfiguration(OMElement configuration) throws XMLStreamException, ServletException, RemoteException { return configServiceAdminStub.updateConfiguration(configuration); }

Target:
public boolean updateConfiguration(OMElement configuration) throws RemoteException { return configServiceAdminStub.updateConfiguration(configuration); }
Source:
public void testCompareToWithDifferentModuleId() { final LocalizedMessage message1 = new LocalizedMessage(0, "com.puppycrawl.tools.checkstyle.checks.coding.messages", "empty.statement", EMPTY_OBJECT_ARRAY, "module1", LocalizedMessage.class, null); final LocalizedMessage message2 = new LocalizedMessage(0, "com.puppycrawl.tools.checkstyle.checks.coding.messages", "empty.statement", EMPTY_OBJECT_ARRAY, null, LocalizedMessage.class, null); final LocalizedMessage message3 = new LocalizedMessage(0, "com.puppycrawl.tools.checkstyle.checks.coding.messages", "empty.statement", EMPTY_OBJECT_ARRAY, "module2", LocalizedMessage.class, null); assertTrue("Invalid comparing result", message1.compareTo(message2) > 0); assertTrue("Invalid comparing result", message2.compareTo(message1) < 0); assertTrue("Invalid comparing result", message1.compareTo(message3) < 0); }

Target:
public void testCompareToWithDifferentModuleId() { final LocalizedMessage message1 = createSampleLocalizedMessageWithId("module1"); final LocalizedMessage message2 = createSampleLocalizedMessageWithId("module2"); final LocalizedMessage messageNull = createSampleLocalizedMessageWithId(null); assertTrue("Invalid comparing result", message1.compareTo(messageNull) > 0); assertTrue("Invalid comparing result", messageNull.compareTo(message1) < 0); assertTrue("Invalid comparing result", message1.compareTo(message2) < 0); }
Source:
public void testCall() { Handle handle = db.getSharedHandle(); handle.execute(findSqlOnClasspath("create_stored_proc_add")); OutParameters result = handle .createCall("{:sum = add(:a, :b)}") .bind("a", 13) .bind("b", 9) .registerOutParameter("sum", Types.INTEGER) .invoke(); int sum = result.getInt("sum"); assertThat(sum).isEqualTo(22); }

Target:
public void testCall() { Handle handle = db.getSharedHandle(); handle.execute(findSqlOnClasspath("create_stored_proc_add")); OutParameters result = handle .createCall("{:sum = call add(:a, :b)}") .bind("a", 13) .bind("b", 9) .registerOutParameter("sum", Types.INTEGER) .invoke(); int sum = result.getInt("sum"); assertThat(sum).isEqualTo(22); }
Source:
private void updateUI() { username.setText(AccountUtil.getUserName()); contributionsText.setText(getResources().getQuantityString(R.plurals.edit_action_contribution_count, Prefs.getTotalUserDescriptionsEdited())); requireActivity().invalidateOptionsMenu(); }

Target:
private void updateUI() { username.setText(AccountUtil.getUserName()); contributionsText.setText(getResources().getQuantityString(R.plurals.edit_action_contribution_count, Prefs.getTotalUserDescriptionsEdited(), Prefs.getTotalUserDescriptionsEdited())); requireActivity().invalidateOptionsMenu(); }
Source:
public Guid getVmtGuid() { return vmtGuid; }

Target:
public Guid getVmtGuid() { return this.vmtGuid; }
Source:
protected void setRealmService(RealmService realmService) { if (log.isDebugEnabled()) { log.info("Setting the Realm Service"); } IWAServiceDataHolder.setRealmService(realmService); }

Target:
protected void setRealmService(RealmService realmService) { if (log.isDebugEnabled()) { log.debug("Setting the Realm Service"); } IWAServiceDataHolder.setRealmService(realmService); }
Source:
private VersionedIdentifier extractLibraryIdentifier(cqlParser parser) { RuleContext context = parser.getContext(); while (!(context instanceof cqlParser.LibraryContext)) { context = context.parent; if (context == null) { break; } } if (context instanceof cqlParser.LibraryContext) { for (ParseTree pt : ((cqlParser.LibraryContext)context).children) { if (pt instanceof cqlParser.LibraryDefinitionContext) { cqlParser.LibraryDefinitionContext ldc = (cqlParser.LibraryDefinitionContext)pt; if (ldc.qualifiedIdentifier() != null && ldc.qualifiedIdentifier().identifier() != null) { return new VersionedIdentifier().withId(StringEscapeUtils.unescapeCql(ldc.qualifiedIdentifier().identifier().getText())); } } } } return null; }

Target:
private VersionedIdentifier extractLibraryIdentifier(cqlParser parser) { RuleContext context = parser.getContext(); while (context != null && !(context instanceof cqlParser.LibraryContext)) { context = context.parent; } if (context instanceof cqlParser.LibraryContext) { cqlParser.LibraryDefinitionContext ldc = ((cqlParser.LibraryContext)context).libraryDefinition(); if (ldc != null && ldc.qualifiedIdentifier() != null && ldc.qualifiedIdentifier().identifier() != null) { return new VersionedIdentifier().withId(StringEscapeUtils.unescapeCql(ldc.qualifiedIdentifier().identifier().getText())); } } return null; }
Source:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (obj.getClass() != this.getClass()) { return false; } EngineBackupLog other = (EngineBackupLog) obj; return (Objects.equals(dbName, other.dbName) && Objects.equals(doneAt, other.doneAt) && this.passed == other.passed && Objects.equals(outputMessage, other.outputMessage)); }

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof EngineBackupLog)) { return false; } EngineBackupLog other = (EngineBackupLog) obj; return (Objects.equals(dbName, other.dbName) && Objects.equals(doneAt, other.doneAt) && this.passed == other.passed && Objects.equals(outputMessage, other.outputMessage)); }
Source:
protected void addFilesToWorkflowAttachment(List<File> workflowAttachment, File zippedEntry, File tempDir) { try { SwaggerUtility.unzipFile(zippedEntry, tempDir); } catch (IOException e) { System.out.println("Could not get files from workflow attachment " + zippedEntry.getName() + " Request not sent."); exceptionMessage(e, "Unable to get workflow attachment files from zip file " + zippedEntry.getName(), IO_ERROR); } try { String[] fileFilter = null; if (abstractEntryClient.isLocalEntry()) { fileFilter = new String[]{"yml", "yaml", "json", this.languageType.toString().toLowerCase()}; } Iterator it = FileUtils.iterateFiles(tempDir, fileFilter, true); while (it.hasNext()) { File afile = (File) it.next(); workflowAttachment.add(afile); } } catch (Exception e) { e.printStackTrace(); LOG.error("Unable to traverse directory " + tempDir.getName() + " to get workflow attachment files", e); exceptionMessage(e, "Unable to traverse directory " + tempDir.getName() + " to get workflow " + "attachment files", GENERIC_ERROR); } }

Target:
protected void addFilesToWorkflowAttachment(List<File> workflowAttachment, File zippedEntry, File tempDir) { try { SwaggerUtility.unzipFile(zippedEntry, tempDir); } catch (IOException e) { System.out.println("Could not get files from workflow attachment " + zippedEntry.getName() + " Request not sent."); exceptionMessage(e, "Unable to get workflow attachment files from zip file " + zippedEntry.getName(), IO_ERROR); } try { String[] fileFilter = null; if (abstractEntryClient.isLocalEntry()) { fileFilter = new String[]{"yml", "yaml", "json", this.languageType.toString().toLowerCase()}; } Iterator it = FileUtils.iterateFiles(tempDir, fileFilter, true); while (it.hasNext()) { File afile = (File) it.next(); workflowAttachment.add(afile); } } catch (Exception e) { LOG.error("Unable to traverse directory " + tempDir.getName() + " to get workflow attachment files", e); exceptionMessage(e, "Unable to traverse directory " + tempDir.getName() + " to get workflow " + "attachment files", GENERIC_ERROR); } }
Source:
private Optional<TableToSweep> getTableToSweep() { return specificTableSweeper.getTxManager().runTaskWithRetry( tx -> { Optional<SweepProgress> progress = currentTable.flatMap( tableToSweep -> specificTableSweeper.getSweepProgressStore().loadProgress( tableToSweep.getTableRef())); SweepPriorityOverrideConfig overrideConfig = sweepPriorityOverrideConfig.get(); if (progress.map( realProgress -> shouldContinueSweepingCurrentTable(realProgress, overrideConfig)) .orElse(false)) { try { createLockForTableIfNecessary(progress.get()); if (currentTable.isPresent()) { currentTable.get().refreshLock(); } return currentTable; } catch (InterruptedException ex) { log.info("Sweep lost the lock for table {}", LoggingArgs.tableRef(progress.get().tableRef())); currentTable = Optional.empty(); } } log.info("Sweep is choosing a new table to sweep."); return getNextTableToSweep(tx, overrideConfig); }); }

Target:
private Optional<TableToSweep> getTableToSweep() { return specificTableSweeper.getTxManager().runTaskWithRetry( tx -> { Optional<SweepProgress> progress = currentTable.flatMap( tableToSweep -> specificTableSweeper.getSweepProgressStore().loadProgress( tableToSweep.getTableRef())); SweepPriorityOverrideConfig overrideConfig = sweepPriorityOverrideConfig.get(); if (progress.map( realProgress -> shouldContinueSweepingCurrentTable(realProgress, overrideConfig)) .orElse(false)) { try { updateProgressAndRefreshLock(progress.get()); return currentTable; } catch (InterruptedException ex) { log.info("Sweep lost the lock for table {}", LoggingArgs.tableRef(progress.get().tableRef())); closeTableLockIfHeld(); currentTable = Optional.empty(); } } log.info("Sweep is choosing a new table to sweep."); closeTableLockIfHeld(); return getNextTableToSweep(tx, overrideConfig); }); }
Source:
public void removed(final String name) throws Exception { final String path = ZKPaths.makePath(ZKNODE_PATH, name); zkClient.delete().forPath(path); }

Target:
public void removed(final String name) throws Exception { final String path = getZNodePath(name); created(name); zkClient.delete().forPath(path); }
Source:
public ProjectInformation get(String projectUrl, String installationName) { SonarInstallation inst = SonarInstallation.get(installationName); if (inst == null) { Logger.LOG.info("Invalid installation name: " + installationName); return null; } try { String projectKey = extractProjectKey(projectUrl); String serverUrl = extractServerUrl(projectUrl); WsClient wsClient = new WsClient(client, serverUrl, projectKey, inst.getSonarLogin(), inst.getSonarPassword()); float version = SonarUtils.extractMajorMinor(wsClient.getServerVersion(serverUrl)); if (!checkServerUrl(serverUrl, inst)) { return null; } ProjectQualityGate qg; if (version < 5.2) { qg = wsClient.getQualityGateBefore52(); } else { qg = wsClient.getQualityGate52(); } ProjectInformation projectInfo = new ProjectInformation(projectKey); projectInfo.setName(qg.getProjectName()); projectInfo.setStatus(qg.getStatus()); projectInfo.setUrl(projectUrl); return projectInfo; } catch (Exception e) { Logger.LOG.log(Level.WARNING, "Error fetching project information", e); return null; } }

Target:
public ProjectInformation get(String projectUrl, String installationName) { SonarInstallation inst = SonarInstallation.get(installationName); if (inst == null) { Logger.LOG.info("Invalid installation name: " + installationName); return null; } try { String projectKey = extractProjectKey(projectUrl); String serverUrl = extractServerUrl(projectUrl); WsClient wsClient = new WsClient(client, serverUrl, projectKey, inst.getSonarLogin(), inst.getSonarPassword()); Float version = SonarUtils.extractMajorMinor(wsClient.getServerVersion(serverUrl)); if (version == null || !checkServerUrl(serverUrl, inst)) { return null; } ProjectQualityGate qg; if (version < 5.2f) { qg = wsClient.getQualityGateBefore52(); } else { qg = wsClient.getQualityGate52(); } ProjectInformation projectInfo = new ProjectInformation(projectKey); projectInfo.setName(qg.getProjectName()); projectInfo.setStatus(qg.getStatus()); projectInfo.setUrl(projectUrl); return projectInfo; } catch (Exception e) { Logger.LOG.log(Level.WARNING, "Error fetching project information", e); return null; } }
Source:
public ListenableFuture<Optional<LabelMeta>> getMeta(final LabelId id, final LabelType type) { final ListenableFuture<Optional<Row>> metas = getOptionalMeta(id, type); return transform(metas, new Function<Optional<Row>, Optional<LabelMeta>>() { @Nullable @Override public Optional<LabelMeta> apply(final Optional<Row> result) { if (!result.isPresent()) { return Optional.absent(); } final Row row = result.get(); if (Strings.isNullOrEmpty(row.getString("description"))) { return Optional.absent(); } return Optional.of( LabelMeta.create(CassandraLabelId.fromLong(row.getLong("label_id")), LabelType.fromValue(row.getString("type")), "REMOVE THIS", row.getString("description"), row.getDate("creation_time").getTime())); } }); }

Target:
public ListenableFuture<Optional<LabelMeta>> getMeta(final LabelId id, final LabelType type) { final ListenableFuture<Optional<Row>> metas = getOptionalMeta(id, type); return transform(metas, new Function<Optional<Row>, Optional<LabelMeta>>() { @Nullable @Override public Optional<LabelMeta> apply(final Optional<Row> metaRow) { if (!metaRow.isPresent()) { return Optional.absent(); } final Row row = metaRow.get(); return Optional.of( LabelMeta.create(CassandraLabelId.fromLong(row.getLong("label_id")), LabelType.fromValue(row.getString("type")), "REMOVE THIS", row.getString("description"), row.getDate("creation_time").getTime())); } }); }
Source:
public static SSLContext sslContext() throws GeneralSecurityException, IOException { SSLContext ctx = SSLContext.getInstance("TLS"); char[] storePass = GridTestProperties.getProperty("ssl.keystore.password").toCharArray(); KeyManagerFactory keyMgrFactory = KeyManagerFactory.getInstance("SunX509"); KeyStore keyStore = KeyStore.getInstance("JKS"); try(InputStream in = new FileInputStream(U.resolveIgnitePath(GridTestProperties .getProperty("ssl.keystore.path")))) { keyStore.load(in, storePass); } keyMgrFactory.init(keyStore, storePass); ctx.init(keyMgrFactory.getKeyManagers(), new TrustManager[]{GridSslBasicContextFactory.getDisabledTrustManager()}, null); return ctx; }

Target:
public static SSLContext sslContext() throws GeneralSecurityException, IOException { SSLContext ctx = SSLContext.getInstance("TLS"); char[] storePass = keyStorePassword().toCharArray(); KeyManagerFactory keyMgrFactory = KeyManagerFactory.getInstance("SunX509"); KeyStore keyStore = KeyStore.getInstance("JKS"); try (InputStream in = new FileInputStream(U.resolveIgnitePath(GridTestProperties .getProperty("ssl.keystore.path")))) { keyStore.load(in, storePass); } keyMgrFactory.init(keyStore, storePass); ctx.init(keyMgrFactory.getKeyManagers(), new TrustManager[]{GridSslBasicContextFactory.getDisabledTrustManager()}, null); return ctx; }
Source:
public void useWakeLockTest() throws IOException { WakeLock wakeLock = ShadowPowerManager.getLatestWakeLock(); assertNull(wakeLock); activity.useWakeLock(new Callback() { @Override public void onCall() { WakeLock lock = ShadowPowerManager.getLatestWakeLock(); assertTrue(lock.isHeld()); } }); wakeLock = ShadowPowerManager.getLatestWakeLock(); assertFalse(wakeLock.isHeld()); }

Target:
public void useWakeLockTest() throws IOException { WakeLock wakeLock = ShadowPowerManager.getLatestWakeLock(); assertThat(wakeLock).isNull(); activity.useWakeLock(new Callback() { @Override public void onCall() { WakeLock lock = ShadowPowerManager.getLatestWakeLock(); assertThat(lock.isHeld()).isTrue(); } }); wakeLock = ShadowPowerManager.getLatestWakeLock(); assertThat(wakeLock.isHeld()).isFalse(); }
Source:
public boolean isGnosManifest() { boolean result = false; val isFile = resolveType(value).equals(Type.FILE); val isXml = value.toLowerCase().contains(".xml"); return isFile && isXml; }

Target:
public boolean isGnosManifest() { val isFile = resolveType(value).equals(Type.FILE); val isXml = value.toLowerCase().contains(".xml"); return isFile && isXml; }
Source:
public void invoke(Request request, Response response) throws IOException, ServletException { log.debug("Processing request with session:" + request.getRequestedSessionId()); getNext().invoke(request, response); Context context = request.getContext(); Manager manager = context.getManager(); Session session = request.getSessionInternal(false); if (session != null && !isUriExcluded(request.getRequestURI())) { log.debug("Persisting session with id: " + session.getId()); session.access(); session.endAccess(); if (manager instanceof StoreManager) { StoreManager storeManager = (StoreManager) manager; storeManager.getStore().save(session); storeManager.removeSuper(session); } else { log.error("In order to persist the session the manager must implement StoreManager"); } } else { log.debug("Session not persisted"); } }

Target:
public void invoke(Request request, Response response) throws IOException, ServletException { log.debug("Processing request with session:" + request.getRequestedSessionId()); getNext().invoke(request, response); Context context = request.getContext(); Manager manager = context.getManager(); Session session = request.getSessionInternal(false); if (session != null && !isUriExcluded(request.getRequestURI())) { log.debug("Persisting session with id: " + session.getId()); session.access(); session.endAccess(); if (manager instanceof StoreManager) { StoreManager storeManager = (StoreManager) manager; storeManager.getStore().save(session); storeManager.removeSuper(session); } else { log.error("In order to persist the session the manager must implement StoreManager"); } } else { log.debug("Session not persisted (Non existent or the URI is ignored)"); } }
Source:
public void onSetupComplete() { log.info("onSetupComplete"); }

Target:
public void onSetupComplete() { log.debug("onSetupComplete"); }
Source:
boolean isBootstrapInProgress() { File bootstrapFile = new File(dataDir, BOOTSTRAP_FILE_NAME); return bootstrapFile.exists(); }

Target:
boolean isBootstrapInProgress() { return (new File(dataDir, BOOTSTRAP_FILE_NAME)).exists(); }