auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void onPost(final GitLabMergeRequest req) { final ParameterizedJobMixIn scheduledJob = new ParameterizedJobMixIn() { @Override protected Job asJob() { return job; } }; if (triggerOnMergeRequest && this.isBranchAllowed(req.getObjectAttribute().getTargetBranch())) { LOGGER.log(Level.INFO, "{0} triggered for merge request.", job.getFullName()); String name = " #" + job.getNextBuildNumber(); GitLabMergeCause cause = createGitLabMergeCause(req); Action[] actions = createActions(req, job); int projectbuildDelay = 0; if (job instanceof ParameterizedJobMixIn.ParameterizedJob) { ParameterizedJobMixIn.ParameterizedJob abstractProject = (ParameterizedJobMixIn.ParameterizedJob)job; if (abstractProject.getQuietPeriod() > projectbuildDelay) { projectbuildDelay = abstractProject.getQuietPeriod(); } } if(addCiMessage) { req.createCommitStatus(getDescriptor().getGitlab().instance(), "pending", Jenkins.getInstance().getRootUrl() + job.getUrl()); } scheduledJob.scheduleBuild2(projectbuildDelay, actions); } else { LOGGER.log(Level.INFO, "trigger on merge request not set"); } }

Target:
public void onPost(final GitLabMergeRequest req) { final ParameterizedJobMixIn scheduledJob = new ParameterizedJobMixIn() { @Override protected Job asJob() { return job; } }; if (triggerOnMergeRequest && this.isBranchAllowed(req.getObjectAttribute().getTargetBranch())) { LOGGER.log(Level.INFO, "{0} triggered for merge request.", job.getFullName()); GitLabMergeCause cause = createGitLabMergeCause(req); Action action = createAction(req, job); int projectbuildDelay = 0; if (job instanceof ParameterizedJobMixIn.ParameterizedJob) { ParameterizedJobMixIn.ParameterizedJob abstractProject = (ParameterizedJobMixIn.ParameterizedJob)job; if (abstractProject.getQuietPeriod() > projectbuildDelay) { projectbuildDelay = abstractProject.getQuietPeriod(); } } if(addCiMessage) { req.createCommitStatus(getDescriptor().getGitlab().instance(), "pending", Jenkins.getInstance().getRootUrl() + job.getUrl()); } scheduledJob.scheduleBuild2(projectbuildDelay, action, new CauseAction(cause)); } else { LOGGER.log(Level.INFO, "trigger on merge request not set"); } }
Source:
public void testMapTuple3WithoutSpecifiedColumn_shouldFail() throws SQLException { Handle handle = dbRule.getSharedHandle(); handle.registerRowMapper(new SomethingMapper()); Tuple3<Integer, Something, Integer> result = handle .createQuery("select * from something where id = 1") .mapTo(new GenericType<Tuple3<Integer, Something, Integer>>() {}) .findOnly(); assertThat(result._1).isEqualTo(1); assertThat(result._2).isEqualTo(new Something(1, "eric")); assertThat(result._3).isNotEqualTo(100); }

Target:
public void testMapTuple3WithoutSpecifiedColumn_shouldFail() throws SQLException { Handle handle = dbRule.getSharedHandle(); handle.registerRowMapper(new SomethingMapper()); assertThatThrownBy(() -> handle .createQuery("select * from something where id = 1") .mapTo(new GenericType<Tuple3<Integer, Something, Integer>>() {}) .findOnly()) .isInstanceOf(NoSuchMapperException.class) .hasMessageContaining("TupleMappers config class"); }
Source:
private void loadMachineUUID() { String uuid = loadExistingUUID(); if (uuid == null) { uuid = UUID.randomUUID().toString(); saveUUID(uuid); } environmentTracker.getService().setProperty(PROP_UUID, uuid); }

Target:
private void loadMachineUUID() { String uuid = loadExistingUUID(); if (uuid == null) { uuid = UUID.randomUUID().toString(); saveUUID(uuid); } EnvironmentInfo environment = environmentTracker.getService(); if (environment != null) { environment.setProperty(PROP_UUID, uuid); } else { System.setProperty(PROP_UUID, uuid); } }
Source:
public void cleanCache() { resetInMemoryCache(); if (SalesforceSDKManagerWithSmartStore.getInstance().hasSmartStore()) { smartStore.dropAllSoups(); } }

Target:
public void cleanCache() { resetInMemoryCache(); if (SalesforceSDKManagerWithSmartStore.getInstance().hasSmartStore()) { clearAllSoups(); } }
Source:
public boolean checkTrigger(GameEvent event, Game game) { ZoneChangeEvent zcEvent = (ZoneChangeEvent) event; if (zcEvent.getFromZone() != Zone.BATTLEFIELD) { return false; } if (zcEvent.getToZone() != Zone.GRAVEYARD && zcEvent.getToZone() != Zone.COMMAND) { return false; } Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); if (!permanent.getControllerId().equals(this.getControllerId()) || !permanent.isCreature()) { return false; } int countersOn = permanent.getCounters(game).getCount(CounterType.P1P1); if (countersOn == 0) { return false; } this.getEffects().clear(); this.addEffect(new AddCountersTargetEffect(CounterType.P1P1.createInstance(countersOn))); return true; }

Target:
public boolean checkTrigger(GameEvent event, Game game) { ZoneChangeEvent zcEvent = (ZoneChangeEvent) event; if (zcEvent.getFromZone() != Zone.BATTLEFIELD) { return false; } if (zcEvent.getToZone() != Zone.GRAVEYARD && zcEvent.getToZone() != Zone.COMMAND) { return false; } Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD); if (permanent == null || !permanent.isCreature()) { return false; } Player player = game.getPlayer(this.getControllerId()); if (player == null || !player.getId().equals(this.getControllerId())) { return false; } int countersOn = permanent.getCounters(game).getCount(CounterType.P1P1); if (countersOn == 0) { return false; } this.getEffects().clear(); this.addEffect(new AddCountersTargetEffect(CounterType.P1P1.createInstance(countersOn))); return true; }
Source:
public void generateData(Path outFile, Configuration configuration, ParquetProperties.WriterVersion version, int blockSize, int pageSize, int fixedLenByteArraySize, CompressionCodecName codec, int nRows) throws IOException { if (exists(configuration, outFile)) { System.out.println("File already exists " + outFile); return; } System.out.println("Generating data @ " + outFile); MessageType schema = parseMessageType( "message test { " + "required binary binary_field; " + "required int32 int32_field; " + "required int64 int64_field; " + "required boolean boolean_field; " + "required float float_field; " + "required double double_field; " + "required fixed_len_byte_array(" + fixedLenByteArraySize +") flba_field; " + "required int96 int96_field; " + "} "); GroupWriteSupport.setSchema(schema, configuration); SimpleGroupFactory f = new SimpleGroupFactory(schema); ParquetWriter<Group> writer = new ParquetWriter<Group>(outFile, new GroupWriteSupport(), codec, blockSize, pageSize, DICT_PAGE_SIZE, true, false, version, configuration); char[] chars = new char[fixedLenByteArraySize]; Arrays.fill(chars, '*'); for (int i = 0; i < nRows; i++) { writer.write( f.newGroup() .append("binary_field", randomUUID().toString()) .append("int32_field", i) .append("int64_field", 64l) .append("boolean_field", true) .append("float_field", 1.0f) .append("double_field", 2.0d) .append("flba_field", new String(chars)) .append("int96_field", Binary.fromUnmodifiedByteArray(new byte[12])) ); } writer.close(); }

