auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
NatsPollingConsumer(Properties natsProperties, long scanInterval, String name) { this.natsProperties = natsProperties; this.scanInterval = scanInterval; this.name = name; this.subject = natsProperties.getProperty(NatsConstants.SUBJECT); }

Target:
NatsPollingConsumer(Properties natsProperties, long scanInterval, String name) { this.natsProperties = natsProperties; this.scanInterval = scanInterval; this.name = name; this.subject = natsProperties.getProperty(NatsConstants.SUBJECT); if (subject == null) throw new SynapseException("NATS subject cannot be null."); }
Source:
protected List<String> getClasspath(JBossServer server, IJBossServerRuntime runtime, List<String> currentClasspath) throws CoreException { IVMInstall vmInstall = runtime.getVM(); IRuntimeClasspathEntry modulesEntry = LaunchConfigUtils.getModulesClasspathEntry(server); IRuntimeClasspathEntry jreEntry = LaunchConfigUtils.getJREEntry(vmInstall); String modulesMemento = modulesEntry.getMemento(); String jreMemento = jreEntry.getMemento(); List<String> classpath = new ArrayList<String>(); classpath.addAll(currentClasspath); if( !classpath.contains(modulesMemento)) classpath.add(modulesMemento); if( !classpath.contains(jreMemento)) classpath.add(jreMemento); return classpath; }

Target:
protected List<String> getClasspath(JBossServer server, IJBossServerRuntime runtime, List<String> currentClasspath) throws CoreException { IVMInstall vmInstall = runtime.getVM(); IRuntimeClasspathEntry modulesEntry = LaunchConfigUtils.getModulesClasspathEntry(server); IRuntimeClasspathEntry jreEntry = LaunchConfigUtils.getJREEntry(vmInstall); String modulesMemento = modulesEntry == null ? null : modulesEntry.getMemento(); String jreMemento = jreEntry == null ? null : jreEntry.getMemento(); List<String> classpath = new ArrayList<String>(); classpath.addAll(currentClasspath); if( modulesMemento != null && !classpath.contains(modulesMemento)) classpath.add(modulesMemento); if( jreMemento != null && !classpath.contains(jreMemento)) classpath.add(jreMemento); return classpath; }
Source:
private List<PatchSet> getPatchSets29(final String changeInfoId, int reviewId, IProgressMonitor monitor) throws GerritException { List<PatchSet> patchSets = new ArrayList<PatchSet>(); String query = "/changes/?q=" + reviewId + "&o=ALL_REVISIONS"; ChangeInfo29[] changeInfo = (ChangeInfo29[]) getChangeInfo29(query, ChangeInfo29[].class, monitor); for (ChangeInfo element : changeInfo) { for (Entry<String, RevisionInfo> revisionInfo : element.getRevisions().entrySet()) { PatchSet.Id patchSetId = new PatchSet.Id(new Change.Id(reviewId), revisionInfo.getValue().getNumber()); patchSets.add(new PatchSet(patchSetId)); } } Collections.sort(patchSets, new Comparator<PatchSet>() { @Override public int compare(PatchSet p1, PatchSet p2) { return p1.getPatchSetId() - p2.getPatchSetId(); } }); return patchSets; }

Target:
private List<PatchSet> getPatchSets29(final String changeInfoId, int reviewId, IProgressMonitor monitor) throws GerritException { List<PatchSet> patchSets = new ArrayList<PatchSet>(); String query = "/changes/?q=" + changeInfoId + "+change:" + reviewId + "&o=ALL_REVISIONS"; ChangeInfo29[] changeInfo = (ChangeInfo29[]) getChangeInfo29(query, ChangeInfo29[].class, monitor); for (ChangeInfo element : changeInfo) { for (Entry<String, RevisionInfo> revisionInfo : element.getRevisions().entrySet()) { PatchSet.Id patchSetId = new PatchSet.Id(new Change.Id(reviewId), revisionInfo.getValue().getNumber()); patchSets.add(new PatchSet(patchSetId)); } } Collections.sort(patchSets, new Comparator<PatchSet>() { @Override public int compare(PatchSet p1, PatchSet p2) { return p1.getPatchSetId() - p2.getPatchSetId(); } }); return patchSets; }
Source:
public String doLayout(HttpRequestEvent event) { StringBuilder builder = new StringBuilder(); String contentInterarrivalStats = null; DoubleSummaryStats stats = event.getResponseContentInterarrivalStats(); if (stats != null) { contentInterarrivalStats = format("%.2f, %.2f, %.2f, %d", stats.getMin(), stats.getAverage(), stats.getMax(), stats.getCount()); } builder.append(ISO_FORMATTER.format(event.getTimeStamp())) .append('\t') .append(event.getClientAddress()) .append('\t') .append(event.getStreamId()) .append('\t') .append(event.getProtocolVersion()) .append('\t') .append(event.getMethod()) .append('\t') .append(event.getRequestUri()) .append('\t') .append(event.getUser()) .append('\t') .append(event.getAgent()) .append('\t') .append(event.getResponseCode()) .append('\t') .append(event.getRequestSize()) .append('\t') .append(event.getResponseSize()) .append('\t') .append(event.getBeginToDispatchMillis()) .append('\t') .append(event.getBeginToEndMillis()) .append('\t') .append(event.getFirstToLastContentTimeInMillis()) .append('\t') .append(event.getTimeToLastByte()) .append('\t') .append(event.getTraceToken()) .append('\t') .append(contentInterarrivalStats) .append('\n'); return builder.toString(); }

