auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void createSuccess() throws Exception { MetadataFieldRest metadataFieldRest = new MetadataFieldRest(); metadataFieldRest.setElement(ELEMENT); metadataFieldRest.setQualifier(QUALIFIER); metadataFieldRest.setScopeNote(SCOPE_NOTE); String authToken = getAuthToken(admin.getEmail(), password); AtomicReference<Integer> idRef = new AtomicReference<>(); try { assertThat(metadataFieldService.findByElement(context, metadataSchema, ELEMENT, QUALIFIER), nullValue()); getClient(authToken) .perform(post("/api/core/metadatafields") .param("schemaId", metadataSchema.getID() + "") .content(new ObjectMapper().writeValueAsBytes(metadataFieldRest)) .contentType(contentType)) .andExpect(status().isCreated()) .andDo(result -> idRef.set(read(result.getResponse().getContentAsString(), "$.id"))); MetadataField metadataField = metadataFieldService.find(context, idRef.get()); assertThat(metadataField, notNullValue()); assertEquals(metadataField.getMetadataSchema(), metadataSchema); assertEquals(metadataField.getElement(), ELEMENT); assertEquals(metadataField.getQualifier(), QUALIFIER); assertEquals(metadataField.getScopeNote(), SCOPE_NOTE); } finally { deleteMetadataFieldIfExists(); } }

Target:
public void createSuccess() throws Exception { MetadataFieldRest metadataFieldRest = new MetadataFieldRest(); metadataFieldRest.setElement("testElementForCreate"); metadataFieldRest.setQualifier("testQualifierForCreate"); metadataFieldRest.setScopeNote(SCOPE_NOTE); String authToken = getAuthToken(admin.getEmail(), password); AtomicReference<Integer> idRef = new AtomicReference<>(); assertThat(metadataFieldService.findByElement(context, metadataSchema, ELEMENT, QUALIFIER), nullValue()); getClient(authToken) .perform(post("/api/core/metadatafields") .param("schemaId", metadataSchema.getID() + "") .content(new ObjectMapper().writeValueAsBytes(metadataFieldRest)) .contentType(contentType)) .andExpect(status().isCreated()) .andDo(result -> idRef.set(read(result.getResponse().getContentAsString(), "$.id"))); getClient(authToken).perform(get("/api/core/metadatafields/" + idRef.get())) .andExpect(status().isOk()) .andExpect(jsonPath("$", MetadataFieldMatcher.matchMetadataFieldByKeys( metadataSchema.getName(), "testElementForCreate", "testQualifierForCreate"))); }
Source:
public void run(Operation operation) throws RequestException { Object key = keyGenerator.generateKey(keySelector.next()); Random random = stressor.getRandom(); Invocation<Integer> invocation; if (operation == StreamingOperations.GET) { invocation = new CacheInvocations.GetViaStream(cache, key); } else if (operation == StreamingOperations.PUT) { invocation = new CacheInvocations.PutViaStream(cache, key, valueGenerator.generateValue(key, entrySize.next(random), random)); } else throw new IllegalArgumentException(operation.name); stressor.makeRequest(invocation); }

Target:
public void run(Operation operation) throws RequestException { Object key = keyGenerator.generateKey(keySelector.next()); Random random = stressor.getRandom(); Invocation invocation; if (operation == StreamingOperations.GET) { invocation = new CacheInvocations.GetViaStream<Object, Integer>(cache, key, buffer); } else if (operation == StreamingOperations.PUT) { invocation = new CacheInvocations.PutViaStream<Object, InputStream>(cache, key, (InputStream) valueGenerator.generateValue(key, entrySize.next(random), random), buffer); } else throw new IllegalArgumentException(operation.name); stressor.makeRequest(invocation); }
Source:
private void updateSchedules( StoredRevision revision, List<StoredWorkflowDefinition> defs, SchedulerManager srm, Instant currentTime) throws ResourceConflictException { ImmutableList.Builder<ScheduleWithScheduler> schedules = ImmutableList.builder(); for (StoredWorkflowDefinition def : defs) { Optional<Scheduler> sr = srm.tryGetScheduler(revision, def, Optional.of(getUnusedKeysCallback())); if (sr.isPresent()) { ScheduleTime firstTime = sr.get().getFirstScheduleTime(currentTime); Schedule schedule = Schedule.of(def.getName(), def.getId(), firstTime.getRunTime(), firstTime.getTime()); schedules.add(new ScheduleWithScheduler(schedule, sr.get())); } } store.updateSchedules(project.getId(), schedules.build(), (oldStatus, newSched) -> { return oldStatus.getLastScheduleTime() .transform(it -> newSched.getScheduler().nextScheduleTime(it)) .or(() -> ScheduleTime.of(newSched.getNextScheduleTime(), newSched.getNextRunTime())); }); }

Target:
private void updateSchedules( StoredRevision revision, List<StoredWorkflowDefinition> defs, SchedulerManager srm, Instant currentTime) throws ResourceConflictException { ImmutableList.Builder<ScheduleWithScheduler> schedules = ImmutableList.builder(); for (StoredWorkflowDefinition def : defs) { Optional<Scheduler> sr = srm.tryGetScheduler(revision, def, true); if (sr.isPresent()) { ScheduleTime firstTime = sr.get().getFirstScheduleTime(currentTime); Schedule schedule = Schedule.of(def.getName(), def.getId(), firstTime.getRunTime(), firstTime.getTime()); schedules.add(new ScheduleWithScheduler(schedule, sr.get())); } } store.updateSchedules(project.getId(), schedules.build(), (oldStatus, newSched) -> { return oldStatus.getLastScheduleTime() .transform(it -> newSched.getScheduler().nextScheduleTime(it)) .or(() -> ScheduleTime.of(newSched.getNextScheduleTime(), newSched.getNextRunTime())); }); }
Source:
public void setCurrentGDBThread(IExecutionDMContext ctx) { String id; if (ctx instanceof IMIExecutionDMContext) { id = ((IMIExecutionDMContext)ctx).getThreadId(); } else { return; } if (!id.equals(fCurrentThreadId)) { fCurrentThreadId = id; this.getSession().getExecutor().execute(new Runnable() { @Override public void run() { ICommand<MIInfo> command = fCommandFactory.createMIThreadSelect(ctx, fCurrentThreadId); fCommandControl.queueCommand(command, new ImmediateDataRequestMonitor<MIInfo> () {}); } }); } }

