auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
XmlManifest(RepoCommand command, IncludedFileReader includedReader, String filename, String baseUrl, String groups) { this.command = command; this.includedReader = includedReader; this.filename = filename; this.xmlInRead = 0; int lastIndex = baseUrl.length() - 1; while (lastIndex >= 0 && baseUrl.charAt(lastIndex) == '/') lastIndex--; this.baseUrl = baseUrl.substring(0, lastIndex + 1); remotes = new HashMap<String, String>(); projects = new ArrayList<Project>(); plusGroups = new HashSet<String>(); minusGroups = new HashSet<String>(); if (groups == null || groups.length() == 0 || groups.equals("default")) { minusGroups.add("notdefault"); } else { for (String group : groups.split(",")) { if (group.startsWith("-")) minusGroups.add(group.substring(1)); else plusGroups.add(group); } } }

Target:
XmlManifest(RepoCommand command, IncludedFileReader includedReader, String filename, String baseUrl, String groups) { this.command = command; this.includedReader = includedReader; this.filename = filename; int lastIndex = baseUrl.length() - 1; while (lastIndex >= 0 && baseUrl.charAt(lastIndex) == '/') lastIndex--; this.baseUrl = baseUrl.substring(0, lastIndex + 1); remotes = new HashMap<String, String>(); projects = new ArrayList<Project>(); plusGroups = new HashSet<String>(); minusGroups = new HashSet<String>(); if (groups == null || groups.length() == 0 || groups.equals("default")) { minusGroups.add("notdefault"); } else { for (String group : groups.split(",")) { if (group.startsWith("-")) minusGroups.add(group.substring(1)); else plusGroups.add(group); } } }
Source:
default Validation<T, Seq<? extends E>> swap() { if (isInvalid()) { final Seq<? extends E> error = this.getErrors(); return Validation.valid(error); } else { final T value = this.get(); return Validation.invalid(value); } }

Target:
default Validation<T, Seq<E>> swap() { if (isInvalid()) { return Validation.valid(this.getErrors()); } else { final T value = this.get(); return Validation.invalid(value); } }
Source:
public static String convertIP6Address(byte[] bytes) throws KuraException { if ((bytes == null) || (bytes.length != 16)) { throw new KuraException(KuraErrorCode.INVALID_PARAMETER); } String[] items = new String[8]; for (int i = 0; i < 8; i++) { int k = i * 2; int value = (bytes[k] << 8) & 0xFF00; value |= bytes[k + 1] & 0xFF; items[i] = Integer.toHexString(value); } String ipAddress = String.join(":", items); return ipAddress; }

Target:
public static String convertIP6Address(byte[] bytes) { if ((bytes == null) || (bytes.length != 16)) { throw new IllegalArgumentException("bytes is null or invalid"); } String[] items = new String[8]; for (int i = 0; i < 8; i++) { int k = i * 2; int value = (bytes[k] << 8) & 0xFF00; value |= bytes[k + 1] & 0xFF; items[i] = Integer.toHexString(value); } return String.join(":", items); }
Source:
public boolean test(Matrix matrix) { return matrix.rows() == matrix.columns() && matrix.determinant() != 0; }

Target:
public boolean test(Matrix matrix) { return matrix.rows() == matrix.columns() && matrix.determinant() != 0.0; }
Source:
public void setProposals(ArrayList<Proposal> proposals) { this.proposals = proposals; int c = 0; String[] items = new String[proposals.size()]; for (Proposal proposal : proposals) { items[c++] = proposal.getDescription(); } list.setItems(items); }

Target:
public void setProposals(ArrayList<Proposal> proposals) { this.proposals = proposals; String[] proposalDescriptions = new String[proposals.size()]; for (int i = 0; i < proposals.size(); i++) { proposalDescriptions[i] = proposals.get(i).getDescription(); } list.setItems(proposalDescriptions); }
Source:
private AuthorizationResponse.Reason getReason(AuthsResponse authsResponse) { AuthorizationResponse.Reason reason; if (authsResponse.getReason() == null) { reason = null; } else if (authsResponse.getReason().equals("APPROVED")) { reason = AuthorizationResponse.Reason.APPROVED; } else if (authsResponse.getReason().equals("DISAPPROVED")) { reason = AuthorizationResponse.Reason.DISAPPROVED; } else if (authsResponse.getReason().equals("FRAUDULENT")) { reason = AuthorizationResponse.Reason.FRAUDULENT; } else if (authsResponse.getReason().equals("POLICY")) { reason = AuthorizationResponse.Reason.POLICY; } else if (authsResponse.getReason().equals("PERMISSION")) { reason = AuthorizationResponse.Reason.PERMISSION; } else if (authsResponse.getReason().equals("AUTHENTICATION")) { reason = AuthorizationResponse.Reason.AUTHENTICATION; } else if (authsResponse.getReason().equals("CONFIGURATION")) { reason = AuthorizationResponse.Reason.CONFIGURATION; } else if (authsResponse.getReason().equals("BUSY_LOCAL")) { reason = AuthorizationResponse.Reason.BUSY_LOCAL; } else { reason = AuthorizationResponse.Reason.OTHER; } return reason; }

Target:
private AuthorizationResponse.Reason getReason(AuthsResponse authsResponse) { AuthorizationResponse.Reason reason; if (authsResponse.getReason() == null) { reason = null; } else if (authsResponse.getReason().equals("APPROVED")) { reason = AuthorizationResponse.Reason.APPROVED; } else if (authsResponse.getReason().equals("DISAPPROVED")) { reason = AuthorizationResponse.Reason.DISAPPROVED; } else if (authsResponse.getReason().equals("FRAUDULENT")) { reason = AuthorizationResponse.Reason.FRAUDULENT; } else if (authsResponse.getReason().equals("POLICY")) { reason = AuthorizationResponse.Reason.POLICY; } else if (authsResponse.getReason().equals("PERMISSION")) { reason = AuthorizationResponse.Reason.PERMISSION; } else if (authsResponse.getReason().equals("AUTHENTICATION")) { reason = AuthorizationResponse.Reason.AUTHENTICATION; } else if (authsResponse.getReason().equals("CONFIGURATION")) { reason = AuthorizationResponse.Reason.CONFIGURATION; } else if (authsResponse.getReason().equals("BUSY_LOCAL")) { reason = AuthorizationResponse.Reason.BUSY_LOCAL; } else if (authsResponse.getReason().equals("SENSOR")) { reason = AuthorizationResponse.Reason.SENSOR; } else { reason = AuthorizationResponse.Reason.OTHER; } return reason; }
Source:
protected boolean isLineInteresting(final String line) { return line.contains("Warning") || line.contains("Error") || line.contains("Remark") || line.contains("Fatal Error"); }