Target:
public void generateData(Path outFile, Configuration configuration, ParquetProperties.WriterVersion version, int blockSize, int pageSize, int fixedLenByteArraySize, CompressionCodecName codec, int nRows) throws IOException { if (exists(configuration, outFile)) { System.out.println("File already exists " + outFile); return; } System.out.println("Generating data @ " + outFile); MessageType schema = parseMessageType( "message test { " + "required binary binary_field; " + "required int32 int32_field; " + "required int64 int64_field; " + "required boolean boolean_field; " + "required float float_field; " + "required double double_field; " + "required fixed_len_byte_array(" + fixedLenByteArraySize +") flba_field; " + "required int96 int96_field; " + "} "); GroupWriteSupport.setSchema(schema, configuration); SimpleGroupFactory f = new SimpleGroupFactory(schema); ParquetWriter<Group> writer = new ParquetWriter<Group>(outFile, new GroupWriteSupport(), codec, blockSize, pageSize, DICT_PAGE_SIZE, true, false, version, configuration); char[] chars = new char[fixedLenByteArraySize]; Arrays.fill(chars, '*'); for (int i = 0; i < nRows; i++) { writer.write( f.newGroup() .append("binary_field", randomUUID().toString()) .append("int32_field", i) .append("int64_field", 64l) .append("boolean_field", true) .append("float_field", 1.0f) .append("double_field", 2.0d) .append("flba_field", new String(chars)) .append("int96_field", Binary.fromConstantByteArray(new byte[12])) ); } writer.close(); }
Source:
private void addImportExportInstanceHelper(WorkflowExecutionContext context, RelationshipLabel label) throws FalconException { String feedName = (label == RelationshipLabel.DATASOURCE_IMPORT_EDGE) ? context.getOutputFeedNames() : context.getInputFeedNames(); String feedInstanceDataPath = (label == RelationshipLabel.DATASOURCE_IMPORT_EDGE) ? context.getOutputFeedInstancePaths() : context.getInputFeedInstancePaths(); String datasourceName = context.getDatasourceName(); String sourceClusterName = context.getSrcClusterName(); LOG.info("Computing feed instance for : name= path= {}, in cluster: " + "from datasource: {}", label.getName(), feedName, feedInstanceDataPath, sourceClusterName, datasourceName); String feedInstanceName = getFeedInstanceName(feedName, sourceClusterName, feedInstanceDataPath, context.getNominalTimeAsISO8601()); Vertex feedInstanceVertex = findVertex(feedInstanceName, RelationshipType.FEED_INSTANCE); LOG.info("Vertex exists? name={}, type={}, v={}", feedInstanceName, RelationshipType.FEED_INSTANCE, feedInstanceVertex); if (feedInstanceVertex == null) { LOG.info("{} instance vertex does not exist, add it", RelationshipType.FEED_INSTANCE, feedInstanceName); feedInstanceVertex = addFeedInstance( feedInstanceName, context, feedName, context.getSrcClusterName()); } Map<RelationshipProperty, String> properties = edgePropertiesForIndexing(context); properties.put(RelationshipProperty.TIMESTAMP, context.getTimeStampAsISO8601()); addInstanceToEntity(feedInstanceVertex, datasourceName, RelationshipType.DATASOURCE_ENTITY, label, properties); addInstanceToEntity(feedInstanceVertex, sourceClusterName, RelationshipType.CLUSTER_ENTITY, RelationshipLabel.FEED_CLUSTER_EDGE, properties); }

Target:
private void addImportExportInstanceHelper(WorkflowExecutionContext context, RelationshipLabel label) throws FalconException { String feedName = (label == RelationshipLabel.DATASOURCE_IMPORT_EDGE) ? context.getOutputFeedNames() : context.getInputFeedNames(); String feedInstanceDataPath = (label == RelationshipLabel.DATASOURCE_IMPORT_EDGE) ? context.getOutputFeedInstancePaths() : context.getInputFeedInstancePaths(); String datasourceName = context.getDatasourceName(); String sourceClusterName = context.getSrcClusterName(); LOG.info("Computing feed instance for : name= path= {}, in cluster: " + "from datasource: {}", label.getName(), feedName, feedInstanceDataPath, sourceClusterName, datasourceName); String feedInstanceName = getFeedInstanceName(feedName, sourceClusterName, feedInstanceDataPath, context.getNominalTimeAsISO8601()); Vertex feedInstanceVertex = addFeedInstance( feedInstanceName, context, feedName, context.getSrcClusterName()); Map<RelationshipProperty, String> properties = edgePropertiesForIndexing(context); properties.put(RelationshipProperty.TIMESTAMP, context.getTimeStampAsISO8601()); addInstanceToEntity(feedInstanceVertex, datasourceName, RelationshipType.DATASOURCE_ENTITY, label, properties); addInstanceToEntity(feedInstanceVertex, sourceClusterName, RelationshipType.CLUSTER_ENTITY, RelationshipLabel.FEED_CLUSTER_EDGE, properties); }
Source:
public void service(HttpRequest request, HttpResponse response) throws IOException { Integer lazyGlobal = getLazyGlobal(); BufferedWriter writer = response.getWriter(); writer.write(String.format("Lazy global: %s; non-lazy global: %s", lazyGlobal, NON_LAZY_GLOBAL)); }

