auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public int visit(IASTName name) { if (!constructorsStack.empty()) { if (name.getParent() instanceof IASTFieldReference) { IASTFieldReference ref = (IASTFieldReference) name.getParent(); if (!referencesThis(ref.getFieldOwner())) return PROCESS_CONTINUE; } Set<IField> actualConstructorFields = constructorsStack.peek(); if (!actualConstructorFields.isEmpty()) { IBinding binding = name.resolveBinding(); if (binding != null && !(binding instanceof IProblemBinding)) { IField equivalentFieldBinding = getContainedEquivalentBinding(actualConstructorFields, binding, name.getTranslationUnit().getIndex()); if (equivalentFieldBinding != null) { Optional<Integer> res = CPPVariableReadWriteFlags.getReadWriteFlags(name); <START> if (!res.isPresent() || (res.get() & PDOMName.WRITE_ACCESS) != 0) { <END> actualConstructorFields.remove(equivalentFieldBinding); } } } } } return PROCESS_CONTINUE; }</code><technical_language>useful add helpers names suggest intended semantics. For example, a helper bool mayBeWriteAccess(Optional<Integer> flags) returns true if flags is present contains WRITE (meaning, a write access), flags is empty (meaning, know, be)</technical_language>

Target:
public int visit(IASTName name) { if (!constructorsStack.empty()) { if (name.getParent() instanceof IASTFieldReference) { IASTFieldReference ref = (IASTFieldReference) name.getParent(); if (!referencesThis(ref.getFieldOwner())) return PROCESS_CONTINUE; } Set<IField> actualConstructorFields = constructorsStack.peek(); if (!actualConstructorFields.isEmpty()) { IBinding binding = name.resolveBinding(); if (binding != null && !(binding instanceof IProblemBinding)) { IField equivalentFieldBinding = getContainedEquivalentBinding(actualConstructorFields, binding, name.getTranslationUnit().getIndex()); if (equivalentFieldBinding != null) { Optional<Integer> res = CPPVariableReadWriteFlags.getReadWriteFlags(name); if (CPPVariableReadWriteFlags.mayBeWriteAccess(res)) { actualConstructorFields.remove(equivalentFieldBinding); } } } } } return PROCESS_CONTINUE; }
Source:
<code>private int getCountOfTenants() throws UserStoreException { String sqlStmt = TenantConstants.LIST_TENANTS_COUNT_SQL; int tenantCount = 0; try (Connection dbConnection = getDBConnection(); PreparedStatement prepStmt = dbConnection.prepareStatement(sqlStmt)) { try (ResultSet rs = prepStmt.executeQuery()) { if (rs.next()) { tenantCount = Integer.parseInt(rs.getString(1)); } } } catch (SQLException e) { <START> throw new UserStoreException("Error occurred while retrieving tenant count"); <END> } return tenantCount; }</code><technical_language>**e** is missing</technical_language>

Target:
private int getCountOfTenants() throws UserStoreException { String sqlStmt = TenantConstants.LIST_TENANTS_COUNT_SQL; int tenantCount = 0; try (Connection dbConnection = getDBConnection(); PreparedStatement prepStmt = dbConnection.prepareStatement(sqlStmt)) { try (ResultSet rs = prepStmt.executeQuery()) { if (rs.next()) { tenantCount = Integer.parseInt(rs.getString(1)); } } } catch (SQLException e) { throw new UserStoreException("Error occurred while retrieving tenant count.", e); } return tenantCount; }
Source:
<code>public void blackHoleConnectorUsage() { assertThatQueryReturnsValue("CREATE TABLE nation as SELECT * FROM tpch.tiny.nation", 25L); queryRunner.execute("CREATE SCHEMA blackhole.test"); assertThatQueryReturnsValue("CREATE TABLE test.nation as SELECT * FROM tpch.tiny.nation", 25L); List<QualifiedObjectName> tableNames = listBlackHoleTables(); assertTrue(tableNames.size() == 1, "Expected only one table."); <START> assertTrue(tableNames.get(0).getObjectName().equals("nation"), "Expected 'nation' table."); <END> assertThatQueryReturnsValue("INSERT INTO nation SELECT * FROM tpch.tiny.nation", 25L); assertThatQueryReturnsValue("INSERT INTO nation SELECT * FROM tpch.tiny.nation", 25L); assertThatQueryReturnsValue("SELECT count(*) FROM nation", 0L); assertThatQueryReturnsValue("DROP TABLE nation", true); assertThatQueryReturnsValue("DROP TABLE test.nation", true); }</code><technical_language>extra line</technical_language>

Target:
public void blackHoleConnectorUsage() { assertThatQueryReturnsValue("CREATE TABLE nation as SELECT * FROM tpch.tiny.nation", 25L); List<QualifiedObjectName> tableNames = listBlackHoleTables(); assertTrue(tableNames.size() == 1, "Expected only one table."); assertTrue(tableNames.get(0).getObjectName().equals("nation"), "Expected 'nation' table."); assertThatQueryReturnsValue("INSERT INTO nation SELECT * FROM tpch.tiny.nation", 25L); assertThatQueryReturnsValue("INSERT INTO nation SELECT * FROM tpch.tiny.nation", 25L); assertThatQueryReturnsValue("SELECT count(*) FROM nation", 0L); assertThatQueryReturnsValue("DROP TABLE nation", true); }
Source:
<code>public TranslatedExpression<T> translate(FunctionMetadata functionMetadata, RowExpression original) { <START> return translate(functionMetadata, original, emptyList()); <END> }</code><technical_language>ImmutableList.of()</technical_language>

Target:
public TranslatedExpression<T> translate(FunctionMetadata functionMetadata, RowExpression original) throws Throwable { return translate(functionMetadata, original, ImmutableList.of()); }
Source:
<code>protected void executeQueryCommand() { getQueryReturnValue().setSucceeded(false); String path = Config.resolveCACertificatePath(); if (FileUtil.fileExists(path)) { try { getQueryReturnValue().setReturnValue(FileUtil.readAllText(path)); } catch (IOException e) { <START> getQueryReturnValue().setSucceeded(false); <END> return; } getQueryReturnValue().setSucceeded(true); } }</code><technical_language>This is redundant - set false begging of method. However, a bad idea do this: returnValue.setExceptionString(e.getMessage())</technical_language>