Target:
protected boolean isLineInteresting(final String line) { return line.contains("Warning") || line.contains("rror") || line.contains("Remark") || line.contains("["); }
Source:
public int getIndex(final ReadableTable tb, final int[] key, final int row) { final long hashcode = HashUtils.hashSubRowLong(tb, key, row); int index = keyHashCodesToIndexes.getIfAbsent(hashcode, ABSENT_VALUE); if (index == ABSENT_VALUE) { return -1; } if (index == COLLIDING_KEY) { IntArrayList collidingIndexes = collidingKeyHashCodesToIndexes.get(hashcode); Preconditions.checkNotNull(collidingIndexes); Preconditions.checkState(collidingIndexes.size() > 1); IntIterator iter = collidingIndexes.intIterator(); while (iter.hasNext()) { int idx = iter.next(); if (TupleUtils.tupleEquals(tb, key, row, data, keyColumns, idx)) { return idx; } } assert false; } return index; }

Target:
public int getIndex(final ReadableTable tb, final int[] key, final int row) { final long hashcode = HashUtils.hashSubRowLong(tb, key, row); int index = keyHashCodesToIndexes.getIfAbsent(hashcode, ABSENT_VALUE); if (index == ABSENT_VALUE) { return -1; } if (index == COLLIDING_KEY) { IntArrayList collidingIndexes = collidingKeyHashCodesToIndexes.get(hashcode); Preconditions.checkNotNull(collidingIndexes); Preconditions.checkState(collidingIndexes.size() > 1); IntIterator iter = collidingIndexes.intIterator(); while (iter.hasNext()) { int idx = iter.next(); if (TupleUtils.tupleEquals(tb, key, row, data, keyColumns, idx)) { return idx; } } return -1; } if (TupleUtils.tupleEquals(tb, key, row, data, keyColumns, index)) { return index; } return -1; }
Source:
void buffer( long nodeReference, long relationshipReference, Read read ) { setOwningNode( nodeReference ); setId( NO_ID ); setNext( NO_ID ); try ( PrimitiveIntObjectMap<BufferedGroup> buffer = Primitive.intObjectMap(); PageCursor edgePage = read.relationshipPage( relationshipReference ) ) { BufferedGroup current = null; while ( relationshipReference != NO_ID ) { read.relationshipFull( edge, relationshipReference, edgePage ); BufferedGroup group = buffer.get( edge.getType() ); if ( group == null ) { buffer.put( edge.getType(), current = group = new BufferedGroup( edge, current ) ); } if ( edge.getFirstNode() == nodeReference ) { if ( edge.getSecondNode() == nodeReference ) { group.loop( edge ); } else { group.outgoing( edge ); } relationshipReference = edge.getFirstNextRel(); } else if ( edge.getSecondNode() == nodeReference ) { group.incoming( edge ); relationshipReference = edge.getSecondNextRel(); } else { throw new IllegalStateException( "not a part of the chain! TODO: better exception" ); } } this.hasCheckedTxState = true; this.bufferedGroup = new BufferedGroup( edge, current ); this.read = read; } }

Target:
void buffer( long nodeReference, long relationshipReference, Read read ) { setOwningNode( nodeReference ); setId( NO_ID ); setNext( NO_ID ); try ( PrimitiveIntObjectMap<BufferedGroup> buffer = Primitive.intObjectMap(); PageCursor edgePage = read.relationshipPage( relationshipReference ) ) { BufferedGroup current = null; while ( relationshipReference != NO_ID ) { read.relationshipFull( edge, relationshipReference, edgePage ); BufferedGroup group = buffer.get( edge.getType() ); if ( group == null ) { buffer.put( edge.getType(), current = group = new BufferedGroup( edge, current ) ); } if ( edge.getFirstNode() == nodeReference ) { if ( edge.getSecondNode() == nodeReference ) { group.loop( edge ); } else { group.outgoing( edge ); } relationshipReference = edge.getFirstNextRel(); } else if ( edge.getSecondNode() == nodeReference ) { group.incoming( edge ); relationshipReference = edge.getSecondNextRel(); } else { throw new IllegalStateException( "not a part of the chain! TODO: better exception" ); } } this.txTypes.clear(); this.txTypeIterator = null; this.hasCheckedTxState = false; this.bufferedGroup = new BufferedGroup( edge, current ); this.read = read; } }
Source:
void shutdownProducer() { Producer<K, V> producer; _producerLock.lock(); try { producer = _kafkaProducer; _kafkaProducer = null; } finally { _producerLock.unlock(); } if (producer != null) { _producerCloseExecutorService.submit(() -> { _log.debug("KafkaProducerWrapper: Closing the Kafka Producer"); producer.close(TIME_OUT, TimeUnit.MILLISECONDS); NUM_PRODUCERS.decrementAndGet(); _log.debug("KafkaProducerWrapper: Kafka Producer is closed"); }); } }

Target:
void shutdownProducer() { Producer<K, V> producer; synchronized (_producerLock) { producer = _kafkaProducer; _kafkaProducer = null; } if (producer != null) { _producerCloseExecutorService.submit(() -> { _log.info("KafkaProducerWrapper: Closing the Kafka Producer"); producer.close(TIME_OUT, TimeUnit.MILLISECONDS); NUM_PRODUCERS.decrementAndGet(); _log.info("KafkaProducerWrapper: Kafka Producer is closed"); }); } }
Source:
public void play(Program program) { try { callVmHookAction(program, VMHook::startPlay); if (program.byTestingSuite()) return; while (!program.isStopped()) { this.step(program); } } catch (RuntimeException e) { program.setRuntimeFailure(e); } catch (StackOverflowError soe){ logger.error("\n!!! VM recursion error: update your java run command with -Xss4M !!!\n", soe); System.exit(-1); } finally { callVmHookAction(program, VMHook::stopPlay); } }

Target:
public void play(Program program) { try { callVmHookAction(program, VMHook::startPlay); if (program.byTestingSuite()) return; while (!program.isStopped()) { this.step(program); } } catch (RuntimeException e) { program.setRuntimeFailure(e); } catch (StackOverflowError soe){ logger.error("\n !!! StackOverflowError: update your java run command with -Xss2M (-Xss4M for tests) !!!\n", soe); System.exit(-1); } finally { callVmHookAction(program, VMHook::stopPlay); } }
Source:
public CLOption(String opt, String val, String param) { super(); this.opt = opt; this.val = val; this.param = param; }

