auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private TWKBMetadata readMetadata() throws IOException { int geometryTypeAndPrecision = dis.readByte(); int geometryType = geometryTypeAndPrecision & 0x0F; int precision = zigzagDecode((geometryTypeAndPrecision & 0xF0) >> 4); metadata.setType(geometryType); metadata.setPrecision(precision); byte header = dis.readByte(); metadata.setHeader(header); int dims = 2; if (metadata.hasExtendedDims()) { int dimensions = dis.readByte(); if ((dimensions & 0x01) > 0) { dims += 1; } if ((dimensions & 0x02) > 0) { dims += 1; } if ((dimensions & 0x01) > 0) { metadata.setHasM(true); metadata.setMprecision((dimensions & 0xE0) >> 5); } if ((dimensions & 0x02) > 0) { metadata.setHasZ(true); metadata.setZprecision((dimensions & 0x1C) >> 2); } } metadata.setDims(dims); if (metadata.hasSize()) { metadata.setSize(dis.readSignedInt()); } else { metadata.setSize(1); } if (metadata.hasBBOX()) { CoordinateSequence bbox = csFactory.create(2, dims); for (int i = 0; i < dims; i++) { double min = readNextDouble(metadata.getScale(0)); double delta = readNextDouble(metadata.getScale(0)); bbox.setOrdinate(0, i, min); bbox.setOrdinate(1, i, min + delta); } metadata.setEnvelope(bbox); } return metadata; }

Target:
private TWKBMetadata readMetadata() throws IOException { int geometryTypeAndPrecision = dis.readByte(); int geometryType = geometryTypeAndPrecision & 0x0F; int precision = zigzagDecode((geometryTypeAndPrecision & 0xF0) >>> 4); metadata.setType(geometryType); metadata.setPrecision(precision); byte header = dis.readByte(); metadata.setHeader(header); int dims = 2; if (metadata.hasExtendedDims()) { int dimensions = dis.readByte(); if ((dimensions & 0x01) > 0) { dims += 1; metadata.setHasM(true); metadata.setMprecision((dimensions & 0xE0) >> 5); } if ((dimensions & 0x02) > 0) { dims += 1; metadata.setHasZ(true); metadata.setZprecision((dimensions & 0x1C) >> 2); } } metadata.setDims(dims); if (metadata.hasSize()) { metadata.setSize(dis.readSignedInt()); } else { metadata.setSize(1); } if (metadata.hasBBOX()) { CoordinateSequence bbox = csFactory.create(2, dims); for (int i = 0; i < dims; i++) { double min = readNextDouble(metadata.getScale(0)); double delta = readNextDouble(metadata.getScale(0)); bbox.setOrdinate(0, i, min); bbox.setOrdinate(1, i, min + delta); } metadata.setEnvelope(bbox); } return metadata; }
Source:
public List<Order> getOrders(OrderSearchCriteria searchCriteria) { Criteria crit = sessionFactory.getCurrentSession().createCriteria(Order.class); if (searchCriteria.getPatient() != null && searchCriteria.getPatient().getPatientId() != null) { crit.add(Restrictions.eq("patient", searchCriteria.getPatient())); } if (searchCriteria.getCareSetting() != null && searchCriteria.getCareSetting().getId() != null) { crit.add(Restrictions.eq("careSetting", searchCriteria.getCareSetting())); } if (searchCriteria.getConcepts() != null && !searchCriteria.getConcepts().isEmpty()) { crit.add(Restrictions.in("concept", searchCriteria.getConcepts())); } if (searchCriteria.getOrderTypes() != null && !searchCriteria.getOrderTypes().isEmpty()) { crit.add(Restrictions.in("orderType", searchCriteria.getOrderTypes())); } if (searchCriteria.getActivatedOnOrBeforeDate() != null) { crit.add(Restrictions.le("dateActivated", searchCriteria.getActivatedOnOrBeforeDate())); } if (searchCriteria.getActivatedOnOrAfterDate() != null) { crit.add(Restrictions.ge("dateActivated", searchCriteria.getActivatedOnOrAfterDate())); } if (!searchCriteria.getIncludeVoided()) { crit.add(Restrictions.eq("voided", false)); } crit.addOrder(org.hibernate.criterion.Order.desc("dateActivated")); return crit.list(); }

Target:
public List<Order> getOrders(OrderSearchCriteria searchCriteria) { Criteria crit = sessionFactory.getCurrentSession().createCriteria(Order.class); if (searchCriteria.getPatient() != null && searchCriteria.getPatient().getPatientId() != null) { crit.add(Restrictions.eq("patient", searchCriteria.getPatient())); } if (searchCriteria.getCareSetting() != null && searchCriteria.getCareSetting().getId() != null) { crit.add(Restrictions.eq("careSetting", searchCriteria.getCareSetting())); } if (searchCriteria.getConcepts() != null && !searchCriteria.getConcepts().isEmpty()) { crit.add(Restrictions.in("concept", searchCriteria.getConcepts())); } if (searchCriteria.getOrderTypes() != null && !searchCriteria.getOrderTypes().isEmpty()) { crit.add(Restrictions.in("orderType", searchCriteria.getOrderTypes())); } if (searchCriteria.getActivatedOnOrBeforeDate() != null) { Calendar cal = Calendar.getInstance(); cal.setTime(searchCriteria.getActivatedOnOrBeforeDate()); cal.set(Calendar.HOUR_OF_DAY, 23); cal.set(Calendar.MINUTE, 59); cal.set(Calendar.SECOND, 59); cal.set(Calendar.MILLISECOND, 999); crit.add(Restrictions.le("dateActivated", cal.getTime())); } if (searchCriteria.getActivatedOnOrAfterDate() != null) { Calendar cal = Calendar.getInstance(); cal.setTime(searchCriteria.getActivatedOnOrAfterDate()); cal.set(Calendar.HOUR_OF_DAY, 0); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); cal.set(Calendar.MILLISECOND, 0); crit.add(Restrictions.ge("dateActivated", cal.getTime())); } if (!searchCriteria.getIncludeVoided()) { crit.add(Restrictions.eq("voided", false)); } crit.addOrder(org.hibernate.criterion.Order.desc("dateActivated")); return crit.list(); }
Source:
public Long getFirstOffset() { try { return journal.firstKey(); } catch (NoSuchElementException e) { return null; } }