Target:
protected void executeQueryCommand() { getQueryReturnValue().setSucceeded(false); String path = Config.resolveCACertificatePath(); if (FileUtil.fileExists(path)) { try { getQueryReturnValue().setReturnValue(FileUtil.readAllText(path)); } catch (IOException e) { getQueryReturnValue().setExceptionString(e.getMessage()); return; } getQueryReturnValue().setSucceeded(true); } }
Source:
<code>public boolean isInEmergencySmsMode() { long lastSmsTimeMs = mTimeLastEmergencySmsSentMs; if (lastSmsTimeMs == -1) { return false; } CarrierConfigManager configManager = (CarrierConfigManager) getContext().getSystemService(Context.CARRIER_CONFIG_SERVICE); PersistableBundle b = configManager.getConfigForSubId(getSubId()); if (b == null) { return false; } int eSmsTimerMs = b.getInt(CarrierConfigManager.KEY_EMERGENCY_SMS_MODE_TIMER_MS_INT, 0); if (eSmsTimerMs == 0) { return false; } if (eSmsTimerMs > EMERGENCY_SMS_TIMER_MAX_MS) { eSmsTimerMs = EMERGENCY_SMS_TIMER_MAX_MS; } boolean isInEmergencySmsMode = SystemClock.elapsedRealtime() <= (lastSmsTimeMs + eSmsTimerMs); <START> if (!isInEmergencySmsMode) { <END> mTimeLastEmergencySmsSentMs = -1; } return isInEmergencySmsMode; }</code><technical_language>else case frequent. add a log for case, a locallog</technical_language>

Target:
public boolean isInEmergencySmsMode() { long lastSmsTimeMs = mTimeLastEmergencySmsSentMs; if (lastSmsTimeMs == EMERGENCY_SMS_NO_TIME_RECORDED) { return false; } CarrierConfigManager configManager = (CarrierConfigManager) getContext().getSystemService(Context.CARRIER_CONFIG_SERVICE); PersistableBundle b = configManager.getConfigForSubId(getSubId()); if (b == null) { return false; } int eSmsTimerMs = b.getInt(CarrierConfigManager.KEY_EMERGENCY_SMS_MODE_TIMER_MS_INT, 0); if (eSmsTimerMs == 0) { return false; } if (eSmsTimerMs > EMERGENCY_SMS_TIMER_MAX_MS) { eSmsTimerMs = EMERGENCY_SMS_TIMER_MAX_MS; } boolean isInEmergencySmsMode = SystemClock.elapsedRealtime() <= (lastSmsTimeMs + eSmsTimerMs); if (!isInEmergencySmsMode) { mTimeLastEmergencySmsSentMs = EMERGENCY_SMS_NO_TIME_RECORDED; } else { Rlog.i(LOG_TAG, "isInEmergencySmsMode: queried while emergency SMS mode is active."); } return isInEmergencySmsMode; }
Source:
<code>protected ICommand getBeforeSetCommand(final SetRequest request) { ICommand gmfCommand = super.getBeforeSetCommand(request); <START> if (request.getValue() instanceof ArrayList && request.getElementToEdit() instanceof AttributeOwner && request.getFeature().getName().equals("ownedAttribute")) { END> ArrayList<?> newPropertyList = (ArrayList<?>) request.getValue(); EList<Property> oldPropertyList = ((AttributeOwner) request.getElementToEdit()).getOwnedAttributes(); for (Object object : newPropertyList) { if (object instanceof Property && !oldPropertyList.contains(object) && (((Property) object).eContainer() instanceof Association)) { return UnexecutableCommand.INSTANCE; } } } return gmfCommand; }</code><technical_language>Isit reference UMLPackage.eInstance....</technical_language>

Target:
protected ICommand getBeforeSetCommand(final SetRequest request) { ICommand gmfCommand = super.getBeforeSetCommand(request); if (request.getValue() instanceof ArrayList && request.getElementToEdit() instanceof AttributeOwner && request.getFeature().equals(UMLPackage.eINSTANCE.getStructuredClassifier_OwnedAttribute())) { ArrayList<?> newPropertyList = (ArrayList<?>) request.getValue(); EList<Property> oldPropertyList = ((AttributeOwner) request.getElementToEdit()).getOwnedAttributes(); for (Object object : newPropertyList) { if (object instanceof Property && !oldPropertyList.contains(object) && (((Property) object).eContainer() instanceof Association)) { return UnexecutableCommand.INSTANCE; } } } return gmfCommand; }
Source:
<code>protected SeekableStreamIndexTaskIOConfig createTaskIoConfig( int groupId, Map<String, String> startPartitions, Map<String, String> endPartitions, String baseSequenceName, DateTime minimumMessageTime, DateTime maximumMessageTime, Set<String> exclusiveStartSequenceNumberPartitions, SeekableStreamSupervisorIOConfig ioConfigg ) { KinesisSupervisorIOConfig ioConfig = (KinesisSupervisorIOConfig) ioConfigg; return new KinesisIndexTaskIOConfig( groupId, baseSequenceName, new SeekableStreamPartitions<>(ioConfig.getStream(), startPartitions), new SeekableStreamPartitions<>(ioConfig.getStream(), endPartitions), true, <START> true, END> minimumMessageTime, maximumMessageTime, ioConfig.getEndpoint(), ioConfig.getRecordsPerFetch(), ioConfig.getFetchDelayMillis(), exclusiveStartSequenceNumberPartitions, ioConfig.getAwsAssumedRoleArn(), ioConfig.getAwsExternalId(), ioConfig.isDeaggregate() ); }</code><technical_language>pauseAfterRead is (and needed, removed Kafka implementation)</technical_language>

Target:
protected SeekableStreamIndexTaskIOConfig createTaskIoConfig( int groupId, Map<String, String> startPartitions, Map<String, String> endPartitions, String baseSequenceName, DateTime minimumMessageTime, DateTime maximumMessageTime, Set<String> exclusiveStartSequenceNumberPartitions, SeekableStreamSupervisorIOConfig ioConfigg ) { KinesisSupervisorIOConfig ioConfig = (KinesisSupervisorIOConfig) ioConfigg; return new KinesisIndexTaskIOConfig( groupId, baseSequenceName, new SeekableStreamPartitions<>(ioConfig.getStream(), startPartitions), new SeekableStreamPartitions<>(ioConfig.getStream(), endPartitions), true, minimumMessageTime, maximumMessageTime, ioConfig.getEndpoint(), ioConfig.getRecordsPerFetch(), ioConfig.getFetchDelayMillis(), exclusiveStartSequenceNumberPartitions, ioConfig.getAwsAssumedRoleArn(), ioConfig.getAwsExternalId(), ioConfig.isDeaggregate() ); }
Source:
<code>void enableButtonMenu() { <START> getSubMenu().setVisible(true); <END> }</code><technical_language>Enabling/disabling method names; changing visibility. nice method names implementation consistent (personally I prefer disable buttons hide User _see_ action perform disabled)</technical_language>