Target:
public CLOption(String opt, String val, String param) { this.opt = opt; this.val = val; this.param = param; }
Source:
public boolean equals(Object comparingDefaultKfsAccountForAws) { if (comparingDefaultKfsAccountForAws == null) { return false; } if (!(comparingDefaultKfsAccountForAws instanceof DefaultKfsAccountForAws)) { return false; } final DefaultKfsAccountForAws defaultKfsAccountForAws = (DefaultKfsAccountForAws) comparingDefaultKfsAccountForAws; return ObjectUtils.equals(defaultKfsAccountForAws.getKfsDefaultAccount(), kfsDefaultAccount) && ObjectUtils.equals(defaultKfsAccountForAws.getAwsAccount(), awsAccount) && ObjectUtils.equals(defaultKfsAccountForAws.getUpdatedAt(), updatedAt); }

Target:
public boolean equals(Object comparingDefaultKfsAccountForAws) { if (comparingDefaultKfsAccountForAws == null) { return false; } if (!(comparingDefaultKfsAccountForAws instanceof DefaultKfsAccountForAws)) { return false; } final DefaultKfsAccountForAws defaultKfsAccountForAws = (DefaultKfsAccountForAws) comparingDefaultKfsAccountForAws; return StringUtils.equals(defaultKfsAccountForAws.getKfsDefaultAccount(), kfsDefaultAccount) && StringUtils.equals(defaultKfsAccountForAws.getAwsAccount(), awsAccount) && ObjectUtils.equals(defaultKfsAccountForAws.getUpdatedAt(), updatedAt); }
Source:
@Override public void call(final Subscriber<? super Response<T>> subscriber) { final Call<T> call = originalCall.clone(); subscriber.add(Subscriptions.create(new Action0() { @Override public void call() { call.cancel(); } })); call.enqueue(new Callback<T>() { @Override public void onResponse(Response<T> response, Retrofit retrofit) { if (subscriber.isUnsubscribed()) { return; } try { subscriber.onNext(response); } catch (Throwable t) { Exceptions.throwIfFatal(t); if (!subscriber.isUnsubscribed()) { subscriber.onError(OnErrorThrowable.addValueAsLastCause(t, call)); } return; } if (!subscriber.isUnsubscribed()) { subscriber.onCompleted(); } } @Override public void onFailure(Throwable t) { Exceptions.throwIfFatal(t); if (subscriber.isUnsubscribed()) { return; } subscriber.onError(OnErrorThrowable.addValueAsLastCause(t, call)); } }); }

Target:
@Override public void call(final Subscriber<? super Response<T>> subscriber) { final Call<T> call = originalCall.clone(); subscriber.add(Subscriptions.create(new Action0() { @Override public void call() { call.cancel(); } })); if (subscriber.isUnsubscribed()) { return; } try { Response<T> response = call.execute(); if (!subscriber.isUnsubscribed()) { subscriber.onNext(response); } } catch (Throwable t) { Exceptions.throwIfFatal(t); if (!subscriber.isUnsubscribed()) { subscriber.onError(t); } return; } if (!subscriber.isUnsubscribed()) { subscriber.onCompleted(); } }
Source:
public static <T, R> R reduce(@Nullable final Collection<T> source, @NonNull final ReduceCallback<T, R> callback, @Nullable final R initialValue) { R acc = initialValue; if (source != null) { for (T val : source) { acc = callback.reduce(acc, val); } } return acc; }

Target:
public static <T, R> R reduce(@Nullable final Collection<T> source, @NonNull final ReduceCallback<T, R> callback, @Nullable final R initialValue) { if (source == null) { return initialValue; } R acc = initialValue; for (T val : source) { acc = callback.reduce(acc, val); } return acc; }
Source:
private BinaryRelation(Kind kind, SymbolicValue v1, SymbolicValue v2) { if (!NORMALIZED_OPERATORS.contains(kind)) { throw new IllegalArgumentException("Relation " + v1 + kind.operand + v2 + " not normalized!"); } this.kind = kind; leftOp = v1; rightOp = v2; hashcode = kind.hashCode() + leftOp.hashCode() + rightOp.hashCode(); }

Target:
private BinaryRelation(Kind kind, SymbolicValue v1, SymbolicValue v2) { if (!NORMALIZED_OPERATORS.contains(kind)) { throw new IllegalArgumentException("Relation " + v1 + kind.operand + v2 + " not normalized!"); } this.kind = kind; leftOp = v1; rightOp = v2; hashcode = computeHash(); }
Source:
private Matcher<byte[]> empty() { return nullValue(byte[].class); }

Target:
private static Matcher<byte[]> empty() { return nullValue(byte[].class); }
Source:
public void stop() { try { exec.shutdownNow(); pathChildrenCache.close(); taskRunner.stop(); log.info("Stopped WorkerTaskMonitor."); } catch (Exception e) { log.makeAlert(e, "Exception stopping WorkerTaskMonitor") .emit(); } }

Target:
public void stop() { synchronized (lifecycleLock) { Preconditions.checkState(started, "not started"); try { exec.shutdownNow(); pathChildrenCache.close(); taskRunner.stop(); started = false; log.info("Stopped WorkerTaskMonitor."); } catch (Exception e) { log.makeAlert(e, "Exception stopping WorkerTaskMonitor") .emit(); } } }
Source:
public void sendXBeePacket(XBeePacket packet, IPacketReceiveListener packetReceiveListener) throws InvalidOperatingModeException, XBeeException { if (!connectionInterface.isConnected()) throw new XBeeException(XBeeException.CONNECTION_NOT_OPEN); switch (getOperatingMode()) { case AT: case UNKNOWN: default: throw new InvalidOperatingModeException(); case API: case API_ESCAPE: if (packet instanceof XBeeAPIPacket) { if (((XBeeAPIPacket)packet).hasAPIFrameID()) { if (((XBeeAPIPacket)packet).getFrameID() == XBeeAPIPacket.NO_FRAME_ID) ((XBeeAPIPacket)packet).setFrameID(getNextFrameID()); if (packetReceiveListener != null) dataReader.addPacketReceiveListener(packetReceiveListener, ((XBeeAPIPacket)packet).getFrameID()); } else if (packetReceiveListener != null) dataReader.addPacketReceiveListener(packetReceiveListener); } try { writePacket(packet); } catch (IOException e) { throw new XBeeException(XBeeException.GENERIC, e.getMessage()); } break; } }