Target:
public void service(HttpRequest request, HttpResponse response) throws IOException { Integer lazyGlobal = LazyGlobalHolder.getInstance(); BufferedWriter writer = response.getWriter(); writer.write(String.format("Lazy global: %s; non-lazy global: %s", lazyGlobal, NON_LAZY_GLOBAL)); }
Source:
private ObjectId insertMultiProposal(Repository git, ObjectInserter inserter) throws IOException, NoOp { ObjectId last = acceptedOld; ObjectId oldTree; RefTree tree; if (ObjectId.zeroId().equals(last)) { oldTree = ObjectId.zeroId(); tree = RefTree.newEmptyTree(); } else { try (RevWalk rw = new RevWalk(git)) { RevCommit c = rw.parseCommit(last); oldTree = c.getTree(); tree = RefTree.read(rw.getObjectReader(), c.getTree()); } } PersonIdent committer = leader.getSystem().newCommitter(); for (Proposal p : todo) { if (!tree.apply(p.getCommands())) { throw new IOException( KetchText.get().queuedProposalFailedToApply); } ObjectId treeId = tree.writeTree(inserter); if (treeId.equals(oldTree)) { continue; } CommitBuilder b = new CommitBuilder(); b.setTreeId(treeId); if (!ObjectId.zeroId().equals(last)) { b.setParentId(last); } b.setAuthor(p.getAuthor() != null ? p.getAuthor() : committer); b.setCommitter(committer); b.setMessage(message(p)); last = inserter.insert(b); } if (last.equals(acceptedOld)) { throw new NoOp(); } return last; }

Target:
private ObjectId insertMultiProposal(Repository git, ObjectInserter inserter) throws IOException, NoOp { ObjectId lastIndex = acceptedOldIndex; ObjectId oldTreeId; RefTree tree; if (ObjectId.zeroId().equals(lastIndex)) { oldTreeId = ObjectId.zeroId(); tree = RefTree.newEmptyTree(); } else { try (RevWalk rw = new RevWalk(git)) { RevCommit c = rw.parseCommit(lastIndex); oldTreeId = c.getTree(); tree = RefTree.read(rw.getObjectReader(), c.getTree()); } } PersonIdent committer = leader.getSystem().newCommitter(); for (Proposal p : todo) { if (!tree.apply(p.getCommands())) { throw new IOException( KetchText.get().queuedProposalFailedToApply); } ObjectId treeId = tree.writeTree(inserter); if (treeId.equals(oldTreeId)) { continue; } CommitBuilder b = new CommitBuilder(); b.setTreeId(treeId); if (!ObjectId.zeroId().equals(lastIndex)) { b.setParentId(lastIndex); } b.setAuthor(p.getAuthor() != null ? p.getAuthor() : committer); b.setCommitter(committer); b.setMessage(message(p)); lastIndex = inserter.insert(b); } if (lastIndex.equals(acceptedOldIndex)) { throw new NoOp(); } return lastIndex; }
Source:
public Pacer(TimeSource timeSource, long delay) { this.timeSource = timeSource; this.delay = delay; }

Target:
public Pacer(TimeSource timeSource, long delay) { this.timeSource = timeSource; this.delay = delay; this.nextLogTime = new AtomicLong(timeSource.getTimeMillis()); }
Source:
public void draw(Batch batch, float parentAlpha) { batch.setShader(shader); if (alpha == 0.0f) { super.setVisible(false); } else { super.setVisible(true); } if (lookData instanceof DroneVideoLookData) { lookData.draw(batch, alpha); } if (isLookVisible() && this.getDrawable() != null) { super.draw(batch, this.alpha); } batch.setShader(null); }

Target:
public synchronized void draw(Batch batch, float parentAlpha) { batch.setShader(shader); if (alpha == 0.0f) { super.setVisible(false); } else { super.setVisible(true); } if (lookData instanceof DroneVideoLookData) { lookData.draw(batch, alpha); } if (isLookVisible() && this.getDrawable() != null) { super.draw(batch, this.alpha); } batch.setShader(null); }
Source:
public PluginInterface findPluginWithId( Class<? extends PluginTypeInterface> pluginType, String pluginId, boolean waitForPluginToBeAvailable ) { return waitForPluginToBeAvailable && findPluginWithId( pluginType, pluginId ) == null ? waitForPluginToBeAvailable( pluginType, pluginId, waitForPluginToBeAvailableLimit ) : findPluginWithId( pluginType, pluginId ); }

Target:
public PluginInterface findPluginWithId( Class<? extends PluginTypeInterface> pluginType, String pluginId, boolean waitForPluginToBeAvailable ) { PluginInterface pluginInterface = findPluginWithId( pluginType, pluginId ); return waitForPluginToBeAvailable && pluginInterface == null ? waitForPluginToBeAvailable( pluginType, pluginId, WAIT_FOR_PLUGIN_TO_BE_AVAILABLE_LIMIT ) : pluginInterface; }
Source:
private NotificationCompat.Builder getBuilder() { String title = getString(R.string.app_name); NotificationCompat.Builder builder = new NotificationCompat.Builder(mContext) .setSmallIcon(R.drawable.notification_icon) .setColor(getResources().getColor(R.color.blue_wordpress)) .setContentTitle(title) .setAutoCancel(true); return builder; }

Target:
private NotificationCompat.Builder getBuilder() { return new NotificationCompat.Builder(mContext) .setSmallIcon(R.drawable.notification_icon) .setColor(getResources().getColor(R.color.blue_wordpress)) .setContentTitle(getString(R.string.app_name)) .setAutoCancel(true); }
Source:
public void setHeader(String headerTitle) { HTMLPanel headerTitlePanel = new HTMLPanel ("H4", headerTitle); headerTitlePanel.addStyleName(Styles.MODAL_TITLE); headerTitlePanel.getElement().getStyle().setFloat(Float.LEFT); if (header.getWidgetCount() > 2) { header.remove(header.getWidgetCount() - 1); } header.add(headerTitlePanel); addHelpButtonHandler(); helpIconButtonTooltip.setText(constants.clickForHelp()); }

Target:
public void setHeader(String headerTitle) { HTMLPanel headerTitlePanel = new HTMLPanel("H4", headerTitle); headerTitlePanel.addStyleName(Styles.MODAL_TITLE); headerTitlePanel.getElement().getStyle().setFloat(Float.LEFT); while (header.getWidgetCount() > 2) { header.remove(header.getWidgetCount() - 1); } header.add(headerTitlePanel); addHelpButtonHandler(); helpIconButtonTooltip.setText(constants.clickForHelp()); }
Source:
boolean tryAdd(final EventData eventData) { if (eventData == null) { throw logger.logExceptionAsWarning(new IllegalArgumentException("eventData cannot be null")); } EventData event = tracerProvider.isEnabled() ? traceMessageSpan(eventData) : eventData; final int size; try { size = getSize(event, events.isEmpty()); } catch (BufferOverflowException exception) { throw logger.logExceptionAsWarning(new AmqpException(false, AmqpErrorCondition.LINK_PAYLOAD_SIZE_EXCEEDED, String.format(Locale.US, "Size of the payload exceeded maximum message size: %s kb", maxMessageSize / 1024), contextProvider.getErrorContext())); } synchronized (lock) { if (this.sizeInBytes + size > this.maxMessageSize) { return false; } this.sizeInBytes += size; } this.events.add(event); return true; }