Target:
public void setCurrentGDBThread(IExecutionDMContext ctx) { String id; if (!(ctx instanceof IMIExecutionDMContext)) { return; } id = ((IMIExecutionDMContext)ctx).getThreadId(); if (!id.equals(fCurrentThreadId)) { fCurrentThreadId = id; this.getSession().getExecutor().execute(new DsfRunnable() { @Override public void run() { ICommand<MIInfo> command = fCommandFactory.createMIThreadSelect(ctx, fCurrentThreadId); fCommandControl.queueCommand(command, new ImmediateDataRequestMonitor<MIInfo> () {}); } }); } }
Source:
private String getInstalledVdsIdIfExists(SSHClient client) { try { ByteArrayOutputStream out = new ConstraintByteArrayOutputStream(256); ByteArrayOutputStream err = new ConstraintByteArrayOutputStream(256); client.executeCommand(Config.<String> GetValue(ConfigValues.GetVdsmIdByVdsmToolCommand), null, out, err); return new String(out.toByteArray(), "UTF-8"); } catch (Exception e) { return null; } }

Target:
private String getInstalledVdsIdIfExists(SSHClient client) { try { ByteArrayOutputStream out = new ConstraintByteArrayOutputStream(256); client.executeCommand(Config.<String> GetValue(ConfigValues.GetVdsmIdByVdsmToolCommand), null, out, null); return new String(out.toByteArray(), Charset.forName("UTF-8")); } catch (Exception e) { log.warnFormat( "Failed to initiate vdsm-id request on host", e ); return null; } }
Source:
protected int uploadFile(OwnCloudClient client) throws HttpException, IOException, OperationCancelledException { int status = -1; try { File f = new File(mLocalPath); mEntity = new FileRequestEntity(f, mMimeType); synchronized (mDataTransferListeners) { ((ProgressiveDataTransferer)mEntity) .addDatatransferProgressListeners(mDataTransferListeners); } mPutMethod.addRequestHeader(OC_TOTAL_LENGTH_HEADER, String.valueOf(f.length())); mPutMethod.setRequestEntity(mEntity); status = client.executeMethod(mPutMethod); if (status == 400 || status == 500) { InvalidCharacterExceptionParser xmlParser = new InvalidCharacterExceptionParser(); InputStream is = new ByteArrayInputStream( mPutMethod.getResponseBodyAsString().getBytes()); try { mForbiddenCharsInServer = xmlParser.parseXMLResponse(is); } catch (Exception e) { mForbiddenCharsInServer = false; Log_OC.e(TAG, "Exception reading exception from server", e); } } client.exhaustResponse(mPutMethod.getResponseBodyAsStream()); } finally { mPutMethod.releaseConnection(); } return status; }

Target:
protected int uploadFile(OwnCloudClient client) throws HttpException, IOException, OperationCancelledException { int status = -1; try { File f = new File(mLocalPath); mEntity = new FileRequestEntity(f, mMimeType); synchronized (mDataTransferListeners) { ((ProgressiveDataTransferer)mEntity) .addDatatransferProgressListeners(mDataTransferListeners); } mPutMethod.addRequestHeader(OC_TOTAL_LENGTH_HEADER, String.valueOf(f.length())); mPutMethod.setRequestEntity(mEntity); status = client.executeMethod(mPutMethod); if (status == 400) { InvalidCharacterExceptionParser xmlParser = new InvalidCharacterExceptionParser(); InputStream is = new ByteArrayInputStream( mPutMethod.getResponseBodyAsString().getBytes()); try { mForbiddenCharsInServer = xmlParser.parseXMLResponse(is); } catch (Exception e) { mForbiddenCharsInServer = false; Log_OC.e(TAG, "Exception reading exception from server", e); } } client.exhaustResponse(mPutMethod.getResponseBodyAsStream()); } finally { mPutMethod.releaseConnection(); } return status; }
Source:
public void sendToConfigHost(RuntimeEnvironment env, String host, int port) { LOGGER.log(Level.INFO, "Sending configuration to: {0}:{1}", new Object[]{host, Integer.toString(port)}); try { env.writeConfiguration(host, port); } catch (IOException ex) { LOGGER.log(Level.SEVERE, "Failed to send configuration to " + host + " (is web application server running with opengrok deployed?)", ex); } LOGGER.info("Configuration update routine done, check log output for errors."); }

Target:
public void sendToConfigHost(RuntimeEnvironment env, String host, int port) { LOGGER.log(Level.INFO, "Sending configuration to: {0}:{1}", new Object[]{host, Integer.toString(port)}); try { env.writeConfiguration(host, port); } catch (IOException ex) { LOGGER.log(Level.SEVERE, String.format( "Failed to send configuration to %s:%d " + "(is web application server running with opengrok deployed?)", host, port), ex); } LOGGER.info("Configuration update routine done, check log output for errors."); }
Source:
private DataPoint rr_ave_update(List<DataPoint> rpeak_temp1, DataPointStream rr_ave, long initial_ts) { List<Long> peak_interval = new ArrayList<Long>(); DataPoint result = rr_ave.data.get(rr_ave.data.size() - 1); if (rpeak_temp1.size() != 0) { peak_interval.add(rpeak_temp1.get(0).timestamp-initial_ts); for (int i = 1; i < rpeak_temp1.size(); i++) { peak_interval.add(rpeak_temp1.get(i).timestamp - rpeak_temp1.get(i - 1).timestamp); } if (peak_interval.size() >= AUTOSENSE.PEAK_INTERVAL_MINIMUM_SIZE) { for (int i = peak_interval.size() - AUTOSENSE.PEAK_INTERVAL_MINIMUM_SIZE; i < peak_interval.size(); i++) { result.value += peak_interval.get(i); } rr_ave.add(new DataPoint(rpeak_temp1.get(rpeak_temp1.size() - 1).timestamp, result.value /= 8.0)); result = rr_ave.data.get(rr_ave.data.size() - 1); } } return result; }

