auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static void writeSequenceToArchive(Resource mediationResource, String individualSequenceExportPath, Registry registry, String mediationName, APIIdentifier apiIdentifier) throws RegistryException, APIManagementException { if (mediationResource != null) { String resourcePath = mediationResource.getPath(); if (registry.resourceExists(resourcePath)) { Resource mediationFile = registry.get(resourcePath); try (OutputStream outputStream = new FileOutputStream( individualSequenceExportPath + File.separator + mediationName + APIConstants.DOT + APIConstants.XML_DOC_EXTENSION); InputStream fileInputStream = mediationFile.getContentStream()) { IOUtils.copy(fileInputStream, outputStream); } catch (IOException e) { throw new APIManagementException("Error while writing the mediation sequence"+ mediationName+ "to file"); } } else { log.error("Sequence resource for API/API Product: " + apiIdentifier.getName() + " not found in " + resourcePath); } } }

Target:
private static void writeSequenceToArchive(Resource mediationResource, String individualSequenceExportPath, Registry registry, String mediationName, APIIdentifier apiIdentifier) throws RegistryException, APIManagementException { if (mediationResource != null) { String resourcePath = mediationResource.getPath(); if (registry.resourceExists(resourcePath)) { Resource mediationFile = registry.get(resourcePath); try (OutputStream outputStream = new FileOutputStream( individualSequenceExportPath + File.separator + mediationName + APIConstants.DOT + APIConstants.XML_DOC_EXTENSION); InputStream fileInputStream = mediationFile.getContentStream()) { IOUtils.copy(fileInputStream, outputStream); } catch (IOException e) { throw new APIManagementException("Error while writing the mediation sequence"+ mediationName+ "to file", e); } } else { throw new APIManagementException( "Resource specified by " + resourcePath + " cannot be found in the registry", ExceptionCodes.RESOURCE_NOT_FOUND); } } }
Source:
public void testForExisting() { String url = "/v2/identifiers/rs199692280?species=mmusculus&assembly=grcm38"; ResponseEntity<String> response = restTemplate.getForEntity(url, String.class); assertEquals(HttpStatus.OK, response.getStatusCode()); Configuration configuration = Configuration.defaultConfiguration() .jsonProvider(new JacksonJsonProvider()) .mappingProvider(new JacksonMappingProvider(objectMapper)) .addOptions(Option.SUPPRESS_EXCEPTIONS); List<Variant> variantList = JsonPath.using(configuration).parse(response.getBody()) .read("$['_embedded']['variantList']", new TypeRef<List<Variant>>() { }); assertTrue(variantList.size() > 0); Variant variant = variantList.get(0); assertEquals("20", variant.getChromosome()); assertEquals("T", variant.getAlternate()); assertEquals("A", variant.getReference()); assertEquals(60100L, variant.getStart()); assertEquals(60100L, variant.getEnd()); }

Target:
public void testForExisting() { String url = "/v2/identifiers/rs199692280/variants?species=mmusculus&assembly=grcm38"; ResponseEntity<String> response = restTemplate.getForEntity(url, String.class); assertEquals(HttpStatus.OK, response.getStatusCode()); Configuration configuration = Configuration.defaultConfiguration() .jsonProvider(new JacksonJsonProvider()) .mappingProvider(new JacksonMappingProvider(objectMapper)) .addOptions(Option.SUPPRESS_EXCEPTIONS); List<Variant> variantList = JsonPath.using(configuration).parse(response.getBody()) .read("$['_embedded']['variantList']", new TypeRef<List<Variant>>() { }); assertFalse(JsonPath.using(configuration).parse(response.getBody()).read ("$['_embedded']['variantList'][0]['_links']['sources']['href']", new TypeRef<String>() { }).isEmpty()); assertFalse(JsonPath.using(configuration).parse(response.getBody()).read ("$['_embedded']['variantList'][0]['_links']['annotation']['href']", new TypeRef<String>() { }).isEmpty()); assertTrue(variantList.size() > 0); Variant variant = variantList.get(0); assertEquals("20", variant.getChromosome()); assertEquals("T", variant.getAlternate()); assertEquals("A", variant.getReference()); assertEquals(60100L, variant.getStart()); assertEquals(60100L, variant.getEnd()); }
Source:
public NetworkVmListModel() { setTitle(ConstantsManager.getInstance().getConstants().virtualMachinesTitle()); setHelpTag(HelpTag.virtual_machines); setHashName("virtual_machines"); setIsAvailable(ApplicationModeHelper.isModeSupported(ApplicationMode.VirtOnly)); setComparator(new Comparator<PairQueryable<VmNetworkInterface, VM>>() { @Override public int compare(PairQueryable<VmNetworkInterface, VM> paramT1, PairQueryable<VmNetworkInterface, VM> paramT2) { int compareValue = paramT1.getSecond().getVdsGroupName().compareTo(paramT2.getSecond().getVdsGroupName()); if (compareValue != 0) { return compareValue; } return paramT1.getSecond().getName().compareTo(paramT2.getSecond().getName()); } }); setRemoveCommand(new UICommand("Remove", this)); updateActionAvailability(); }

Target:
public NetworkVmListModel() { setTitle(ConstantsManager.getInstance().getConstants().virtualMachinesTitle()); setHelpTag(HelpTag.virtual_machines); setHashName("virtual_machines"); setAvailableInModes(ApplicationMode.VirtOnly); setComparator(new Comparator<PairQueryable<VmNetworkInterface, VM>>() { @Override public int compare(PairQueryable<VmNetworkInterface, VM> paramT1, PairQueryable<VmNetworkInterface, VM> paramT2) { int compareValue = paramT1.getSecond().getVdsGroupName().compareTo(paramT2.getSecond().getVdsGroupName()); if (compareValue != 0) { return compareValue; } return paramT1.getSecond().getName().compareTo(paramT2.getSecond().getName()); } }); setRemoveCommand(new UICommand("Remove", this)); updateActionAvailability(); }
Source:
public TestGerritClient(TaskRepository repository, AbstractWebLocation location) { super(repository, GerritFixture.current().getGerritVersion()); System.out.println("Testing against Gerrit " + GerritFixture.current().getGerritVersion()); initialize(location, null, null, null, null); }

Target:
public TestGerritClient(TaskRepository repository, AbstractWebLocation location) { super(repository, GerritFixture.current().getGerritVersion()); initialize(location, null, null, null, null); }
Source:
public static Protocol fromValue(String value) { try { return valueOf(value); } catch (IllegalArgumentException e) { return UNRECOGNIZED; } }