Target:
boolean tryAdd(final EventData eventData) { if (eventData == null) { throw logger.logExceptionAsWarning(new NullPointerException("eventData cannot be null")); } EventData event = tracerProvider.isEnabled() ? traceMessageSpan(eventData) : eventData; final int size; try { size = getSize(event, events.isEmpty()); } catch (BufferOverflowException exception) { throw logger.logExceptionAsWarning(new AmqpException(false, AmqpErrorCondition.LINK_PAYLOAD_SIZE_EXCEEDED, String.format(Locale.US, "Size of the payload exceeded maximum message size: %s kb", maxMessageSize / 1024), contextProvider.getErrorContext())); } synchronized (lock) { if (this.sizeInBytes + size > this.maxMessageSize) { return false; } this.sizeInBytes += size; } this.events.add(event); return true; }
Source:
public Optional<SolrConfiguration> getSolrConfiguration() { return null; }

Target:
public Optional<SolrConfiguration> getSolrConfiguration() { return Optional.empty(); }
Source:
public boolean isEqualTo(StateChange stateChange) { if (stateChange instanceof SetViewportSizeOf) { return this.fboName.equals(((SetViewportSizeOf) stateChange).fboName); } return false; }

Target:
public boolean isEqualTo(StateChange stateChange) { if (stateChange instanceof SetViewportSizeOf) { return this.fboName.equals(((SetViewportSizeOf) stateChange).getFboName()); } return false; }
Source:
public RecyclerViewIndicatorDotDecor(int radius, int padding, int indicatorHeight, @ColorInt int colorInactive, @ColorInt int colorActive) { float strokeWidth = Resources.getSystem().getDisplayMetrics().density * 1; this.radius = radius; inactivePaint.setStrokeCap(Paint.Cap.ROUND); inactivePaint.setStrokeWidth(strokeWidth); inactivePaint.setStyle(Paint.Style.FILL); inactivePaint.setAntiAlias(true); inactivePaint.setColor(colorInactive); activePaint.setStrokeCap(Paint.Cap.ROUND); activePaint.setStrokeWidth(strokeWidth); activePaint.setStyle(Paint.Style.FILL); activePaint.setAntiAlias(true); activePaint.setColor(colorActive); this.indicatorItemPadding = padding; this.indicatorHeight = indicatorHeight; }

Target:
public RecyclerViewIndicatorDotDecor(int radius, int padding, int indicatorHeight, @ColorInt int colorInactive, @ColorInt int colorActive) { this.radius = radius; this.indicatorItemPadding = padding; this.indicatorHeight = indicatorHeight; float strokeWidth = Resources.getSystem().getDisplayMetrics().density * 1; inactivePaint.setStrokeCap(Paint.Cap.ROUND); inactivePaint.setStrokeWidth(strokeWidth); inactivePaint.setStyle(Paint.Style.FILL); inactivePaint.setAntiAlias(true); inactivePaint.setColor(colorInactive); activePaint.setStrokeCap(Paint.Cap.ROUND); activePaint.setStrokeWidth(strokeWidth); activePaint.setStyle(Paint.Style.FILL); activePaint.setAntiAlias(true); activePaint.setColor(colorActive); }
Source:
public Iterator<ResultHandler.ComparableRow> iterator() { if (wasFailed()) return Collections.emptyListIterator(); return new AbstractIterator<ResultHandler.ComparableRow>() { Iterator<Row> iter = resultSet.iterator(); protected ResultHandler.ComparableRow computeNext() { if (iter.hasNext()) { return new DriverRow(iter.next()); } return endOfData(); } }; }

Target:
public Iterator<ResultHandler.ComparableRow> iterator() { if (wasFailed()) return Collections.emptyListIterator(); return new AbstractIterator<ResultHandler.ComparableRow>() { Iterator<Row> iter = resultSet.iterator(); protected ResultHandler.ComparableRow computeNext() { if (iter.hasNext()) return new DriverRow(iter.next()); return endOfData(); } }; }
Source:
public void onMinecartPass(EntityMinecart cart) { if (isPowered()) { double speed = Math.sqrt(cart.motionX * cart.motionX + cart.motionZ * cart.motionZ); BlockRailBase.EnumRailDirection dir = getRailDirectionRaw(); World world = theWorldAsserted(); if (speed > BOOST_THRESHOLD) { BlockRailBase.EnumRailDirection trackShape = getRailDirectionRaw(); boolean highSpeed = CartTools.isTravellingHighSpeed(cart); if (TrackShapeHelper.isNorthSouth(trackShape)) { if (reversed ^ cart.motionZ < 0) { boostCartSpeed(cart, speed); } else { slowOrNormalCartSpeed(cart, highSpeed); } } else { if (!reversed ^ cart.motionX < 0) { boostCartSpeed(cart, speed); } else { slowOrNormalCartSpeed(cart, highSpeed); } } } else if (dir == BlockRailBase.EnumRailDirection.EAST_WEST) { if (world.isSideSolid(getPos().west(), EnumFacing.EAST)) { cart.motionX = START_BOOST; } else if (world.isSideSolid(getPos().east(), EnumFacing.WEST)) { cart.motionX = -START_BOOST; } } else if (dir == BlockRailBase.EnumRailDirection.NORTH_SOUTH) { if (world.isSideSolid(getPos().north(), EnumFacing.SOUTH)) { cart.motionZ = START_BOOST; } else if (world.isSideSolid(getPos().south(), EnumFacing.NORTH)) { cart.motionZ = -START_BOOST; } } } }