Target:
private DataPoint rr_ave_update(List<DataPoint> rpeak_temp1, DataPointStream rr_ave, long initial_ts) { List<Long> peak_interval = new ArrayList<Long>(); DataPoint result = rr_ave.data.get(rr_ave.data.size() - 1); if (rpeak_temp1.size() != 0) { peak_interval.add(rpeak_temp1.get(0).timestamp-initial_ts); for (int i = 1; i < rpeak_temp1.size(); i++) { peak_interval.add(rpeak_temp1.get(i).timestamp - rpeak_temp1.get(i - 1).timestamp); } if (peak_interval.size() >= AUTOSENSE.PEAK_INTERVAL_MINIMUM_SIZE) { long rr_ave_temp = 0; for (int i = peak_interval.size() - AUTOSENSE.PEAK_INTERVAL_MINIMUM_SIZE; i < peak_interval.size(); i++) { rr_ave_temp += peak_interval.get(i); } rr_ave.add(new DataPoint(rpeak_temp1.get(rpeak_temp1.size() - 1).timestamp, rr_ave_temp / 8.0)); result = rr_ave.data.get(rr_ave.data.size() - 1); } } return result; }
Source:
private void registerChannelCreation(Channel channel, Object partitionKey, long now) { if (partitions.containsKey(partitionKey)) { channelId2Creation.putIfAbsent(channelId(channel), new ChannelCreation(now, partitionKey)); } }

Target:
private void registerChannelCreation(Channel channel, Object partitionKey, long now) { ChannelId id = channelId(channel); if (!channelId2Creation.containsKey(id)) { channelId2Creation.putIfAbsent(id, new ChannelCreation(now, partitionKey)); } }
Source:
public void clear() { queuedHooks.clear(); queuedHooksSizeB = 0; forRequest = null; warnThresholdBreached = false; }

Target:
public void clear() { queuedHooks.clear(); queuedHooksSizeB = 0; warnQueuedHooksSizeB = -1; maxQueuedHooksSizeB = -1; forRequest = null; warnThresholdBreached = false; }
Source:
public Long commit(String author, String commitComment, String parentLockContext) { if (!isDirty()) { return -1L; } final DatastoreLockContext lockContext = createLockContext(service(User.class).getUsername(), parentLockContext); final DatastoreLockTarget lockTarget = createLockTarget(id(), path()); IOperationLockManager locks = service(IOperationLockManager.class); Commit commit = null; try { acquireLock(locks, lockContext, lockTarget); final Long timestamp = service(TimestampProvider.class).getTimestamp(); log().info("Persisting changes to {}@{}", path(), timestamp); commit = staging.commit(null, timestamp, author, commitComment); log().info("Changes have been successfully persisted to {}@{}.", path(), timestamp); return commit == null ? null : commit.getTimestamp(); } catch (final IndexException e) { Throwable rootCause = Throwables.getRootCause(e); if (rootCause instanceof CycleDetectedException) { throw (CycleDetectedException) rootCause; } throw new SnowowlRuntimeException(e.getMessage(), e); } finally { locks.unlock(lockContext, lockTarget); if (commit != null) { new RepositoryCommitNotification(id(), commit.getId(), commit.getGroupId(), commit.getBranch(), commit.getTimestamp(), commit.getAuthor(), commit.getComment(), getNewObjects(commit), getChangedObjects(commit), getRemovedObjects(commit), commit.getMergeSource()) .publish(service(IEventBus.class)); } clear(); } }

Target:
public Long commit(String author, String commitComment, String parentLockContext) { if (!isDirty()) { return -1L; } final DatastoreLockContext lockContext = createLockContext(service(User.class).getUsername(), parentLockContext); final DatastoreLockTarget lockTarget = createLockTarget(id(), path()); IOperationLockManager locks = service(IOperationLockManager.class); Commit commit = null; try { acquireLock(locks, lockContext, lockTarget); final long timestamp = service(TimestampProvider.class).getTimestamp(); log().info("Persisting changes to {}@{}", path(), timestamp); commit = staging.commit(null, timestamp, author, commitComment); log().info("Changes have been successfully persisted to {}@{}.", path(), timestamp); return commit == null ? null : commit.getTimestamp(); } catch (final IndexException e) { Throwable rootCause = Throwables.getRootCause(e); if (rootCause instanceof CycleDetectedException) { throw (CycleDetectedException) rootCause; } throw new SnowowlRuntimeException(e.getMessage(), e); } finally { locks.unlock(lockContext, lockTarget); if (commit != null) { new RepositoryCommitNotification(id(), commit.getId(), commit.getGroupId(), commit.getBranch(), commit.getTimestamp(), commit.getAuthor(), commit.getComment(), getNewObjects(commit), getChangedObjects(commit), getRemovedObjects(commit), commit.getMergeSource()) .publish(service(IEventBus.class)); } clear(); } }
Source:
public void testVisibilityDefaultMemberFunction() throws Exception { IBinding[] memberBindings = findQualifiedPossiblyImplicit(pdom, "AClass::defaultMemFun"); assertVisibility(ICPPClassType.v_private, getMemberVisibility(memberBindings[0])); }

Target:
public void testVisibilityDefaultMemberFunction() throws Exception { IBinding[] defaultFunction = findQualifiedPossiblyImplicit(pdom, "A::defaultMemFun"); assertVisibility(ICPPClassType.v_private, getMemberVisibility(defaultFunction[0])); IBinding[] publicFunction = findQualifiedPossiblyImplicit(pdom, "A::publicMemFun"); assertVisibility(ICPPClassType.v_public, getMemberVisibility(publicFunction[0])); IBinding[] protectedFunction = findQualifiedPossiblyImplicit(pdom, "A::protectedMemFun"); assertVisibility(ICPPClassType.v_protected, getMemberVisibility(protectedFunction[0])); IBinding[] privateFunction = findQualifiedPossiblyImplicit(pdom, "A::privateMemFun"); assertVisibility(ICPPClassType.v_private, getMemberVisibility(privateFunction[0])); }
Source:
public double[] getNodeSensitivitiesForValue(final Interpolator1DDataBundle data, final Double value) { Validate.notNull(data, "data"); Validate.notNull(value, "value"); ArgumentChecker.isTrue(value < data.firstKey() || value > data.lastKey(), "value was within data range"); int nData = data.size(); double[] res = new double[nData]; Interpolator1DPiecewisePoynomialWithExtraKnotsDataBundle polyData = (Interpolator1DPiecewisePoynomialWithExtraKnotsDataBundle) data; double eps = polyData.getEps(); double small = polyData.getSmall(); if (Math.abs(value) < SMALL) { for (int i = 0; i < nData; ++i) { double den = Math.abs(polyData.getValues()[i]) < small ? eps : polyData.getValues()[i] * eps; double up = getPolynomialFunction().differentiate(polyData.getPiecewisePolynomialResultUp()[i], value) .getData()[0]; double dw = getPolynomialFunction().differentiate(polyData.getPiecewisePolynomialResultDw()[i], value) .getData()[0]; res[i] = 0.5 * (up - dw) / den; } } else { for (int i = 0; i < nData; ++i) { double den = Math.abs(polyData.getValues()[i]) < small ? eps : polyData.getValues()[i] * eps; double up = getPolynomialFunction().evaluate(polyData.getPiecewisePolynomialResultUp()[i], value).getData()[0]; double dw = getPolynomialFunction().evaluate(polyData.getPiecewisePolynomialResultDw()[i], value).getData()[0]; res[i] = 0.5 * (up - dw) / den / value; } } return res; }