Target:
public void sendXBeePacket(XBeePacket packet, IPacketReceiveListener packetReceiveListener) throws InvalidOperatingModeException, XBeeException { if (!connectionInterface.isOpen()) throw new XBeeException(XBeeException.CONNECTION_NOT_OPEN); switch (getOperatingMode()) { case AT: case UNKNOWN: default: throw new InvalidOperatingModeException(); case API: case API_ESCAPE: if (packet instanceof XBeeAPIPacket) { if (((XBeeAPIPacket)packet).needsAPIFrameID()) { if (((XBeeAPIPacket)packet).getFrameID() == XBeeAPIPacket.NO_FRAME_ID) ((XBeeAPIPacket)packet).setFrameID(getNextFrameID()); if (packetReceiveListener != null) dataReader.addPacketReceiveListener(packetReceiveListener, ((XBeeAPIPacket)packet).getFrameID()); } else if (packetReceiveListener != null) dataReader.addPacketReceiveListener(packetReceiveListener); } try { writePacket(packet); } catch (IOException e) { throw new XBeeException(XBeeException.GENERIC, e.getMessage()); } break; } }
Source:
public Result<Storage> setDefaultStorage(final String defaultStorageId) { final Result<Storage> storageResult = getStorage(defaultStorageId); if (storageResult.isSuccessful()) { try { curator.setData().forPath(ZK_TIMELINES_DEFAULT_STORAGE, defaultStorageId.getBytes(Charsets.UTF_8)); } catch (Exception e) { LOG.error(e.getMessage(), e); return Result.problem(Problem.valueOf(INTERNAL_SERVER_ERROR, "Zookeeper connection error")); } } return storageResult; }

Target:
public Result<Storage> setDefaultStorage(final String defaultStorageId) { final Result<Storage> storageResult = getStorage(defaultStorageId); if (storageResult.isSuccessful()) { try { curator.setData().forPath(ZK_TIMELINES_DEFAULT_STORAGE, defaultStorageId.getBytes(Charsets.UTF_8)); } catch (final Exception e) { LOG.error("Error while setting default storage in zk ", e.getMessage(), e); return Result.problem(Problem.valueOf(INTERNAL_SERVER_ERROR, "Error while setting default storage in zk")); } } return storageResult; }
Source:
public void testFastqSerialize(final String basename) throws Exception { final File tmpFile = File.createTempFile("test.", ".fastq"); tmpFile.deleteOnExit(); int count=0; final FastqReader fastqReader = new FastqReader(new File(TEST_DATA_DIR,basename)); final ObjectOutputStream objectOut = new ObjectOutputStream(new FileOutputStream(tmpFile)); for(final FastqRecord rec: fastqReader) { objectOut.writeObject(rec); ++count; } objectOut.flush(); objectOut.close(); fastqReader.close(); final ObjectInputStream objectIn = new ObjectInputStream(new FileInputStream(tmpFile)); for(int i=0;i< count;++i) { final Object o = objectIn.readObject(); Assert.assertTrue(o instanceof FastqRecord,"instance of FastqRecord ?" +o.getClass()); } objectIn.close(); }

Target:
public void testFastqSerialize(final String basename) throws Exception { final ArrayList<FastqRecord> records = new ArrayList<>(); final FastqReader fastqReader = new FastqReader(new File(TEST_DATA_DIR,basename)); for(final FastqRecord rec: fastqReader) { records.add(rec); if(records.size()>100) break; } fastqReader.close(); Assert.assertEquals(TestUtil.serializeAndDeserialize(records),records); }
Source:
public PermissionBlueprintDTO populate(ModelTranslator translator, PermissionBlueprintInfo source, PermissionBlueprintDTO dest) { if (source == null) { throw new IllegalArgumentException("source is null"); } if (dest == null) { throw new IllegalArgumentException("dest is null"); } dest.setId(null); dest.setType(source.getTypeName()); dest.setAccess(source.getAccessLevel()); if (translator != null) { if (source.getOwner() != null) { OwnerDTO owner = translator.translate(source.getOwner(), OwnerDTO.class); NestedOwnerDTO ownerDTO = new NestedOwnerDTO() .displayName(owner.getDisplayName()) .href(owner.getHref()) .id(owner.getId()) .key(owner.getKey()); dest.setOwner(ownerDTO); } } else { dest.setOwner(null); } return dest; }

Target:
public PermissionBlueprintDTO populate(ModelTranslator translator, PermissionBlueprintInfo source, PermissionBlueprintDTO dest) { if (source == null) { throw new IllegalArgumentException("source is null"); } if (dest == null) { throw new IllegalArgumentException("dest is null"); } dest.setId(null); dest.setType(source.getTypeName()); dest.setAccess(source.getAccessLevel()); if (source.getOwner() != null) { dest.setOwner(new NestedOwnerDTO().key(source.getOwner().getKey())); } else { dest.setOwner(null); } return dest; }
Source:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.create_key_email_fragment, container, false); mEmailEdit = (EmailEditText) view.findViewById(R.id.create_key_email); View mBackButton = view.findViewById(R.id.create_key_back_button); View mNextButton = view.findViewById(R.id.create_key_next_button); RecyclerView mEmailsRecyclerView = (RecyclerView) view.findViewById(R.id.create_key_emails); mEmailEdit.setText(mCreateKeyActivity.mEmail); if (mCreateKeyActivity.mEmail == null) { mEmailEdit.requestFocus(); } mBackButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mCreateKeyActivity.loadFragment(null, FragAction.TO_LEFT); } }); mNextButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { nextClicked(); } }); mEmailsRecyclerView.setHasFixedSize(true); mEmailsRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity())); mEmailsRecyclerView.setItemAnimator(new DefaultItemAnimator()); if (mAdditionalEmailModels == null) { mAdditionalEmailModels = new ArrayList<>(); } if (mEmailAdapter == null) { mEmailAdapter = new EmailAdapter(mAdditionalEmailModels, new View.OnClickListener() { @Override public void onClick(View v) { addEmail(); } }); if (mCreateKeyActivity.mAdditionalEmails != null) { mEmailAdapter.addAll(mCreateKeyActivity.mAdditionalEmails); } } mEmailsRecyclerView.setAdapter(mEmailAdapter); return view; }

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.create_key_email_fragment, container, false); mEmailEdit = (EmailEditText) view.findViewById(R.id.create_key_email); View backButton = view.findViewById(R.id.create_key_back_button); View nextButton = view.findViewById(R.id.create_key_next_button); RecyclerView emailsRecyclerView = (RecyclerView) view.findViewById(R.id.create_key_emails); mEmailEdit.setText(mCreateKeyActivity.mEmail); if (mCreateKeyActivity.mEmail == null) { mEmailEdit.requestFocus(); } backButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mCreateKeyActivity.loadFragment(null, FragAction.TO_LEFT); } }); nextButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { nextClicked(); } }); emailsRecyclerView.setHasFixedSize(true); emailsRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity())); emailsRecyclerView.setItemAnimator(new DefaultItemAnimator()); if (mAdditionalEmailModels == null) { mAdditionalEmailModels = new ArrayList<>(); } if (mEmailAdapter == null) { mEmailAdapter = new EmailAdapter(mAdditionalEmailModels, new View.OnClickListener() { @Override public void onClick(View v) { addEmail(); } }); if (mCreateKeyActivity.mAdditionalEmails != null) { mEmailAdapter.addAll(mCreateKeyActivity.mAdditionalEmails); } } emailsRecyclerView.setAdapter(mEmailAdapter); return view; }
Source:
public void then_flattened_nested_filterByPredicate() { SearchQuery<DocumentReference> query; String normalField = indexMapping.identicalForFirstTwo.relativeFieldName; String flattenedField = "flattened." + indexMapping.flattenedField.relativeFieldName; String nestedField = "nested." + indexMapping.flattenedField.relativeFieldName; query = indexManager.createScope().query() .predicate( b -> b.match().onField( normalField ).matching( "aaa" ) ) .sort( f -> f.byField( flattenedField ).asc().then().byField( normalField ).asc() ) .toQuery(); assertThat( query.fetch( 2 ) ).hasDocRefHitsExactOrder( INDEX_NAME, DOCUMENT_1, DOCUMENT_2 ); query = indexManager.createScope().query() .predicate( b -> b.match().onField( normalField ).matching( "aaa" ) ) .sort( f -> f.byField( nestedField ).asc().then().byField( flattenedField ).asc() ) .toQuery(); assertThat( query.fetch( 2 ) ).hasDocRefHitsExactOrder( INDEX_NAME, DOCUMENT_2, DOCUMENT_1 ); query = indexManager.createScope().query() .predicate( b -> b.match().onField( normalField ).matching( "aaa" ) ) .sort( f -> f.byField( normalField ).asc().then().byField( nestedField ).asc() ) .toQuery(); assertThat( query.fetch( 2 ) ).hasDocRefHitsExactOrder( INDEX_NAME, DOCUMENT_2, DOCUMENT_1 ); }