Target:
public void onMinecartPass(EntityMinecart cart) { if (isPowered()) { double speed = Math.sqrt(cart.motionX * cart.motionX + cart.motionZ * cart.motionZ); if (speed > BOOST_THRESHOLD) { BlockRailBase.EnumRailDirection trackShape = getRailDirectionRaw(); boolean highSpeed = CartTools.isTravellingHighSpeed(cart); if (TrackShapeHelper.isNorthSouth(trackShape)) { if (reversed ^ cart.motionZ < 0) { boostCartSpeed(cart, speed); } else { slowOrNormalCartSpeed(cart, highSpeed); } } else { if (!reversed ^ cart.motionX < 0) { boostCartSpeed(cart, speed); } else { slowOrNormalCartSpeed(cart, highSpeed); } } } else { CartTools.startBoost(cart, getPos(), getRailDirectionRaw(), START_BOOST); } } }
Source:
private void handleNiInEs(GpsNiNotification notif) { if (DEBUG) Log.d(TAG, "in handleNiInEs () :" + " niType: " + notif.niType + " notificationId: " + notif.notificationId); boolean isUEInEmergencyMode = mIsInEmergency || Boolean.parseBoolean(SystemProperties.get(TelephonyProperties.PROPERTY_INECM_MODE)); boolean isNiTypeES = notif.niType == GPS_NI_TYPE_EMERGENCY_SUPL ? true : false; if (isNiTypeES != isUEInEmergencyMode) { try { mNetInitiatedListener.sendNiResponse(notif.notificationId, GPS_NI_RESPONSE_IGNORE); } catch (RemoteException e) { Log.e(TAG, "RemoteException in sendNiResponse"); } } else { handleNi(notif); } }

Target:
private void handleNiInEs(GpsNiNotification notif) { if (DEBUG) Log.d(TAG, "in handleNiInEs () :" + " niType: " + notif.niType + " notificationId: " + notif.notificationId); boolean isUEInEmergencyMode = mIsInEmergency || Boolean.parseBoolean(SystemProperties.get(TelephonyProperties.PROPERTY_INECM_MODE)); boolean isNiTypeES = (notif.niType == GPS_NI_TYPE_EMERGENCY_SUPL); if (isNiTypeES != isUEInEmergencyMode) { try { mNetInitiatedListener.sendNiResponse(notif.notificationId, GPS_NI_RESPONSE_IGNORE); } catch (RemoteException e) { Log.e(TAG, "RemoteException in sendNiResponse"); } } else { handleNi(notif); } }
Source:
public void testIsTypeConstrainedForConstructorReturnValueConstrainedType() { BeanDescriptor descriptor = getBeanDescriptor( ConstructorReturnValueConstrainedType.class ); assertFalse( descriptor.isBeanConstrained(), "The entity should have no bean constraints" ); assertTrue( descriptor.getConstrainedMethods( MethodType.NON_GETTER, MethodType.GETTER ).isEmpty(), "The entity should have no constraint methods" ); assertTrue( descriptor.getConstrainedConstructors().size() == 1, "The entity should have a constrained constructor" ); }

Target:
public void testIsTypeConstrainedForConstructorReturnValueConstrainedType() { BeanDescriptor descriptor = getBeanDescriptor( ConstructorReturnValueConstrainedType.class ); assertFalse( descriptor.isBeanConstrained(), "The entity should have no bean constraints" ); assertTrue( descriptor.getConstrainedMethods( MethodType.NON_GETTER, MethodType.GETTER ).isEmpty(), "The entity should have no constrained methods" ); assertTrue( descriptor.getConstrainedConstructors().size() == 1, "The entity should have a constrained constructor" ); }
Source:
public static final IntList lineMap(final byte[] buf, int ptr, int end) { IntList map = new IntList((end - ptr) / 36); map.add(Integer.MIN_VALUE); boolean foundLF = true; for (; ptr < end; ptr++) { if (foundLF) { map.add(ptr); } if (buf[ptr] == '\0') { map = new IntList(3); map.add(Integer.MIN_VALUE); map.add(0); break; } foundLF = (buf[ptr] == '\n'); } map.add(end); return map; }

Target:
public static final IntList lineMap(final byte[] buf, int ptr, int end) { int start = ptr; IntList map = new IntList((end - ptr) / 36); map.add(Integer.MIN_VALUE); boolean foundLF = true; for (; ptr < end; ptr++) { if (foundLF) { map.add(ptr); } if (buf[ptr] == '\0') { map = new IntList(3); map.add(Integer.MIN_VALUE); map.add(start); break; } foundLF = (buf[ptr] == '\n'); } map.add(end); return map; }
Source:
private static Type getPrestoType(String elasticsearchType) { switch (elasticsearchType) { case "double": case "float": return DOUBLE; case "integer": return INTEGER; case "long": return BIGINT; case "string": return VARCHAR; case "boolean": return BOOLEAN; case "binary": return VARBINARY; default: return VARCHAR; } }

Target:
private static Type getPrestoType(String elasticsearchType) { switch (elasticsearchType) { case "double": case "float": return DOUBLE; case "integer": return INTEGER; case "long": return BIGINT; case "string": case "text": case "keyword": return VARCHAR; case "boolean": return BOOLEAN; case "binary": return VARBINARY; default: throw new IllegalArgumentException("Not supported Elasticsearch type: " + elasticsearchType); } }
Source:
public KafkaProducer<Long, Object> createProducer() { Properties properties = new Properties(); properties.setProperty(BOOTSTRAP_SERVERS_CONFIG, getConnectString()); properties.setProperty(VALUE_SERIALIZER_CLASS_CONFIG, JsonEncoder.class.getName()); properties.setProperty(KEY_SERIALIZER_CLASS_CONFIG, LongSerializer.class.getName()); properties.setProperty(PARTITIONER_CLASS_CONFIG, DefaultPartitioner.class.getName()); properties.setProperty(ACKS_CONFIG, "1"); return new KafkaProducer<>(properties); }

Target:
public KafkaProducer<Long, Object> createProducer() { Properties properties = new Properties(); properties.setProperty(BOOTSTRAP_SERVERS_CONFIG, getConnectString()); properties.setProperty(VALUE_SERIALIZER_CLASS_CONFIG, JsonEncoder.class.getName()); properties.setProperty(KEY_SERIALIZER_CLASS_CONFIG, LongSerializer.class.getName()); properties.setProperty(ACKS_CONFIG, "1"); return new KafkaProducer<>(properties); }
Source:
private View getFontStyleOwnerView() { if (this instanceof DNodeListElementEditPart) { return (View) getModel(); } else { return getPrimaryView(); } }

Target:
protected View getFontStyleOwnerView() { return getPrimaryView(); }
Source:
Map<String, Set<String>> getAllConnectorTaskLocks(String connector) { return _zkclient.getChildren(KeyBuilder.datastreamTaskLockRoot(_cluster, connector)) .stream() .collect(Collectors.toMap(Function.identity(), x -> new HashSet<>(_zkclient.getChildren(KeyBuilder.datastreamTaskLockPrefix(_cluster, connector, x))))); }