Target:
public double[] getNodeSensitivitiesForValue(final Interpolator1DDataBundle data, final Double value) { Validate.notNull(data, "data"); Validate.notNull(value, "value"); ArgumentChecker.isTrue(value < data.firstKey() || value > data.lastKey(), "value was within data range"); Validate.isTrue(data instanceof Interpolator1DPiecewisePoynomialWithExtraKnotsDataBundle); Interpolator1DPiecewisePoynomialWithExtraKnotsDataBundle polyData = (Interpolator1DPiecewisePoynomialWithExtraKnotsDataBundle) data; return _interpolator.getNodeSensitivitiesForValue(polyData, value, _func, SMALL); }
Source:
private Config run(InputStream is, ReportsBean reports) throws JumbuneException, IOException, JSchException, InterruptedException { JobConfig jobConfig = null; try{ jobConfig = JobConfigUtil.jobConfig(is); JobConfigUtil jobConfigUtil = new JobConfigUtil(jobConfig); loadInitialSetup(jobConfig); disableModules(jobConfig); jobConfigUtil.createJumbuneDirectories(); createJobJarFolderOnAgent(jobConfig); startExecution(reports, jobConfig); }finally{ try { LOGGER.debug("Clean up process slave tmp + agent home shell case"); cleanUpJumbuneAgentCurrentJobFolder(jobConfig); cleanUpSlavesTempFldr(jobConfig); deleteTokenFile(); } catch (Exception e) { LOGGER.error("Exception occurred in clean up slaves tmp folder ", e); } ConsoleLogUtil.CONSOLELOGGER.debug("clean up done"); } return jobConfig; }

Target:
private Config run(InputStream is, ReportsBean reports) throws JumbuneException, IOException, JSchException, InterruptedException { JobConfig jobConfig = null; try{ jobConfig = JobConfigUtil.jobConfig(is); JobConfigUtil jobConfigUtil = new JobConfigUtil(jobConfig); loadInitialSetup(jobConfig); disableModules(jobConfig); jobConfigUtil.createJumbuneDirectories(); createJobJarFolderOnAgent(jobConfig); startExecution(reports, jobConfig); }finally{ try { LOGGER.debug("Cleaning up agent and slaves temporary directories"); cleanUpJumbuneAgentCurrentJobFolder(jobConfig); cleanUpSlavesTempFldr(jobConfig); deleteTokenFile(); } catch (Exception e) { LOGGER.error("Exception occurred in clean up slaves tmp folder ", e); } ConsoleLogUtil.CONSOLELOGGER.debug("clean up done"); } return jobConfig; }
Source:
private BulkActionView findBulkActionByQuery(final String luceneQuery, final User user) throws DotDataException { try { final String prepareBulkActionsQuery = LuceneQueryUtils .prepareBulkActionsQuery(luceneQuery); final String query = "{\n" + " \"query\" : { \n" + " \"query_string\" : {\n" + " \"query\" : \"%s\"\n" + " } \n" + "\n" + " },\n" + " \"aggs\" : {\n" + " \"tag\" : {\n" + " \"terms\" : {\n" + " \"field\" : \"wfstep\",\n" + " \"size\" : 1000 \n" + " }\n" + " }\n" + " },\n" + "\t\"size\":0 \n" + "}"; final String preparedQuery = String.format(query, prepareBulkActionsQuery); final SearchResponse response = this.contentletAPI .esSearchRaw(preparedQuery.toLowerCase(), false, user, false); Logger.debug(getClass(), () -> "luceneQuery: " + prepareBulkActionsQuery); Logger.debug(getClass(), () -> "esSearch: " + query); return this.buildBulkActionView(response, user); } catch (Exception e) { throw new DotDataException(e); } }

Target:
private BulkActionView findBulkActionByQuery(final String luceneQuery, final User user) throws DotDataException { try { final String prepareBulkActionsQuery = LuceneQueryUtils .prepareBulkActionsQuery(luceneQuery); final String query = String.format(BULK_ACTIONS_QUERY_WRAPPER, prepareBulkActionsQuery); final SearchResponse response = this.contentletAPI .esSearchRaw(query.toLowerCase(), false, user, false); Logger.debug(getClass(), () -> "luceneQuery: " + prepareBulkActionsQuery); return this.buildBulkActionView(response, user); } catch (Exception e) { throw new DotDataException(e); } }
Source:
private static boolean postAggregatorDirectColumnIsOk( final RowSignature aggregateRowSignature, final DruidExpression expression, final RexNode rexNode ) { if (!expression.isDirectColumnAccess()) { return false; } final ValueType columnValueType = aggregateRowSignature.getColumnType(expression.getDirectColumn()); if (expression.isDirectColumnAccess() && columnValueType == ValueType.COMPLEX) { return true; } final ExprType toExprType = Expressions.exprTypeForValueType(columnValueType); final ExprType fromExprType = Expressions.exprTypeForValueType( Calcites.getValueTypeForSqlTypeName(rexNode.getType().getSqlTypeName()) ); return toExprType.equals(fromExprType); }

Target:
private static boolean postAggregatorDirectColumnIsOk( final RowSignature aggregateRowSignature, final DruidExpression expression, final RexNode rexNode ) { if (!expression.isDirectColumnAccess()) { return false; } final ValueType columnValueType = aggregateRowSignature.getColumnType(expression.getDirectColumn()); if (columnValueType == ValueType.COMPLEX) { return true; } final ExprType toExprType = Expressions.exprTypeForValueType(columnValueType); final ExprType fromExprType = Expressions.exprTypeForValueType( Calcites.getValueTypeForSqlTypeName(rexNode.getType().getSqlTypeName()) ); return toExprType.equals(fromExprType); }
Source:
public void notifyCacheEntryCreated(K key, V value, boolean pre, InvocationContext ctx, FlagAffectedCommand command) { if (!cacheEntryCreatedListeners.isEmpty()) { EventImpl<K, V> e = EventImpl.createEvent(cache, CACHE_ENTRY_CREATED); configureEvent(e, key, value, pre, ctx, command, null, null); boolean isLocalNodePrimaryOwner = clusteringDependentLogic.localNodeIsPrimaryOwner(key); boolean sendEvents = !ctx.isInTxScope(); try { for (CacheEntryListenerInvocation<K, V> listener : cacheEntryCreatedListeners) listener.invoke(e, isLocalNodePrimaryOwner); if (sendEvents) { eventManager.sendEvents(); sendEvents = false; } } finally { if (sendEvents) { eventManager.dropEvents(); } } } }