Target:
public String doLayout(HttpRequestEvent event) { StringBuilder builder = new StringBuilder(); String contentInterarrivalStats = null; DoubleSummaryStats stats = event.getResponseContentInterarrivalStats(); if (stats != null) { contentInterarrivalStats = format("%.2f, %.2f, %.2f, %d", stats.getMin(), stats.getAverage(), stats.getMax(), stats.getCount()); } builder.append(ISO_FORMATTER.format(event.getTimeStamp())) .append('\t') .append(event.getClientAddress()) .append('\t') .append(event.getMethod()) .append('\t') .append(event.getRequestUri()) .append('\t') .append(event.getUser()) .append('\t') .append(event.getAgent()) .append('\t') .append(event.getResponseCode()) .append('\t') .append(event.getRequestSize()) .append('\t') .append(event.getResponseSize()) .append('\t') .append(event.getTimeToLastByte()) .append('\t') .append(event.getTraceToken()) .append('\t') .append(event.getProtocolVersion()) .append('\t') .append(event.getBeginToDispatchMillis()) .append('\t') .append(event.getBeginToEndMillis()) .append('\t') .append(event.getFirstToLastContentTimeInMillis()) .append('\t') .append(contentInterarrivalStats) .append('\n'); return builder.toString(); }
Source:
public void afterPropertiesSet() { eventBus.register(this); forgedAlliancePreferences = preferencesService.getPreferences().getForgedAlliance(); Vault vault = clientProperties.getVault(); this.mapDownloadUrlFormat = vault.getMapDownloadUrlFormat(); this.mapPreviewUrlFormat = vault.getMapPreviewUrlFormat(); installedSkirmishMaps = FXCollections.observableArrayList(); mapsByFolderName = new HashMap<>(); installedSkirmishMaps.addListener((ListChangeListener<MapBean>) change -> { while (change.next()) { for (MapBean mapBean : change.getRemoved()) { mapsByFolderName.remove(mapBean.getFolderName().toLowerCase()); } for (MapBean mapBean : change.getAddedSubList()) { mapsByFolderName.put(mapBean.getFolderName().toLowerCase(), mapBean); } } }); JavaFxUtil.addListener(forgedAlliancePreferences.pathProperty(), observable -> tryLoadMaps()); JavaFxUtil.addListener(forgedAlliancePreferences.customMapsDirectoryProperty(), observable -> tryLoadMaps()); tryLoadMaps(); }

Target:
public void afterPropertiesSet() { eventBus.register(this); JavaFxUtil.addListener(forgedAlliancePreferences.pathProperty(), observable -> tryLoadMaps()); JavaFxUtil.addListener(forgedAlliancePreferences.customMapsDirectoryProperty(), observable -> tryLoadMaps()); tryLoadMaps(); }
Source:
public void testCreate() { Book book = mock(Book.class); DataStoreTransaction tx = mock(DataStoreTransaction.class); when(tx.createNewObject(Book.class)).thenReturn(book); RequestScope scope = new RequestScope(null, null, tx, new User(1), null, getElideSettings(null, dictionary, MOCK_AUDIT_LOGGER)); PersistentResource resource = PersistentResource.createObject(null, Book.class, scope, java.util.Optional.of("uuid")); resource.setValue("title", "should not affect calls since this is create!"); Assert.assertNotNull(resource); scope.runQueuedPreSecurityTriggers(); verify(book, times(1)).onCreateBook(scope); verify(book, times(0)).onDeleteBook(scope); verify(book, times(0)).onUpdateTitle(scope); verify(book, times(1)).preRead(scope); scope.runQueuedPreCommitTriggers(); verify(book, times(1)).preCreateBook(scope); verify(book, times(0)).preDeleteBook(scope); verify(book, times(0)).preUpdateTitle(scope); verify(book, times(1)).preCommitRead(scope); scope.runQueuedPostCommitTriggers(); verify(book, times(1)).postCreateBook(scope); verify(book, times(0)).postDeleteBook(scope); verify(book, times(0)).postUpdateTitle(scope); verify(book, times(1)).postRead(scope); }

Target:
public void testCreate() { Book book = mock(Book.class); DataStoreTransaction tx = mock(DataStoreTransaction.class); when(tx.createNewObject(Book.class)).thenReturn(book); RequestScope scope = new RequestScope(null, null, tx, new User(1), null, getElideSettings(null, dictionary, MOCK_AUDIT_LOGGER)); PersistentResource resource = PersistentResource.createObject(null, Book.class, scope, Optional.of("uuid")); resource.setValue("title", "should not affect calls since this is create!"); Assert.assertNotNull(resource); scope.runQueuedPreSecurityTriggers(); verify(book, times(1)).onCreateBook(scope); verify(book, times(0)).onDeleteBook(scope); verify(book, times(0)).onUpdateTitle(scope); verify(book, times(1)).preRead(scope); scope.runQueuedPreCommitTriggers(); verify(book, times(1)).preCreateBook(scope); verify(book, times(0)).preDeleteBook(scope); verify(book, times(0)).preUpdateTitle(scope); verify(book, times(1)).preCommitRead(scope); scope.runQueuedPostCommitTriggers(); verify(book, times(1)).postCreateBook(scope); verify(book, times(0)).postDeleteBook(scope); verify(book, times(0)).postUpdateTitle(scope); verify(book, times(1)).postRead(scope); }
Source:
public Integer getCutsRemaining() { Integer cutsConsumed = 0; for (Sample child : getChildren()) { if (child instanceof SampleLCMTube && ((SampleLCMTube) child).getCutsConsumed() != null) { cutsConsumed += ((SampleLCMTube) child).getCutsConsumed(); } } return (getCuts() - getDiscards() - cutsConsumed); }

Target:
public Integer getCutsRemaining() { int cutsConsumed = 0; for (Sample child : getChildren()) { if (child != null && child instanceof SampleLCMTube && ((SampleLCMTube) child).getCutsConsumed() != null) { cutsConsumed += ((SampleLCMTube) child).getCutsConsumed(); } } return (getCuts() - getDiscards() - cutsConsumed); }
Source:
public void setSeed(long seed) { ObfuscationReflectionHelper.setPrivateValue(WorldInfo.class, this.worldInfo, seed, "randomSeed"); this.rand.setSeed(seed); }

Target:
public void setSeed(long seed) { this.worldInfo.randomSeed = seed; this.rand.setSeed(seed); }
Source:
protected void doWork(ProductInterface product) throws Exception { long millis = System.currentTimeMillis(); try { worker.doWork(); } catch (Exception e) { System.out.printf("%s: Product %s: EXCEPTION %s (time: %s)%n", Calendar.getInstance().getTime().toString(), product.getName(), e.getMessage(), (System.currentTimeMillis() - millis) / 1000); if (errorCount.incrementAndGet() > MAX_ERRORS) { e.printStackTrace(); throw new BenchmarkException(e); } else { System.err.printf("%s: %s%n", getProductWorker().getName(), e.getMessage()); } } }