Target:
public void then_flattened_nested_filterByPredicate() { SearchQuery<DocumentReference> query; String normalField = indexMapping.identicalForFirstTwo.relativeFieldName; String flattenedField = "flattened." + indexMapping.flattenedField.relativeFieldName; String nestedField = "nested." + indexMapping.flattenedField.relativeFieldName; query = indexManager.createScope().query() .predicate( b -> b.match().field( normalField ).matching( "aaa" ) ) .sort( f -> f.field( flattenedField ).asc().then().field( normalField ).asc() ) .toQuery(); assertThat( query.fetch( 2 ) ).hasDocRefHitsExactOrder( INDEX_NAME, DOCUMENT_1, DOCUMENT_2 ); query = indexManager.createScope().query() .predicate( b -> b.match().field( normalField ).matching( "aaa" ) ) .sort( f -> f.field( nestedField ).asc().then().field( flattenedField ).asc() ) .toQuery(); assertThat( query.fetch( 2 ) ).hasDocRefHitsExactOrder( INDEX_NAME, DOCUMENT_2, DOCUMENT_1 ); query = indexManager.createScope().query() .predicate( b -> b.match().field( normalField ).matching( "aaa" ) ) .sort( f -> f.field( normalField ).asc().then().field( nestedField ).asc() ) .toQuery(); assertThat( query.fetch( 2 ) ).hasDocRefHitsExactOrder( INDEX_NAME, DOCUMENT_2, DOCUMENT_1 ); }
Source:
public void ensureInputsPresent(MerkleTree merkleTree, Map<Digest, Message> additionalInputs) throws IOException, InterruptedException { Iterable<Digest> allDigests = Iterables.concat(merkleTree.getAllDigests(), additionalInputs.keySet()); ImmutableSet<Digest> missingDigests = getFromFuture(cacheProtocol.findMissingDigests(allDigests)); List<ListenableFuture<Void>> uploadFutures = new ArrayList<>(); for (Digest missingDigest : missingDigests) { if (!missingDigests.contains(missingDigest)) { continue; } uploadFutures.add(uploadBlob(missingDigest, merkleTree, additionalInputs)); } waitForBulkTransfer(uploadFutures, false); }

Target:
public void ensureInputsPresent(MerkleTree merkleTree, Map<Digest, Message> additionalInputs) throws IOException, InterruptedException { Iterable<Digest> allDigests = Iterables.concat(merkleTree.getAllDigests(), additionalInputs.keySet()); ImmutableSet<Digest> missingDigests = getFromFuture(cacheProtocol.findMissingDigests(allDigests)); List<ListenableFuture<Void>> uploadFutures = new ArrayList<>(); for (Digest missingDigest : missingDigests) { uploadFutures.add(uploadBlob(missingDigest, merkleTree, additionalInputs)); } waitForBulkTransfer(uploadFutures, false); }
Source:
protected final Object handleMissingEntryOnRead(TopologyAffectedCommand command) { CacheTopology cacheTopology = stateTransferManager.getCacheTopology(); int currentTopologyId = cacheTopology.getTopologyId(); int cmdTopology = command.getTopologyId(); if (cmdTopology < currentTopologyId) { return (Object) UnsuccessfulResponse.INSTANCE; } else { throw new OutdatedTopologyException(cmdTopology); } }

Target:
protected final Object handleMissingEntryOnRead(TopologyAffectedCommand command) { CacheTopology cacheTopology = stateTransferManager.getCacheTopology(); int currentTopologyId = cacheTopology.getTopologyId(); int cmdTopology = command.getTopologyId(); if (cmdTopology < currentTopologyId) { return UnsuccessfulResponse.INSTANCE; } else { throw new OutdatedTopologyException(cmdTopology); } }
Source:
public List<FileDownloadInfo> getAllDownloadsFor(long batchId) { Cursor downloadsCursor = contentResolver.query( downloadsUriProvider.getAllDownloadsUri(), null, batchId == NO_BATCH_ID ? null : DownloadContract.Downloads.COLUMN_BATCH_ID + " = ?", batchId == NO_BATCH_ID ? null : new String[] { String.valueOf(batchId) }, DownloadContract.Batches._ID + " ASC" ); try { List<FileDownloadInfo> downloads = new ArrayList<>(); FileDownloadInfo.Reader reader = new FileDownloadInfo.Reader(contentResolver, downloadsCursor); while (downloadsCursor.moveToNext()) { downloads.add(downloadInfoCreator.create(reader)); } return downloads; } finally { if (downloadsCursor != null) downloadsCursor.close(); } }