Target:
public void notifyCacheEntryCreated(K key, V value, boolean pre, InvocationContext ctx, FlagAffectedCommand command) { if (!cacheEntryCreatedListeners.isEmpty()) { EventImpl<K, V> e = EventImpl.createEvent(cache, CACHE_ENTRY_CREATED); configureEvent(e, key, value, pre, ctx, command, null, null); boolean isLocalNodePrimaryOwner = clusteringDependentLogic.localNodeIsPrimaryOwner(key); boolean sendEvents = !ctx.isInTxScope(); try { for (CacheEntryListenerInvocation<K, V> listener : cacheEntryCreatedListeners) { listener.invoke(e, isLocalNodePrimaryOwner); } if (sendEvents) { eventManager.sendEvents(); sendEvents = false; } } finally { if (sendEvents) { eventManager.dropEvents(); } } } }
Source:
RequestRateLimiter(long maxRequestsPerSecond, long maxUniqueFeatures, Function<ContainerRequestContext, Optional<T>> requestFeatureFunc) { this.requestFeatureFunc = requestFeatureFunc; this.limiters = CacheBuilder.newBuilder() .maximumSize(maxUniqueFeatures) .build(new CacheLoader<T, RateLimiter>() { @Override public RateLimiter load(T key) throws Exception { return RateLimiter.create(maxRequestsPerSecond); } }); }

Target:
RequestRateLimiter(long maxRequestsPerSecond, long maxUniqueFeatures, Function<ContainerRequestContext, Optional<T>> requestFeatureFunc) { this.requestFeatureFunc = requestFeatureFunc; this.limiters = CacheBuilder.newBuilder() .maximumSize(maxUniqueFeatures) .expireAfterAccess(10, TimeUnit.MINUTES) .build(new CacheLoader<T, RateLimiter>() { @Override public RateLimiter load(T key) throws Exception { return RateLimiter.create(maxRequestsPerSecond); } }); }
Source:
private void scrollToSection(@Nullable Section section) { if (section == null) { return; } bridge.execute(JavaScriptActionHandler.prepareToScrollTo(section.getAnchor(), "{ highlight: false }")); if (section.getId() == ABOUT_SECTION_ID) { bridge.execute(JavaScriptActionHandler.scrollToFooter(webView.getContext())); } else { final int topScrollExtra = 64; int offset = DimenUtil.roundedDpToPx(adapter.getYOffset(section.getId()) - topScrollExtra); webView.setScrollY(section.getId() == 0 ? 0 : offset); } }

Target:
private void scrollToSection(@Nullable Section section) { if (section == null) { return; } if (section.getId() == ABOUT_SECTION_ID) { bridge.execute(JavaScriptActionHandler.scrollToFooter(webView.getContext())); } else { bridge.execute(JavaScriptActionHandler.prepareToScrollTo(section.getAnchor(), "{ highlight: false }")); } }
Source:
public String apply(ProjectResource rsrc) throws AuthException, ResourceNotFoundException, IOException { Repository repo = null; try { repo = repoManager.openRepository(rsrc.getNameKey()); String headRef = repo.getRef(Constants.HEAD).getTarget().getName(); if (!rsrc.getControl().controlForRef(headRef).isVisible()) { throw new AuthException(); } return headRef; } catch (RepositoryNotFoundException e) { throw new ResourceNotFoundException(rsrc.getName()); } finally { if (repo != null) { repo.close(); } } }

Target:
public String apply(ProjectResource rsrc) throws AuthException, ResourceNotFoundException, IOException { Repository repo = null; try { repo = repoManager.openRepository(rsrc.getNameKey()); Ref head = repo.getRef(Constants.HEAD); if (head == null) { throw new ResourceNotFoundException(Constants.HEAD); } else if (head.isSymbolic()) { String n = head.getTarget().getName(); if (rsrc.getControl().controlForRef(n).isVisible()) { return n; } throw new AuthException(); } else if (head.getObjectId() != null) { if (rsrc.getControl().isOwner()) { return head.getObjectId().name(); } throw new AuthException(); } throw new ResourceNotFoundException(Constants.HEAD); } catch (RepositoryNotFoundException e) { throw new ResourceNotFoundException(rsrc.getName()); } finally { if (repo != null) { repo.close(); } } }
Source:
public synchronized Iterable<Cache<K,V>> iterateAllCaches() { return caches; }

Target:
public synchronized Iterable<Cache<K, V>> iterateAllCaches() { return new ArrayList<Cache<K, V>>(caches); }
Source:
SolrOutputFormatProvider(BatchSolrSearchConfig batchConfig) { this.conf = new HashMap<>(); conf.put("solr.server.url", batchConfig.getSolrHost()); conf.put("solr.server.mode", batchConfig.getSolrMode()); conf.put("solr.server.collection", batchConfig.getCollectionName()); conf.put("solr.server.keyfield", batchConfig.getKeyField()); conf.put("solr.batch.size", batchConfig.getBatchSize()); if (batchConfig.getOutputFieldMappings() == null) { conf.put("solr.output.field.mappings", ""); } else { conf.put("solr.output.field.mappings", batchConfig.getOutputFieldMappings()); } }

Target:
SolrOutputFormatProvider(BatchSolrSearchConfig batchConfig) { this.conf = new HashMap<>(); conf.put(SolrRecordWriter.SERVER_URL, batchConfig.getSolrHost()); conf.put(SolrRecordWriter.SERVER_MODE, batchConfig.getSolrMode()); conf.put(SolrRecordWriter.COLLECTION_NAME, batchConfig.getCollectionName()); conf.put(SolrRecordWriter.KEY_FIELD, batchConfig.getKeyField()); conf.put(SolrRecordWriter.BATCH_SIZE, batchConfig.getBatchSize()); if (batchConfig.getOutputFieldMappings() == null) { conf.put(SolrRecordWriter.FIELD_MAPPINGS, ""); } else { conf.put(SolrRecordWriter.FIELD_MAPPINGS, batchConfig.getOutputFieldMappings()); } }
Source:
private NacosConfigListener createTargetListener(String key, String group) { String normalizedKey = normalizedKey(key); NacosConfigListener configListener = new NacosConfigListener(); configListener.fillContext(normalizedKey, group); return configListener; }