Target:
public long getFirstOffset() { Map.Entry<Long, StoreKey> first = journal.firstEntry(); return first == null ? -1 : first.getKey(); }
Source:
private Producer<String, String> setKafkaProducer() { Properties props = new Properties(); props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, config.getBootstrapServers()); props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, DEFAULT_KEY_SERIALIZER); props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, DEFAULT_VALUE_SERIALIZER); props.put(ProducerConfig.RETRIES_CONFIG, DEFAULT_RETRIES); props.putAll(config.getKafkaProducerConfig()); queueMemoryBound = (props.containsKey(ProducerConfig.BUFFER_MEMORY_CONFIG) ? Long.parseLong(props.getProperty(ProducerConfig.BUFFER_MEMORY_CONFIG)) : queueMemoryBound); return new KafkaProducer<>(props); }

Target:
private Producer<String, String> setKafkaProducer() { ClassLoader currCtxCl = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); Properties props = new Properties(); props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, config.getBootstrapServers()); props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName()); props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName()); props.put(ProducerConfig.RETRIES_CONFIG, DEFAULT_RETRIES); props.putAll(config.getKafkaProducerConfig()); return new KafkaProducer<>(props); } finally { Thread.currentThread().setContextClassLoader(currCtxCl); } }
Source:
public BreakpointManagerImpl(final EditorAgent editorAgent, final DebuggerManager debuggerManager, final ConsolePart console, final EventBus eventBus) { this.editorAgent = editorAgent; this.breakpoints = new HashMap<>(); this.debuggerManager = debuggerManager; this.console = console; eventBus.addHandler(EditorOpenedEvent.TYPE, new EditorOpenedEventHandler() { @Override public void onEditorOpened(EditorOpenedEvent event) { BreakpointManagerImpl.this.onEditorOpened(event.getFile(), event.getEditor()); } }); }

Target:
public BreakpointManagerImpl(final EditorAgent editorAgent, final DebuggerManager debuggerManager, final ConsolePart console, final EventBus eventBus) { this.editorAgent = editorAgent; this.breakpoints = new HashMap<>(); this.debuggerManager = debuggerManager; this.console = console; eventBus.addHandler(EditorOpenedEvent.TYPE, new EditorOpenedEventHandler() { @Override public void onEditorOpened(EditorOpenedEvent event) { doOpenEditor(event.getFile(), event.getEditor()); } }); }
Source:
EnumValueElement(Text key, Class<T> type) { super(key); this.type = type; this.values = Arrays.stream(type.getFields()) .filter(Field::isEnumConstant) .collect(Collectors.toMap( field -> field.getName().toLowerCase(), field -> Enum.valueOf(type, field.getName()), (value, value2) -> { throw new UnsupportedOperationException(type.getCanonicalName() + " contains more than one enum constant " + "with the same name, only differing by capitalization, which is unsupported."); } )); }

Target:
EnumValueElement(Text key, Class<T> type) { super(key); this.type = type; this.values = Arrays.stream(type.getEnumConstants()) .collect(Collectors.toMap( value -> value.name().toLowerCase(), Function.identity(), (value, value2) -> { throw new UnsupportedOperationException(type.getCanonicalName() + " contains more than one enum constant " + "with the same name, only differing by capitalization, which is unsupported."); } )); }
Source:
public int handleCommand(final Namespace ns, final Manager m) { if (!m.isRegistered()) { System.err.println("User is not registered."); return 1; } List<ContactInfo> contacts = m.getContacts(); for (ContactInfo c : contacts) { System.out.println(String.format("Id: %s Name: %s", c.number, c.name)); } return 0; }

Target:
public int handleCommand(final Namespace ns, final Manager m) { if (!m.isRegistered()) { System.err.println("User is not registered."); return 1; } List<ContactInfo> contacts = m.getContacts(); for (ContactInfo c : contacts) { System.out.println(String.format("Number: %s Name: %s", c.number, c.name)); } return 0; }
Source:
public String getId() { return name; }

Target:
public String getId() { return getType() + ":" + getName(); }
Source:
public void getsMultipleSingleSelection() throws Exception { bot.radio("SWT.MULTI").click(); bot.checkBox("Multiple Columns").select(); bot.checkBox("Listen").select(); bot.button("Clear").click(); tree = bot.treeInGroup("Tree"); tree.select(new int[] { 1, 2 }); TableCollection selection = tree.selection(); assertEquals("Node 2", selection.get(0, 0)); assertEquals("databases", selection.get(0, 1)); assertEquals("2556", selection.get(0, 2)); assertEquals("tomorrow", selection.get(0, 3)); assertEquals(new TableRow(new String[] { "Node 3", "images", "91571", "yesterday" }), selection.get(1)); SWTBotText text = bot.textInGroup("Listeners"); assertEventMatches(text, "Selection [13]: SelectionEvent{Tree time=-550222256 data=null item=TreeItem {Node 2} detail=0 x=0 y=0 width=0 height=0 stateMask=0x80000 text=null doit=true}"); assertEventMatches(text, "MouseDown [3]: MouseEvent{Tree time=-550222259 data=null button=1 stateMask=0x0 x=0 y=0 count=1}"); assertEventMatches(text, "MouseUp [4]: MouseEvent{Tree time=-550222255 data=null button=1 stateMask=0x80000 x=0 y=0 count=1}"); assertEventMatches(text, "Selection [13]: SelectionEvent{Tree time=-550222256 data=null item=TreeItem {Node 3} detail=0 x=0 y=0 width=0 height=0 stateMask=0xc0000 text=null doit=true}"); assertEventMatches(text, "MouseDown [3]: MouseEvent{Tree time=-550222259 data=null button=1 stateMask=0x40000 x=0 y=0 count=1}"); assertEventMatches(text, "MouseUp [4]: MouseEvent{Tree time=-550222255 data=null button=1 stateMask=0xc0000 x=0 y=0 count=1}"); }