Target:
Map<String, Set<String>> getAllConnectorTaskLocks(String connector) { return _zkclient.getChildren(KeyBuilder.datastreamTaskLockRoot(_cluster, connector)) .stream() .collect(Collectors.toMap(Function.identity(), prefix -> new HashSet<>(_zkclient.getChildren(KeyBuilder.datastreamTaskLockPrefix(_cluster, connector, prefix))))); }
Source:
public FormInstance parse() throws InvalidStructureException, IOException, XmlPullParserException, UnfullfilledRequirementsException { this.checkNode("fixture"); String fixtureId = parser.getAttributeValue(null, "id"); if (fixtureId == null) { throw new InvalidStructureException("fixture is lacking id attribute", parser); } String userId = parser.getAttributeValue(null, "user_id"); TreeElement root; if (nextTagInBlock("fixture")) { root = new TreeElementParser(parser, 0, fixtureId).parse(); } else { root = new TreeElement(); } FormInstance instance = new FormInstance(root, fixtureId); if (userId != null) { instance.schema = userId; } if (storage() != null) { int recordId = -1; Vector<Integer> matchingFixtures = storage().getIDsForValue(FormInstance.META_ID, fixtureId); if (matchingFixtures.size() > 0) { Vector<Integer> matchingUsers = storage().getIDsForValue(FormInstance.META_XMLNS, ExtUtil.emptyIfNull(userId)); for (Integer i : matchingFixtures) { if (matchingUsers.indexOf(i) != -1) { recordId = i.intValue(); } } } if (recordId != -1) { if (!overwrite) { return instance; } instance.setID(recordId); } } commit(instance); return instance; }

Target:
public FormInstance parse() throws InvalidStructureException, IOException, XmlPullParserException, UnfullfilledRequirementsException { this.checkNode("fixture"); String fixtureId = parser.getAttributeValue(null, "id"); if (fixtureId == null) { throw new InvalidStructureException("fixture is lacking id attribute", parser); } String userId = parser.getAttributeValue(null, "user_id"); TreeElement root; if (!nextTagInBlock("fixture")) { return null; } root = new TreeElementParser(parser, 0, fixtureId).parse(); FormInstance instance = new FormInstance(root, fixtureId); if (userId != null) { instance.schema = userId; } if (storage() != null) { int recordId = -1; Vector<Integer> matchingFixtures = storage().getIDsForValue(FormInstance.META_ID, fixtureId); if (matchingFixtures.size() > 0) { Vector<Integer> matchingUsers = storage().getIDsForValue(FormInstance.META_XMLNS, ExtUtil.emptyIfNull(userId)); for (Integer i : matchingFixtures) { if (matchingUsers.indexOf(i) != -1) { recordId = i.intValue(); } } } if (recordId != -1) { if (!overwrite) { return instance; } instance.setID(recordId); } } commit(instance); return instance; }
Source:
private Map<VirtualFile, Collection<LiveIssue>> flagFailedFiles(Collection<VirtualFile> analyzed, Collection<ClientInputFile> failedAnalysisFiles) { Map<VirtualFile, Collection<LiveIssue>> map = new HashMap<>(); Set<VirtualFile> failedVirtualFiles = failedAnalysisFiles.stream().map(f -> (VirtualFile) f.getClientObject()).collect(Collectors.toSet()); for (VirtualFile f : analyzed) { if (failedVirtualFiles.contains(f)) { console.error("File won't be refreshed because there were errors during analysis: " + f.getPath()); manager.addFileWithErrors(f); } else { manager.removeFileWithErrors(f); } map.put(f, new ArrayList<>()); } return map; }

Target:
private Map<VirtualFile, Collection<LiveIssue>> flagFailedFiles(Collection<VirtualFile> analyzed, Collection<ClientInputFile> failedAnalysisFiles) { Map<VirtualFile, Collection<LiveIssue>> map = new HashMap<>(); Set<VirtualFile> failedVirtualFiles = asVirtualFiles(failedAnalysisFiles); for (VirtualFile f : analyzed) { if (failedVirtualFiles.contains(f)) { manager.addFileWithErrors(f); } else { manager.removeFileWithErrors(f); } map.put(f, new ArrayList<>()); } return map; }
Source:
public GraphQLSchema build() { Set<Class<?>> allClasses = dictionary.getBindings(); if (allClasses.isEmpty()) { throw new IllegalArgumentException("None of the provided classes are exported by Elide"); } Set<Class<?>> rootClasses = allClasses.stream().filter(dictionary::isRoot).collect(Collectors.toSet()); dictionary.walkEntityGraph(rootClasses, this::buildInputObjectStub); resolveInputObjectRelationships(); GraphQLObjectType.Builder root = newObject().name("root"); for (Class<?> clazz : rootClasses) { String entityName = dictionary.getJsonAliasFor(clazz); root.field(newFieldDefinition() .name(entityName) .dataFetcher(dataFetcher) .argument(relationshipOpArg) .argument(idArgument) .argument(filterArgument) .argument(sortArgument) .argument(pageFirstArgument) .argument(pageOffsetArgument) .argument(buildInputObjectArgument(clazz, true)) .type(buildQueryObject(clazz))); } dictionary.walkEntityGraph(rootClasses, this::buildQueryObject); GraphQLSchema schema = GraphQLSchema.newSchema() .query(root) .mutation(root) .build(new HashSet<>(CollectionUtils.union( queryObjectRegistry.values(), inputObjectRegistry.values() ))); return schema; }

Target:
public GraphQLSchema build() { Set<Class<?>> allClasses = dictionary.getBindings(); if (allClasses.isEmpty()) { throw new IllegalArgumentException("None of the provided classes are exported by Elide"); } Set<Class<?>> rootClasses = allClasses.stream().filter(dictionary::isRoot).collect(Collectors.toSet()); dictionary.walkEntityGraph(rootClasses, this::buildInputObjectStub); resolveInputObjectRelationships(); GraphQLObjectType.Builder root = newObject().name("root"); for (Class<?> clazz : rootClasses) { String entityName = dictionary.getJsonAliasFor(clazz); root.field(newFieldDefinition() .name(entityName) .dataFetcher(dataFetcher) .argument(relationshipOpArg) .argument(idArgument) .argument(filterArgument) .argument(sortArgument) .argument(pageFirstArgument) .argument(pageOffsetArgument) .argument(buildInputObjectArgument(clazz, true)) .type(buildConnectionObject(clazz))); } dictionary.walkEntityGraph(rootClasses, this::buildConnectionObject); GraphQLSchema schema = GraphQLSchema.newSchema() .query(root) .mutation(root) .build(new HashSet<>(CollectionUtils.union( connectionObjectRegistry.values(), inputObjectRegistry.values() ))); return schema; }
Source:
public void onServiceConnected(IBinder binder) { if (connectState != ConnectState.IDLE) { connectState = ConnectState.CONNECTED; if (eventCallbacks != null) { eventCallbacks.onServiceConnected(binder); } if (!connectionCallbacks.isEmpty()) { final Set<ConnectionCallbacks> copy = new HashSet<>(connectionCallbacks); for (LostApiClient.ConnectionCallbacks callbacks : copy) { callbacks.onConnected(); } } } }