Target:
public static Protocol fromValue(String value) { return Enums .getIfPresent(FirewallRule.Protocol.class, value) .or(UNRECOGNIZED); }
Source:
public NBTTagCompound serializeNBT() { NBTTagList nbtTagList = new NBTTagList(); for (int i = 0; i < stacks.length; i++) { if (stacks[i] != null) { NBTTagCompound itemTag = new NBTTagCompound(); if (size < 256) itemTag.setByte("Slot", (byte) i); else itemTag.setInteger("Slot", i); stacks[i].writeToNBT(itemTag); nbtTagList.appendTag(itemTag); } } NBTTagCompound nbt = new NBTTagCompound(); nbt.setTag("Items", nbtTagList); nbt.setInteger("Size", size); return nbt; }

Target:
public NBTTagCompound serializeNBT() { NBTTagList nbtTagList = new NBTTagList(); for (int i = 0; i < stacks.length; i++) { if (stacks[i] != null) { NBTTagCompound itemTag = new NBTTagCompound(); itemTag.setInteger("Slot", i); stacks[i].writeToNBT(itemTag); nbtTagList.appendTag(itemTag); } } NBTTagCompound nbt = new NBTTagCompound(); nbt.setTag("Items", nbtTagList); nbt.setInteger("Size", stacks.length); return nbt; }
Source:
public BinaryValue getQueryInfo() { StringBuilder sb = new StringBuilder("SELECT * FROM "); sb.append(this.builder.tableName); sb.append(" WHERE PRIMARY KEY = { "); int numKeys = this.builder.keyValues.size(); for (int i = 0; i < numKeys; i++) { if (this.builder.keyValues.get(i) == null) { sb.append("NULL"); } else { sb.append(this.builder.keyValues.get(i).toString()); } if (i < numKeys-1) { sb.append(", "); } } sb.append(" }"); return BinaryValue.create(sb.toString()); }

Target:
public BinaryValue getQueryInfo() { if (this.queryInfoMessage == null) { this.queryInfoMessage = createQueryInfoMessage(); } return this.queryInfoMessage; }
Source:
private IStatus getFormPresenterStatus() { IStatus saveStatus = Status.OK_STATUS; if (formPresenterSupport != null && formPresenterSupport.getCurrentStatus() != null) { saveStatus = formPresenterSupport.getCurrentStatus(); } return saveStatus; }

Target:
private IStatus getFormPresenterStatus() { IStatus status = Status.OK_STATUS; if (formPresenterSupport.getCurrentStatus() != null) { status = formPresenterSupport.getCurrentStatus(); } return status; }
Source:
public String getProperty(String key) { if (properties != null && !properties.isEmpty()) { if (properties.containsKey(key)) { return properties.get(key); } else { String key_prefixed = TargetConstants.PREFIX_CUSTOM_PROPERTY + key; if (properties.containsKey(key_prefixed)) { return properties.get(key_prefixed); } } } return ""; }

Target:
public String getProperty(String key) { if (properties != null && !properties.isEmpty()) { if (properties.containsKey(key)) { return properties.get(key); } else { String key_prefixed = TargetConstants.PREFIX_CUSTOM_PROPERTY + key; if (properties.containsKey(key_prefixed)) { return properties.get(key_prefixed); } } } return null; }
Source:
public void parseAsList() { assertEquals(Lists.newArrayList("a"), ConfigurationUtils.parseAsList("a", ",")); assertEquals(Lists.newArrayList("a", "b", "c"), ConfigurationUtils.parseAsList("a,b,c", ",")); assertEquals(Lists.newArrayList("a", "b", "c"), ConfigurationUtils.parseAsList(" a , b , c ", ",")); assertEquals(Lists.newArrayList("a,b,c"), ConfigurationUtils.parseAsList("a,b,c", ";")); }

Target:
public void parseAsList() { assertEquals(Lists.newArrayList("a"), ConfigurationUtils.parseAsList("a", ",")); assertEquals(Lists.newArrayList("a", "b", "c"), ConfigurationUtils.parseAsList("a,b,c", ",")); assertEquals(Lists.newArrayList("a", "b", "c"), ConfigurationUtils.parseAsList(" a , b , c ", ",")); assertEquals(Lists.newArrayList("a,b,c"), ConfigurationUtils.parseAsList("a,b,c", ";")); assertEquals(Lists.newArrayList("a", "c"), ConfigurationUtils.parseAsList(",,a,,c,,", ",")); }
Source:
private List<SimpleInterval> performSNPSegmentationStep(final String sampleName, final Genome genome) { logger.info("Performing initial SNP segmentation (assuming no allelic bias)..."); final File snpSegmentFile; try { snpSegmentFile = File.createTempFile(outputPrefix + "-" + SNP_MAF_SEG_FILE_TAG + "-tmp", ".seg"); } catch (final IOException e) { throw new UserException.CouldNotCreateOutputFile("Could not create temporary SNP segmentation file.", e); } List<SimpleInterval> snpSegments = calculateAndWriteSNPSegmentation(sampleName, genome, snpSegmentFile, 1.); logger.info("Initial number of SNP segments: " + snpSegments.size()); final Set<List<SimpleInterval>> snpSegmentationsFound = new HashSet<>(); for (int numIterations = 1; numIterations <= maxNumSNPSegmentationIterations; numIterations++) { logger.info("SNP-segmentation iteration: " + numIterations); snpSegmentationsFound.add(snpSegments); final double allelicBias = calculateAllelicBias(genome, snpSegmentFile); logger.info(String.format("Mean allelic bias: %.3f", allelicBias)); snpSegments = calculateAndWriteSNPSegmentation(sampleName, genome, snpSegmentFile, allelicBias); logger.info("Number of SNP segments: " + snpSegments.size()); if (snpSegmentationsFound.contains(snpSegments)) { logger.info("Final number of SNP segments: " + snpSegments.size()); final File finalSNPSegmentFile = new File(outputPrefix + "-" + SNP_MAF_SEG_FILE_TAG + ".seg"); snpSegments = calculateAndWriteSNPSegmentation(sampleName, genome, finalSNPSegmentFile, allelicBias); break; } } return snpSegments; }