Target:
public void getsMultipleSingleSelection() throws Exception { bot.radio("SWT.MULTI").click(); bot.checkBox("Multiple Columns").select(); bot.checkBox("Listen").select(); bot.button("Clear").click(); tree = bot.treeInGroup("Tree"); tree.select(new int[] { 1, 2 }); TableCollection selection = tree.selection(); assertEquals("Node 2", selection.get(0, 0)); assertEquals("databases", selection.get(0, 1)); assertEquals("2556", selection.get(0, 2)); assertEquals("tomorrow", selection.get(0, 3)); assertEquals(new TableRow(new String[] { "Node 3", "images", "91571", "yesterday" }), selection.get(1)); SWTBotText text = bot.textInGroup("Listeners"); assertEventMatches(text, "MouseDown [3]: MouseEvent{Tree time=-550222259 data=null button=1 stateMask=0x0 x=0 y=0 count=1}"); assertEventMatches(text, "Selection [13]: SelectionEvent{Tree time=-550222256 data=null item=TreeItem {Node 2} detail=0 x=0 y=0 width=0 height=0 stateMask=0x80000 text=null doit=true}"); assertEventMatches(text, "MouseUp [4]: MouseEvent{Tree time=-550222255 data=null button=1 stateMask=0x80000 x=0 y=0 count=1}"); assertEventMatches(text, "MouseDown [3]: MouseEvent{Tree time=-550222259 data=null button=1 stateMask=0x40000 x=0 y=0 count=1}"); assertEventMatches(text, "Selection [13]: SelectionEvent{Tree time=-550222256 data=null item=TreeItem {Node 3} detail=0 x=0 y=0 width=0 height=0 stateMask=0xc0000 text=null doit=true}"); assertEventMatches(text, "MouseUp [4]: MouseEvent{Tree time=-550222255 data=null button=1 stateMask=0xc0000 x=0 y=0 count=1}"); }
Source:
boolean isLandscape() { final DisplayMetrics metrics = playerImpl != null && playerImpl.getParentActivity() != null ? playerImpl.getParentActivity().getResources().getDisplayMetrics() : getResources().getDisplayMetrics(); return metrics.heightPixels < metrics.widthPixels; }

Target:
boolean isLandscape() { final DisplayMetrics metrics = (playerImpl != null && playerImpl.getParentActivity() != null) ? playerImpl.getParentActivity().getResources().getDisplayMetrics() : getResources().getDisplayMetrics(); return metrics.heightPixels < metrics.widthPixels; }
Source:
public void hasActiveMembership_shouldFindAnActiveMemberCorrectly() throws Exception{ SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date endDateEarlier = dateFormat.parse("2007-02-01 00:00:00"); Date endDateLater = dateFormat.parse("2100-02-01 00:00:00"); Cohort cohort = new Cohort(3); CohortMembership membershipOne = new CohortMembership(7); membershipOne.setVoided(false); membershipOne.setEndDate(endDateLater); cohort.addMembership(membershipOne); CohortMembership membershipTwo = new CohortMembership(8); membershipTwo.setVoided(true); cohort.addMembership(membershipTwo); CohortMembership cohortMembershipThree = new CohortMembership(9); cohortMembershipThree.setEndDate(endDateEarlier); cohort.addMembership(cohortMembershipThree); CohortMembership membershipFour = new CohortMembership(10); cohort.addMembership(membershipFour); assertTrue(cohort.hasActiveMembership(7)); assertFalse(cohort.hasActiveMembership(9)); assertFalse(cohort.hasActiveMembership(8)); assertTrue(cohort.hasActiveMembership(10)); }

Target:
public void hasActiveMembership_shouldFindAnActiveMemberCorrectly() throws Exception{ Calendar calendar = Calendar.getInstance(); calendar.add(Calendar.DAY_OF_YEAR, 1); Date endDateLater = calendar.getTime(); calendar.add(Calendar.DAY_OF_YEAR, -2); Date endDateEarlier = calendar.getTime(); Cohort cohort = new Cohort(3); CohortMembership membershipOne = new CohortMembership(7); membershipOne.setVoided(false); membershipOne.setEndDate(endDateLater); cohort.addMembership(membershipOne); CohortMembership membershipTwo = new CohortMembership(8); membershipTwo.setVoided(true); cohort.addMembership(membershipTwo); CohortMembership cohortMembershipThree = new CohortMembership(9); cohortMembershipThree.setEndDate(endDateEarlier); cohort.addMembership(cohortMembershipThree); CohortMembership membershipFour = new CohortMembership(10); cohort.addMembership(membershipFour); assertTrue(cohort.hasActiveMembership(7)); assertFalse(cohort.hasActiveMembership(9)); assertFalse(cohort.hasActiveMembership(8)); assertTrue(cohort.hasActiveMembership(10)); }
Source:
public synchronized boolean commitSession(long id, int sessionTimeout) { LOG.info("Committing global session 0X" + Long.toHexString(id)); sessionsWithTimeout.put(id, sessionTimeout); return true; }

Target:
public synchronized boolean commitSession(long id, int sessionTimeout) { return sessionsWithTimeout.put(id, sessionTimeout) == null; }
Source:
protected String getPackageLocation() { return "com/puppycrawl/tools/" + "checkstyle/xpath"; }

Target:
protected String getPackageLocation() { return "com/puppycrawl/tools/checkstyle/xpath/xpathquerygenerator"; }
Source:
public boolean deleteIdentifier() { if (selectedIdentifier != null) { return loadTestDataService.deleteIdentifier(selectedIdentifier); } else { addPatientErrorMessages("Identifer have to be select to be deleted"); } return false; }

Target:
public boolean deleteIdentifier() { boolean result = false; if (selectedIdentifier != null) { result = loadTestDataService.deleteIdentifier(selectedIdentifier); } else { addPatientErrorMessages(msgForSelectDelete("identifer")); } return result; }
Source:
private static StoragePool cloneStorage_pool(StoragePool instance) { StoragePool obj = new StoragePool(); obj.setdescription(instance.getdescription()); obj.setComment(instance.getComment()); obj.setId(instance.getId()); obj.setName(instance.getName()); obj.setStatus(instance.getStatus()); obj.setmaster_domain_version(instance.getmaster_domain_version()); obj.setLVER(instance.getLVER()); obj.setrecovery_mode(instance.getrecovery_mode()); obj.setspm_vds_id(instance.getspm_vds_id()); obj.setcompatibility_version(instance.getcompatibility_version()); return obj; }

Target:
private static StoragePool cloneStorage_pool(StoragePool instance) { StoragePool obj = new StoragePool(); obj.setdescription(instance.getdescription()); obj.setComment(instance.getComment()); obj.setId(instance.getId()); obj.setName(instance.getName()); obj.setIsLocal(instance.isLocal()); obj.setStatus(instance.getStatus()); obj.setmaster_domain_version(instance.getmaster_domain_version()); obj.setLVER(instance.getLVER()); obj.setrecovery_mode(instance.getrecovery_mode()); obj.setspm_vds_id(instance.getspm_vds_id()); obj.setcompatibility_version(instance.getcompatibility_version()); return obj; }
Source:
protected void onPostExecute(Boolean success) { AlertDialog.Builder builder = new AlertDialog.Builder(context); if (success) { String replayURL = "<LINK_0>" + roomId; builder.setMessage(String.format(context.getResources().getString(R.string.replay_exported), replayURL)); } else { builder.setMessage(R.string.replay_exporting_failure); } builder.setPositiveButton(R.string.dialog_ok, null); final AlertDialog alert = builder.create(); waitingDialog.dismiss(); alert.show(); }