Target:
protected void doWork(ProductInterface product) throws Exception { try { worker.doWork(); } catch (Exception e) { if (errorCount.incrementAndGet() > MAX_ERRORS) { e.printStackTrace(); throw new BenchmarkException(e); } else { System.err.printf("%s: %s%n", getProductWorker().getName(), e.getMessage()); } } }
Source:
public void execute(JobExecutionContext context) throws JobExecutionException { JobDetail jobDetail = context.getJobDetail(); JobDataMap jobDataMap = jobDetail.getJobDataMap(); PopulatorContext pContext = new PopulatorContext(); pContext.setURI((String)jobDataMap.get("xcri.oxcap.populator.uri")); pContext.setUser((String)jobDataMap.get("xcri.oxcap.populator.username")); pContext.setPassword((String)jobDataMap.get("xcri.oxcap.populator.password")); pContext.setName((String)jobDataMap.get("xcri.oxcap.populator.name")); populator.update(pContext); }

Target:
public void execute(JobExecutionContext context) throws JobExecutionException { JobDetail jobDetail = context.getJobDetail(); JobDataMap jobDataMap = jobDetail.getJobDataMap(); PopulatorContext pContext = new PopulatorContext("xcri.oxcap.populator", jobDataMap); populator.update(pContext); }
Source:
private void postDescription(@NonNull String editToken) { descriptionEditCall = new DescriptionEditClient().request(wikiData, pageTitle, editView.getDescription(), editToken, new DescriptionEditClient.Callback() { @Override public void success(@NonNull Call<DescriptionEdit> call) { if (getActivity() != null) { DeviceUtil.hideSoftKeyboard(getActivity()); editView.setSaveState(false); Prefs.setLastDescriptionEditTime(new Date().getTime()); startActivityForResult(DescriptionEditSuccessActivity.newIntent(getContext()), Constants.ACTIVITY_REQUEST_DESCRIPTION_EDIT_SUCCESS); } } @Override public void abusefilter(@NonNull Call<DescriptionEdit> call, String info) { editView.setSaveState(false); editView.setError(info); } @Override public void failure(@NonNull Call<DescriptionEdit> call, @NonNull Throwable caught) { editFailed(caught); } }); }

Target:
private void postDescription(@NonNull String editToken) { descriptionEditCall = new DescriptionEditClient().request(wikiData, pageTitle, editView.getDescription(), editToken, new DescriptionEditClient.Callback() { @Override public void success(@NonNull Call<DescriptionEdit> call) { Prefs.setLastDescriptionEditTime(new Date().getTime()); WikipediaApp.getInstance().listenForNotifications(); if (getActivity() != null) { DeviceUtil.hideSoftKeyboard(getActivity()); editView.setSaveState(false); startActivityForResult(DescriptionEditSuccessActivity.newIntent(getContext()), Constants.ACTIVITY_REQUEST_DESCRIPTION_EDIT_SUCCESS); } } @Override public void abusefilter(@NonNull Call<DescriptionEdit> call, String info) { editView.setSaveState(false); editView.setError(info); } @Override public void failure(@NonNull Call<DescriptionEdit> call, @NonNull Throwable caught) { editFailed(caught); } }); }
Source:
public void emtpyInputEmptyOutputTest() { Dominoes dominoes = new Dominoes(); ArrayList<Domino> dominoesArray = new ArrayList<>(); ArrayList<Domino> chain = dominoes.formChain(dominoesArray); assertNull(chain); }

Target:
public void emtpyInputEmptyOutputTest() throws ChainNotFoundException { Dominoes dominoes = new Dominoes(); List<Domino> dominoesList = new ArrayList<>(); List<Domino> chain = dominoes.formChain(dominoesList); assertEquals("The output list should be empty.", 0, chain.size()); }
Source:
void retrieveLoop() { try { while (!nodesQueue.isEmpty() || !pendingNodes.isEmpty()) { try { processTimeouts(); while (requestNextNodes(REQUEST_MAX_NODES)) ; synchronized (this) { wait(10); } regularTask(); } catch (InterruptedException e) { throw e; } catch (Throwable t) { logger.error("Error", t); } } } catch (InterruptedException e) { logger.warn("Main fast sync loop was interrupted", e); } }

Target:
void retrieveLoop() { try { while (!nodesQueue.isEmpty() || !pendingNodes.isEmpty()) { try { processTimeouts(); while (requestNextNodes(REQUEST_MAX_NODES)) ; synchronized (this) { wait(10); } logStat(); } catch (InterruptedException e) { throw e; } catch (Throwable t) { logger.error("Error", t); } } } catch (InterruptedException e) { logger.warn("Main fast sync loop was interrupted", e); } }
Source:
public int hashCode() { return 47 + index.hashCode(); }

Target:
public int hashCode() { return index.hashCode(); }
Source:
protected void executeQueryCommand() { getQueryReturnValue().setReturnValue(DbFacade.getInstance() .getVdsGroupDAO() .getAll(getUserID(), getParameters().isFiltered())); }

Target:
protected void executeQueryCommand() { getQueryReturnValue().setReturnValue(getDbFacade() .getVdsGroupDAO() .getAll(getUserID(), getParameters().isFiltered())); }
Source:
public boolean updatePostContentNewEditor(boolean isAutoSave, String title, String content) { if (mPost == null) { return false; } if (!isAutoSave) { } boolean titleChanged = PostUtils.updatePostTitleIfDifferent(mPost, title); boolean contentChanged = true; if (mEditorFragment instanceof AztecEditorFragment) { contentChanged = ((AztecEditorFragment)mEditorFragment).hasHistory(); } if (contentChanged) { contentChanged = PostUtils.updatePostContentIfDifferent(mPost, content); } if (!mPost.isLocalDraft() && (titleChanged || contentChanged)) { mPost.setIsLocallyChanged(true); mPost.setDateLocallyChanged(DateTimeUtils.iso8601FromTimestamp(System.currentTimeMillis() / 1000)); } return titleChanged || contentChanged; }

Target:
public boolean updatePostContentNewEditor(boolean isAutoSave, String title, String content) { if (mPost == null) { return false; } if (!isAutoSave) { } boolean titleChanged = PostUtils.updatePostTitleIfDifferent(mPost, title); boolean contentChanged; if (mEditorFragment instanceof AztecEditorFragment) { contentChanged = ((AztecEditorFragment)mEditorFragment).hasHistory(); if (contentChanged) { mPost.setContent(content); } else if (!((AztecEditorFragment)mEditorFragment).isHistoryEnabled()){ contentChanged = PostUtils.updatePostContentIfDifferent(mPost, content); } } else { contentChanged = PostUtils.updatePostContentIfDifferent(mPost, content); } if (!mPost.isLocalDraft() && (titleChanged || contentChanged)) { mPost.setIsLocallyChanged(true); mPost.setDateLocallyChanged(DateTimeUtils.iso8601FromTimestamp(System.currentTimeMillis() / 1000)); } return titleChanged || contentChanged; }
Source:
public void release() { if (toClose.size() > 0) for (InputStream content = toClose.remove(0); toClose.size() > 0; content = toClose.remove(0)) closeQuietly(content); }