Target:
void enableButtonMenu() { getAddColumn().setEnabled(true); getEditColumns().setEnabled(true); }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_toolbar_container); showBackButton(); <START> try { <END> centerId = getIntent().getExtras().getInt(Constants.CENTER_ID); } catch (NullPointerException e) { Log.e(LOG_TAG, "No intent received for centerId"); } if (centerId != 0) { replaceFragment(GroupListFragment.newInstance(centerId), true, R.id.container); } else { replaceFragment(new CenterListFragment(), false, R.id.container); } }</code><technical_language>This is good idea put try catch. is Fix java @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_toolbar_container); showBackButton(); Bundle bundle= getIntent().getExtras(); if (bundle != null) { int centerId = bundle.getInt(Constants.CENTER_ID); replaceFragment(GroupListFragment.newInstance(centerId), true, R.id.container); } else { replaceFragment(new CenterListFragment(), false, R.id.container); } } Remove private int centerId = 0 variable also</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_toolbar_container); showBackButton(); Bundle bundle = getIntent().getExtras(); if (bundle != null) { int centerId = bundle.getInt(Constants.CENTER_ID); replaceFragment(GroupListFragment.newInstance(centerId), true, R.id.container); } else { replaceFragment(new CenterListFragment(), false, R.id.container); } }
Source:
<code>protected void onDraw(Canvas canvas) { <START> canvas.drawColor(0x40FFFFFF); <END> super.onDraw(canvas); }</code><technical_language>a named constant top of this file</technical_language>

Target:
protected void onDraw(Canvas canvas) { canvas.drawColor(INSPECT_OVERLAY_COLOR); super.onDraw(canvas); }
Source:
<code>public BoltResultHandle executeQuery( BoltQuerySource querySource, LoginContext loginContext, String statement, MapValue params, ThrowingAction<KernelException> onFail ) { InternalTransaction internalTransaction = queryService.beginTransaction( implicit, loginContext ); ClientConnectionInfo sourceDetails = new BoltConnectionInfo( querySource.principalName, querySource.clientName, querySource.connectionDescriptor.clientAddress(), querySource.connectionDescriptor.serverAddress() ); TransactionalContext transactionalContext = contextFactory.newContext( sourceDetails, internalTransaction, statement, params ); return new BoltResultHandle() { @Override public BoltResult start() throws KernelException { try { QueryResult run = ((ExecutionResult) queryExecutionEngine.executeQuery( statement, params, transactionalContext )) .queryResult(); return new CypherAdapterStream( run, clock ); } catch ( KernelException e ) { <START> transactionalContext.close( false ); <END> onFail.apply(); throw new QueryExecutionKernelException( e ); } catch ( Throwable e ) { transactionalContext.close( false ); onFail.apply(); throw e; } } @Override public void close( boolean success ) { transactionalContext.close( success ); } @Override public void terminate() { transactionalContext.terminate(); } }; }</code><technical_language>close(false)</technical_language>

Target:
public BoltResultHandle executeQuery( BoltQuerySource querySource, LoginContext loginContext, String statement, MapValue params, ThrowingAction<KernelException> onFail ) { InternalTransaction internalTransaction = queryService.beginTransaction( implicit, loginContext ); ClientConnectionInfo sourceDetails = new BoltConnectionInfo( querySource.principalName, querySource.clientName, querySource.connectionDescriptor.clientAddress(), querySource.connectionDescriptor.serverAddress() ); TransactionalContext transactionalContext = contextFactory.newContext( sourceDetails, internalTransaction, statement, params ); return new BoltResultHandle() { @Override public BoltResult start() throws KernelException { try { QueryResult run = ((ExecutionResult) queryExecutionEngine.executeQuery( statement, params, transactionalContext )) .queryResult(); return new CypherAdapterStream( run, clock ); } catch ( KernelException e ) { close( false ); onFail.apply(); throw new QueryExecutionKernelException( e ); } catch ( Throwable e ) { close( false ); onFail.apply(); throw e; } } @Override public void close( boolean success ) { transactionalContext.close( success ); } @Override public void terminate() { transactionalContext.terminate(); } }; }
Source:
<code>private void <START> executeDiskExtend() <END> { switch (getOldDisk().getDiskStorageType()) { case IMAGE: extendDiskImageSize(); break; case CINDER: extendCinderDiskSize(); break; } }</code><technical_language>I this is missing MANAGED_BLOCK_STORAGE</technical_language>

Target:
private void executeDiskExtend() { switch (getOldDisk().getDiskStorageType()) { case IMAGE: extendDiskImageSize(); break; case CINDER: extendCinderDiskSize(); break; case MANAGED_BLOCK_STORAGE: extendManagedBlockDiskSize(); break; } }
Source:
<code>public Map<String, String> getColors() { Map<String, String> colors = new HashMap<>(); boolean even = true; int hue = 60; final List<String> revisions = getRevisions() .stream() .sorted(Comparator.comparingInt(this::getFileVersion).reversed()) .collect(Collectors.toList()); for (String revision : revisions) { <START> colors.put(revision, String.format("hsl(%d, %d%%, %d%%)", hue, 90 - (even ? 0 : 10), 80 - (even ? 0 : 10))); <END> hue += 360 / getRevisions().size(); hue %= 360; even = !even; } return colors; }</code><technical_language>move (even ? 0 : 10) a var (adjust ?) for readability</technical_language>

Target:
public Map<String, String> getColors() { return colors.get(); }
Source:
<code>private void fetchMessages() { <START> Set<SystemStreamPartition> SSPsToFetch = new HashSet<>(); <END> for (SystemStreamPartition ssp : nextOffsets.keySet()) { if (sink.needsMoreMessages(ssp)) { SSPsToFetch.add(ssp); } } LOG.debug("pollConsumer {}", SSPsToFetch.size()); if (!SSPsToFetch.isEmpty()) { kafkaConsumerMetrics.incClientReads(metricName); Map<SystemStreamPartition, List<IncomingMessageEnvelope>> response; LOG.debug("pollConsumer from following SSPs: {}; total#={}", SSPsToFetch, SSPsToFetch.size()); response = pollConsumer(SSPsToFetch, 500); for (Map.Entry<SystemStreamPartition, List<IncomingMessageEnvelope>> e : response.entrySet()) { List<IncomingMessageEnvelope> envelopes = e.getValue(); if (envelopes != null) { moveMessagesToTheirQueue(e.getKey(), envelopes); } } populateCurrentLags(SSPsToFetch); } else { LOG.debug("No topic/partitions need to be fetched for consumer right now. Sleeping {}ms.", kafkaConsumer, SLEEP_MS_WHILE_NO_TOPIC_PARTITION); kafkaConsumerMetrics.incClientSkippedFetchRequests(metricName); try { Thread.sleep(SLEEP_MS_WHILE_NO_TOPIC_PARTITION); } catch (InterruptedException e) { LOG.warn("Sleep in fetchMessages was interrupted"); } } refreshLatencyMetrics(); }</code><technical_language>Minor: variable names follow camel-case convention. s/SSPsToFetch/partitionsToFetch</technical_language>