Target:
protected void onPostExecute(Boolean success) { AlertDialog.Builder builder = new AlertDialog.Builder(context); if (success) { String replayURL = "<LINK_0>" + roomId; builder.setMessage(String.format(context.getResources().getString(R.string.replay_exported), replayURL)); } else { builder.setMessage(R.string.replay_exporting_failure); } builder.setPositiveButton(R.string.dialog_ok, null); final AlertDialog alert = builder.create(); mWaitingDialog.dismiss(); alert.show(); }
Source:
public boolean isCashAdvanceLine(ConcurStandardAccountingExtractDetailLine line) { return StringUtils.isNotEmpty(line.getCashAdvanceCaKey()); }

Target:
public boolean isCashAdvanceLine(ConcurStandardAccountingExtractDetailLine line) { return StringUtils.isNotBlank(line.getCashAdvanceKey()); }
Source:
public void consume() { MentionsData data = null; try { data = DefaultMentionsEventExecutor.this.queue.poll(10, SECONDS); if (data != null) { DefaultMentionsEventExecutor.this.logger .debug("[{}] - consumed. Queue size [{}]", data.getDocumentReference(), data.getVersion(), DefaultMentionsEventExecutor.this.queue.size()); DefaultMentionsEventExecutor.this.dataConsumer.consume(data); } } catch (Exception e) { DefaultMentionsEventExecutor.this.logger .warn("Error during mention analysis of task [{}]. Cause [{}].", data, getRootCauseMessage(e)); if (data != null) { try { DefaultMentionsEventExecutor.this.queue.put(data); } catch (InterruptedException interruptedException) { DefaultMentionsEventExecutor.this.logger .error("Error when adding back a fail failed task [{}]. Cause [{}].", data, getRootCauseMessage(e)); } } } }

Target:
public void consume() { MentionsData data = null; try { data = DefaultMentionsEventExecutor.this.queue.poll(); if (data != null) { if (data.isStop()) { this.halt = true; } else if (!data.isDeprecated()) { DefaultMentionsEventExecutor.this.logger .debug("[{}] - consumed. Queue size [{}]", data.getDocumentReference(), data.getVersion(), DefaultMentionsEventExecutor.this.queue.size()); DefaultMentionsEventExecutor.this.dataConsumer.consume(data); } } } catch (Exception e) { DefaultMentionsEventExecutor.this.logger .warn("Error during mention analysis of task [{}]. Cause [{}].", data, getRootCauseMessage(e)); if (data != null) { try { DefaultMentionsEventExecutor.this.queue.put(data); } catch (InterruptedException interruptedException) { DefaultMentionsEventExecutor.this.logger .error("Error when adding back a fail failed task [{}]. Cause [{}].", data, getRootCauseMessage(e)); } } } }
Source:
public void configurePipeline(PipelineConfigurer pipelineConfigurer) { super.configurePipeline(pipelineConfigurer); config.validateConfig(); pipelineConfigurer.getStageConfigurer().setOutputSchema(DEFAULT_XML_SCHEMA); if (StringUtils.isNotEmpty(config.tableName)) { pipelineConfigurer.createDataset(config.tableName, KeyValueTable.class.getName()); } }

Target:
public void configurePipeline(PipelineConfigurer pipelineConfigurer) { super.configurePipeline(pipelineConfigurer); config.validateConfig(); pipelineConfigurer.getStageConfigurer().setOutputSchema(DEFAULT_XML_SCHEMA); pipelineConfigurer.createDataset(config.tableName, KeyValueTable.class.getName()); }
Source:
private StorageDir(StorageTier tier, int dirIndex, long capacityBytes, long reservedBytes, String dirPath, String dirMedium) { mTier = Preconditions.checkNotNull(tier, "tier"); mDirIndex = dirIndex; mCapacityBytes = capacityBytes; if (capacityBytes < reservedBytes) { reservedBytes = capacityBytes / 20; } mReservedBytes = new AtomicLong(reservedBytes); mUsedReservedBytes = new AtomicLong(0); mAvailableBytes = new AtomicLong(capacityBytes - reservedBytes); mCommittedBytes = new AtomicLong(0); mDirPath = dirPath; mDirMedium = dirMedium; mBlockIdToBlockMap = new HashMap<>(200); mBlockIdToTempBlockMap = new HashMap<>(200); mSessionIdToTempBlockIdsMap = new HashMap<>(200); }

Target:
private StorageDir(StorageTier tier, int dirIndex, long capacityBytes, long reservedBytes, String dirPath, String dirMedium) { mTier = Preconditions.checkNotNull(tier, "tier"); mDirIndex = dirIndex; mCapacityBytes = capacityBytes; if (capacityBytes < reservedBytes) { reservedBytes = capacityBytes / 20; } mReservedBytes = new AtomicLong(reservedBytes); mAvailableBytes = new AtomicLong(capacityBytes - reservedBytes); mCommittedBytes = new AtomicLong(0); mDirPath = dirPath; mDirMedium = dirMedium; mBlockIdToBlockMap = new HashMap<>(200); mBlockIdToTempBlockMap = new HashMap<>(200); mSessionIdToTempBlockIdsMap = new HashMap<>(200); }
Source:
RenameDialog(Context context, final Listener listener) { renameAmountDialog = new MaterialDialog.Builder(context) .inputType(InputType.TYPE_CLASS_NUMBER) .input(context.getString(R.string.num_copies), "", (dialog, input) -> { if (input.length() > 0) { int amount = Integer.parseInt(input.toString()); boolean validNumber = amount > 0 && amount <= currentMaxAmount; dialog.getActionButton(DialogAction.POSITIVE).setEnabled(validNumber); return; } dialog.getActionButton(DialogAction.POSITIVE).setEnabled(false); }) .alwaysCallInputCallback() .negativeText(android.R.string.no) .positiveText(R.string.next) .onNeutral((dialog, which) -> { dialog.getInputEditText().setText("" + currentMaxAmount); handlePositiveAmountToRename(); }) .onPositive((dialog, which) -> { handlePositiveAmountToRename(); }) .build(); renamingDialog = new MaterialDialog.Builder(context) .title(R.string.change_name) .input(context.getString(R.string.new_name), currentName, (dialog, input) -> { boolean submitEnabled = !(input.toString().trim().isEmpty() || input.toString().equals(currentName)); dialog.getActionButton(DialogAction.POSITIVE).setEnabled(submitEnabled); }) .alwaysCallInputCallback() .negativeText(android.R.string.no) .onAny((dialog, which) -> { if (which == DialogAction.POSITIVE) { String newName = dialog.getInputEditText().getText().toString().trim(); listener.onRenameSubmitted(currentName, newName, amountToRename); } else if (which == DialogAction.NEUTRAL) { renameAmountDialog.show(); } }) .build(); }