Target:
public void release() { closeQuietly(closer); }
Source:
public boolean canExecute(ITmfTrace trace) { if (!(trace instanceof LttngUstTrace)) { return false; } LttngUstTrace ustTrace = (LttngUstTrace) trace; if (!"lttng-ust".equals(ustTrace.getTracerName())) { return false; } if (ustTrace.getTracerMajorVersion() < 2) { return false; } if (ustTrace.getTracerMajorVersion() == 2 && ustTrace.getTracerMinorVersion() < 8) { return false; } return super.canExecute(trace); }

Target:
public boolean canExecute(ITmfTrace trace) { if (!(trace instanceof LttngUstTrace)) { return false; } LttngUstTrace ustTrace = (LttngUstTrace) trace; String tracerName = CtfUtils.getTracerName(ustTrace); int majorVersion = CtfUtils.getTracerMajorVersion(ustTrace); int minorVersion = CtfUtils.getTracerMinorVersion(ustTrace); if (!LttngUstTrace.TRACER_NAME.equals(tracerName)) { return false; } if (majorVersion < 2) { return false; } if (majorVersion == 2 && minorVersion < 8) { return false; } return super.canExecute(trace); }
Source:
public static char[] convert(String value) throws FieldConvertError { if (!value.matches(CHAR_ARRAY_REGEX)) { throw new FieldConvertError("invalid char array value: " + value); } String[] split = value.split(" "); char[] chars = new char[split.length]; for (int i = 0; i < split.length; i++) { chars[i] = split[i].charAt(0); } return chars; }

Target:
public static char[] convert(String value) throws FieldConvertError { if (!value.matches(CHAR_ARRAY_REGEX)) { throw new FieldConvertError("invalid char array: " + Arrays.toString(value.getBytes())); } String[] split = value.split(" "); char[] chars = new char[split.length]; for (int i = 0; i < split.length; i++) { chars[i] = split[i].charAt(0); } return chars; }
Source:
public ServiceResponse<List<NoteItem>> retrieveNoteItems(int encounterId) { ServiceResponse<List<NoteItem>> response = new ServiceResponse<>(); List<NoteItem> noteItems = new ArrayList<>(); Query<PatientEncounterTabField> query = QueryProvider.getPatientEncounterTabFieldQuery() .fetch("tabField") .where() .isNull("IsDeleted") .eq("patient_encounter_id", encounterId) .eq("tabField.name", "pharmacy_note") .order() .desc("date_taken"); try { List<? extends IPatientEncounterTabField> patientEncounterTreatmentFields = patientEncounterTabFieldRepository.find(query); if (patientEncounterTreatmentFields == null) { response.addError("", "bad query"); } else { for (IPatientEncounterTabField petf : patientEncounterTreatmentFields) { if (petf.getTabField() != null) noteItems.add(itemModelMapper.createNoteItem(petf.getTabFieldValue(),petf.getDateTaken(),userRepository.retrieveUserById(petf.getUserId()).getLastName() + ", " + userRepository.retrieveUserById(petf.getUserId()).getFirstName())); break; } response.setResponseObject(noteItems); } } catch (Exception ex) { response.addError("", "error"); } return response; }

Target:
public ServiceResponse<List<NoteItem>> retrieveNoteItems(int encounterId) { ServiceResponse<List<NoteItem>> response = new ServiceResponse<>(); List<NoteItem> noteItems = new ArrayList<>(); Query<PatientEncounterTabField> query = QueryProvider.getPatientEncounterTabFieldQuery() .fetch("tabField") .where() .isNull("IsDeleted") .eq("patient_encounter_id", encounterId) .eq("tabField.name", "pharmacy_note") .order() .desc("date_taken"); try { List<? extends IPatientEncounterTabField> patientEncounterTreatmentFields = patientEncounterTabFieldRepository.find(query); if (patientEncounterTreatmentFields == null) { response.addError("", "bad query"); } else { if(!patientEncounterTreatmentFields.isEmpty()) { IPatientEncounterTabField petf = patientEncounterTreatmentFields.get(0); noteItems.add(itemModelMapper.createNoteItem(petf.getTabFieldValue(), petf.getDateTaken(), userRepository.retrieveUserById(petf.getUserId()).getLastName() + ", " + userRepository.retrieveUserById(petf.getUserId()).getFirstName())); } response.setResponseObject(noteItems); } } catch (Exception ex) { response.addError("", "error"); } return response; }
Source:
public void test(TestHarness th) { long totalMemory = Runtime.getRuntime().totalMemory(); long freeMemory = Runtime.getRuntime().freeMemory(); System.out.println("freeMemory1: " + Runtime.getRuntime().freeMemory()); th.check(totalMemory > freeMemory, "Total memory is strictly greater than free memory"); th.check(freeMemory > 0, "Free memory is strictly greater than 0"); for (int i = 0; i < 1000; i++) { long[] array = new long[100000]; } System.out.println("freeMemory2: " + Runtime.getRuntime().freeMemory()); th.check(totalMemory, Runtime.getRuntime().totalMemory(), "Total memory doesn't change"); th.check(freeMemory > Runtime.getRuntime().freeMemory(), "Free memory decreases after allocating some objects"); freeMemory = Runtime.getRuntime().freeMemory(); Runtime.getRuntime().gc(); System.out.println("freeMemory3: " + Runtime.getRuntime().freeMemory()); th.check(freeMemory < Runtime.getRuntime().freeMemory(), "Free memory increases after a collection"); }