Target:
public List<FileDownloadInfo> getAllDownloadsFor(long batchId) { Cursor downloadsCursor = contentResolver.query( downloadsUriProvider.getAllDownloadsUri(), null, batchId == NO_BATCH_ID ? null : DownloadContract.Downloads.COLUMN_BATCH_ID + " = ?", batchId == NO_BATCH_ID ? null : new String[] { String.valueOf(batchId) }, DownloadContract.Batches._ID + " ASC" ); try { List<FileDownloadInfo> downloads = new ArrayList<>(); FileDownloadInfo.Reader reader = new FileDownloadInfo.Reader(contentResolver, downloadsCursor); while (downloadsCursor.moveToNext()) { downloads.add(downloadInfoCreator.create(reader)); } return downloads; } finally { if (downloadsCursor != null) { downloadsCursor.close(); } } }
Source:
public String toString() { return "ClientCacheEntryExpiredEvent(" + "key=" + key + ")"; }

Target:
public String toString() { return "ExpiredEventImpl(" + "key=" + key + ")"; }
Source:
private StringBuilder filterAnonVarsAndPrint(K result, Set<String> filterSet, CompiledDefinition compiledDef, KRunOptions options) { StringBuilder sb = new StringBuilder(); ByteArrayOutputStream bs = new ByteArrayOutputStream(); if (result instanceof KApply && ((KApply) result).klabel().toString().equals(KLabels.AND)) { List<K> conjunctions = mutable(Assoc.flatten(KLabel(KLabels.AND), immutable(((KApply) result).items()), KLabel(KLabels.ML_TRUE))); conjunctions = conjunctions.stream().filter(x -> { if (x.getClass().toString().contains("BoolToken")) { return false; } if ((options.pattern != null) && x instanceof KApply && ((KApply) x).klabel().toString().equals(KLabels.EQUALS)) { K var = ((KApply) x).klist().items().get(0); if (var instanceof KVariable) { return filterSet.contains(((KVariable) var).name()); } } return true; }).collect(Collectors.toList()); conjunctions.sort(Comparator.comparing(K::toString)); if (conjunctions.size() > 1) { conjunctions.subList(0, conjunctions.size() - 1).forEach(x -> { prettyPrint(compiledDef, options.output, s -> bs.write(s, 0, s.length), x); sb.append(new String(bs.toByteArray())); sb.append(" " + KLabels.AND + " "); }); } if (!conjunctions.isEmpty()) { bs.reset(); prettyPrint(compiledDef, options.output, s -> bs.write(s, 0, s.length), conjunctions.get(conjunctions.size() - 1)); sb.append(new String(bs.toByteArray())); } return sb; } else { prettyPrint(compiledDef, options.output, s -> bs.write(s, 0, s.length), result); sb.append(new String(bs.toByteArray())); return sb; } }

Target:
private StringBuilder filterAnonVarsAndPrint(K result, Set<String> filterSet, CompiledDefinition compiledDef, KRunOptions options) { StringBuilder sb = new StringBuilder(); ByteArrayOutputStream bs = new ByteArrayOutputStream(); if (result instanceof KApply && ((KApply) result).klabel().toString().equals(KLabels.ML_AND)) { List<K> conjunctions = mutable(Assoc.flatten(KLabel(KLabels.ML_AND), immutable(((KApply) result).items()), KLabel(KLabels.ML_TRUE))); conjunctions = conjunctions.stream().filter(x -> { if ((options.pattern != null) && x instanceof KApply && ((KApply) x).klabel().name().equals(KLabels.EQUALS)) { K var = ((KApply) x).klist().items().get(0); if (var instanceof KVariable) { return filterSet.contains(((KVariable) var).name()); } } return true; }).collect(Collectors.toList()); conjunctions.sort(Comparator.comparing(K::toString)); if (conjunctions.size() > 1) { conjunctions.subList(0, conjunctions.size() - 1).forEach(x -> { prettyPrint(compiledDef, options.output, s -> bs.write(s, 0, s.length), x); sb.append(new String(bs.toByteArray())); sb.append(" " + KLabels.ML_AND + " "); }); } if (!conjunctions.isEmpty()) { bs.reset(); prettyPrint(compiledDef, options.output, s -> bs.write(s, 0, s.length), conjunctions.get(conjunctions.size() - 1)); sb.append(new String(bs.toByteArray())); } return sb; } else { prettyPrint(compiledDef, options.output, s -> bs.write(s, 0, s.length), result); sb.append(new String(bs.toByteArray())); return sb; } }
Source:
public synchronized ZoneId deserialize(JsonElement element, Type type, JsonDeserializationContext context) { try { return ZoneId.of(element.getAsString()); } catch (DateTimeParseException e) { throw new JsonSyntaxException(element.getAsString(), e); } }

Target:
public synchronized ZoneId deserialize(JsonElement element, Type type, JsonDeserializationContext context) { try { return ZoneId.of(element.getAsString()); } catch (DateTimeException e) { throw new JsonSyntaxException(element.getAsString(), e); } }
Source:
public Object getTransactionId() { return tx != null ? tx.getId() : null; }

Target:
public Object getTransactionId() { return tx.getId(); }
Source:
public void getSourceFile(OutputStream output, OrcsApi orcsApi, String urlToSource, boolean offline) throws IOException { ResourceToken pageToken = offline ? AtsRestTemplateTokens.OfflineSourceFileTemplateHtml : AtsRestTemplateTokens.SourceFileTemplateHtml; Writer writer = new OutputStreamWriter(output); Client client = Client.create(); URI.create(urlToSource); WebResource service = client.resource(urlToSource); PageCreator page = new PageCreator(orcsApi.getResourceRegistry()); page.addKeyValuePair("fileContents", service.get(String.class)); page.realizePage(pageToken, writer); writer.close(); }

Target:
public void getSourceFile(OutputStream output, OrcsApi orcsApi, String urlToSource, boolean offline) { ResourceToken pageToken = offline ? AtsRestTemplateTokens.OfflineSourceFileTemplateHtml : AtsRestTemplateTokens.SourceFileTemplateHtml; Writer writer = null; try { writer = new OutputStreamWriter(output); Client client = Client.create(); URI.create(urlToSource); WebResource service = client.resource(urlToSource); PageCreator page = new PageCreator(orcsApi.getResourceRegistry()); page.addKeyValuePair("fileContents", service.get(String.class)); page.realizePage(pageToken, writer); } finally { Lib.close(writer); } }
Source:
void writeData(Http2Stream stream, ByteBuf chunk, boolean end, Handler<AsyncResult<Void>> handler) { EventExecutor executor = chctx.executor(); ChannelPromise promise = chctx.newPromise(); promise.addListener((future -> { if(future.isSuccess()) { handler.handle(Future.succeededFuture()); } else { handler.handle(Future.failedFuture(future.cause())); } })); if (executor.inEventLoop()) { _writeData(stream, chunk, end, promise); } else { executor.execute(() -> { _writeData(stream, chunk, end, promise); }); } }