Target:
private List<SimpleInterval> performSNPSegmentationStep(final String sampleName, final Genome genome) { logger.info("Performing initial SNP segmentation (assuming no allelic bias)..."); final File snpSegmentFile; try { snpSegmentFile = File.createTempFile(outputPrefix + "-" + SNP_MAF_SEG_FILE_TAG + "-tmp", ".seg"); } catch (final IOException e) { throw new UserException.CouldNotCreateOutputFile("Could not create temporary SNP segmentation file.", e); } List<SimpleInterval> snpSegments = calculateAndWriteSNPSegmentation(sampleName, genome, snpSegmentFile, INITIAL_ALLELIC_BIAS_GUESS); logger.info("Initial number of SNP segments: " + snpSegments.size()); final Set<List<SimpleInterval>> snpSegmentationsFound = new HashSet<>(); for (int numIterations = 1; numIterations <= maxNumSNPSegmentationIterations; numIterations++) { logger.info("SNP-segmentation iteration: " + numIterations); snpSegmentationsFound.add(snpSegments); final double allelicBias = calculateAllelicBias(genome, snpSegmentFile); logger.info(String.format("Mean allelic bias: %.3f", allelicBias)); snpSegments = calculateAndWriteSNPSegmentation(sampleName, genome, snpSegmentFile, allelicBias); logger.info("Number of SNP segments: " + snpSegments.size()); if (snpSegmentationsFound.contains(snpSegments)) { logger.info("Final number of SNP segments: " + snpSegments.size()); final File finalSNPSegmentFile = new File(outputPrefix + "-" + SNP_MAF_SEG_FILE_TAG + ".seg"); snpSegments = calculateAndWriteSNPSegmentation(sampleName, genome, finalSNPSegmentFile, allelicBias); break; } } return snpSegments; }
Source:
public Object execute(ExecutionEvent event) throws ExecutionException { try { IStructuredSelection selection = (IStructuredSelection)HandlerUtil .getCurrentSelectionChecked(event); IProject project = (IProject)selection.getFirstElement(); IPreferenceStore store = PreferenceStoreManager.getPreferenceStore(project); QuestionDialog dialog = new QuestionDialog( Display.getCurrent().getActiveShell(), Messages.getString("AddC2UMLSyncNature.dialogTitle"), Messages.getString("AddC2UMLSyncNature.dialogBody"), store); int result = dialog.open(); if (result > -1) { SynchronizersManager.getSynchronizer().setInitialValues(project); if (result == 0) { syncFromSources(project); } else if (result == 1) { syncFromModel(project); } } } catch (CoreException e) { throw new ExecutionException(e.getMessage(), e); } return null; }

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { try { IStructuredSelection selection = (IStructuredSelection)HandlerUtil .getCurrentSelectionChecked(event); IProject project = (IProject)selection.getFirstElement(); IPreferenceStore store = PreferenceStoreManager.getPreferenceStore(project); QuestionDialog dialog = new QuestionDialog( Display.getCurrent().getActiveShell(), Messages.getString("AddC2UMLSyncNature.dialogTitle"), Messages.getString("AddC2UMLSyncNature.dialogBody"), store); int result = dialog.open(); if (result > -1) { IModelSynchronizer synchronizer = SynchronizersManager.getSynchronizer(); if (synchronizer != null) { synchronizer.setInitialValues(project); } if (result == 0) { syncFromSources(project); } else if (result == 1) { syncFromModel(project); } } } catch (CoreException e) { throw new ExecutionException(e.getMessage(), e); } return null; }
Source:
public void run() { while (true) { try { synchronized (gcLock) { long start = System.nanoTime(); while (openTransactions() > 0) { if ((System.nanoTime() - start) / 1000 > MAX_WAIT_FOR_TRANSACTION_MILLIS) openTransactions.clear(); Thread.sleep(MAX_WAIT_FOR_TRANSACTION_MILLIS / 20); } long ready = System.nanoTime(); target.gc().join(); long done = System.nanoTime(); Logging.LOG().info(String.format("GC took: %d ms waiting to start, %d ms in actual GC", (ready - start)/1000000, (done - ready)/1000000)); } Thread.sleep(gcPeriodMillis); } catch (Throwable t) { Logging.LOG().log(Level.WARNING, t.getMessage(), t); } } }

Target:
public void run() { while (true) { try { synchronized (gcLock) { long start = System.nanoTime(); while (openTransactions() > 0) { if ((System.nanoTime() - start) / 1_000_000 > MAX_WAIT_FOR_TRANSACTION_MILLIS) openTransactions.clear(); System.out.println("GC sleeping waiting for " + openTransactions() + " open transactions.."); Thread.sleep(100); } long ready = System.nanoTime(); target.gc().join(); long done = System.nanoTime(); Logging.LOG().info(String.format("GC took: %d ms waiting to start, %d ms in actual GC", (ready - start)/1_000_000, (done - ready)/1_000_000)); } Thread.sleep(gcPeriodMillis); } catch (Throwable t) { Logging.LOG().log(Level.WARNING, t.getMessage(), t); } } }
Source:
void removeWordAtIndex(final int index) { final int oldTopic = assignments[index]; topicCounts.compute(oldTopic, (key, oldValue) -> { if (oldValue == null) { return 0; } else { return oldValue - 1; } }); }

Target:
void removeWordAtIndex(final int index) { final int oldTopic = assignments[index]; topicCounts.compute(oldTopic, (key, oldValue) -> { if (oldValue == null || oldValue == 0) { throw new RuntimeException(String.format("The TopicCounts for %d-th word is %d", index, oldValue)); } else { return oldValue - 1; } }); }
Source:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { try { isSystemUpdatingWebView = false; return inflater.inflate(R.layout.fragment_authenticated_webview, container, false); } catch (InflateException e) { logger.error(e, true); isSystemUpdatingWebView = true; return inflater.inflate(R.layout.layout_content_error, container, false); } }

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { try { isSystemUpdatingWebView = false; return inflater.inflate(R.layout.fragment_authenticated_webview, container, false); } catch (InflateException e) { logger.error(e, true); isSystemUpdatingWebView = true; return inflater.inflate(R.layout.content_error, container, false); } }
Source:
static KeyStore createTrustStoreFromCertificates(Path path) { try { KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); keyStore.load(null, null); File[] files = getFilesForPath(path); for (File currFile : files) { keyStore.setCertificateEntry(currFile.getName(), readX509Certificate(currFile.toPath())); } return keyStore; } catch (GeneralSecurityException | IOException e) { throw Throwables.propagate(e); } }