Target:
public void test(TestHarness th) { long totalMemory = Runtime.getRuntime().totalMemory(); long freeMemory = Runtime.getRuntime().freeMemory(); System.out.println("freeMemory1: " + Runtime.getRuntime().freeMemory()); th.check(totalMemory > freeMemory, "Total memory is strictly greater than free memory"); th.check(freeMemory > 0, "Free memory is strictly greater than 0"); long[] array = new long[1048576]; System.out.println("freeMemory2: " + Runtime.getRuntime().freeMemory()); th.check(totalMemory, Runtime.getRuntime().totalMemory(), "Total memory doesn't change"); th.check(freeMemory > Runtime.getRuntime().freeMemory(), "Free memory decreases after allocating some objects"); freeMemory = Runtime.getRuntime().freeMemory(); array = null; Runtime.getRuntime().gc(); System.out.println("freeMemory3: " + Runtime.getRuntime().freeMemory()); th.check(freeMemory < Runtime.getRuntime().freeMemory(), "Free memory increases after a collection"); }
Source:
public Collection<RegisteredService> load() { LOGGER.trace("Loading services from [{}]", serviceRegistry.getName()); this.services.putAll(this.serviceRegistry.load() .stream() .collect(Collectors.toMap(r -> { LOGGER.debug("Adding registered service with name and internal identifier [{}]", r.getServiceId(), r.getName(), r.getId()); return r.getId(); }, Function.identity(), (r, s) -> s))); loadInternal(); publishEvent(new CasRegisteredServicesLoadedEvent(this, getAllServices())); evaluateExpiredServiceDefinitions(); LOGGER.info("Loaded service(s) from [{}].", this.services.asMap().size(), this.serviceRegistry.getName()); return services.asMap().values(); }

Target:
public Collection<RegisteredService> load() { LOGGER.trace("Loading services from [{}]", serviceRegistry.getName()); this.services.putAll(this.serviceRegistry.load() .stream() .collect(Collectors.toMap(r -> { LOGGER.trace("Adding registered service with name and internal identifier [{}]", r.getServiceId(), r.getName(), r.getId()); return r.getId(); }, Function.identity(), (r, s) -> s))); loadInternal(); publishEvent(new CasRegisteredServicesLoadedEvent(this, getAllServices())); evaluateExpiredServiceDefinitions(); LOGGER.info("Loaded service(s) from [{}].", this.services.asMap().size(), this.serviceRegistry.getName()); return services.asMap().values(); }
Source:
public void shouldCreateEncounterWithGivenParametersWithObsWithManyValues() { Location location = new Location(); location.setName("testLocation"); Patient patient = new Patient(); patient.setUuid("10"); Provider provider = new Provider(); provider.setUuid("20"); Person person = new Person(); person.setUuid("30"); provider.setPerson(person); DateTime encounterDatetime = new DateTime("2000-08-16T07:22:05Z"); Map<String, String> observations = new HashMap<>(); observations.put("testConceptName","testObservationValueName0, testObservationValueName1"); List<Observation> obsList = createObservationListWithManyObservations(); Encounter encounter = new Encounter(location, new EncounterType("testEncounterType"), encounterDatetime.toDate(), patient, Collections.singletonList(provider.getPerson()), obsList); doReturn(patient).when(patientService).getPatientByUuid(eq(CONFIG_NAME), eq(patient.getUuid())); doReturn(provider).when(providerService).getProviderByUuid(eq(CONFIG_NAME), eq(provider.getUuid())); doReturn(Collections.singletonList(location)) .when(locationService).getLocations(eq(CONFIG_NAME), eq(location.getName())); openMRSActionProxyService.createEncounter(CONFIG_NAME, new DateTime(encounter.getEncounterDatetime()), encounter.getEncounterType().getName(), location.getName(), patient.getUuid(), provider.getUuid(), observations); verify(encounterService).createEncounter(eq(CONFIG_NAME), encounterCaptor.capture()); assertEquals(encounter, encounterCaptor.getValue()); }

Target:
public void shouldCreateEncounterWithGivenParametersWithObsWithManyValues() { Location location = new Location(); location.setName("testLocation"); Patient patient = new Patient(); patient.setUuid("10"); Provider provider = new Provider(); provider.setUuid("20"); Person person = new Person(); person.setUuid("30"); provider.setPerson(person); DateTime encounterDatetime = new DateTime("2000-08-16T07:22:05Z"); Map<String, String> observations = new HashMap<>(); observations.put("testConceptName","testObservationValueName0, testObservationValueName1"); List<Observation> obsList = createObservationList(2); Encounter encounter = new Encounter(location, new EncounterType("testEncounterType"), encounterDatetime.toDate(), patient, Collections.singletonList(provider.getPerson()), obsList); doReturn(patient).when(patientService).getPatientByUuid(eq(CONFIG_NAME), eq(patient.getUuid())); doReturn(provider).when(providerService).getProviderByUuid(eq(CONFIG_NAME), eq(provider.getUuid())); doReturn(Collections.singletonList(location)) .when(locationService).getLocations(eq(CONFIG_NAME), eq(location.getName())); openMRSActionProxyService.createEncounter(CONFIG_NAME, new DateTime(encounter.getEncounterDatetime()), encounter.getEncounterType().getName(), location.getName(), patient.getUuid(), provider.getUuid(), observations); verify(encounterService).createEncounter(eq(CONFIG_NAME), encounterCaptor.capture()); assertEquals(encounter, encounterCaptor.getValue()); }
Source:
public <T> Mono<T> getComponent(String digitalTwinId, String componentPath, Class<T> clazz) { return getComponentWithResponse(digitalTwinId, componentPath, clazz) .flatMap(response -> Mono.justOrEmpty(response.getValue())); }

Target:
public <T> Mono<T> getComponent(String digitalTwinId, String componentPath, Class<T> clazz) { return getComponentWithResponse(digitalTwinId, componentPath, clazz) .map(DigitalTwinsResponse::getValue); }
Source:
public CompletableFuture<LogReplicationEntry> sendWithBuffering(LogReplicationEntry message) { message.getMetadata().setSnapshotSyncSeqNum(maxAckedMsgSeqNum++); pendingMessages.append(message); log.info("Send messsage {}", message.getMetadata()); CompletableFuture<LogReplicationEntry> cf = dataSender.send(message); addCFToAcked(message, cf); return cf; }

Target:
public CompletableFuture<LogReplicationEntry> sendWithBuffering(LogReplicationEntry message) { message.getMetadata().setSnapshotSyncSeqNum(maxAckedMsgSeqNum++); pendingMessages.append(message); log.trace("Send messsage {}", message.getMetadata()); CompletableFuture<LogReplicationEntry> cf = dataSender.send(message); addCFToAcked(message, cf); return cf; }
Source:
public WAL.Entry filter(WAL.Entry entry) { byte[] tableName = entry.getKey().getTablename().getName(); if (!SchemaUtil.isMetaTable(tableName) && !SchemaUtil.isChildLinkTable(tableName)){ return entry; } List<Cell> cells = entry.getEdit().getCells(); List<Cell> cellsToRemove = Lists.newArrayList(); for (Cell cell : cells) { if (!isTenantRowCell(cell)){ cellsToRemove.add(cell); } } cells.removeAll(cellsToRemove); if (cells.size() > 0) { return entry; } else { return null; } }