Target:
void writeData(Http2Stream stream, ByteBuf chunk, boolean end, Handler<AsyncResult<Void>> handler) { EventExecutor executor = chctx.executor(); ChannelPromise promise = chctx.newPromise(); if (handler != null) { promise.addListener((future) -> { if(future.isSuccess()) { handler.handle(Future.succeededFuture()); } else { handler.handle(Future.failedFuture(future.cause())); } }); } if (executor.inEventLoop()) { _writeData(stream, chunk, end, promise); } else { executor.execute(() -> { _writeData(stream, chunk, end, promise); }); } }
Source:
public void get( String key, AsyncCallback<Object> callback ) { get( key, callback ); }

Target:
public void get( String key, AsyncCallback<Object> callback ) { get( key, Object.class, callback ); }
Source:
private static Storage getService(String credentialsPath) throws Exception { if (null == mStorageService) { HttpTransport httpTransport = GoogleNetHttpTransport.newTrustedTransport(); GoogleCredential credential; try { credential = GoogleCredential.fromStream(new FileInputStream(credentialsPath), httpTransport, JSON_FACTORY) .createScoped(Collections.singleton(StorageScopes.CLOUD_PLATFORM)); } catch (IOException e) { throw new RuntimeException("Failed to load Google credentials : " + credentialsPath, e); } mStorageService = new Storage.Builder(httpTransport, JSON_FACTORY, credential) .setApplicationName("com.pinterest.secor") .build(); } return mStorageService; }

Target:
private static Storage getService(String credentialsPath) throws Exception { if (mStorageService == null) { HttpTransport httpTransport = GoogleNetHttpTransport.newTrustedTransport(); GoogleCredential credential; try { if (credentialsPath != null) { credential = GoogleCredential.fromStream(new FileInputStream(credentialsPath), httpTransport, JSON_FACTORY) .createScoped(Collections.singleton(StorageScopes.CLOUD_PLATFORM)); } else { credential = GoogleCredential.getApplicationDefault(httpTransport, JSON_FACTORY); } } catch (IOException e) { throw new RuntimeException("Failed to load Google credentials : " + credentialsPath, e); } mStorageService = new Storage.Builder(httpTransport, JSON_FACTORY, credential) .setApplicationName("com.pinterest.secor") .build(); } return mStorageService; }
Source:
public void testUsesInitialDelegateAndUpdatesDelegatesWhenRefreshableChanges() throws Exception { Object object1 = new Object(); Object object2 = new Object(); when(supplier.apply(object1)).thenReturn(delegate1); Refreshable<Object> refreshable = Refreshable.of(object1); RefreshableProxyInvocationHandler<Object, Callable> handler = RefreshableProxyInvocationHandler.create(refreshable, supplier); verify(supplier).apply(object1); Mockito.reset(supplier); Callable proxy = Reflection.newProxy(Callable.class, handler); proxy.call(); verify(delegate1).call(); Mockito.verifyNoMoreInteractions(delegate1, delegate2, supplier); Mockito.reset(delegate1, delegate2, supplier); proxy.call(); verify(delegate1).call(); Mockito.verifyNoMoreInteractions(delegate1, delegate2, supplier); Mockito.reset(delegate1, delegate2, supplier); refreshable.set(object2); when(supplier.apply(object2)).thenReturn(delegate2); proxy.call(); verify(delegate2).call(); verify(supplier).apply(object2); Mockito.verifyNoMoreInteractions(delegate1, delegate2, supplier); Mockito.reset(delegate1, delegate2, supplier); proxy.call(); verify(delegate2).call(); Mockito.verifyNoMoreInteractions(delegate1, delegate2, supplier); Mockito.reset(delegate1, delegate2, supplier); }

Target:
public void testUsesInitialDelegateAndUpdatesDelegatesWhenRefreshableChanges() throws Exception { Object object1 = new Object(); Object object2 = new Object(); when(supplier.apply(object1)).thenReturn(delegate1); Refreshable<Object> refreshable = Refreshable.of(object1); RefreshableProxyInvocationHandler<Object, Callable> handler = RefreshableProxyInvocationHandler.create(refreshable, supplier); verify(supplier).apply(object1); Callable proxy = Reflection.newProxy(Callable.class, handler); proxy.call(); verify(delegate1).call(); Mockito.verifyNoMoreInteractions(delegate1, delegate2, supplier); proxy.call(); verify(delegate1, times(2)).call(); Mockito.verifyNoMoreInteractions(delegate1, delegate2, supplier); refreshable.set(object2); when(supplier.apply(object2)).thenReturn(delegate2); proxy.call(); verify(delegate2).call(); verify(supplier).apply(object2); Mockito.verifyNoMoreInteractions(delegate1, delegate2, supplier); proxy.call(); verify(delegate2, times(2)).call(); Mockito.verifyNoMoreInteractions(delegate1, delegate2, supplier); }
Source:
protected void defaultButtonInitialization(){ saveButton = new TextButton("Save"); saveButton.setPixelSize(60, 22); saveButton.getElement().setMargins(new Margins(0, 0, 0, 0)); cancelButton = new TextButton("Cancel"); cancelButton.setPixelSize(60, 22); cancelButton.getElement().setMargins(new Margins(0, 0, 0, PIXELS_BETWEEN_BUTTONS)); }

Target:
protected void defaultButtonInitialization(){ saveButton = new TextButton("Save"); saveButton.setPixelSize(60, 22); saveButton.getElement().setMargins(new Margins(0, 0, 0, 0)); saveButton.addSelectHandler(new SelectEvent.SelectHandler() { @Override public void onSelect(SelectEvent selectEvent) { onSaveButtonClick(); } }); cancelButton = new TextButton("Cancel"); cancelButton.setPixelSize(60, 22); cancelButton.getElement().setMargins(new Margins(0, 0, 0, PIXELS_BETWEEN_BUTTONS)); cancelButton.addSelectHandler(new SelectEvent.SelectHandler() { @Override public void onSelect(SelectEvent selectEvent) { onCancelButtonClick(); } }); }
Source:
public BatchSource<JetInputOutputFormat<KeyIn, ValueIn>> createDataSource(DataStore<KeyIn, ValueIn> dataOutStore, Query<KeyIn, ValueIn> query) { JetEngine.dataInStore = dataOutStore; JetEngine.query = query; BatchSource<JetInputOutputFormat<KeyIn, ValueIn>> source = Sources.batchFromProcessor("gora-jet-source", new JetSource<KeyIn, ValueIn>()); return source; }