Target:
private void fetchMessages() { Set<SystemStreamPartition> sspsToFetch = new HashSet<>(); for (SystemStreamPartition ssp : nextOffsets.keySet()) { if (sink.needsMoreMessages(ssp)) { sspsToFetch.add(ssp); } } LOG.debug("pollConsumer for SSPs: {}", sspsToFetch.size(), sspsToFetch); if (!sspsToFetch.isEmpty()) { kafkaConsumerMetrics.incClientReads(metricName); Map<SystemStreamPartition, List<IncomingMessageEnvelope>> response; response = pollConsumer(sspsToFetch, 500L); for (Map.Entry<SystemStreamPartition, List<IncomingMessageEnvelope>> e : response.entrySet()) { List<IncomingMessageEnvelope> envelopes = e.getValue(); if (envelopes != null) { moveMessagesToTheirQueue(e.getKey(), envelopes); } } populateCurrentLags(sspsToFetch); } else { LOG.debug("No topic/partitions need to be fetched for system right now. Sleeping {}ms.", systemName, SLEEP_MS_WHILE_NO_TOPIC_PARTITION); kafkaConsumerMetrics.incClientSkippedFetchRequests(metricName); try { Thread.sleep(SLEEP_MS_WHILE_NO_TOPIC_PARTITION); } catch (InterruptedException e) { LOG.warn("Sleep in fetchMessages was interrupted"); } } refreshLagMetrics(); }
Source:
<code>public void testCompute() { DoubleLeastPostAggregator greatestPostAggregator; CountAggregator agg = new CountAggregator("rows"); agg.aggregate(); agg.aggregate(); agg.aggregate(); Map<String, Object> metricValues = new HashMap<String, Object>(); metricValues.put(agg.getName(), agg.get()); List<PostAggregator> postAggregatorList = Lists.newArrayList( new ConstantPostAggregator( "roku", 6 ), new FieldAccessPostAggregator( "rows", "rows" ) ); <START> greatestPostAggregator = new DoubleLeastPostAggregator("least", postAggregatorList); <END> Assert.assertEquals(3.0, greatestPostAggregator.compute(metricValues)); }</code><technical_language>"leastPostAggregator", in testComparator()</technical_language>

Target:
public void testCompute() { final String aggName = "rows"; DoubleLeastPostAggregator leastPostAggregator; CountAggregator agg = new CountAggregator(); agg.aggregate(); agg.aggregate(); agg.aggregate(); Map<String, Object> metricValues = new HashMap<String, Object>(); metricValues.put(aggName, agg.get()); List<PostAggregator> postAggregatorList = Lists.newArrayList( new ConstantPostAggregator( "roku", 6D ), new FieldAccessPostAggregator( "rows", aggName ) ); leastPostAggregator = new DoubleLeastPostAggregator("least", postAggregatorList); Assert.assertEquals(3.0, leastPostAggregator.compute(metricValues)); }
Source:
<code>private Object doGetAttribute(Class<?> clazz) { <START> ensureServletContext(); <END> return context.getAttribute(clazz.getName()); }</code><technical_language>ensureServletContext() done clazz is Lookup.class ? this method is called then. Previously done</technical_language>

Target:
private Object doGetAttribute(Class<?> clazz) { ensureServletContext(); return getContext().getAttribute(clazz.getName()); }
Source:
<code>protected Optional<PlanNodeStatsEstimate> doCalculate(PlanNode node, StatsProvider sourceStats, Lookup lookup, Session session, Map<Symbol, Type> types) { FilterNode filterNode = (FilterNode) node; PlanNode nodeSource = lookup.resolve(filterNode.getSource()); SemiJoinNode semiJoinNode; if (nodeSource instanceof ProjectNode) { ProjectNode projectNode = (ProjectNode) nodeSource; if (!projectNode.isIdentity()) { return Optional.empty(); } PlanNode projectNodeSource = lookup.resolve(projectNode.getSource()); if (!(projectNodeSource instanceof SemiJoinNode)) { return Optional.empty(); } semiJoinNode = (SemiJoinNode) projectNodeSource; } <START> else { <END> if (!(nodeSource instanceof SemiJoinNode)) { return Optional.empty(); } semiJoinNode = (SemiJoinNode) nodeSource; } return calculate(filterNode, semiJoinNode, sourceStats, session, types); }</code><technical_language>else if(nodeSource instanceof SemiJoinNode){ semiJoinNode = (SemiJoinNode) nodeSource; } else { return Optional.empty(); }</technical_language>

Target:
protected Optional<PlanNodeStatsEstimate> doCalculate(PlanNode node, StatsProvider sourceStats, Lookup lookup, Session session, Map<Symbol, Type> types) { FilterNode filterNode = (FilterNode) node; PlanNode nodeSource = lookup.resolve(filterNode.getSource()); SemiJoinNode semiJoinNode; if (nodeSource instanceof ProjectNode) { ProjectNode projectNode = (ProjectNode) nodeSource; if (!projectNode.isIdentity()) { return Optional.empty(); } PlanNode projectNodeSource = lookup.resolve(projectNode.getSource()); if (!(projectNodeSource instanceof SemiJoinNode)) { return Optional.empty(); } semiJoinNode = (SemiJoinNode) projectNodeSource; } else if (nodeSource instanceof SemiJoinNode) { semiJoinNode = (SemiJoinNode) nodeSource; } else { return Optional.empty(); } return calculate(filterNode, semiJoinNode, sourceStats, session, types); }
Source:
<code>public static ZoneOffset ofHours(int hours) { <START> checkArgument(Math.abs(hours) <= 18, "offset size must be between -18 and 18 hours inclusive"); <END> @SuppressWarnings("NumericCastThatLosesPrecision") final int seconds = (int) Durations.toSeconds(Durations.ofHours(hours)); return ZoneOffset.newBuilder() .setAmountSeconds(seconds) .build(); }</code><technical_language>Is symmetrical (18 ends)? If checks messages. do constants</technical_language>

Target:
public static ZoneOffset ofHours(int hours) { final int maxHoursBound = 18; checkArgument(Math.abs(hours) <= maxHoursBound, "offset size must be between -18 and 18 hours inclusive"); @SuppressWarnings("NumericCastThatLosesPrecision") final int seconds = (int) Durations.toSeconds(Durations.ofHours(hours)); return ZoneOffset.newBuilder() .setAmountSeconds(seconds) .build(); }
Source:
<code>public DefaultPluginDictionary(Object plugin, Locale defaultLocale, Path dir) { super(plugin, defaultLocale, Paths.get(dir.toString(), Sponge.getPluginManager().getId(plugin) + FILE_EXTENSION)); <START> } <END></code><technical_language>dir.resolve(Sponge.getPluginManager()...)</technical_language>