Target:
public WAL.Entry filter(WAL.Entry entry) { byte[] tableName = entry.getKey().getTablename().getName(); if (!SchemaUtil.isMetaTable(tableName)){ return entry; } List<Cell> cells = entry.getEdit().getCells(); List<Cell> cellsToRemove = Lists.newArrayList(); for (Cell cell : cells) { if (!isTenantRowCell(cell)){ cellsToRemove.add(cell); } } cells.removeAll(cellsToRemove); if (cells.size() > 0) { return entry; } else { return null; } }
Source:
private void backgroundLookup() { new Thread() { public void run() { cache.set(lookup.lookup()); } }.start(); }

Target:
private void backgroundLookup() { THREAD_POOL.submit(new Runnable() { public void run() { cache.set(lookup.lookup()); } }); }
Source:
public DataObject fromBundleRequestInput(final ActionRequestDto bundleInput) throws ProtocolAdapterException { return null; }

Target:
public Void fromBundleRequestInput(final ActionRequestDto bundleInput) throws ProtocolAdapterException { this.checkActionRequestType(bundleInput); return null; }
Source:
protected void testFailure(TestDescriptor testDescriptor, TestResult result) { try { if (result.getExceptions() instanceof AssertionError) testResultRecorder.recordTestResult(testDescriptor.getName(), 0, 1, 0, result.getException(), calculateExecutionTimeInSeconds(result)); else testResultRecorder.recordTestResult(testDescriptor.getName(), 0, 0, 1, result.getException(), calculateExecutionTimeInSeconds(result)); } catch (IOException e) { throw new RuntimeException(e); } }

Target:
protected void testFailure(TestDescriptor testDescriptor, TestResult result) { String testName = testDescriptor.getName(); Throwable throwable = result.getException(); long executionTime = calculateExecutionTimeInSeconds(result); try { if (throwable instanceof AssertionError) { testResultRecorder.recordTestResult(testName, 0, 1, 0, throwable, executionTime); } else { testResultRecorder.recordTestResult(testName, 0, 0, 1, throwable, executionTime); } } catch (IOException e) { throw new RuntimeException(e); } }
Source:
public boolean isNoexcept(boolean inCalledContext) { if (fOperator == op_throw) return false; ICPPFunction overload = getOverload(); if (overload != null) { return EvalUtil.evaluateNoexceptSpecifier(overload.getType().getNoexceptSpecifier()); } return fArgument.isNoexcept(inCalledContext); }

Target:
public boolean isNoexcept(boolean inCalledContext) { if (fOperator == op_throw) return false; ICPPFunction overload = getOverload(); if (overload != null) { if (!EvalUtil.evaluateNoexceptSpecifier(overload.getType().getNoexceptSpecifier())) return false; } return fArgument.isNoexcept(inCalledContext); }
Source:
private void triggerConnect() { setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); try { Optional<Credentials> credentials = OptionalProduct.all( Optional.ofNullable(emailField.getText()).map(String::trim).filter(s -> !s.isEmpty()), Optional.of(new String(passwordField.getPassword())).filter(s -> !s.isEmpty()) ).map(Credentials::new); URL baseUrl = new URL(urlField.getText()); CentralServer server = CentralServer.of( baseUrl, parseInt(projectIdField.getText()), credentials.orElseThrow(BriefcaseException::new) ); onConnectCallbacks.forEach(callback -> callback.accept(server)); } catch (BriefcaseException e) { setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); errorMessage("Invalid Central configuration", "Please, check data and try again.\n\nError: " + e.getCause().getMessage()); } catch (MalformedURLException e) { setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); errorMessage("Invalid Central configuration", "Malformed URL. Please, review data and try again.\n\nError: " + e.getMessage()); } }

Target:
private void triggerConnect() { setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); try { URL baseUrl = new URL(urlField.getText()); CentralServer server = CentralServer.of( baseUrl, parseInt(projectIdField.getText()), UI.credentialsFromFields(emailField, passwordField).orElseThrow(BriefcaseException::new) ); onConnectCallbacks.forEach(callback -> callback.accept(server)); } catch (BriefcaseException e) { setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); errorMessage("Invalid Central configuration", "Please, check data and try again.\n\nError: " + e.getCause().getMessage()); } catch (MalformedURLException e) { setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); errorMessage("Invalid Central configuration", "Malformed URL. Please, review data and try again.\n\nError: " + e.getMessage()); } }
Source:
private DTLSMessage handshakeMessageFromByteArray(byte[] decryptedMessage) throws GeneralSecurityException, HandshakeException { if (LOGGER.isTraceEnabled()) { LOGGER.trace("Decrypting HANDSHAKE message ciphertext{}{}", StringUtil.lineSeparator(), StringUtil.byteArray2HexString(decryptedMessage)); } HandshakeParameter parameter = null; if (incomingSession != null) { parameter = incomingSession.getParameter(); } else { LOGGER.debug("Parsing message without a session"); } if (LOGGER.isDebugEnabled()) { StringBuilder msg = new StringBuilder("Parsing HANDSHAKE message plaintext [{}]"); if (LOGGER.isTraceEnabled()) { msg.append(":").append(StringUtil.lineSeparator()).append(StringUtil.byteArray2HexString(decryptedMessage)); } LOGGER.debug(msg.toString(), parameter); } HandshakeMessage handshakeMessage = HandshakeMessage.fromByteArray(decryptedMessage, parameter, getPeerAddress()); if (handshakeMessage.getMessageType() == HandshakeType.FINISHED && epoch == 0) { LOGGER.debug("FINISH with epoch 0 from peer [{}]!", peerAddress); AlertMessage alert = new AlertMessage(AlertLevel.FATAL, AlertDescription.UNEXPECTED_MESSAGE, peerAddress); throw new HandshakeException("FINISH with epoch 0!", alert); } return handshakeMessage; }