Target:
public BatchSource<JetInputOutputFormat<KeyIn, ValueIn>> createDataSource(DataStore<KeyIn, ValueIn> dataOutStore, Query<KeyIn, ValueIn> query) { JetEngine.dataInStore = dataOutStore; JetEngine.query = query; return Sources.batchFromProcessor("gora-jet-source", new JetSource<KeyIn, ValueIn>()); }
Source:
private RestModel replace(ItemRest item, Operation operation) throws PatchBadRequestException, UnprocessableEntityException { checkOperationValue((String) operation.getValue()); Boolean withdraw = BooleanUtils.toBooleanObject((String) operation.getValue()); if (withdraw == null) { throw new PatchBadRequestException( "Boolean value not provided for withdrawn operation.."); } if (withdraw) { if (!item.getWithdrawn() && !item.getInArchive()) { throw new UnprocessableEntityException("Cannot withdraw item when it is not in archive."); } if (item.getWithdrawn()) { return item; } item.setWithdrawn(true); return item; } else { if (!item.getWithdrawn()) { return item; } item.setWithdrawn(false); return item; } }

Target:
public ItemRest replace(ItemRest item, Operation operation) { Boolean withdraw = getBooleanOperationValue(operation.getValue()); if (withdraw) { if (!item.getWithdrawn() && !item.getInArchive()) { throw new UnprocessableEntityException("Cannot withdraw item when it is not in archive."); } if (item.getWithdrawn()) { return item; } item.setWithdrawn(true); return item; } else { if (!item.getWithdrawn()) { return item; } item.setWithdrawn(false); return item; } }
Source:
public void updatesRequired_shouldAlwaysHaveAValidUpdateToLatestFile() throws Exception { try { DatabaseUpdater.updatesRequired(); } catch (RuntimeException | IOException rex) { log.error("Runtime Exception in test for Validation Errors"); } }

Target:
public void updatesRequired_shouldAlwaysHaveAValidUpdateToLatestFile() throws Exception { try { DatabaseUpdater.updatesRequired(); } catch (Exception ex) { log.error("Exception in test for Validation Errors"); } }
Source:
public ValueMatcher makeMatcher( BitmapIndexSelector selector, ColumnSelectorFactory columnSelectorFactory, RowOffsetMatcherFactory rowOffsetMatcherFactory ) { final List<ValueMatcher> matchers = new ArrayList<>(); final List<ImmutableBitmap> bitmaps = new ArrayList<>(); for (Filter filter : filters) { if (filter.supportsBitmapIndex(selector)) { bitmaps.add(filter.getBitmapIndex(selector)); } else { ValueMatcher matcher = filter.makeMatcher(columnSelectorFactory); matchers.add(matcher); } } if (bitmaps.size() > 0) { ImmutableBitmap combinedBitmap = selector.getBitmapFactory().intersection(bitmaps); ValueMatcher offsetMatcher = rowOffsetMatcherFactory.makeRowOffsetMatcher(combinedBitmap); matchers.add(0, offsetMatcher); } return makeMatcher(matchers.toArray(new ValueMatcher[0])); }

Target:
public ValueMatcher makeMatcher( BitmapIndexSelector selector, ColumnSelectorFactory columnSelectorFactory, RowOffsetMatcherFactory rowOffsetMatcherFactory ) { final List<ValueMatcher> matchers = new ArrayList<>(); final List<ImmutableBitmap> bitmaps = new ArrayList<>(); for (Filter filter : filters) { if (filter.supportsBitmapIndex(selector)) { bitmaps.add(filter.getBitmapIndex(selector)); } else { ValueMatcher matcher = filter.makeMatcher(columnSelectorFactory); matchers.add(matcher); } } if (bitmaps.size() > 0) { ImmutableBitmap combinedBitmap = selector.getBitmapFactory().intersection(bitmaps); ValueMatcher offsetMatcher = rowOffsetMatcherFactory.makeRowOffsetMatcher(combinedBitmap); matchers.add(0, offsetMatcher); } return makeMatcher(matchers.toArray(EMPTY_VALUE_MATCHER_ARRAY)); }
Source:
public AnnotatedTypeMirror visitVariable(VariableTree node, AnnotatedTypeFactory f) { AnnotatedTypeMirror result = TypeFromTree.fromTypeTree(f, node.getType()); List<? extends AnnotationTree> annoTrees = node.getModifiers().getAnnotations(); if (annoTrees != null && !annoTrees.isEmpty()) { List<AnnotationMirror> annos = TreeUtils.annotationsFromTypeAnnotationTrees(annoTrees); AnnotatedTypeMirror innerType = AnnotatedTypes.innerMostType(result); for (AnnotationMirror anno : annos) { if (AnnotationUtils.isDeclarationAnnotation(anno)) { result.addAnnotation(anno); } else { innerType.addAnnotation(anno); } } } Element elt = TreeUtils.elementFromDeclaration(node); AnnotatedTypeMirror lambdaParamType = inferLambdaParamAnnotations(f, result, elt); if (lambdaParamType != null) { return lambdaParamType; } return result; }

Target:
public AnnotatedTypeMirror visitVariable(VariableTree node, AnnotatedTypeFactory f) { AnnotatedTypeMirror result = TypeFromTree.fromTypeTree(f, node.getType()); List<? extends AnnotationTree> annoTrees = node.getModifiers().getAnnotations(); if (annoTrees != null && !annoTrees.isEmpty()) { List<AnnotationMirror> annos = TreeUtils.annotationsFromTypeAnnotationTrees(annoTrees); AnnotatedTypeMirror innerType = AnnotatedTypes.innerMostType(result); for (AnnotationMirror anno : annos) { if (AnnotationUtils.isDeclarationAnnotation(anno) && !AnnotationUtils.annotationName(anno) .startsWith("org.checkerframework")) { result.addAnnotation(anno); } else { innerType.addAnnotation(anno); } } } Element elt = TreeUtils.elementFromDeclaration(node); AnnotatedTypeMirror lambdaParamType = inferLambdaParamAnnotations(f, result, elt); if (lambdaParamType != null) { return lambdaParamType; } return result; }