Target:
public RenameDialog(Context context, final Listener listener) { renameAmountDialog = new MaterialDialog.Builder(context) .content(R.string.multiple_renames_title) .inputType(InputType.TYPE_CLASS_NUMBER) .input(context.getString(R.string.num_copies), "", (dialog, input) -> { if (input.length() > 0) { int amount = Integer.parseInt(input.toString()); boolean validNumber = amount > 0 && amount <= currentMaxAmount; dialog.getActionButton(DialogAction.POSITIVE).setEnabled(validNumber); return; } dialog.getActionButton(DialogAction.POSITIVE).setEnabled(false); }) .alwaysCallInputCallback() .negativeText(android.R.string.no) .positiveText(R.string.next) .onPositive((dialog, which) -> { amountToRename = Integer.parseInt( dialog.getInputEditText().getText().toString().trim()); goIntoRenamingDialogFromAmountChoice(); }) .build(); renamingDialog = new MaterialDialog.Builder(context) .title(R.string.change_name) .input(context.getString(R.string.new_name), currentName, (dialog, input) -> { boolean submitEnabled = !(input.toString().trim().isEmpty() || input.toString().equals(currentName)); dialog.getActionButton(DialogAction.POSITIVE).setEnabled(submitEnabled); }) .alwaysCallInputCallback() .negativeText(android.R.string.no) .onAny((dialog, which) -> { if (which == DialogAction.POSITIVE) { String newName = dialog.getInputEditText().getText().toString().trim(); listener.onRenameSubmitted(currentName, newName, amountToRename); } else if (which == DialogAction.NEUTRAL) { renameAmountDialog.show(); } }) .build(); }
Source:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } ColumnMetadata other = (ColumnMetadata) obj; return Objects.equals(this.name, other.name) && Objects.equals(this.type, other.type) && Objects.equals(this.comment, other.comment) && Objects.equals(this.extraInfo, other.extraInfo) && Objects.equals(this.hidden, other.hidden) && this.nullable == other.nullable; }

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } ColumnMetadata other = (ColumnMetadata) obj; return Objects.equals(this.name, other.name) && Objects.equals(this.type, other.type) && Objects.equals(this.nullable, other.nullable) && Objects.equals(this.comment, other.comment) && Objects.equals(this.extraInfo, other.extraInfo) && Objects.equals(this.hidden, other.hidden); }
Source:
private synchronized void changeServer(ClientChannel oldCh) { if (oldCh == ch && ch != null) { if (!backups.isEmpty()) { backups.addLast(primary); primary = backups.removeFirst(); } try { ch.close(); } catch (Exception ignored) { } ch = null; } }

Target:
private synchronized void changeServer(ClientChannel oldCh) { if (oldCh == ch && ch != null) { rollAddress(); U.closeQuiet(ch); ch = null; } }
Source:
public String encrypt(String plaintext, String passphrase, Version cryptoVersion) { Preconditions.checkArgument(Version.V1_1.equals(cryptoVersion)); Preconditions.checkNotNull(plaintext); Preconditions.checkNotNull(passphrase); String cipheredText = newEncryptor(passphrase).encrypt(plaintext); ObjectNode node = MAPPER.createObjectNode(); node.put(CIPHERED_TEXT_KEY, cipheredText); node.put(ICrypto.VERSION_IDENTIFIER, Version.V1_1.versionStr()); return ICrypto.encode(node.toString()); }

Target:
public String encrypt(String plaintext, String passphrase, Version cryptoVersion) { Preconditions.checkArgument(Version.V1_1.equals(cryptoVersion)); String cipheredText = newEncryptor(passphrase).encrypt(plaintext); ObjectNode node = MAPPER.createObjectNode(); node.put(CIPHERED_TEXT_KEY, cipheredText); node.put(ICrypto.VERSION_IDENTIFIER, Version.V1_1.versionStr()); return Crypto.encode(node.toString()); }
Source:
public boolean isMissingData() { return getCacheTopology() != null && getCacheTopology().isDegradedMode(); }

Target:
public boolean isMissingData() { return getCacheTopology() != null && getCacheTopology().isMissingData(); }
Source:
public String process(String query) { LOG.info("Processing query: {}", query); try { URI uri = new URI(query); String path = getPath(query, LOG); if (path != null && path.equalsIgnoreCase(DiagnosticsRequestType.POSITION.toString())) { return processDatastreamPositionRequest(uri); } else if (path != null && path.equalsIgnoreCase(DiagnosticsRequestType.DATASTREAM_STATE.toString())) { throw new UnsupportedOperationException("FileConnector does not support querying for datastream state"); } else { LOG.error("Could not process query with path {}", query, path); } } catch (Exception e) { LOG.error("Failed to process query {}", query, e); } return null; }

Target:
public String process(String query) { LOG.info("Processing query: {}", query); try { URI uri = new URI(query); String path = getPath(query, LOG); if (path != null && path.equalsIgnoreCase(DiagnosticsRequestType.POSITION.toString())) { return processDatastreamPositionRequest(uri); } else if (path != null && path.equalsIgnoreCase(DiagnosticsRequestType.DATASTREAM_STATE.toString())) { throw new UnsupportedOperationException("FileConnector does not support querying for datastream state"); } else { LOG.error("Could not process query with path {}", query, path); } } catch (Exception e) { throw new DatastreamRuntimeException(String.format("Failed to process query %s", query), e); } return null; }
Source:
public CompletableFuture<CoordinationResponse> deliverCoordinationRequestToCoordinator( OperatorID operator, CoordinationRequest request) throws FlinkException { OperatorCoordinator coordinator = coordinatorMap.get(operator); if (coordinator instanceof CoordinationResponser) { return CompletableFuture.completedFuture( ((CoordinationResponser) coordinator).handleCoordinationRequest(request)); } else if (coordinator != null) { return FutureUtils.completedExceptionally( new IllegalArgumentException("Coordinator of operator " + operator + " cannot handle client event")); } else { throw new FlinkException("Coordinator of operator " + operator + " does not exist"); } }