Target:
public DefaultPluginDictionary(Object plugin, Locale defaultLocale, Path dir) { super(plugin, defaultLocale, dir.resolve(Sponge.getPluginManager().fromInstance(plugin).get().getId() + FILE_EXTENSION)); }
Source:
<code>public Response gatewaySynapseArtifactsGet(String gatewayLabel, MessageContext messageContext) throws APIManagementException { List<String> gatewayRuntimeArtifactsArray = new ArrayList<>(); try { List<ByteArrayInputStream> baip = apiMgtDAO.getAllGatewayPublishedAPIArtifacts(gatewayLabel); <START> for (ByteArrayInputStream byteStream :baip){ <END> byte[] bytes = ByteStreams.toByteArray(byteStream); String gatewayRuntimeArtifacts = new String(bytes); gatewayRuntimeArtifactsArray.add(gatewayRuntimeArtifacts); } } catch (APIManagementException | IOException e) { throw new APIManagementException("Error retrieving Artifact from DB", e); } synapseArtifactListDTOS.list(gatewayRuntimeArtifactsArray); synapseArtifactListDTOS.setCount(gatewayRuntimeArtifactsArray.size()); return Response.ok().entity(synapseArtifactListDTOS).build(); }</code><technical_language>Formatting issue</technical_language>

Target:
public Response gatewaySynapseArtifactsGet(String gatewayLabel, MessageContext messageContext) throws APIManagementException { List<String> gatewayRuntimeArtifactsArray; try { gatewayRuntimeArtifactsArray = gatewayArtifactsMgtDAO.getAllGatewayPublishedAPIArtifacts(gatewayLabel); } catch (APIManagementException e) { throw new APIManagementException("Error retrieving Artifact from DB", e); } synapseArtifactListDTOS.list(gatewayRuntimeArtifactsArray); synapseArtifactListDTOS.setCount(gatewayRuntimeArtifactsArray.size()); return Response.ok().entity(synapseArtifactListDTOS).build(); }
Source:
<code>public void onStreamReceived(Session session, Stream stream) { Log.i(LOG_TAG, "Stream Received"); if (mSubscriber == null) { <START> mSubscriber = (new Subscriber.Builder(this, stream)).build(); <END> mSubscriber.setSubscriberListener(this); mSubscriber.getRenderer().setStyle(BaseVideoRenderer.STYLE_VIDEO_SCALE, BaseVideoRenderer.STYLE_VIDEO_FILL); mSession.subscribe(mSubscriber); } }</code><technical_language>Again: remove parens: mSubscriber = new Subscriber.Builder(this, stream).build();</technical_language>

Target:
public void onStreamReceived(Session session, Stream stream) { Log.i(LOG_TAG, "Stream Received"); if (mSubscriber == null) { mSubscriber = new Subscriber.Builder(this, stream).build(); mSubscriber.setSubscriberListener(this); mSubscriber.getRenderer().setStyle(BaseVideoRenderer.STYLE_VIDEO_SCALE, BaseVideoRenderer.STYLE_VIDEO_FILL); mSession.subscribe(mSubscriber); } }
Source:
<code>public void test() { String title = getViewTitle(); SWTBotView viewBot = fBot.viewByTitle(title); viewBot.show(); viewBot.setFocus(); TmfSignalManager.dispatchSignal(new TmfSelectionRangeUpdatedSignal(this, START_TIME)); <START> ConditionHelpers.timeGraphIsReadyCondition((AbstractTimeGraphView) <END> viewBot.getViewReference().getPart(false), new TmfTimeRange(START_TIME, START_TIME), START_TIME); openDialog(viewBot); SWTBotShell shell = fBot.shell("Find"); SWTBot bot = shell.bot(); SWTBotButton findButton = bot.button("Fi&nd"); String text = getFindText(); testWrapSearch(text, bot, findButton, viewBot); testDirectionSearch(true, text, bot, findButton, viewBot); testCaseSensitive(text, bot, findButton); final @NonNull String ttext = text.split(SPACE)[0]; testWholeWord(ttext, bot, findButton); testRegEx(REGEX_PREFIX + ttext, bot, findButton); testDirectionSearch(false, text, bot, findButton, viewBot); }</code><technical_language>return of this is used. need do viewBot.waitUntil(condition)</technical_language>

Target:
public void test() { String title = getViewTitle(); SWTBotView viewBot = fBot.viewByTitle(title); viewBot.show(); viewBot.setFocus(); TmfSignalManager.dispatchSignal(new TmfSelectionRangeUpdatedSignal(this, START_TIME)); fBot.waitUntil(ConditionHelpers.timeGraphIsReadyCondition((AbstractTimeGraphView) viewBot.getViewReference().getPart(false), new TmfTimeRange(START_TIME, START_TIME), START_TIME)); openDialog(viewBot); SWTBotShell shell = fBot.shell("Find"); SWTBot bot = shell.bot(); SWTBotButton findButton = bot.button("Fi&nd"); String text = getFindText(); testWrapSearch(text, bot, findButton, viewBot); testDirectionSearch(true, text, bot, findButton, viewBot); testCaseSensitive(text, bot, findButton); final @NonNull String ttext = text.split(SPACE)[0]; testWholeWord(ttext, bot, findButton); testRegEx(REGEX_PREFIX + ttext, bot, findButton); testDirectionSearch(false, text, bot, findButton, viewBot); }
Source:
<code>public Map<String, Object> sampleForFields(String indexAndType, Collection<String> fields) { if (fields == null || fields.isEmpty()) { return Collections.emptyMap(); } StringBuilder sb = new StringBuilder(); sb.append("{ \"terminate_after\":1, \"size\":1,\n"); sb.append("\"_source\": ["); for (String field : fields) { sb.append(String.format(Locale.ROOT, "\"%s\",", field)); } sb.setLength(sb.length() - 1); sb.append("],\n\"query\":{"); if (esVersion().after(EsVersion.V_1_X)) { sb.append("\"bool\": { \"must\":["); } else { sb.append("\"constant_score\":{ \"filter\": { \"and\":["); } for (String field: fields) { sb.append(String.format(Locale.ROOT, "\n{ \"exists\":{ \"field\":\"%s\"} },", field)); } sb.setLength(sb.length() - 1); sb.append("\n]}"); <START> if (esVersion().equals(EsVersion.V_2_X)) { <END> sb.append("}"); } sb.append("}}"); Map<String, List<Map<String, Object>>> hits = parseContent(execute(GET, indexAndType + "/_search", new BytesArray(sb.toString())).body(), "hits"); List<Map<String, Object>> docs = hits.get("hits"); if (docs == null || docs.isEmpty()) { return Collections.emptyMap(); } Map<String, Object> foundFields = docs.get(0); Map<String, Object> fieldInfo = (Map<String, Object>) foundFields.get("_source"); return fieldInfo; }</code><technical_language>this !esVersion().equals(EsVersion.V_2_X)</technical_language>