Target:
private NacosConfigListener createTargetListener(String key, String group) { NacosConfigListener configListener = new NacosConfigListener(); configListener.fillContext(key, group); return configListener; }
Source:
public void setSystemPurposeStatus(String systemPurposeStatus) { this.systemPurposeStatus = systemPurposeStatus; this.setRHCloudProfileModified(new Date()); }

Target:
public void setSystemPurposeStatus(String systemPurposeStatus) { this.systemPurposeStatus = systemPurposeStatus; }
Source:
public void testNameToFullModuleNameMap() throws Exception { final Set<Class<?>> classes = CheckUtil.getCheckstyleModules(); final Class<PackageObjectFactory> packageObjectFactoryClass = PackageObjectFactory.class; final Field field = packageObjectFactoryClass.getDeclaredField("NAME_TO_FULL_MODULE_NAME"); field.setAccessible(true); final Collection<String> canonicalNames = ((Map<String, String>) field.get(null)).values(); final Optional<Class<?>> optional1 = classes.stream() .filter(clazz -> { return !canonicalNames.contains(clazz.getCanonicalName()) && !"com.puppycrawl.tools.checkstyle.meta.JavadocMetadataScraper" .equals(clazz.getName()); }).findFirst(); if (optional1.isPresent()) { fail("Invalid canonical name: " + optional1.get()); } final Optional<String> optional2 = canonicalNames.stream().filter(canonicalName -> { return classes.stream().map(Class::getCanonicalName) .noneMatch(clssCanonicalName -> clssCanonicalName.equals(canonicalName)); }).findFirst(); if (optional2.isPresent()) { fail("Invalid class: " + optional2.get()); } }

Target:
public void testNameToFullModuleNameMap() throws Exception { final Set<Class<?>> classes = CheckUtil.getCheckstyleModules(); final Class<PackageObjectFactory> packageObjectFactoryClass = PackageObjectFactory.class; final Field field = packageObjectFactoryClass.getDeclaredField("NAME_TO_FULL_MODULE_NAME"); field.setAccessible(true); final Collection<String> canonicalNames = ((Map<String, String>) field.get(null)).values(); final Optional<Class<?>> optional1 = classes.stream() .filter(clazz -> { return !canonicalNames.contains(clazz.getCanonicalName()) && !Definitions.INTERNAL_MODULES.contains(clazz.getName()); }).findFirst(); if (optional1.isPresent()) { fail("Invalid canonical name: " + optional1.get()); } final Optional<String> optional2 = canonicalNames.stream().filter(canonicalName -> { return classes.stream().map(Class::getCanonicalName) .noneMatch(clssCanonicalName -> clssCanonicalName.equals(canonicalName)); }).findFirst(); if (optional2.isPresent()) { fail("Invalid class: " + optional2.get()); } }
Source:
public void testLongFileNameThatRequiresEncoding() { String str = "+" + StringUtils.repeat("1", 255); String result = fileManager.getFileName(TaskTestUtil.createMockTask(str), true); assertNotNull(result); assertTrue(result.length() <= 255); assertEquals( "%2B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111.3664039548", result); }

Target:
public void testLongFileNameThatRequiresEncoding() { String str = "+" + StringUtils.repeat("1", 255); String result = fileManager.getFileName(TaskTestUtil.createMockTask(str), false); assertEquals("%2B" + StringUtils.repeat("1", 237) + ".3664039548", result); result = fileManager.getFileName(TaskTestUtil.createMockTask(str), true); assertEquals(str.replaceAll("\\+", "%2B"), result); }
Source:
public Map<String, Serializable> getStringSerializableMap(SchedulingService service, TaskTerminationData taskToTerminate) throws Exception { Map<String, Serializable> variables = new HashMap<>(); RunningTaskData taskData = taskToTerminate.taskData; TaskResultImpl taskResult = taskToTerminate.taskResult; InternalJob internalJob = taskToTerminate.internalJob; if (!taskToTerminate.normalTermination || taskResult == null) { List<InternalTask> iDependences = taskData.getTask().getIDependences(); if (iDependences != null) { List<TaskId> parentIds = new ArrayList<>(iDependences.size()); for (int i = 0; i < iDependences.size(); i++) { parentIds.add(iDependences.get(i).getId()); } Map<TaskId, TaskResult> taskResults = service.getInfrastructure().getDBManager() .loadTasksResults( taskData.getTask().getJobId(), parentIds); getResultsFromListOfTaskResults(variables, taskResults); } else { if (internalJob != null) variables.putAll(taskData.getTask().getVariablesOverriden(internalJob)); } variables.put(SchedulerVars.PA_TASK_SUCCESS.toString(), Boolean.toString(false)); } else if (taskResult.hadException()) { variables = fillMapWithTaskResult(taskResult, false); } else { variables = fillMapWithTaskResult(taskResult, true); } return variables; }

Target:
public VariablesMap getStringSerializableMap(SchedulingService service, TaskTerminationData taskToTerminate) throws Exception { VariablesMap variablesMap = new VariablesMap(); RunningTaskData taskData = taskToTerminate.taskData; TaskResultImpl taskResult = taskToTerminate.taskResult; InternalJob internalJob = taskToTerminate.internalJob; variablesMap.setScopeMap(taskData.getTask().getSerializableVariables()); if (!taskToTerminate.normalTermination || taskResult == null) { List<InternalTask> iDependences = taskData.getTask().getIDependences(); if (iDependences != null) { List<TaskId> parentIds = new ArrayList<>(iDependences.size()); for (int i = 0; i < iDependences.size(); i++) { parentIds.add(iDependences.get(i).getId()); } Map<TaskId, TaskResult> taskResults = service.getInfrastructure().getDBManager() .loadTasksResults( taskData.getTask().getJobId(), parentIds); getResultsFromListOfTaskResults(variablesMap.getInheritedMap(), taskResults); } else { if (internalJob != null) variablesMap.getInheritedMap().putAll(internalJob.getVariables()); } variablesMap.getInheritedMap().put(SchedulerVars.PA_TASK_SUCCESS.toString(), Boolean.toString(false)); } else if (taskResult.hadException()) { variablesMap.setInheritedMap(fillMapWithTaskResult(taskResult, false)); } else { variablesMap.setInheritedMap(fillMapWithTaskResult(taskResult, true)); } return variablesMap; }
Source:
public DefaultZooKeeperClient(final CuratorFramework client, final String clusterId) { this.client = client; this.clusterId = clusterId; if (clusterId == null) { this.clusterIdExists = null; this.watcher = null; this.connectionStateListener = null; return; } this.clusterIdExists = new AtomicBoolean(false); this.watcher = new Watcher() { @Override public void process(WatchedEvent event) { log.info("DefaultZooKeeperClient processing WatchedEvent - {}", event); checkClusterIdExists(clusterId, "watcher"); } }; connectionStateListener = new ConnectionStateListener() { @Override public void stateChanged(CuratorFramework client, ConnectionState newState) { log.info("DefaultZooKeeperClient connection state change - {}", newState); if (newState == ConnectionState.RECONNECTED || newState == ConnectionState.CONNECTED) { checkClusterIdExists(clusterId, "connectionStateListener"); } } }; }