Target:
public CompletableFuture<CoordinationResponse> deliverCoordinationRequestToCoordinator( OperatorID operator, CoordinationRequest request) throws FlinkException { OperatorCoordinator coordinator = coordinatorMap.get(operator); if (coordinator instanceof CoordinationRequestHandler) { return ((CoordinationRequestHandler) coordinator).handleCoordinationRequest(request); } else if (coordinator != null) { throw new FlinkException("Coordinator of operator " + operator + " cannot handle client event"); } else { throw new FlinkException("Coordinator of operator " + operator + " does not exist"); } }
Source:
public void testVerifyMissingToken() { Header header = new Header("X-Auth-Token", ""); given(). header(header). when(). post("/token/verify"). then(). statusCode(HttpStatus.SC_FORBIDDEN); }

Target:
public void testVerifyMissingToken() { Header header = new Header(AUTH_HEADER, ""); given(). header(header). when(). post("/token/verify"). then(). statusCode(HttpStatus.SC_FORBIDDEN); }
Source:
public boolean isProviderFor(CSSDiagram diagram) { if(diagram.getElement() instanceof Element){ Element element = (Element)diagram.getElement(); if (SysMLResource.isSysMLProfileApplied(element)){ return true; } } return false; }

Target:
public boolean isProviderFor(CSSDiagram diagram) { if(diagram.getElement() instanceof Element){ Element element = (Element)diagram.getElement(); return SysMLResource.isSysMLProfileApplied(element); } return false; }
Source:
public void onSizeLimitReached(final Checkpoint cp) throws IOException { LOG.info("Reached size {}", cp); scheduler.execute(new Runnable() { @Override public void run() { try { LOG.info("Started flushing mem table."); long prevAllocLogIdBeforeFlush = entryLogger.getPreviousAllocatedEntryLogId(); memTable.flush(SortedLedgerStorage.this); long afterAllocLogIdBeforeFlush = entryLogger.getPreviousAllocatedEntryLogId(); if (entryLogger.rollLogsIfEntryLogLimitReached()) { checkpointer.startCheckpoint(cp); } else if ((prevAllocLogIdBeforeFlush != afterAllocLogIdBeforeFlush) && !isTransactionalCompactionEnabled) { entryLogger.rollLogs(); checkpointer.startCheckpoint(cp); } } catch (IOException e) { stateManager.transitionToReadOnlyMode(); LOG.error("Exception thrown while flushing skip list cache.", e); } } }); }

Target:
public void onSizeLimitReached(final Checkpoint cp) throws IOException { LOG.info("Reached size {}", cp); scheduler.execute(new Runnable() { @Override public void run() { try { LOG.info("Started flushing mem table."); entryLogger.prepareEntryMemTableFlush(); memTable.flush(SortedLedgerStorage.this); if (entryLogger.commitEntryMemTableFlush()) { checkpointer.startCheckpoint(cp); } } catch (Exception e) { stateManager.transitionToReadOnlyMode(); LOG.error("Exception thrown while flushing skip list cache.", e); } } }); }
Source:
public ResourceData[] getResource(String destinationPath) throws ResourceAdminServiceExceptionException, RemoteException { ResourceData[] rs; rs = resourceAdminServiceStub.getResourceData(new String[]{destinationPath}); return rs; }

Target:
public ResourceData[] getResource(String destinationPath) throws ResourceAdminServiceExceptionException, RemoteException { return resourceAdminServiceStub.getResourceData(new String[]{destinationPath}); }
Source:
public <T extends Service> T get(Class<T> serviceType) { if (services == null) { return null; } return (T) services.get(serviceType); }

Target:
public <T extends Service> T get(Class<T> serviceType) { return (T) services.get(serviceType); }
Source:
private void parseFrame(IByteProvider byteProvider) { try { byte currentByte = byteProvider.getByte(); if (currentByte == Frame.START_BYTE) { int length = byteProvider.getByte(); if (length > 0) { byte[] data = byteProvider.getBytes(length + 1); ReceiveFrame frame = new ReceiveFrame(); frame.parse(data); receiveFrames.add(frame); } } } catch (Exception e) { logger.error("Error while parsing ReceiveFrame", e); } }

Target:
private void parseFrame(IByteProvider byteProvider) { try { byte currentByte = byteProvider.getByte(); if (currentByte == Frame.START_BYTE) { int length = byteProvider.getByte(); if (length > 0) { byte[] data = byteProvider.getBytes(length + 1); ReceiveFrame frame = new ReceiveFrame(); frame.parse(data); receiveFrames.add(frame); } } } catch (Exception e) { logger.warn("Error while parsing ReceiveFrame", e); } }
Source:
private void addReportedIpv4Configuration(ReportedConfigurations result) { if (!isIpv4PrimaryAddressExist()) { return; } Ipv4BootProtocol definedIpv4BootProtocol = getIpv4PrimaryAddress().getBootProtocol(); result.add(ReportedConfigurationType.IPV4_BOOT_PROTOCOL, iface.getIpv4BootProtocol(), definedIpv4BootProtocol); if (definedIpv4BootProtocol == Ipv4BootProtocol.STATIC_IP && iface.getIpv4BootProtocol() == definedIpv4BootProtocol) { result.add(ReportedConfigurationType.IPV4_NETMASK, iface.getIpv4Subnet(), getIpv4PrimaryAddress().getNetmask(), isIpv4NetworkSubnetInSync()); result.add(ReportedConfigurationType.IPV4_ADDRESS, iface.getIpv4Address(), getIpv4PrimaryAddress().getAddress()); result.add(ReportedConfigurationType.IPV4_GATEWAY, iface.getIpv4Gateway(), getIpv4PrimaryAddress().getGateway(), !isDefaultRouteNetwork || isIpv4GatewayInSync()); } }