Target:
public void onServiceConnected(IBinder binder) { if (connectState != ConnectState.IDLE) { connectState = ConnectState.CONNECTED; if (eventCallbacks != null) { eventCallbacks.onServiceConnected(binder); } if (!connectionCallbacks.isEmpty()) { final ArrayList<ConnectionCallbacks> copy = new ArrayList<>(connectionCallbacks); for (LostApiClient.ConnectionCallbacks callbacks : copy) { callbacks.onConnected(); } } } }
Source:
public void write(Enriched<EntityType> enrichable, JsonGenerator jg) { try { write(jg, enrichable.getEntity()); } catch (IOException e) { log.error(e); } }

Target:
public void write(Enriched<EntityType> enrichable, JsonGenerator jg) { try { write(jg, enrichable.getEntity()); } catch (Exception e) { if (e instanceof InterruptedException) { Thread.currentThread().interrupt(); throw new RuntimeException("interrupted", e); } else { log.info("enrichment failed", e); } } }
Source:
public AbstractSpanBatchInformation(int batchSize, Task task, Column column, Span span) { super(batchSize, task, column); Preconditions.checkNotNull(span); this.span = span; }

Target:
public AbstractSpanBatchInformation(int batchSize, Task task, Column column, Span span) { super(batchSize, task, column); this.span = Preconditions.checkNotNull(span); }
Source:
protected void refreshLunsInfo(List<LUNs> lunsFromVgInfo, List<LUNs> lunsFromDb) { for (LUNs lunFromVgInfo : lunsFromVgInfo) { LUNs lunFromDB = getLunDao().get(lunFromVgInfo.getLUN_id()); if (lunFromDB == null) { getLunDao().save(lunFromVgInfo); log.infoFormat("New LUN discovered, ID: {0}", lunFromVgInfo.getLUN_id()); } else if (lunFromDB.getDeviceSize() != lunFromVgInfo.getDeviceSize()) { getLunDao().updateLUNsDeviceSize(lunFromVgInfo.getLUN_id(), lunFromVgInfo.getDeviceSize()); log.infoFormat("Updated LUN device size, ID: {0}", lunFromVgInfo.getLUN_id()); } for (StorageServerConnections connection : lunFromVgInfo.getLunConnections()) { StorageServerConnections connectionFromDb = getStorageServerConnectionDAO().getForIqn(connection.getiqn()); if (connectionFromDb == null) { continue; } LUN_storage_server_connection_map lunConnection = new LUN_storage_server_connection_map( lunFromVgInfo.getLUN_id(), connectionFromDb.getid()); if (getStorageServerConnectionLunMapDao().get(lunConnection.getId()) == null) { getStorageServerConnectionLunMapDao().save(lunConnection); } } } for (LUNs lunFromDb : lunsFromDb) { if (!isDummyLun(lunFromDb) && !containsLun(lunsFromVgInfo, lunFromDb)) { getLunDao().remove(lunFromDb.getLUN_id()); log.infoFormat("Removed LUN ID: {0}", lunFromDb.getLUN_id()); } } }

Target:
protected void refreshLunsInfo(List<LUNs> lunsFromVgInfo, List<LUNs> lunsFromDb) { for (LUNs lunFromVgInfo : lunsFromVgInfo) { LUNs lunFromDB = getLunDao().get(lunFromVgInfo.getLUN_id()); if (lunFromDB == null) { getLunDao().save(lunFromVgInfo); log.infoFormat("New LUN discovered, ID: {0}", lunFromVgInfo.getLUN_id()); } else if (lunFromDB.getDeviceSize() != lunFromVgInfo.getDeviceSize()) { getLunDao().updateLUNsDeviceSize(lunFromVgInfo.getLUN_id(), lunFromVgInfo.getDeviceSize()); log.infoFormat("Updated LUN device size - ID: {0}, previous size: {1}, new size: {2}.", lunFromVgInfo.getLUN_id(), lunFromDB.getDeviceSize(), lunFromVgInfo.getDeviceSize()); } for (StorageServerConnections connection : lunFromVgInfo.getLunConnections()) { StorageServerConnections connectionFromDb = getStorageServerConnectionDAO().getForIqn(connection.getiqn()); if (connectionFromDb == null) { continue; } LUN_storage_server_connection_map lunConnection = new LUN_storage_server_connection_map( lunFromVgInfo.getLUN_id(), connectionFromDb.getid()); if (getStorageServerConnectionLunMapDao().get(lunConnection.getId()) == null) { getStorageServerConnectionLunMapDao().save(lunConnection); } } } for (LUNs lunFromDb : lunsFromDb) { if (!isDummyLun(lunFromDb) && !containsLun(lunsFromVgInfo, lunFromDb)) { getLunDao().remove(lunFromDb.getLUN_id()); log.infoFormat("Removed LUN ID: {0}", lunFromDb.getLUN_id()); } } }
Source:
Mono<PagedResponse<String>> queryFirstPage(String query, Context context) { QuerySpecification querySpecification = new QuerySpecification(); querySpecification .setQuery(query); return protocolLayer .getQueries() .queryTwinsWithResponseAsync(querySpecification, context) .map(objectPagedResponse -> new PagedResponseBase<>( objectPagedResponse.getRequest(), objectPagedResponse.getStatusCode(), objectPagedResponse.getHeaders(), objectPagedResponse.getValue().getItems().stream() .map(object -> { try { return mapper.writeValueAsString(object); } catch (JsonProcessingException e) { logger.error("JsonProcessingException occurred while retrieving query result items: ", e); throw new RuntimeException("JsonProcessingException occurred while retrieving query result items", e); } }) .filter(Objects::nonNull) .collect(Collectors.toList()), objectPagedResponse.getValue().getContinuationToken(), objectPagedResponse.getDeserializedHeaders())); }