Target:
public DefaultZooKeeperClient(final CuratorFramework client, final String clusterId) { this.client = client; this.clusterId = clusterId; if (clusterId == null) { this.clusterIdExists = null; this.watcher = null; this.connectionStateListener = null; return; } this.clusterIdExists = new AtomicBoolean(false); this.watcher = new Watcher() { @Override public void process(WatchedEvent event) { log.info("DefaultZooKeeperClient processing WatchedEvent - {}", event); checkClusterIdExists(clusterId, "watcher"); } }; connectionStateListener = new ConnectionStateListener() { @Override public void stateChanged(CuratorFramework client, ConnectionState newState) { log.info("DefaultZooKeeperClient connection state change - {}", newState); if (newState.isConnected()) { checkClusterIdExists(clusterId, "connectionStateListener"); } } }; }
Source:
public SerializableTransactionManager serializable() { List<AutoCloseable> closeables = Lists.newArrayList(); try { return serializableInternal(closeables); } catch (Throwable throwable) { log.warn("Exception thrown when creating transaction manager. " + "Closing previously opened resources", throwable); closeables.forEach(autoCloseable -> { try { autoCloseable.close(); } catch (Exception ex) { log.info("Error closing {}", SafeArg.of("klass", autoCloseable.getClass()), ex); } }); throw throwable; } }

Target:
public SerializableTransactionManager serializable() { List<AutoCloseable> closeables = Lists.newArrayList(); try { return serializableInternal(closeables); } catch (Throwable throwable) { List<String> closeablesClasses = closeables.stream() .map(autoCloseable -> autoCloseable.getClass().toString()) .collect(Collectors.toList()); log.warn("Exception thrown when creating transaction manager. " + "Closing previously opened resources: {}", SafeArg.of("classes", closeablesClasses.toString()), throwable); closeables.forEach(autoCloseable -> { try { autoCloseable.close(); } catch (Exception ex) { log.info("Error closing {}", SafeArg.of("class", autoCloseable.getClass().toString()), ex); } }); throw throwable; } }
Source:
private void renderDiffBaseListBox(ChangeInfo info) { JsArray<RevisionInfo> list = info.revisions().values(); RevisionInfo.sortRevisionInfoByNumber(list); int selectedIdx = list.length(); for (int i = list.length() - 1; i >= 0; i--) { RevisionInfo r = list.get(i); diffBase.addItem( r._number() + ": " + r.name().substring(0, 6), r.name()); if (r.name().equals(revision)) { SelectElement.as(diffBase.getElement()).getOptions() .getItem(diffBase.getItemCount() - 1).setDisabled(true); } if (base != null) { if (base.equals(String.valueOf(r._number()))) { selectedIdx = list.length() - i - 1; } } } RevisionInfo rev = info.revisions().get(revision); JsArray<CommitInfo> parents = rev.commit().parents(); diffBase.addItem( parents.length() > 1 ? Util.C.autoMerge() : Util.C.baseDiffItem(), ""); diffBase.setSelectedIndex(selectedIdx); }

Target:
private void renderDiffBaseListBox(ChangeInfo info) { JsArray<RevisionInfo> list = info.revisions().values(); RevisionInfo.sortRevisionInfoByNumber(list); int selectedIdx = list.length(); for (int i = list.length() - 1; i >= 0; i--) { RevisionInfo r = list.get(i); diffBase.addItem( r._number() + ": " + r.name().substring(0, 6), r.name()); if (r.name().equals(revision)) { SelectElement.as(diffBase.getElement()).getOptions() .getItem(diffBase.getItemCount() - 1).setDisabled(true); } if (base != null && base.equals(String.valueOf(r._number()))) { selectedIdx = diffBase.getItemCount() - 1; } } RevisionInfo rev = info.revisions().get(revision); JsArray<CommitInfo> parents = rev.commit().parents(); diffBase.addItem( parents.length() > 1 ? Util.C.autoMerge() : Util.C.baseDiffItem(), ""); diffBase.setSelectedIndex(selectedIdx); }
Source:
public PagedArrayList(KeysetPage keyset, long totalSize, int firstResult, int maxResults) { this.keyset = keyset; this.totalSize = totalSize; this.page = (int) Math.floor((firstResult == -1 ? 0 : firstResult) * 1d / maxResults) + 1; this.totalPages = totalSize < 1 ? (int) totalSize : (int) Math.ceil(totalSize * 1d / maxResults); this.firstResult = firstResult; this.maxResults = maxResults; }

Target:
public PagedArrayList(KeysetPage keyset, long totalSize, int firstResult, int maxResults) { this.keyset = keyset; this.totalSize = totalSize; this.page = (int) Math.floor((firstResult == -1 ? 0 : firstResult) * 1d / maxResults) + 1; this.totalPages = totalSize < 1 ? 0 : (int) Math.ceil(totalSize * 1d / maxResults); this.firstResult = firstResult; this.maxResults = maxResults; }
Source:
public void generate(JNIMethod method) { List<String> tags = new ArrayList<>(); String data = ((AbstractItem)method).flatten(); if (data != null && data.length() != 0) { tags.add("@method " + data); } JNIParameter[] params = method.getParameters(); for (JNIParameter param2 : params) { ASTParameter param = (ASTParameter)param2; param.setCast(param.getCast()); data = ((AbstractItem)param).flatten(); if (data != null && data.length() != 0) { tags.add("@param " + param.getName() + " " + data); } } if (tags.size() == 0) return; if (tags.size() == 1) { String doc = " " + delimiter; inserts.put(Integer.valueOf(((ASTMethod)method).start), doc); } else { StringBuilder buffer = new StringBuilder(); buffer.append(" "); buffer.append(delimiter); inserts.put(Integer.valueOf(((ASTMethod)method).start), buffer.toString()); } }