Target:
private void addReportedIpv4Configuration(ReportedConfigurations result) { if (!isIpv4PrimaryAddressExist()) { return; } Ipv4BootProtocol definedIpv4BootProtocol = getIpv4PrimaryAddress().getBootProtocol(); result.add(ReportedConfigurationType.IPV4_BOOT_PROTOCOL, iface.getIpv4BootProtocol(), definedIpv4BootProtocol); if (definedIpv4BootProtocol == Ipv4BootProtocol.STATIC_IP && iface.getIpv4BootProtocol() == definedIpv4BootProtocol) { result.add(ReportedConfigurationType.IPV4_NETMASK, iface.getIpv4Subnet(), getIpv4PrimaryAddress().getNetmask(), isIpv4NetworkSubnetInSync()); result.add(ReportedConfigurationType.IPV4_ADDRESS, iface.getIpv4Address(), getIpv4PrimaryAddress().getAddress()); result.add(ReportedConfigurationType.IPV4_GATEWAY, iface.getIpv4Gateway(), getIpv4PrimaryAddress().getGateway(), isIpv4GatewayInSync()); } }
Source:
protected View getView() { if (getHost().getModel() instanceof View) { if (((View) getHost().getModel()) instanceof View) { return (View) ((View) getHost().getModel()); } return null; } return null; }

Target:
protected View getView() { View view = null; if (getHost().getModel() instanceof View) { if (((View) getHost().getModel()) instanceof View) { view = (View) ((View) getHost().getModel()); } } return view; }
Source:
public Bundle[] getBundles(String symbolicName, String versionRange) { PlatformAdmin platformAdmin = getPlatformAdmin(); if (platformAdmin == null) return null; State state = platformAdmin.getState(false); BundleDescription[] bundleDescriptions = state.getBundles(symbolicName); if (bundleDescriptions.length == 1) { if ((bundleDescriptions[0].getBundle().getState() & (Bundle.INSTALLED | Bundle.UNINSTALLED)) == 0) { return new Bundle[] { bundleDescriptions[0].getBundle() }; } } Bundle[] results = Arrays.stream(bundleDescriptions).map(bd -> bd.getBundle()) .filter(bundle -> (bundle.getState() & (Bundle.INSTALLED | Bundle.UNINSTALLED)) == 0) .toArray(Bundle[]::new); return results; }

Target:
public Bundle[] getBundles(String symbolicName, String versionRange) { ModuleContainer container = getModuleContainer(); if (container == null) return null; FrameworkWiring wiring = container.getFrameworkWiring(); Map<String, String> directives = Collections.singletonMap(Namespace.REQUIREMENT_FILTER_DIRECTIVE, getRequirementFilter(symbolicName, null)); Collection<BundleCapability> matchingBundleCapabilities = wiring.findProviders(ModuleContainer .createRequirement(IdentityNamespace.IDENTITY_NAMESPACE, directives, Collections.emptyMap())); if (matchingBundleCapabilities.isEmpty()) { return null; } Bundle[] results = matchingBundleCapabilities.stream().map(c -> c.getRevision().getBundle()) .filter(bundle -> (bundle.getState() & (Bundle.INSTALLED | Bundle.UNINSTALLED)) == 0) .toArray(Bundle[]::new); return results; }
Source:
private static Configuration getServiceBusConfig() throws FalconException { String namespace = StartupProperties.get().getProperty(AZURE_SERVICEBUS_CONF_PREFIX + AZURE_SERVICEBUS_CONF_NAMESPACE); if (namespace == null) { throw new FalconException(AZURE_SERVICEBUS_CONF_PREFIX + AZURE_SERVICEBUS_CONF_NAMESPACE + " property not set in startup properties. Please add it."); } String sasKeyName = StartupProperties.get().getProperty(AZURE_SERVICEBUS_CONF_PREFIX + AZURE_SERVICEBUS_CONF_SASKEYNAME); if (sasKeyName == null) { throw new FalconException(AZURE_SERVICEBUS_CONF_PREFIX + AZURE_SERVICEBUS_CONF_SASKEYNAME + " property not set in startup properties. Please add it."); } String sasKey = StartupProperties.get().getProperty(AZURE_SERVICEBUS_CONF_PREFIX + AZURE_SERVICEBUS_CONF_SASKEY); if (sasKey == null) { throw new FalconException(AZURE_SERVICEBUS_CONF_PREFIX + AZURE_SERVICEBUS_CONF_SASKEY + " property not set in startup properties. Please add it."); } String serviceBusRootUri = StartupProperties.get().getProperty(AZURE_SERVICEBUS_CONF_PREFIX + AZURE_SERVICEBUS_CONF_SERVICEBUSROOTURI); if (serviceBusRootUri == null) { throw new FalconException(AZURE_SERVICEBUS_CONF_PREFIX + AZURE_SERVICEBUS_CONF_SERVICEBUSROOTURI + " property not set in startup properties. Please add it."); } LOG.info("namespace: " + namespace + ", sas key name: " + sasKeyName + ", sas key: " + sasKey + ", root uri: " + serviceBusRootUri); return ServiceBusConfiguration.configureWithSASAuthentication(namespace, sasKeyName, sasKey, serviceBusRootUri); }

Target:
private static Configuration getServiceBusConfig() throws FalconException { String namespace = StartupProperties.get().getProperty(AZURE_SERVICEBUS_CONF_PREFIX + AZURE_SERVICEBUS_CONF_NAMESPACE); if (StringUtils.isBlank(namespace)) { throw new FalconException(AZURE_SERVICEBUS_CONF_PREFIX + AZURE_SERVICEBUS_CONF_NAMESPACE + " property not set in startup properties. Please add it."); } String sasKeyName = StartupProperties.get().getProperty(AZURE_SERVICEBUS_CONF_PREFIX + AZURE_SERVICEBUS_CONF_SASKEYNAME); if (StringUtils.isBlank(sasKeyName)) { throw new FalconException(AZURE_SERVICEBUS_CONF_PREFIX + AZURE_SERVICEBUS_CONF_SASKEYNAME + " property not set in startup properties. Please add it."); } String sasKey = StartupProperties.get().getProperty(AZURE_SERVICEBUS_CONF_PREFIX + AZURE_SERVICEBUS_CONF_SASKEY); if (StringUtils.isBlank(sasKey)) { throw new FalconException(AZURE_SERVICEBUS_CONF_PREFIX + AZURE_SERVICEBUS_CONF_SASKEY + " property not set in startup properties. Please add it."); } String serviceBusRootUri = StartupProperties.get().getProperty(AZURE_SERVICEBUS_CONF_PREFIX + AZURE_SERVICEBUS_CONF_SERVICEBUSROOTURI); if (StringUtils.isBlank(serviceBusRootUri)) { throw new FalconException(AZURE_SERVICEBUS_CONF_PREFIX + AZURE_SERVICEBUS_CONF_SERVICEBUSROOTURI + " property not set in startup properties. Please add it."); } LOG.info("namespace: {}, sas key name: {}, sas key: {}, root uri: {}", namespace, sasKeyName, sasKey, serviceBusRootUri); return ServiceBusConfiguration.configureWithSASAuthentication(namespace, sasKeyName, sasKey, serviceBusRootUri); }
Source:
public int getEntryCount() { return valueBlockBuilder.getPositionCount(); }