Target:
public Map<String, Object> sampleForFields(String indexAndType, Collection<String> fields) { if (fields == null || fields.isEmpty()) { return Collections.emptyMap(); } StringBuilder sb = new StringBuilder(); sb.append("{ \"terminate_after\":1, \"size\":1,\n"); sb.append("\"_source\": ["); for (String field : fields) { sb.append(String.format(Locale.ROOT, "\"%s\",", field)); } sb.setLength(sb.length() - 1); sb.append("],\n\"query\":{"); if (internalVersion.onOrAfter(EsMajorVersion.V_2_X)) { sb.append("\"bool\": { \"must\":["); } else { sb.append("\"constant_score\":{ \"filter\": { \"and\":["); } for (String field: fields) { sb.append(String.format(Locale.ROOT, "\n{ \"exists\":{ \"field\":\"%s\"} },", field)); } sb.setLength(sb.length() - 1); sb.append("\n]}"); if (internalVersion.on(EsMajorVersion.V_1_X)) { sb.append("}"); } sb.append("}}"); Map<String, List<Map<String, Object>>> hits = parseContent(execute(GET, indexAndType + "/_search", new BytesArray(sb.toString())).body(), "hits"); List<Map<String, Object>> docs = hits.get("hits"); if (docs == null || docs.isEmpty()) { return Collections.emptyMap(); } Map<String, Object> foundFields = docs.get(0); Map<String, Object> fieldInfo = (Map<String, Object>) foundFields.get("_source"); return fieldInfo; }
Source:
<code>public void passCodeEntered(String passcode) { if (!isInternetAvailable()) { <START> passCodeView.clearPasscodeField(); <END> return; } if (counter == 3) { Toast.makeText(getApplicationContext(), R.string.incorrect_passcode_more_than_three, Toast.LENGTH_SHORT).show(); PrefManager.clearPrefs(); startLoginActivity(); return; } if (isPassCodeLengthCorrect()) { String passwordEntered = EncryptionUtil.getHash(passCodeView.getPasscode()); if (PrefManager.getPassCode().equals(passwordEntered)) { startDashBoardActivity(); } else { counter++; passCodeView.clearPasscodeField(); Toaster.show(clRootview, R.string.incorrect_passcode); } } }</code><technical_language>checking internet connection, saving passcode locally app some offline feature need check internet connection</technical_language>

Target:
public void passCodeEntered(String passcode) { String passwordEntered = EncryptionUtil.getHash(passCodeView.getPasscode()); boolean isPassCodeCorrect = PrefManager.getPassCode().equals(passwordEntered); if (counter == 3 && !isPassCodeCorrect) { Toast.makeText(getApplicationContext(), R.string.incorrect_passcode_more_than_three, Toast.LENGTH_SHORT).show(); PrefManager.clearPrefs(); startSplashActivity(); return; } if (isPassCodeLengthCorrect()) { if (isPassCodeCorrect) { startDashBoardActivity(); } else { counter++; passCodeView.clearPasscodeField(); Toaster.show(clRootview, R.string.incorrect_passcode); } } }
Source:
<code>public Block readBlock(BlockEncodingSerde blockEncodingSerde, SliceInput sliceInput) { Type keyType = TypeSerde.readType(typeManager, sliceInput); Block keyBlock = blockEncodingSerde.readBlock(sliceInput); Block valueBlock = blockEncodingSerde.readBlock(sliceInput); int hashTableLength = sliceInput.readInt(); int[] hashTable = null; if (hashTableLength >= 0) { hashTable = new int[hashTableLength]; sliceInput.readBytes(wrappedIntArray(hashTable)); } <START> if (keyBlock.getPositionCount() != valueBlock.getPositionCount() <END> || hashTable != null && keyBlock.getPositionCount() * HASH_MULTIPLIER != hashTable.length) { throw new IllegalArgumentException( format("Deserialized MapBlock violates invariants: key %d, value %d, hash %d", keyBlock.getPositionCount(), valueBlock.getPositionCount(), hashTable.length)); } int positionCount = sliceInput.readInt(); int[] offsets = new int[positionCount + 1]; sliceInput.readBytes(wrappedIntArray(offsets)); Optional<boolean[]> mapIsNull = EncoderUtil.decodeNullBits(sliceInput, positionCount); return MapType.createMapBlockInternal(typeManager, keyType, 0, positionCount, mapIsNull, offsets, keyBlock, valueBlock, Optional.ofNullable(hashTable)); }</code><technical_language>please add clarifying parentheses</technical_language>

Target:
public Block readBlock(BlockEncodingSerde blockEncodingSerde, SliceInput sliceInput) { Type keyType = TypeSerde.readType(typeManager, sliceInput); Block keyBlock = blockEncodingSerde.readBlock(sliceInput); Block valueBlock = blockEncodingSerde.readBlock(sliceInput); int hashTableLength = sliceInput.readInt(); int[] hashTable = null; if (hashTableLength >= 0) { hashTable = new int[hashTableLength]; sliceInput.readBytes(wrappedIntArray(hashTable)); } if (keyBlock.getPositionCount() != valueBlock.getPositionCount()) { throw new IllegalArgumentException( format("Deserialized MapBlock violates invariants: key %d, value %d", keyBlock.getPositionCount(), valueBlock.getPositionCount())); } if (hashTable != null && keyBlock.getPositionCount() * HASH_MULTIPLIER != hashTable.length) { throw new IllegalArgumentException( format("Deserialized MapBlock violates invariants: expected hashtable size %d, actual hashtable size %d", keyBlock.getPositionCount() * HASH_MULTIPLIER, hashTable.length)); } int positionCount = sliceInput.readInt(); int[] offsets = new int[positionCount + 1]; sliceInput.readBytes(wrappedIntArray(offsets)); Optional<boolean[]> mapIsNull = EncoderUtil.decodeNullBits(sliceInput, positionCount); return MapType.createMapBlockInternal(typeManager, keyType, 0, positionCount, mapIsNull, offsets, keyBlock, valueBlock, Optional.ofNullable(hashTable)); }
Source:
<code>public NegotiatedTokenBinding decode(int[] serverdata) throws TlsFatalAlert { if(serverdata.length !=4){ throw new TlsFatalAlert(AlertDescription.unsupported_extension); } this.setMajorProtocolVerison(serverdata[0]); this.setMinorProtocolVerison(serverdata[1]); if(serverdata[3]==0){ this.setSelectedKeyParameter("rsa2048_pcks15"); }else if (serverdata[3]==1){ this.setSelectedKeyParameter("rsa2048_pss"); }else if (serverdata[3]==2){ <START> this.setSelectedKeyParameter("rsa2048_ecdsap256"); <END> }else{ throw new TlsFatalAlert(AlertDescription.unsupported_extension); } return this; }</code><technical_language>Please constants for key parameters</technical_language>