Target:
private DTLSMessage handshakeMessageFromByteArray(byte[] decryptedMessage) throws GeneralSecurityException, HandshakeException { if (LOGGER.isTraceEnabled()) { LOGGER.trace("Decrypting HANDSHAKE message ciphertext{}{}", StringUtil.lineSeparator(), StringUtil.byteArray2HexString(decryptedMessage)); } HandshakeParameter parameter = null; if (incomingSession != null) { parameter = incomingSession.getParameter(); } else { LOGGER.debug("Parsing message without a session"); } if (LOGGER.isDebugEnabled()) { StringBuilder msg = new StringBuilder("Parsing HANDSHAKE message plaintext [{}]"); if (LOGGER.isTraceEnabled()) { msg.append(":").append(StringUtil.lineSeparator()).append(StringUtil.byteArray2HexString(decryptedMessage)); } LOGGER.debug(msg.toString(), parameter); } return HandshakeMessage.fromByteArray(decryptedMessage, parameter, getPeerAddress()); }
Source:
private void migrateSingleAccountNumbers(Account account, Organization destinationOrganization) { List<IncomingPhoneNumber> incomingPhoneNumbers = dao.getIncomingPhoneNumbers(account.getSid()); if(incomingPhoneNumbers != null) { for (int i=0; i<incomingPhoneNumbers.size(); i++){ IncomingPhoneNumber incomingPhoneNumber = incomingPhoneNumbers.get(i); incomingPhoneNumber.setOrganizationSid(destinationOrganization.getSid()); dao.updateIncomingPhoneNumber(incomingPhoneNumber); if(!updateNumberAtPhoneNumberProvisioningManager(incomingPhoneNumber, destinationOrganization)){ logger.error(String.format("could not update numner %s at number provider %s ", incomingPhoneNumber.getPhoneNumber(), phoneNumberProvisioningManager)); } } } }

Target:
private void migrateSingleAccountNumbers(Account account, Organization destinationOrganization) { List<IncomingPhoneNumber> incomingPhoneNumbers = dao.getIncomingPhoneNumbers(account.getSid()); if(incomingPhoneNumbers != null) { for (int i=0; i<incomingPhoneNumbers.size(); i++){ IncomingPhoneNumber incomingPhoneNumber = incomingPhoneNumbers.get(i); incomingPhoneNumber.setOrganizationSid(destinationOrganization.getSid()); dao.updateIncomingPhoneNumber(incomingPhoneNumber); if(!updateNumberAtPhoneNumberProvisioningManager(incomingPhoneNumber, destinationOrganization)){ logger.error(String.format("could not update number %s at number provider %s ", incomingPhoneNumber.getPhoneNumber(), phoneNumberProvisioningManager)); } } } }
Source:
public void registerAuthService(AuthenticationService service) { authList.add(service); StartupServiceUtils.updateServiceCache("business-messaging-auth-mgt", AuthenticationService.class); }

Target:
public void registerAuthService(AuthenticationService service) { authList.add(service); StartupServiceUtils.updateServiceCache(COMPONENT_NAME, AuthenticationService.class); }
Source:
private static String getTokenFileFromClassloader(Class<?> contextClass, VaadinContext context) throws IOException { String tokenResource = VAADIN_SERVLET_RESOURCES + TOKEN_FILE; Lookup lookup = context.getAttribute(Lookup.class); ResourceProvider resourceProvider = lookup .lookup(ResourceProvider.class); List<URL> classResources = resourceProvider .getApplicationResources(contextClass, tokenResource); List<URL> contextResources = resourceProvider .getApplicationResources(context, tokenResource); List<URL> resources; if (classResources.isEmpty()) { resources = contextResources; } else if (contextResources.isEmpty()) { resources = classResources; } else { resources = new ArrayList<>( classResources.size() + contextResources.size()); resources.addAll(classResources); resources.addAll(contextResources); } URL resource = resources.stream() .filter(url -> !url.getPath().endsWith("jar!/" + tokenResource)) .findFirst().orElse(null); if (resource == null && !resources.isEmpty()) { return getPossibleJarResource(contextClass, context, resources); } return resource == null ? null : FrontendUtils.streamToString(resource.openStream()); }

Target:
private static String getTokenFileFromClassloader(Class<?> contextClass, VaadinContext context) throws IOException { String tokenResource = VAADIN_SERVLET_RESOURCES + TOKEN_FILE; Lookup lookup = context.getAttribute(Lookup.class); ResourceProvider resourceProvider = lookup .lookup(ResourceProvider.class); List<URL> classResources = resourceProvider .getApplicationResources(contextClass, tokenResource); List<URL> contextResources = resourceProvider .getApplicationResources(context, tokenResource); List<URL> resources = Stream .concat(classResources.stream(), contextResources.stream()) .collect(Collectors.toList()); URL resource = resources.stream() .filter(url -> !url.getPath().endsWith("jar!/" + tokenResource)) .findFirst().orElse(null); if (resource == null && !resources.isEmpty()) { return getPossibleJarResource(contextClass, context, resources); } return resource == null ? null : FrontendUtils.streamToString(resource.openStream()); }
Source:
public void setProjectName(String projectName) { fProjectName = projectName; if(fLocationText.getText().equals(EMPTY_STRING)) { fRemoteDirSelected = false; } if (fRemoteDirSelected == false) { fLocationText.setText(getDefaultPathDisplayString()); } }

Target:
public void setProjectName(String projectName) { fProjectName = projectName; if(fLocationText.getText().equals(EMPTY_STRING)) { fRemoteDirSelected = false; } if (!fRemoteDirSelected) { fLocationText.setText(getDefaultPathDisplayString()); } }
Source:
private boolean matchesFilter(StackTraceElement[] stackTraces) { for (StackTraceElement element : stackTraces) { for (Filter filter : filters ) { if (element.getMethodName().equals(filter.methodName) && element.getClassName().equals(filter.className)) { return true; } } } return false; }