Target:
public int getEntryCount() { return keyBlockBuilder.getPositionCount(); }
Source:
public void actionPerformed(ActionEvent e) { if (selectedVariable != null) { changeValuePresenter.showDialog(); } if (selectedExpression != null) { editWatchExpressionPresenter.showDialog(); } }

Target:
public void actionPerformed(ActionEvent e) { if (debuggerPresenter.getSelectedWatchExpression() != null) { editWatchExpressionPresenter.showDialog(); } else if (debuggerPresenter.getSelectedVariable() != null) { changeValuePresenter.showDialog(); } }
Source:
public static boolean isPageview(String uriHost, String uriPath, String uriQuery, String httpStatus, String contentType, String userAgent) { return ( httpStatus.equals("200") && ( (contentTypesSet.contains(contentType) && !stringContains(uriPath, apiHit)) || (contentType.equals(appContentType) && isAppPageRequest(uriPath, uriQuery, userAgent)) ) && ( uriHostWikimediaDomainPattern.matcher(uriHost).find() || uriHostProjectDomainPattern.matcher(uriHost).find() ) && !uriPathUnwantedSpecialPagesPattern.matcher(uriPath).find() && !uriQueryUnwantedSpecialPagesPattern.matcher(uriQuery).find() && uriPathPattern.matcher(uriPath).find() ); }

Target:
public static boolean isPageview( String uriHost, String uriPath, String uriQuery, String httpStatus, String contentType, String userAgent ) { return ( httpStatus.equals("200") && ( (contentTypesSet.contains(contentType) && !stringContains(uriPath, apiHit)) || (contentType.equals(appContentType) && isAppPageRequest(uriPath, uriQuery, userAgent)) ) && ( patternIsFound(uriHostWikimediaDomainPattern, uriHost) || patternIsFound(uriHostProjectDomainPattern, uriHost) ) && patternIsFound(uriPathPattern, uriPath) && !patternIsFound(uriPathUnwantedSpecialPagesPattern, uriPath) && !patternIsFound(uriQueryUnwantedSpecialPagesPattern, uriQuery) ); }
Source:
private static boolean isLanguageBlacklisted(@NonNull String lang) { try { List<String> blacklist = GsonUtil.getDefaultGson().fromJson(WikipediaApp.getInstance() .getRemoteConfig().getConfig() .optString("descriptionEditLangBlacklist", "['en','de','it','fr','es','ja','nl','pt','tr','zh-hant']"), new TypeToken<List<String>>() {}.getType()); return blacklist.contains(lang); } catch (JsonSyntaxException e) { L.logRemoteErrorIfProd(e); } return true; }

Target:
private static boolean isLanguageBlacklisted(@NonNull String lang) { JSONArray blacklist = WikipediaApp.getInstance().getRemoteConfig().getConfig() .optJSONArray("descriptionEditLangBlacklist"); if (blacklist != null) { for (int i = 0; i < blacklist.length(); i++) { if (lang.equals(blacklist.optString(i))) { return true; } } return false; } else { return Arrays.asList("en", "de", "it", "fr", "es", "ja", "nl", "pt", "tr", "zh-hant") .contains(lang); } }
Source:
public void createEnvironment(@Observes(precedence = 10) BeforeClass event, OpenShiftAdapter client, CECubeConfiguration configuration, OpenShiftClient openshiftClient) throws Exception { final TestClass testClass = event.getTestClass(); log.info(String.format("Creating environment for %s", testClass.getName())); OpenShiftResourceFactory.createResources(testClass.getName(), client, null, testClass.getJavaClass(), configuration.getProperties()); processTemplateResources(testClass, client, configuration); registerRoutes(configuration, openshiftClient); }

Target:
public void createEnvironment(@Observes(precedence = 10) BeforeClass event, OpenShiftAdapter client, CECubeConfiguration configuration, OpenShiftClient openshiftClient) throws DeploymentException { final TestClass testClass = event.getTestClass(); log.info(String.format("Creating environment for %s", testClass.getName())); OpenShiftResourceFactory.createResources(testClass.getName(), client, null, testClass.getJavaClass(), configuration.getProperties()); processTemplateResources(testClass, client, configuration); registerRoutes(configuration, openshiftClient); }
Source:
void stopEvent(final String requestId, final IEvents events, final String eventName) { if (mDispatcher == null) { return; } final String startTime = mEventTracking.get(new Pair<>(requestId, eventName)); if (StringExtensions.isNullOrBlank(startTime)) { Logger.v(TAG, "Stop Event called without a corresponding start_event"); return; } long startTimeLong = Long.parseLong(startTime); long stopTimeLong = System.currentTimeMillis(); long diffTime = stopTimeLong - startTimeLong; final String stopTime = Long.toString(stopTimeLong); events.setProperty(EventStrings.START_TIME, startTime); events.setProperty(EventStrings.STOP_TIME, stopTime); events.setProperty(EventStrings.RESPONSE_TIME, Long.toString(diffTime)); mDispatcher.receive(requestId, events); }

Target:
void stopEvent(final String requestId, final IEvents events, final String eventName) { if (mDispatcher == null) { return; } final String startTime = mEventTracking.get(new Pair<>(requestId, eventName)); if (StringExtensions.isNullOrBlank(startTime)) { Logger.w(TAG, "Stop Event called without a corresponding start_event", "", null); return; } long startTimeLong = Long.parseLong(startTime); long stopTimeLong = System.currentTimeMillis(); long diffTime = stopTimeLong - startTimeLong; final String stopTime = Long.toString(stopTimeLong); events.setProperty(EventStrings.START_TIME, startTime); events.setProperty(EventStrings.STOP_TIME, stopTime); events.setProperty(EventStrings.RESPONSE_TIME, Long.toString(diffTime)); mDispatcher.receive(requestId, events); }