Target:
static KeyStore createTrustStoreFromCertificates(Path path) { try { KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); keyStore.load(null, null); for (File currFile : getFilesForPath(path)) { keyStore.setCertificateEntry(currFile.getName(), readX509Certificate(currFile.toPath())); } return keyStore; } catch (GeneralSecurityException | IOException e) { throw Throwables.propagate(e); } }
Source:
public Slave(SlaveLooper slaveLooper, final Communicator<Message> streamInCommunicator, final Communicator<Message> streamOutCommunicator, final Communicator<InstanceControlMsg> inControlQueue, final Communicator<Metrics.MetricPublisherPublishMessage> metricsOutCommunicator) { this.slaveLooper = slaveLooper; this.streamInCommunicator = streamInCommunicator; this.streamOutCommunicator = streamOutCommunicator; this.inControlQueue = inControlQueue; this.metricsOutCommunicator = metricsOutCommunicator; this.serializer = SerializeDeSerializeHelper.getSerializer(helper.getTopologyContext().getTopologyConfig()); instanceState = new HashMapState<>(); isStatefulProcessingStarted = false; this.systemConfig = (SystemConfig) SingletonRegistry.INSTANCE.getSingleton(SystemConfig.HERON_SYSTEM_CONFIG); this.metricsCollector = new MetricsCollector(slaveLooper, metricsOutCommunicator); handleControlMessage(); }

Target:
public Slave(SlaveLooper slaveLooper, final Communicator<Message> streamInCommunicator, final Communicator<Message> streamOutCommunicator, final Communicator<InstanceControlMsg> inControlQueue, final Communicator<Metrics.MetricPublisherPublishMessage> metricsOutCommunicator) { this.slaveLooper = slaveLooper; this.streamInCommunicator = streamInCommunicator; this.streamOutCommunicator = streamOutCommunicator; this.inControlQueue = inControlQueue; this.metricsOutCommunicator = metricsOutCommunicator; instanceState = null; isStatefulProcessingStarted = false; this.systemConfig = (SystemConfig) SingletonRegistry.INSTANCE.getSingleton(SystemConfig.HERON_SYSTEM_CONFIG); this.metricsCollector = new MetricsCollector(slaveLooper, metricsOutCommunicator); handleControlMessage(); }
Source:
public void release(T element) { recycle(element); elements.add(element); semaphore.release(); }

Target:
public void release(T element) { try { if (recycle(element)) { elements.add(element); } } finally { semaphore.release(); } }
Source:
public MongoProviderImpl(String connectionUrl, String maxConnectionIdleTime) { MongoClientOptions.Builder clientOptionsBuilder = new MongoClientOptions.Builder(); if(StringUtils.isNotEmpty(maxConnectionIdleTime) && Integer.parseInt(maxConnectionIdleTime) > 0) { clientOptionsBuilder.maxConnectionIdleTime(Integer.parseInt(maxConnectionIdleTime)); } MongoClientURI uri = new MongoClientURI(connectionUrl, clientOptionsBuilder); definedDatabase = uri.getDatabase(); LOG.info("[MongoProvider] [constructor] creating new MongoClient for {}, {}", uri.getHosts(), (StringUtils.isEmpty(definedDatabase) ? "default database" : "database: " + definedDatabase)); mongo = new MongoClient(uri); }

Target:
public MongoProviderImpl(String connectionUrl, String maxConnectionIdleTime) { MongoClientOptions.Builder clientOptionsBuilder = new MongoClientOptions.Builder(); if(StringUtils.isNotEmpty(maxConnectionIdleTime) && Integer.parseInt(maxConnectionIdleTime) > 0) { clientOptionsBuilder.maxConnectionIdleTime(Integer.parseInt(maxConnectionIdleTime)); } MongoClientURI uri = new MongoClientURI(connectionUrl, clientOptionsBuilder); definedDatabase = uri.getDatabase(); LOG.info("[MongoProvider] [constructor] creating new MongoClient for {}, {}, maxConnectionIdleTime ms ", uri.getHosts(), (StringUtils.isEmpty(definedDatabase) ? "default database" : "database: " + definedDatabase), uri.getOptions().getMaxConnectionIdleTime()); mongo = new MongoClient(uri); }
Source:
public void initialize(BatchJoinerRuntimeContext context) { FailureCollector collector = context.getFailureCollector(); Map<String, Schema> inputSchemas = context.getInputSchemas(); init(inputSchemas, collector); collector.getOrThrowException(); outputSchema = getOutputSchema(inputSchemas, collector); if (outputSchema == null) { outputSchema = conf.getOutputSchema(collector); if (outputSchema == null) { collector.addFailure("Output schema must be specified", null).withConfigProperty(conf.OUTPUT_SCHEMA); } } collector.getOrThrowException(); }

Target:
public void initialize(BatchJoinerRuntimeContext context) { FailureCollector collector = context.getFailureCollector(); Map<String, Schema> inputSchemas = context.getInputSchemas(); init(inputSchemas, collector); collector.getOrThrowException(); outputSchema = getOutputSchema(inputSchemas, collector); collector.getOrThrowException(); }
Source:
ReviewNoteHeaderFormatter(TimeZone tz) { rfc2822DateFormatter = new SimpleDateFormat("dd MMM yyyy HH:mm:ss Z", Locale.US); rfc2822DateFormatter.setCalendar(Calendar.getInstance(tz, Locale.US)); }