Target:
public NegotiatedTokenBinding decode(int[] serverdata) throws TlsFatalAlert { if (serverdata.length != 4) { throw new TlsFatalAlert(AlertDescription.unsupported_extension); } this.setMajorProtocolVerison(serverdata[0]); this.setMinorProtocolVerison(serverdata[1]); if (serverdata[3] == 0) { this.setSelectedKeyParameter(RSA2048_PCKS15); } else if (serverdata[3] == 1) { this.setSelectedKeyParameter(RSA2048_PSS); } else if (serverdata[3] == 2) { this.setSelectedKeyParameter(RSA2048_ECDSAP256); } else { throw new TlsFatalAlert(AlertDescription.unsupported_extension); } return this; }
Source:
<code>private boolean checkPreCondition(PreCondition preCondition, Vendor<? extends T> vendor, IEclipseContext context) { final Object object = context.get(preCondition.key()); <START> if (object == null) { <END> return false; } return object.equals(preCondition.value()); }</code><technical_language>is expect a null value? I is a bit fetched ..</technical_language>

Target:
private boolean checkPreCondition(PreCondition preCondition, Vendor<? extends T> vendor, IEclipseContext context) { if (preCondition.value().equals(PreCondition.UNASSIGNED)) { return context.containsKey(preCondition.key()); } final Object object = context.get(preCondition.key()); if (object == null) { return false; } return object.equals(preCondition.value()); }
Source:
<code>public Account apply(HttpResponse from) { return Account.builder() <START> .bytesUsed(Long.parseLong(from.getFirstHeaderOrNull("X-Account-Bytes-Used"))) <END> .containerCount(Long.parseLong(from.getFirstHeaderOrNull("X-Account-Container-Count"))) .objectCount(Long.parseLong(from.getFirstHeaderOrNull("X-Account-Object-Count"))) .metadata(EntriesWithoutMetaPrefix.INSTANCE.apply(from.getHeaders())).build(); }</code><technical_language>header names refactored</technical_language>

Target:
public Account apply(HttpResponse from) { return Account.builder() .bytesUsed(Long.parseLong(from.getFirstHeaderOrNull(ACCOUNT_BYTES_USED))) .containerCount(Long.parseLong(from.getFirstHeaderOrNull(ACCOUNT_CONTAINER_COUNT))) .objectCount(Long.parseLong(from.getFirstHeaderOrNull(ACCOUNT_OBJECT_COUNT))) .metadata(EntriesWithoutMetaPrefix.INSTANCE.apply(from.getHeaders())).build(); }
Source:
<code><START> public boolean equals(Object o) { <END> if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ShutDownVpcVspCommand that = (ShutDownVpcVspCommand) o; if (_domainTemplateName != null ? !_domainTemplateName.equals(that._domainTemplateName) : that._domainTemplateName != null) return false; if (_domainUuid != null ? !_domainUuid.equals(that._domainUuid) : that._domainUuid != null) return false; if (_vpcUuid != null ? !_vpcUuid.equals(that._vpcUuid) : that._vpcUuid != null) return false; return true; }</code><technical_language>This equals implementation include attributes Command super class</technical_language>

Target:
public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof ShutDownVpcVspCommand)) return false; if (!super.equals(o)) return false; ShutDownVpcVspCommand that = (ShutDownVpcVspCommand) o; if (_domainTemplateName != null ? !_domainTemplateName.equals(that._domainTemplateName) : that._domainTemplateName != null) return false; if (_domainUuid != null ? !_domainUuid.equals(that._domainUuid) : that._domainUuid != null) return false; if (_vpcUuid != null ? !_vpcUuid.equals(that._vpcUuid) : that._vpcUuid != null) return false; return true; }
Source:
<code>public JavaBeanExecutable<?> executable(Executable executable) { if ( executable instanceof Constructor ) { return new JavaBeanConstructor( (Constructor<?>) executable ); } <START> return executable( executable.getDeclaringClass(), ( (Method) executable ) ); <END> }</code><technical_language>call executable(Class<?> declaringClass, Executable executable) remove if()</technical_language>

Target:
public JavaBeanExecutable<?> executable(Executable executable) { return executable( executable.getDeclaringClass(), executable ); }
Source:
<code><START> private <END> String getMethodNameAndParameters(String methodSignature) { Pattern pattern = Pattern.compile("[\\w\\$]+\\([^)]*\\)"); Matcher methodPatternMatcher = pattern.matcher(methodSignature); if (methodPatternMatcher.find()) { return methodPatternMatcher.group(); } else { throw new IllegalArgumentException(); } }</code><technical_language>static</technical_language>

Target:
private static String getMethodNameAndParameters(String methodSignature) { Matcher methodPatternMatcher = pattern.matcher(methodSignature); if (methodPatternMatcher.find()) { return methodPatternMatcher.group(); } else { throw new IllegalArgumentException(methodSignature); } }
Source:
<code>private void doPutGetWithExpiration(RemoteCacheManager rm, String cacheName) throws Exception { RemoteCache<String, String> cache = rm.getCache(cacheName); assertEquals(0, numEntries(server1, cacheName)); assertEquals(0, numEntries(server2, cacheName)); for (int i = 0; i < 10; i++) { cache.put("key" + i, "value" + i); } for (int i = 0; i < 10; i++) { assertEquals("value" + i, cache.get("key" + i)); } <START> assertEquals(10, numEntries(server1, cacheName)); <END> Thread.sleep(2100); for (int i = 0; i < 10; i++) { assertNull(cache.get("key" + i)); } }</code><technical_language>Server2 is connected server1 a RemoteCacheStore</technical_language>

Target:
private void doPutGetWithExpiration(RemoteCacheManager rm, String cacheName) throws Exception { RemoteCache<String, String> cache = rm.getCache(cacheName); assertEquals(0, numEntries(server1, cacheName)); assertEquals(0, numEntries(server2, cacheName)); for (int i = 0; i < 10; i++) { cache.put("key" + i, "value" + i); } for (int i = 0; i < 10; i++) { assertEquals("value" + i, cache.get("key" + i)); } assertEquals(10, numEntries(server2, cacheName)); Thread.sleep(2100); for (int i = 0; i < 10; i++) { assertNull(cache.get("key" + i)); } }
Source:
<code>public void buildsPngImage() throws Exception { final Base base = new MkBase(); final String alias = "test"; final String urn = "urn:test:1"; <START> final User user = base.user(new URN(urn)); <END> user.aliases().add(alias); MatcherAssert.assertThat( new RsPrint( new TkFriend(base).act( new RqRegex.Fake( new RqWithAuth(urn), "(.*)", alias ) ) ), Matchers.notNullValue() ); }</code><technical_language>@zshamrock need create a variable User inlined base.user(new URN(urn)).aliases().add(alias);</technical_language>