Target:
public void generate(JNIMethod method) { List<String> tags = new ArrayList<>(); String data = ((AbstractItem)method).flatten(); if (data != null && data.length() != 0) { tags.add("@method " + data); } for (JNIParameter p : method.getParameters()) { ASTParameter param = (ASTParameter)p; param.setCast(param.getCast()); data = ((AbstractItem)param).flatten(); if (data != null && data.length() != 0) { tags.add("@param " + param.getName() + " " + data); } } if (tags.size() == 0) return; if (tags.size() == 1) { String doc = " " + delimiter; inserts.put(Integer.valueOf(((ASTMethod)method).start), doc); } else { StringBuilder buffer = new StringBuilder(); buffer.append(" "); buffer.append(delimiter); inserts.put(Integer.valueOf(((ASTMethod)method).start), buffer.toString()); } }
Source:
private void executeQuery() { if (results == null) { validateNamedParameters(); QueryOperation op = cache.getOperationsFactory().newQueryOperation(this, cache.getDataFormat()); Object response = await(op.execute()); if (response instanceof QueryResponse) { QueryResponse resp = (QueryResponse) response; totalResults = (int) resp.getTotalResults(); results = unwrapResults(resp.getProjectionSize(), resp.getResults()); } if (response instanceof JsonObject) { JsonObject resp = (JsonObject) response; totalResults = resp.get(JSON_TOTAL_RESULTS).getAsInt(); JsonArray hits = resp.get(JSON_HITS).getAsJsonArray(); results = stream(hits.spliterator(), false) .map(hit -> hit.getAsJsonObject().get(JSON_HIT).toString()) .collect(Collectors.toList()); } } }

Target:
private void executeQuery() { if (results == null) { validateNamedParameters(); QueryOperation op = cache.getOperationsFactory().newQueryOperation(this, cache.getDataFormat()); BaseQueryResponse response = (BaseQueryResponse) await(op.execute()); totalResults = (int) response.getTotalResults(); try { results = response.extractResults(serializationContext); } catch (IOException e) { throw new HotRodClientException(e); } } }
Source:
public void purge(Condition condition, RequestContext requestContext) throws ResponseException { Context.getConditionService().purgeService(condition); }

Target:
public void purge(Condition condition, RequestContext requestContext) throws ResponseException { conditionService.purgeCondition(condition); }
Source:
public boolean run() { List<Jobby> jobs = Lists.newArrayList(); ensurePaths(); if (config.isDeterminingPartitions()) { if(config.getPartitionDimension() == null){ jobs.add(new DetermineHashedPartitionsJob(config)); } else { jobs.add(new DeterminePartitionsJob(config)); } } else { Map<DateTime, List<HadoopyShardSpec>> shardSpecs = Maps.newTreeMap(DateTimeComparator.getInstance()); int shardCount = 0; for (Interval segmentGranularity : config.getSegmentGranularIntervals()) { DateTime bucket = segmentGranularity.getStart(); final HadoopyShardSpec spec = new HadoopyShardSpec(new NoneShardSpec(), shardCount++); shardSpecs.put(bucket, Lists.newArrayList(spec)); log.info("DateTime[%s], spec[%s]", bucket, spec); } config.setShardSpecs(shardSpecs); } indexJob = new IndexGeneratorJob(config); jobs.add(indexJob); if (dbUpdaterJob != null) { jobs.add(dbUpdaterJob); } else { log.info("No updaterJobSpec set, not uploading to database"); } String failedMessage = null; for (Jobby job : jobs) { if (failedMessage == null) { if (!job.run()) { failedMessage = String.format("Job[%s] failed!", job.getClass()); } } } if (failedMessage == null) { publishedSegments = IndexGeneratorJob.getPublishedSegments(config); } if (!config.isLeaveIntermediate()) { if (failedMessage == null || config.isCleanupOnFailure()) { Path workingPath = config.makeIntermediatePath(); log.info("Deleting path[%s]", workingPath); try { workingPath.getFileSystem(new Configuration()).delete(workingPath, true); } catch (IOException e) { log.error(e, "Failed to cleanup path[%s]", workingPath); } } } if (failedMessage != null) { throw new ISE(failedMessage); } return true; }

Target:
public boolean run() { List<Jobby> jobs = Lists.newArrayList(); JobHelper.ensurePaths(config); indexJob = new IndexGeneratorJob(config); jobs.add(indexJob); if (dbUpdaterJob != null) { jobs.add(dbUpdaterJob); } else { log.info("No updaterJobSpec set, not uploading to database"); } JobHelper.runJobs(jobs, config); publishedSegments = IndexGeneratorJob.getPublishedSegments(config); return true; }
Source:
public void onPageFinishedLoading(String url) { LOG.d(TAG, "onPageFinished(" + url + ")"); clearLoadTimeoutTimer(); cordova.onCordovaInit(pluginManager); pluginManager.postMessage("onPageFinished", url); if (engine.getView().getVisibility() != View.VISIBLE) { Thread t = new Thread(new Runnable() { public void run() { try { Thread.sleep(2000); cordova.getActivity().runOnUiThread(new Runnable() { public void run() { pluginManager.postMessage("spinner", "stop"); } }); } catch (InterruptedException e) { } } }); t.start(); } if (url.equals("about:blank")) { pluginManager.postMessage("exit", null); } }

Target:
public void onPageFinishedLoading(String url) { LOG.d(TAG, "onPageFinished(" + url + ")"); clearLoadTimeoutTimer(); pluginManager.postMessage("onPageFinished", url); if (engine.getView().getVisibility() != View.VISIBLE) { Thread t = new Thread(new Runnable() { public void run() { try { Thread.sleep(2000); cordova.getActivity().runOnUiThread(new Runnable() { public void run() { pluginManager.postMessage("spinner", "stop"); } }); } catch (InterruptedException e) { } } }); t.start(); } if (url.equals("about:blank")) { pluginManager.postMessage("exit", null); } }
Source:
public MistWatermarkEvent getLatestWatermark() { if (latestWatermarkTimestamp == -1L) { return null; } else { return new MistWatermarkEvent(latestWatermarkTimestamp); } }

Target:
public MistWatermarkEvent getLatestWatermark() { return latestWatermark; }