Target:
ReviewNoteHeaderFormatter(TimeZone tz) { rfc2822DateFormatter = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss Z", Locale.US); rfc2822DateFormatter.setCalendar(Calendar.getInstance(tz, Locale.US)); }
Source:
public ContentBuffer(ContentResolver contentResolver, ContentWriter contentWriter, ItemsPeopleWriter peopleWriter) { this.resolver = Preconditions.checkNotNull(contentResolver); this.writer = Preconditions.checkNotNull(contentWriter); this.peopleWriter = Preconditions.checkNotNull(peopleWriter); }

Target:
public ContentBuffer(ContentResolver contentResolver, ContentWriter contentWriter, ItemsPeopleWriter peopleWriter) { this.resolver = checkNotNull(contentResolver); this.writer = checkNotNull(contentWriter); this.peopleWriter = checkNotNull(peopleWriter); }
Source:
public void invalidateCaches(Collection<Integer> recordIds) { List<Pair<String, String[]>> whereParamList = TableBuilder.sqlList(recordIds); int removed = 0; for (Pair<String, String[]> querySet : whereParamList) { removed += db.delete(TABLE_NAME, COL_APP_ID + " = '" + mAppId + "' AND " + COL_CACHE_NAME + " = '" + mCacheName + "' AND " + COL_ENTITY_KEY + " IN " + querySet.first, querySet.second); } if (SqlStorage.STORAGE_OUTPUT_DEBUG) { Log.d(TAG, "Invalidated " + removed + " cached values for bulk entities"); } }

Target:
public void invalidateCaches(Collection<Integer> recordIds) { List<Pair<String, String[]>> whereParamList = TableBuilder.sqlList(recordIds); int removed = 0; for (Pair<String, String[]> querySet : whereParamList) { removed += db.delete(TABLE_NAME, COL_CACHE_NAME + " = '" + mCacheName + "' AND " + COL_ENTITY_KEY + " IN " + querySet.first, querySet.second); } if (SqlStorage.STORAGE_OUTPUT_DEBUG) { Log.d(TAG, "Invalidated " + removed + " cached values for bulk entities"); } }
Source:
public void onConnect(Channel channel) { log.info("CONNECTED to " + host + ":" + port); synchronized(channelSync) { this.channel = channel; } }

Target:
public void onConnect(Channel channel) { log.info("Client connected to " + host + ":" + port); synchronized(channelSync) { this.channel = channel; } }
Source:
void test_getAbbreviatedName_TooLongHint(){ final String className = "java.lang.String"; Assertions.assertSame(className, ClassUtils.getAbbreviatedName(className, className.length()+1)); Assertions.assertSame(className, ClassUtils.getAbbreviatedName(className, className.length())); }

Target:
public void test_getAbbreviatedName_TooLongHint(){ final String className = "java.lang.String"; Assertions.assertSame(className, ClassUtils.getAbbreviatedName(className, className.length()+1)); Assertions.assertSame(className, ClassUtils.getAbbreviatedName(className, className.length())); }
Source:
public Condition getConditionByUuid(String uuid) { if(log.isInfoEnabled()){ log.info("Getting condition with uuid " + uuid); } return conditionDAO.getConditionByUuid(uuid); }

Target:
public Condition getConditionByUuid(String uuid) { return conditionDAO.getConditionByUuid(uuid); }
Source:
public String show(Request request, Response response) throws IOException { ArtifactStore artifactStore = getEntityFromConfig(request.params("store_id")); if (isGetOrHeadRequestFresh(request, artifactStore)) { return notModified(response); } else { setEtagHeader(artifactStore, response); return writerForTopLevelObject(request, response, writer -> ArtifactStoreRepresenter.toJSON(writer, artifactStore)); } }

Target:
public String show(Request request, Response response) throws IOException { ArtifactStore artifactStore = getEntityFromConfig(request.params(ID_PARAM)); if (isGetOrHeadRequestFresh(request, artifactStore)) { return notModified(response); } else { setEtagHeader(artifactStore, response); return writerForTopLevelObject(request, response, writer -> ArtifactStoreRepresenter.toJSON(writer, artifactStore)); } }
Source:
public @Nonnull FormValidation doCheckNewName(@QueryParameter String newName) { if (!isNameEditable()) { return FormValidation.error("This item has not an editable name."); } if (!hasPermission(Item.CONFIGURE)) { if (parent instanceof AccessControlled) { ((AccessControlled)parent).checkPermission(Item.CREATE); } checkPermission(Item.DELETE); } newName = newName == null ? null : newName.trim(); try { Jenkins.checkGoodName(newName); assert newName != null; if (newName.equals(name)) { return FormValidation.warning(Messages.AbstractItem_NewNameUnchanged()); } Jenkins.get().getProjectNamingStrategy().checkName(newName); checkIfNameIsUsed(newName); checkRename(newName); } catch (Failure e) { return FormValidation.error(e.getMessage()); } return FormValidation.ok(); }

Target:
public @Nonnull FormValidation doCheckNewName(@QueryParameter String newName) { if (!isNameEditable()) { return FormValidation.error("Trying to rename an item that does not support this operation."); } if (!hasPermission(Item.CONFIGURE)) { if (parent instanceof AccessControlled) { ((AccessControlled)parent).checkPermission(Item.CREATE); } checkPermission(Item.DELETE); } newName = newName == null ? null : newName.trim(); try { Jenkins.checkGoodName(newName); assert newName != null; if (newName.equals(name)) { return FormValidation.warning(Messages.AbstractItem_NewNameUnchanged()); } Jenkins.get().getProjectNamingStrategy().checkName(newName); checkIfNameIsUsed(newName); checkRename(newName); } catch (Failure e) { return FormValidation.error(e.getMessage()); } return FormValidation.ok(); }
Source:
public synchronized XmlXYDataProvider getXyProvider(@NonNull ITmfTrace trace, @NonNull Element viewElement) { if (fXyProviders.contains(trace, viewElement)) { return fXyProviders.get(trace, viewElement); } Set<String> analysisIds = TmfXmlUtils.getViewAnalysisIds(viewElement); Element entry = TmfXmlUtils.getChildElements(viewElement, TmfXmlStrings.ENTRY_ELEMENT).get(0); XmlXYDataProvider provider = XmlXYDataProvider.create(trace, analysisIds, entry); fXyProviders.put(trace, viewElement, provider); return provider; }

Target:
public synchronized XmlXYDataProvider getXyProvider(@NonNull ITmfTrace trace, @NonNull Element viewElement) { if (fXyProviders.contains(trace, viewElement)) { return fXyProviders.get(trace, viewElement); } @NonNull Set<@NonNull String> analysisIds = TmfXmlUtils.getViewAnalysisIds(viewElement); Element entry = TmfXmlUtils.getChildElements(viewElement, TmfXmlStrings.ENTRY_ELEMENT).get(0); XmlXYDataProvider provider = XmlXYDataProvider.create(trace, analysisIds, entry); fXyProviders.put(trace, viewElement, provider); return provider; }
Source:
public void shouldFailUpdateMainContentAlreadyInColdStorage() throws IOException { DocumentModel documentModel = createFileDocument(DEFAULT_DOC_NAME, true); moveAndVerifyContent(session, documentModel); documentModel = session.getDocument(documentModel.getRef()); documentModel.setPropertyValue(ColdStorageHelper.FILE_CONTENT_PROPERTY, (Serializable) Blobs.createBlob(FILE_CONTENT)); try { session.saveDocument(documentModel); fail("Should fail because a main content document in cold storage cannot be updated."); } catch (NuxeoException e) { assertEquals(SC_FORBIDDEN, e.getStatusCode()); assertEquals( String.format("The main content of document: %s cannot be updated. It's already in cold storage.", documentModel.getId()), e.getMessage()); } documentModel = session.getDocument(documentModel.getRef()); documentModel.setPropertyValue("dc:title", "I update the title"); documentModel.setPropertyValue("dc:description", "I add a description"); var attachments = List.of(Map.of("file", Blobs.createBlob("bar", "text/plain"))); documentModel.setPropertyValue("files:files", (Serializable) attachments); documentModel = session.saveDocument(documentModel); assertEquals("I update the title", documentModel.getPropertyValue("dc:title")); assertEquals("I add a description", documentModel.getPropertyValue("dc:description")); attachments = (List<Map<String, Blob>>) documentModel.getPropertyValue("files:files"); assertEquals(1, attachments.size()); assertNotNull(attachments.get(0).get("file")); assertEquals("bar", attachments.get(0).get("file").getString()); }

Target:
public void shouldFailUpdateMainContentAlreadyInColdStorage() throws IOException { DocumentModel documentModel = createFileDocument(DEFAULT_DOC_NAME, true); moveAndVerifyContent(session, documentModel); documentModel.refresh(); documentModel.setPropertyValue(ColdStorageHelper.FILE_CONTENT_PROPERTY, (Serializable) Blobs.createBlob(FILE_CONTENT)); try { session.saveDocument(documentModel); fail("Should fail because a main content document in cold storage cannot be updated."); } catch (NuxeoException e) { assertEquals(SC_FORBIDDEN, e.getStatusCode()); assertEquals( String.format("The main content of document: %s cannot be updated. It's already in cold storage.", documentModel), e.getMessage()); } documentModel.refresh(); documentModel.setPropertyValue("dc:title", "I update the title"); documentModel.setPropertyValue("dc:description", "I add a description"); var attachments = List.of(Map.of("file", Blobs.createBlob("bar", "text/plain"))); documentModel.setPropertyValue("files:files", (Serializable) attachments); documentModel = session.saveDocument(documentModel); assertEquals("I update the title", documentModel.getPropertyValue("dc:title")); assertEquals("I add a description", documentModel.getPropertyValue("dc:description")); var actualAttachments = (List<Map<String, Blob>>) documentModel.getPropertyValue("files:files"); assertTrue(CollectionUtils.isEqualCollection(attachments, actualAttachments)); }
Source:
Map createRequestDataMap(Stage stage) { Map<String, Object> data = new LinkedHashMap<String, Object>(); data.put("pipeline-name", stage.getIdentifier().getPipelineName()); data.put("pipeline-counter", new Integer(stage.getIdentifier().getPipelineCounter()).toString()); data.put("stage-name", stage.getIdentifier().getStageName()); data.put("stage-counter", stage.getIdentifier().getStageCounter()); data.put("stage-state", stage.getState().toString()); data.put("stage-result", stage.getResult().toString()); Pipeline pipeline = pipelineService.fullPipelineById(stage.getPipelineId()); Map<String, Object> pipelineMap = createPipelineDataMap(pipeline); data.put("pipeline", pipelineMap); return data; }

Target:
Map createRequestDataMap(Stage stage) { Map<String, Object> data = new LinkedHashMap<String, Object>(); String pipelineName = stage.getIdentifier().getPipelineName(); Integer pipelineCounter = new Integer(stage.getIdentifier().getPipelineCounter()); Map<String, Object> pipelineMap = createPipelineDataMap(pipelineName, pipelineCounter, stage); data.put("pipeline", pipelineMap); return data; }
Source:
public Iterable<Branch> iterate() { return new MkIterable<Branch>( this.storage, String.format("%s/branch", this.xpath()), new MkIterable.Mapping<Branch>() { @Override public Branch map(final XML xml) { return new MkBranch( MkBranches.this.storage, MkBranches.this.self, MkBranches.this.coords, xml.xpath("@name").get(0), xml.xpath(XPATH_TO_SHA).get(0) ); } } ); }

Target:
public Iterable<Branch> iterate() { return new MkIterable<Branch>( this.storage, String.format("%s/branch", this.xpath()), new MkIterable.Mapping<Branch>() { @Override public Branch map(final XML xml) { return new MkBranch( MkBranches.this.storage, MkBranches.this.self, MkBranches.this.coords, xml.xpath("@name").get(0), xml.xpath(MkBranches.XPATH_TO_SHA).get(0) ); } } ); }
Source:
public static void reload(GerritClient gerrit, ChangeInfo toRefresh) { ChangeInfo newChangeInfo = QueryHelpers.queryMessageTab(gerrit, toRefresh.getId()); toRefresh.set_number(newChangeInfo.get_number()); toRefresh.setChange_id(newChangeInfo.getChange_id()); toRefresh.setStatus(newChangeInfo.getStatus()); toRefresh.setStarred(newChangeInfo.isStarred()); toRefresh.setSubject(newChangeInfo.getSubject()); toRefresh.setCreated(newChangeInfo.getCreated()); toRefresh.setUpdated(newChangeInfo.getUpdated()); toRefresh.setReviewed(newChangeInfo.isReviewed()); toRefresh.setMergeable(newChangeInfo.isMergeable()); toRefresh.setInsertions(newChangeInfo.getInsertions()); toRefresh.setDeletions(newChangeInfo.getDeletions()); toRefresh.setCurrent_revision(newChangeInfo.getCurrent_revision()); toRefresh.setTopic(newChangeInfo.getTopic()); toRefresh.setMergeable(newChangeInfo.isMergeable()); toRefresh.getLabels().clear(); toRefresh.getLabels().addAll(newChangeInfo.getLabels()); toRefresh.getMessages().clear(); toRefresh.getMessages().addAll(newChangeInfo.getMessages()); toRefresh.getPermitted_labels().clear(); toRefresh.getPermitted_labels().addAll(newChangeInfo.getPermitted_labels()); toRefresh.getActions().clear(); toRefresh.getActions().addAll(newChangeInfo.getActions()); mergeRevisions(toRefresh, newChangeInfo); }

Target:
public static void reload(GerritClient gerrit, ChangeInfo toRefresh) { ChangeInfo newChangeInfo = QueryHelpers.queryMessageTab(gerrit, toRefresh.getId()); toRefresh.set_number(newChangeInfo.get_number()); toRefresh.setChange_id(newChangeInfo.getChange_id()); toRefresh.setStatus(newChangeInfo.getStatus()); toRefresh.setStarred(newChangeInfo.isStarred()); toRefresh.setSubject(newChangeInfo.getSubject()); toRefresh.setCreated(newChangeInfo.getCreated()); toRefresh.setUpdated(newChangeInfo.getUpdated()); toRefresh.setReviewed(newChangeInfo.isReviewed()); toRefresh.setInsertions(newChangeInfo.getInsertions()); toRefresh.setDeletions(newChangeInfo.getDeletions()); toRefresh.setCurrent_revision(newChangeInfo.getCurrent_revision()); toRefresh.setTopic(newChangeInfo.getTopic()); toRefresh.setMergeable(newChangeInfo.isMergeable()); toRefresh.getLabels().clear(); toRefresh.getLabels().addAll(newChangeInfo.getLabels()); toRefresh.getMessages().clear(); toRefresh.getMessages().addAll(newChangeInfo.getMessages()); toRefresh.getPermitted_labels().clear(); toRefresh.getPermitted_labels().addAll(newChangeInfo.getPermitted_labels()); toRefresh.getActions().clear(); toRefresh.getActions().addAll(newChangeInfo.getActions()); mergeRevisions(toRefresh, newChangeInfo); }
Source:
public OutputStream createFile(final Path path, final FileSystem.Statistics statistics, final boolean overwrite, final FsPermission permission, final FsPermission umask) throws AzureBlobFileSystemException { try (AbfsPerfInfo perfInfo = startTracking("createFile", "createPath")) { boolean isNamespaceEnabled = getIsNamespaceEnabled(); LOG.debug("createFile filesystem: path: overwrite: permission: umask: isNamespaceEnabled: {}", client.getFileSystem(), path, overwrite, permission.toString(), umask.toString(), isNamespaceEnabled); final AbfsRestOperation op = client.createPath(AbfsHttpConstants.FORWARD_SLASH + getRelativePath(path), true, overwrite, isNamespaceEnabled ? getOctalNotation(permission) : null, isNamespaceEnabled ? getOctalNotation(umask) : null); perfInfo.registerResult(op.getResult()).registerSuccess(true); return new AbfsOutputStream( client, statistics, AbfsHttpConstants.FORWARD_SLASH + getRelativePath(path), 0, abfsConfiguration.getWriteBufferSize(), abfsConfiguration.isFlushEnabled(), abfsConfiguration.isOutputStreamFlushDisabled()); } }

Target:
public OutputStream createFile(final Path path, final FileSystem.Statistics statistics, final boolean overwrite, final FsPermission permission, final FsPermission umask) throws AzureBlobFileSystemException { try (AbfsPerfInfo perfInfo = startTracking("createFile", "createPath")) { boolean isNamespaceEnabled = getIsNamespaceEnabled(); LOG.debug("createFile filesystem: path: overwrite: permission: umask: isNamespaceEnabled: {}", client.getFileSystem(), path, overwrite, permission.toString(), umask.toString(), isNamespaceEnabled); boolean appendBlob = false; if (isAppendBlobKey(path.toString())) { appendBlob = true; } client.createPath(AbfsHttpConstants.FORWARD_SLASH + getRelativePath(path), true, overwrite, isNamespaceEnabled ? getOctalNotation(permission) : null, isNamespaceEnabled ? getOctalNotation(umask) : null, appendBlob); return new AbfsOutputStream( client, statistics, AbfsHttpConstants.FORWARD_SLASH + getRelativePath(path), 0, abfsConfiguration.getWriteBufferSize(), abfsConfiguration.isFlushEnabled(), abfsConfiguration.isOutputStreamFlushDisabled(), abfsConfiguration.isAppendWithFlushEnabled(), appendBlob); } }
Source:
public static void loadZombiePlayer(GenericController rc) { Class playerClass; try { ClassLoader icl = new IndividualClassLoader("ZombiePlaer", _debugMethodsEnabled, false, true); playerClass = icl.loadClass("ZombiePlayer"); } catch (InstrumentationException ie) { System.out.println("[Engine] Error during instrumentation of " + rc.getRobot().toString() + ".\n[Engine] Robot will self-destruct in 3...2...1..."); rc.getRobot().suicide(); return; } catch (Exception e) { ErrorReporter.report(e); rc.getRobot().suicide(); return; } new ScheduledRunnable(new RobotRunnable(playerClass, rc), rc.getRobot().getID()); }

Target:
public static void loadZombiePlayer(GenericController rc) { Class playerClass; try { ClassLoader icl = new IndividualClassLoader("ZombiePlayer", _debugMethodsEnabled, false, true); playerClass = icl.loadClass("ZombiePlayer.ZombiePlayer"); } catch (InstrumentationException ie) { System.out.println("[Engine] Error during instrumentation of " + rc.getRobot().toString() + ".\n[Engine] Robot will self-destruct in 3...2...1..."); rc.getRobot().suicide(); return; } catch (Exception e) { ErrorReporter.report(e); rc.getRobot().suicide(); return; } new ScheduledRunnable(new RobotRunnable(playerClass, rc), rc.getRobot().getID()); }
Source:
private static Set<Set<Integer>> getAllJoiningColumns(RexCall joinCondition) { if (joinCondition.isA(SqlKind.AND)) { final Set<Set<Integer>> r = new HashSet<>(); joinCondition.getOperands() .forEach(node -> { if (node instanceof RexCall) { final Pair<Integer, Integer> columnPair = getJoiningColumns((RexCall) node); if (columnPair != null) { final Integer fst = columnPair.getFirst(), snd = columnPair.getSecond(); final AtomicBoolean updated = new AtomicBoolean(false); for (Set<Integer> entry : r) { if (entry.contains(fst) || entry.contains(snd)) { entry.add(fst); entry.add(snd); updated.set(true); break; } } if (! updated.get()) { r.add(new HashSet<Integer>() {{ add(columnPair.getFirst()); add(columnPair.getSecond()); }}); } } } }); return r; } else { final Pair<Integer, Integer> pair = getJoiningColumns(joinCondition); if (pair == null) { return new HashSet<>(); } else { return Collections.singleton(new HashSet<Integer>(){{ add(pair.getFirst()); add(pair.getSecond()); }}); } } }

Target:
private static Set<Set<Integer>> getAllJoiningColumns(RexCall joinCondition) { final Set<Set<Integer>> r = new HashSet<>(); if (joinCondition.isA(SqlKind.AND)) { joinCondition.getOperands().stream().filter(node -> node instanceof RexCall) .forEach(node -> getJoiningColumns((RexCall) node).ifPresent(columnPair -> { final Integer fst = columnPair.getFirst(), snd = columnPair.getSecond(); boolean updated = false; for (Set<Integer> entry : r) { if (entry.contains(fst) || entry.contains(snd)) { entry.add(fst); entry.add(snd); updated = true; break; } } if (! updated) { r.add(new HashSet<Integer>() {{ add(columnPair.getFirst()); add(columnPair.getSecond()); }}); } })); } else { getJoiningColumns(joinCondition).ifPresent(pair -> r.add(new HashSet<Integer>(){{ add(pair.getFirst()); add(pair.getSecond()); }})); } return r; }
Source:
public SimpleVersionedSerializerTypeSerializerProxy( SerializableSupplier<SimpleVersionedSerializer<T>> serializerSupplier) { this.serializerSupplier = serializerSupplier; }

Target:
public SimpleVersionedSerializerTypeSerializerProxy( SerializableSupplier<SimpleVersionedSerializer<T>> serializerSupplier) { this.serializerSupplier = checkNotNull(serializerSupplier, "serializerSupplier"); }
Source:
private RexNode simplifyOrs(List<RexNode> terms, RexUnknownAs unknownAs) { final Map<RexNode, Comparison> notEqualsComparisonMap = new HashMap<>(); for (int i = 0; i < terms.size(); i++) { final RexNode term = terms.get(i); switch (term.getKind()) { case LITERAL: if (RexLiteral.isNullLiteral(term)) { if (unknownAs == FALSE) { terms.remove(i); --i; continue; } } else { if (RexLiteral.booleanValue(term)) { return term; } else { terms.remove(i); --i; continue; } } break; case NOT_EQUALS: Comparison notEqualsComparison = Comparison.of(term, node -> RexUtil.isReferenceOrAccess(node, false)); if (notEqualsComparison != null) { Comparison prevNotEqualsComparison = notEqualsComparisonMap.get(notEqualsComparison.ref); if (prevNotEqualsComparison == null) { notEqualsComparisonMap.put(notEqualsComparison.ref, notEqualsComparison); } else { Comparable comparable1 = notEqualsComparison.literal.getValue(); Comparable comparable2 = prevNotEqualsComparison.literal.getValue(); if (comparable1.compareTo(comparable2) != 0) { return rexBuilder.makeLiteral(true); } } } break; } terms.set(i, term); } return RexUtil.composeDisjunction(rexBuilder, terms); }

Target:
private RexNode simplifyOrs(List<RexNode> terms, RexUnknownAs unknownAs) { final Map<RexNode, RexNode> notEqualsComparisonMap = new HashMap<>(); final RexLiteral trueLiteral = rexBuilder.makeLiteral(true); for (int i = 0; i < terms.size(); i++) { final RexNode term = terms.get(i); switch (term.getKind()) { case LITERAL: if (RexLiteral.isNullLiteral(term)) { if (unknownAs == FALSE) { terms.remove(i); --i; continue; } else if (unknownAs == TRUE) { return trueLiteral; } } else { if (RexLiteral.booleanValue(term)) { return term; } else { terms.remove(i); --i; continue; } } break; case NOT_EQUALS: final Comparison notEqualsComparison = Comparison.of(term); if (notEqualsComparison != null) { final RexNode prevNotEquals = notEqualsComparisonMap.get(notEqualsComparison.ref); if (prevNotEquals == null) { notEqualsComparisonMap.put(notEqualsComparison.ref, term); } else { if (prevNotEquals.getKind() != SqlKind.IS_NOT_NULL) { final Comparable comparable1 = notEqualsComparison.literal.getValue(); final Comparable comparable2 = Comparison.of(prevNotEquals).literal.getValue(); if (comparable1.compareTo(comparable2) != 0) { final RexNode isNotNull = rexBuilder.makeCall(SqlStdOperatorTable.IS_NOT_NULL, notEqualsComparison.ref); final RexNode constantNull = rexBuilder.makeNullLiteral(trueLiteral.getType()); final RexNode newCondition = simplify( rexBuilder.makeCall(SqlStdOperatorTable.OR, isNotNull, constantNull), unknownAs); if (newCondition.isAlwaysTrue()) { return trueLiteral; } notEqualsComparisonMap.put(notEqualsComparison.ref, isNotNull); final int pos = terms.indexOf(prevNotEquals); terms.set(pos, newCondition); } } terms.remove(i); --i; continue; } } break; } terms.set(i, term); } return RexUtil.composeDisjunction(rexBuilder, terms); }
Source:
public AccountGroup.Id call() throws OrmException, NameAlreadyUsedException { final PerformCreateGroup performCreateGroup = performCreateGroupFactory.create(); final Account.Id me = user.getAccountId(); return performCreateGroup.createGroup(groupName, null, null, new Account.Id[] { me }, null); }

Target:
public AccountGroup.Id call() throws OrmException, NameAlreadyUsedException { final PerformCreateGroup performCreateGroup = performCreateGroupFactory.create(); final Account.Id me = user.getAccountId(); return performCreateGroup.createGroup(groupName, null, false, null, Collections.singleton(me), null); }
Source:
public void registerDevice( List<String> channels, Date expiration, AsyncCallback<String> callback ) throws BackendlessException { if( !BackendlessPushService.isFCM( ContextHandler.getAppContext() ) ) throw new IllegalStateException( "The method is intended only for FireBase messaging." ); if( channels == null || channels.isEmpty() || (channels.size() == 1 && (channels.get( 0 ) == null || channels.get( 0 ).isEmpty())) ) channels = Collections.singletonList( DEFAULT_CHANNEL_NAME ); for( String channel : channels ) checkChannelName( channel ); long expirationMs = 0; if( expiration != null) if (expiration.before( Calendar.getInstance().getTime() ) ) throw new IllegalArgumentException( ExceptionMessage.WRONG_EXPIRATION_DATE ); else expirationMs = expiration.getTime(); FCMRegistration.registerDevice( ContextHandler.getAppContext(), channels, expirationMs, callback ); }

Target:
public void registerDevice( List<String> channels, Date expiration, AsyncCallback<String> callback ) { if( !BackendlessPushService.isFCM( ContextHandler.getAppContext() ) ) throw new IllegalStateException( "The method is intended only for FireBase messaging." ); if( channels == null || channels.isEmpty() || (channels.size() == 1 && (channels.get( 0 ) == null || channels.get( 0 ).isEmpty())) ) { channels = Collections.singletonList( DEFAULT_CHANNEL_NAME ); } for( String channel : channels ) checkChannelName( channel ); long expirationMs = 0; if( expiration != null) { if( expiration.before( Calendar.getInstance().getTime() ) ) throw new IllegalArgumentException( ExceptionMessage.WRONG_EXPIRATION_DATE ); else expirationMs = expiration.getTime(); } FCMRegistration.registerDevice( ContextHandler.getAppContext(), channels, expirationMs, callback ); }
Source:
private Properties initProperties() throws MojoExecutionException { if (generateGitPropertiesFile) { return properties = new Properties(); } else { return properties = project.getProperties(); } }

Target:
private Properties initProperties() throws GitCommitIdExecutionException { if (generateGitPropertiesFile) { return properties = new Properties(); } else { return properties = project.getProperties(); } }