Target:
public void buildsPngImage() throws Exception { final Base base = new MkBase(); final String alias = "test"; final String urn = "urn:test:1"; base.user(new URN(urn)).aliases().add(alias); MatcherAssert.assertThat( new RsPrint( new TkFriend(base).act( new RqRegex.Fake( new RqWithAuth(urn), "(.*)", alias ) ) ), Matchers.notNullValue() ); }
Source:
<code>public void initExecutor() { pageProviderService = Framework.getLocalService(PageProviderService.class); queryParametersMap = new EnumMap<>(QueryParams.class); queryParametersMap.put(QueryParams.PAGE_SIZE, PAGE_SIZE); queryParametersMap.put(QueryParams.CURRENT_PAGE_INDEX, CURRENT_PAGE_INDEX); queryParametersMap.put(QueryParams.MAX_RESULTS, MAX_RESULTS); queryParametersMap.put(QueryParams.SORT_BY, SORT_BY); queryParametersMap.put(QueryParams.SORT_ORDER, SORT_ORDER); queryParametersMap.put(QueryParams.QUERY, QUERY); queryParametersMap.put(QueryParams.ORDERED_PARAMS, ORDERED_PARAMS); langPathMap = new EnumMap<>(LangParams.class); <START> langPathMap.put(LangParams.NXQL, NXQL); <END> }</code><technical_language>usual pattern follow is give a constructor enum store string a field, a getter get it. need for EnumMap</technical_language>

Target:
public void initExecutor() { pageProviderService = Framework.getService(PageProviderService.class); }
Source:
<code>protected Object doGetValue() { Object value = null; boolean allCompSameValue = true; if (source instanceof ShapeImpl) { <START> for (Object child : source.getChildren()) { <END> if (child instanceof BasicCompartmentImpl) { NamedStyle valueStyle = ((View) child).getNamedStyle(styleClass, styleName); if (valueStyle != null) { if (value == null) { value = valueStyle.eGet(styleFeature); } else if (!value.equals(valueStyle.eGet(styleFeature))) { allCompSameValue = false; } } } } } return allCompSameValue ? value : getDefaultValue(); }</code><technical_language>do a while-loop break condition</technical_language>

Target:
protected Object doGetValue() { Object value = null; boolean allCompSameValue = true; if (source instanceof View) { Iterator<?> iterator = source.getChildren().iterator(); while (iterator.hasNext() && allCompSameValue == true) { Object child = (Object) iterator.next(); if (child instanceof BasicCompartmentImpl) { NamedStyle valueStyle = ((View) child).getNamedStyle(styleClass, styleName); if (valueStyle != null) { if (value == null) { value = valueStyle.eGet(styleFeature); } else if (!value.equals(valueStyle.eGet(styleFeature))) { allCompSameValue = false; } } } } } return allCompSameValue ? value : getDefaultValue(); }
Source:
<code>@Override public <T> T evaluate(ExecutionContext ctx, Object... args) { if (opImpl == null) <START> opImpl = new ExpressionFactory(ctx.parent().typeFactory(), ctx.parent().conformance(), ctx.parent().opTable()).implement(this); <END> return (T) opImpl.apply(operands.stream().map(o -> o.evaluate(ctx, args)).toArray()); }</code><technical_language>long lines readable</technical_language>

Target:
@Override public <T> T evaluate(ExecutionContext ctx, Object... args) { if (opImpl == null) { IgniteTypeFactory typeFactory = ctx.parent().typeFactory(); SqlConformance conformance = ctx.parent().conformance(); SqlOperatorTable opTable = ctx.parent().opTable(); opImpl = new ExpressionFactory(typeFactory, conformance, opTable).implement(this); } return (T) opImpl.apply(operands.stream().map(o -> o.evaluate(ctx, args)).toArray()); }
Source:
<code>private void startSnapShot(LatLngBounds latLngBounds, int height, int width) { if (mapSnapshotter == null) { MapSnapshotter.Options options = new MapSnapshotter.Options(width, height).withRegion(latLngBounds).withStyle(mapboxMap.getStyleUrl()); mapSnapshotter = new MapSnapshotter(SnapshotShareActivity.this, options); } else { mapSnapshotter.setSize(width, height); mapSnapshotter.setRegion(latLngBounds); mapSnapshotter.setRegion(latLngBounds); } mapSnapshotter.start(new MapSnapshotter.SnapshotReadyCallback() { @Override public void onSnapshotReady(MapSnapshot snapshot) { Bitmap bitmapOfMapSnapshotImage = snapshot.getBitmap(); Uri bmpUri = getLocalBitmapUri(bitmapOfMapSnapshotImage); Intent shareIntent = new Intent(); <START> shareIntent.putExtra(Intent.EXTRA_STREAM, bmpUri); <END> shareIntent.setType("image/*"); shareIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); startActivity(Intent.createChooser(shareIntent, "Share map image")); hasStartedSnapshotGeneration = false; } }); }</code><technical_language>Apply change fix crash while sharing GoogleMaps some others crashing): Add: shareIntent.setAction(Intent.ACTION_SEND); Modify: shareIntent.setType("image/png");</technical_language>

Target:
private void startSnapShot(LatLngBounds latLngBounds, int height, int width) { if (mapSnapshotter == null) { MapSnapshotter.Options options = new MapSnapshotter.Options(width, height).withRegion(latLngBounds).withStyle(mapboxMap.getStyleUrl()); mapSnapshotter = new MapSnapshotter(SnapshotShareActivity.this, options); } else { mapSnapshotter.setSize(width, height); mapSnapshotter.setRegion(latLngBounds); mapSnapshotter.setRegion(latLngBounds); } mapSnapshotter.start(new MapSnapshotter.SnapshotReadyCallback() { @Override public void onSnapshotReady(MapSnapshot snapshot) { Bitmap bitmapOfMapSnapshotImage = snapshot.getBitmap(); Uri bmpUri = getLocalBitmapUri(bitmapOfMapSnapshotImage); Intent shareIntent = new Intent(); shareIntent.putExtra(Intent.EXTRA_STREAM, bmpUri); shareIntent.setType("image/png"); shareIntent.setAction(Intent.ACTION_SEND); shareIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); startActivity(Intent.createChooser(shareIntent, "Share map image")); hasStartedSnapshotGeneration = false; } }); }