Target:
Mono<PagedResponse<String>> queryFirstPage(String query, Context context) { QuerySpecification querySpecification = new QuerySpecification().setQuery(query); return protocolLayer .getQueries() .queryTwinsWithResponseAsync(querySpecification, context) .map(objectPagedResponse -> new PagedResponseBase<>( objectPagedResponse.getRequest(), objectPagedResponse.getStatusCode(), objectPagedResponse.getHeaders(), objectPagedResponse.getValue().getItems().stream() .map(object -> { try { return mapper.writeValueAsString(object); } catch (JsonProcessingException e) { logger.error("JsonProcessingException occurred while retrieving query result items: ", e); throw new RuntimeException("JsonProcessingException occurred while retrieving query result items", e); } }) .filter(Objects::nonNull) .collect(Collectors.toList()), objectPagedResponse.getValue().getContinuationToken(), objectPagedResponse.getDeserializedHeaders())); }
Source:
private void receiveAndSend(JmsTemplate template) { javax.jms.Message request = template.receive(requestQueue7); final javax.jms.Message jmsReply = request; try { template.send(request.getJMSReplyTo(), (MessageCreator) session -> jmsReply); } catch (JmsException e) { } catch (JMSException e) { } }

Target:
private void receiveAndSend(JmsTemplate template) { javax.jms.Message request = template.receive(requestQueue7); final javax.jms.Message jmsReply = request; try { template.send(request.getJMSReplyTo(), (MessageCreator) session -> jmsReply); } catch (JmsException | JMSException e) { } }
Source:
public void update(float delta) { Iterable<EntityRef> characterEntities = entityManager.getEntitiesWith(CharacterComponent.class, LocationComponent.class); for (EntityRef characterEntity: characterEntities) { CharacterComponent characterComponent = characterEntity.getComponent(CharacterComponent.class); if (characterComponent == null) { continue; } LocationComponent characterLocation = characterEntity.getComponent(LocationComponent.class); if (characterLocation == null) { continue; } EntityRef target = characterComponent.interactionTarget; if (target.isActive()) { LocationComponent targetLocation = target.getComponent(LocationComponent.class); if (targetLocation == null) { continue; } float maxInteractionRange = characterComponent.interactionRange; if (isDistanceToLarge(characterLocation, targetLocation, maxInteractionRange)) { InteractionUtil.setInteractionTarget(characterEntity, EntityRef.NULL); } } } }

Target:
public void update(float delta) { Iterable<EntityRef> characterEntities = entityManager.getEntitiesWith(CharacterComponent.class, LocationComponent.class); for (EntityRef characterEntity: characterEntities) { CharacterComponent characterComponent = characterEntity.getComponent(CharacterComponent.class); if (characterComponent == null) { continue; } LocationComponent characterLocation = characterEntity.getComponent(LocationComponent.class); if (characterLocation == null) { continue; } EntityRef target = characterComponent.authorizedInteractionTarget; if (target.isActive()) { LocationComponent targetLocation = target.getComponent(LocationComponent.class); if (targetLocation == null) { continue; } float maxInteractionRange = characterComponent.interactionRange; if (isDistanceToLarge(characterLocation, targetLocation, maxInteractionRange)) { InteractionUtil.cancelInteractionAsServer(characterEntity); } } } }
Source:
private void sync() throws IOException { TransactionLogWriter tmpWriter = null; long latestSeq = 0; int entryCount = 0; synchronized (this) { if (closed) { return; } tmpWriter = writer; List<Entry> currentPending = getPendingWrites(); if (currentPending.size() != 0) { tmpWriter.commitMarker(currentPending.size()); } for (Entry e : currentPending) { tmpWriter.append(e); entryCount++; latestSeq = Math.max(latestSeq, e.getKey().get()); } } long lastSynced = syncedUpTo.get(); if (lastSynced < latestSeq) { tmpWriter.sync(); metricsCollector.histogram("wal.sync.size", entryCount); syncedUpTo.compareAndSet(lastSynced, latestSeq); } }

Target:
private void sync() throws IOException { TransactionLogWriter tmpWriter = null; long latestSeq = 0; int entryCount = 0; synchronized (this) { if (closed) { return; } tmpWriter = writer; List<Entry> currentPending = getPendingWrites(); if (!currentPending.isEmpty()) { tmpWriter.commitMarker(currentPending.size()); } for (Entry e : currentPending) { tmpWriter.append(e); entryCount++; latestSeq = Math.max(latestSeq, e.getKey().get()); } } long lastSynced = syncedUpTo.get(); if (lastSynced < latestSeq) { tmpWriter.sync(); metricsCollector.histogram("wal.sync.size", entryCount); syncedUpTo.compareAndSet(lastSynced, latestSeq); } }
Source:
public <T> T getService(final Class<T> clazz, final ServiceReference reference) { ServiceTracker tracker = new ServiceTracker(bundleContext, reference, null); Object newProxyInstance = Proxy.newProxyInstance(clazz.getClassLoader(), new Class<?>[] { clazz }, new ServiceTrackerInvocationHandler(tracker)); return (T) newProxyInstance; }

Target:
public <T> T getService(final Class<T> clazz, final ServiceReference reference) throws OsgiServiceNotAvailableException { Object service = bundleContext.getService(reference); if (service == null) { throw new OsgiServiceNotAvailableException("service retrieved from the bundlecontext was null"); } return (T) service; }
Source:
public void deleteAll(List<K> keys) { cache.invalidateAll(keys); }

Target:
public void deleteAll(List<K> keys) { try { deleteAllAsync(keys).get(); } catch (Exception e) { throw new SamzaException("DELETE_ALL failed", e); } }
Source:
public void show(@NonNull PageTitle title) { ReadingList.DAO.anyListContainsTitleAsync(ReadingListDaoProxy.key(title), new CallbackTask.Callback<ReadingListPage>() { @Override public void success(@Nullable ReadingListPage page) { ReadingListBookmarkMenu.this.page = page; PopupMenu menu = new PopupMenu(anchorView.getContext(), anchorView); menu.getMenuInflater().inflate(R.menu.menu_reading_list_page_toggle, menu.getMenu()); menu.setOnMenuItemClickListener(new PageSaveMenuClickListener()); menu.show(); } }); }

Target:
public void show(@NonNull PageTitle title) { ReadingList.DAO.anyListContainsTitleAsync(ReadingListDaoProxy.key(title), new CallbackTask.Callback<ReadingListPage>() { @Override public void success(@Nullable ReadingListPage page) { if (!ViewCompat.isAttachedToWindow(anchorView)) { return; } ReadingListBookmarkMenu.this.page = page; PopupMenu menu = new PopupMenu(anchorView.getContext(), anchorView); menu.getMenuInflater().inflate(R.menu.menu_reading_list_page_toggle, menu.getMenu()); menu.setOnMenuItemClickListener(new PageSaveMenuClickListener()); menu.show(); } }); }
Source:
public JavaWriter emitLastEnumValue(String name) throws IOException { indent(); out.write(name); out.write(";\n"); return this; }

Target:
private JavaWriter emitLastEnumValue(String name) throws IOException { indent(); out.write(name); out.write(";\n"); return this; }