Target:
private boolean matchesFilter(StackTraceElement[] stackTraces) { for (StackTraceElement element : stackTraces) { String methodName = element.getMethodName(); String className = element.getClassName(); int low = 0; int high = filters.length; while (low < high) { int mid = (low + high) >>> 1; Filter filter = filters[mid]; int c = methodName.compareTo(filter.methodName); if (c == 0) c = className.compareTo(filter.className); if (c == 0) { return true; } else if (c < 0) { high = mid; } else { low = mid + 1; } } } return false; }
Source:
private BpmnNode jbpmServiceTask(org.eclipse.bpmn2.Task task) { Node<View<ServiceTask>, Edge> node = factoryManager.newNode(task.getId(), ServiceTask.class); ServiceTask definition = node.getContent().getDefinition(); ServiceTaskPropertyReader p = propertyReaderFactory.ofCustom(task) .orElseThrow(() -> new NoSuchElementException("Cannot find WorkItemDefinition for " + task.getName())); definition.setName(p.getServiceTaskName()); Object taskType = definition.getTaskType(); definition.getTaskType().setRawType(p.getServiceTaskName()); definition.setDescription(p.getServiceTaskDescription()); definition.setCategory(p.getServiceTaskCategory()); definition.setDefaultHandler(p.getServiceTaskDefaultHandler()); definition.setGeneral(new TaskGeneralSet( new Name(p.getName()), new Documentation(p.getDocumentation()) )); definition.setDataIOSet(new DataIOSet( p.getAssignmentsInfo() )); definition.setExecutionSet(new ServiceTaskExecutionSet( new TaskName(p.getTaskName()), new IsAsync(p.isAsync()), new AdHocAutostart(p.isAdHocAutoStart()), new OnEntryAction(p.getOnEntryAction()), new OnExitAction(p.getOnExitAction()), new SLADueDate(p.getSlaDueDate()) )); definition.setSimulationSet(p.getSimulationSet()); node.getContent().setBounds(p.getBounds()); definition.setDimensionsSet(p.getRectangleDimensionsSet()); definition.setBackgroundSet(p.getBackgroundSet()); definition.setFontSet(p.getFontSet()); return BpmnNode.of(node, p); }

Target:
private BpmnNode jbpmServiceTask(org.eclipse.bpmn2.Task task) { return propertyReaderFactory .ofCustom(task) .map(p -> { final Node<View<ServiceTask>, Edge> node = factoryManager.newNode(task.getId(), ServiceTask.class); final ServiceTask definition = node.getContent().getDefinition(); definition.setName(p.getServiceTaskName()); definition.getTaskType().setRawType(p.getServiceTaskName()); definition.setDescription(p.getServiceTaskDescription()); definition.setCategory(p.getServiceTaskCategory()); definition.setDefaultHandler(p.getServiceTaskDefaultHandler()); definition.setGeneral(new TaskGeneralSet( new Name(p.getName()), new Documentation(p.getDocumentation()) )); definition.setDataIOSet(new DataIOSet( p.getAssignmentsInfo() )); definition.setExecutionSet(new ServiceTaskExecutionSet( new TaskName(p.getTaskName()), new IsAsync(p.isAsync()), new AdHocAutostart(p.isAdHocAutoStart()), new OnEntryAction(p.getOnEntryAction()), new OnExitAction(p.getOnExitAction()), new SLADueDate(p.getSlaDueDate()) )); definition.setSimulationSet(p.getSimulationSet()); node.getContent().setBounds(p.getBounds()); definition.setDimensionsSet(p.getRectangleDimensionsSet()); definition.setBackgroundSet(p.getBackgroundSet()); definition.setFontSet(p.getFontSet()); return BpmnNode.of(node, p); }) .orElseGet(() -> noneTask(task)); }
Source:
private void processPriorityEvents() throws IOException, InterruptedException { final boolean hasPriorityEvents = inputGate.getPriorityEventAvailableFuture().isDone(); if (hasPriorityEvents) { while (pollNext().map(BufferOrEvent::morePriorityEvents).orElse(false)) { } } waitForPriorityEvents(inputGate, mailboxExecutor); }

Target:
private void processPriorityEvents() throws IOException, InterruptedException { boolean hasPriorityEvent = inputGate.getPriorityEventAvailableFuture().isDone(); while (hasPriorityEvent) { final Optional<BufferOrEvent> bufferOrEventOpt = pollNext(); checkState(bufferOrEventOpt.isPresent()); final BufferOrEvent bufferOrEvent = bufferOrEventOpt.get(); checkState(bufferOrEvent.hasPriority(), "Should only poll priority events"); hasPriorityEvent = bufferOrEvent.morePriorityEvents(); } waitForPriorityEvents(inputGate, mailboxExecutor); }
Source:
public void addChild(Widget widget) { switch (layout) { case ONE_COLUMN: addChildOneColumn(widget); break; case TWO_COLUMNS: addChildTwoColumns(widget); break; default: Info.display("DynamicLayoutPanel", "addChild with layout " + layout + " not yet implemented"); } }

Target:
public void addChild(Widget widget) { switch (layout) { case TWO_COLUMNS: addChildTwoColumns(widget); break; default: addChildOneColumn(widget); } }
Source:
private void removeAppBar() { DWORD dwABM = new DWORD(); APPBARDATA ABData = new APPBARDATA.ByReference(); ABData.cbSize.setValue( ABData.size() ); dwABM.setValue(ShellAPI.ABM_REMOVE); UINT_PTR result = Shell32.INSTANCE.SHAppBarMessage( dwABM, ABData); assertNotNull(result ); }

Target:
private void removeAppBar() { APPBARDATA data = new APPBARDATA.ByReference(); data.cbSize.setValue(data.size()); UINT_PTR result = Shell32.INSTANCE.SHAppBarMessage(new DWORD(ShellAPI.ABM_REMOVE), data); assertNotNull(result); }
Source:
public static RawType valueOf(String value) { int idx; if (value == null || !value.startsWith("data:") || ((idx = value.indexOf(",")) < 0)) { return new RawType(); } String mimeType = DEFAULT_MIME_TYPE; int idx2 = value.indexOf(";"); if (idx2 > 5) { mimeType = value.substring(5, idx2); } return new RawType(Base64.getDecoder().decode(value.substring(idx + 1)), mimeType); }

Target:
public static RawType valueOf(String value) { int idx, idx2; if (value == null) { throw new IllegalArgumentException("Argument must not be null"); } else if (value.isEmpty()) { throw new IllegalArgumentException("Argument must not be blank"); } else if (!value.startsWith("data:") || ((idx = value.indexOf(",")) < 0)) { throw new IllegalArgumentException("Invalid data URI syntax for argument " + value); } else if ((idx2 = value.indexOf(";")) <= 5) { throw new IllegalArgumentException("Missing MIME type in argument " + value); } return new RawType(Base64.getDecoder().decode(value.substring(idx + 1)), value.substring(5, idx2)); }