auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void procreate() { if (getSpouseID() != null && getSpouse() == null) { setSpouseID(null); } if (!isDeployed()) { if (getAge(campaign.getCalendar()) > 13 && getAge(campaign.getCalendar()) < 51) { if (getSpouse() == null && campaign.getCampaignOptions().useUnofficialProcreationNoRelationship()) { if (Compute.randomInt(100000) < 2) { GregorianCalendar tCal = (GregorianCalendar) campaign.getCalendar().clone(); tCal.add(GregorianCalendar.DAY_OF_YEAR, 40*7); setDueDate(tCal); campaign.addReport(getHyperlinkedName()+" has conceived"); if (campaign.getCampaignOptions().logConception()) { addLogEntry(campaign.getDate(), "Has conceived"); } } } else if (getSpouse() != null) { if (getSpouse().isActive() && !getSpouse().isDeployed() && getSpouse().getAge(campaign.getCalendar()) > 13) { if (Compute.randomInt(10000) < 200) { GregorianCalendar tCal = (GregorianCalendar) campaign.getCalendar().clone(); tCal.add(GregorianCalendar.DAY_OF_YEAR, 40*7); setDueDate(tCal); campaign.addReport(getHyperlinkedName()+" has conceived"); if (campaign.getCampaignOptions().logConception()) { addLogEntry(campaign.getDate(), "Has conceived"); } } } } } } }

Target:
public void procreate() { if (getSpouseID() != null && getSpouse() == null) { setSpouseID(null); } if (!isDeployed()) { if (getAge(campaign.getCalendar()) > 13 && getAge(campaign.getCalendar()) < 51) { if (getSpouse() == null && campaign.getCampaignOptions().useUnofficialProcreationNoRelationship()) { if (Compute.randomInt(100000) < 2) { GregorianCalendar tCal = (GregorianCalendar) campaign.getCalendar().clone(); tCal.add(GregorianCalendar.DAY_OF_YEAR, 40*7); setDueDate(tCal); campaign.addReport(getHyperlinkedName()+" has conceived"); if (campaign.getCampaignOptions().logConception()) { addLogEntry(campaign.getDate(), "Has conceived"); } } } else if (getSpouse() != null) { if (getSpouse().isActive() && !getSpouse().isDeployed() && getSpouse().getAge(campaign.getCalendar()) > 13) { if (Compute.randomInt(10000) < 2) { GregorianCalendar tCal = (GregorianCalendar) campaign.getCalendar().clone(); tCal.add(GregorianCalendar.DAY_OF_YEAR, 40*7); setDueDate(tCal); campaign.addReport(getHyperlinkedName()+" has conceived"); if (campaign.getCampaignOptions().logConception()) { addLogEntry(campaign.getDate(), "Has conceived"); } } } } } } }
Source:
public void shouldShowAllMusicsAsHTTP() { MockHttpResult mockHttpResult = new MockHttpResult(); controller = new MusicController(dao, userInfo, mockHttpResult, validator, musics); when(dao.listAll()).thenReturn(Arrays.asList(music)); controller.showAllMusicsAsHTTP(); assertEquals("<p class=\"content\">"+ Arrays.asList(music).toString()+"</p>", mockHttpResult.getBody()); }

Target:
public void shouldShowAllMusicsAsHTTP() { MockHttpResult mockHttpResult = new MockHttpResult(); controller = new MusicController(dao, userInfo, mockHttpResult, validator, musics); when(dao.listAll()).thenReturn(Arrays.asList(music)); controller.showAllMusicsAsHTTP(); assertThat(mockHttpResult.getBody(), is("<p class=\"content\">"+ Arrays.asList(music).toString()+"</p>")); }
Source:
public void run() { fFilterDialog.update(fTimeGraphViewer.getControl().getShell(), this, fTimeGraphViewer); fFilterDialog.open(); fFilterDialog.getShell().setSize(400, 400); }

Target:
public void run() { fFilterDialog.update(fTimeGraphViewer.getControl().getShell(), this, fTimeGraphViewer); fFilterDialog.open(); fFilterDialog.getShell().setSize(SHELL_SIZE, SHELL_SIZE); }
Source:
private void authenticateCheck(String username, String password) { if (NetworkUtils.hasNetwork()) { RestApi restApi = RestServiceBuilder.createService(RestApi.class, username, password); Call<Session> call = restApi.getSession(); call.enqueue(new Callback<Session>() { @Override public void onResponse(Call<Session> call, Response<Session> response) { if (response.isSuccessful()) { Session session = response.body(); if (session.isAuthenticated()) { Log.e("Service Task ", "user authenticated"); } else { Log.e("Service Task ", "User Credentials Changed"); if(isForeground(ApplicationConstants.PACKAGE_NAME)){ Intent broadcastIntent = new Intent(); broadcastIntent.setAction(ApplicationConstants.BroadcastActions.AUTHENTICATION_CHECK_BROADCAST_ACTION); sendBroadcast(broadcastIntent); }else{ OpenMRSDBOpenHelper.getInstance().closeDatabases(); mOpenMRS.clearUserPreferencesData(); mOpenMRS.clearCurrentLoggedInUserInfo(); } } } else { ToastUtil.error("Error in AuthenticateCheckService Response"); } } @Override public void onFailure(Call<Session> call, Throwable t) { ToastUtil.error("Error in AuthenticateCheckService"); } }); } else { Log.e("Service Task ", "No Network"); } }

Target:
private void authenticateCheck(String username, String password) { if (NetworkUtils.hasNetwork()) { RestApi restApi = RestServiceBuilder.createService(RestApi.class, username, password); Call<Session> call = restApi.getSession(); call.enqueue(new Callback<Session>() { @Override public void onResponse(Call<Session> call, Response<Session> response) { if (response.isSuccessful()) { Session session = response.body(); if (session.isAuthenticated()) { Log.e("Service Task ", "user authenticated"); } else { Log.e("Service Task ", "User Credentials Changed"); if (isForeground(OpenMRS.getInstance().getPackageName())) { Intent broadcastIntent = new Intent(); broadcastIntent.setAction(ApplicationConstants.BroadcastActions.AUTHENTICATION_CHECK_BROADCAST_ACTION); sendBroadcast(broadcastIntent); } else { OpenMRSDBOpenHelper.getInstance().closeDatabases(); mOpenMRS.clearUserPreferencesData(); mOpenMRS.clearCurrentLoggedInUserInfo(); } } } else { ToastUtil.error("Error in AuthenticateCheckService Response"); } } @Override public void onFailure(Call<Session> call, Throwable t) { ToastUtil.error("Error in AuthenticateCheckService"); } }); } else { Log.e("Service Task ", "No Network"); } }
Source:
public AsyncTaskResult<List<EnrolledCoursesResponse>> loadInBackground() { ProfileModel profile = loginPrefs.getCurrentUserProfile(); List<EnrolledCoursesResponse> enrolledCoursesResponse = null; AsyncTaskResult<List<EnrolledCoursesResponse>> result = new AsyncTaskResult<>(); try { if (profile != null) { String org = config.getOrganizationCode(); enrolledCoursesResponse = api.getUserEnrolledCourses(profile.username, org, false); environment.getNotificationDelegate().syncWithServerForFailure(); environment.getNotificationDelegate().checkCourseEnrollment(enrolledCoursesResponse); } } catch (Exception exception) { result.setEx(exception); } result.setResult(enrolledCoursesResponse); return result; }

Target:
public AsyncTaskResult<List<EnrolledCoursesResponse>> loadInBackground() { ProfileModel profile = loginPrefs.getCurrentUserProfile(); List<EnrolledCoursesResponse> enrolledCoursesResponse = null; AsyncTaskResult<List<EnrolledCoursesResponse>> result = new AsyncTaskResult<>(); try { if (profile != null) { String orgCode = config.getOrganizationCode(); enrolledCoursesResponse = api.getUserEnrolledCourses(profile.username, orgCode, false); environment.getNotificationDelegate().syncWithServerForFailure(); environment.getNotificationDelegate().checkCourseEnrollment(enrolledCoursesResponse); } } catch (Exception exception) { result.setEx(exception); } result.setResult(enrolledCoursesResponse); return result; }
Source:
public boolean equals(Object o) { if (o instanceof SoulTicket) return ((SoulTicket) o).getDescription().equals(description); return false; }

Target:
public boolean equals(Object o) { if (this == o) return true; if (o instanceof SoulTicket) return ((SoulTicket) o).getDescription().equals(description); return false; }
Source:
public boolean apply(Game game, Ability source) { game.getPlayers().forEach((playerId, player) -> { if (!(player == null)) { FilterPermanent filter = new FilterCreatureOrPlaneswalkerPermanent(); filter.add(new ControllerIdPredicate(playerId)); if (game.getBattlefield().getActivePermanents( filter, source.getControllerId(), game ).isEmpty()) { Effect discardEffect = new DiscardTargetEffect(1); discardEffect.setTargetPointer(new FixedTarget(playerId, game)); discardEffect.apply(game, source); } else { Effect effect = new SacrificeEffect( StaticFilters.FILTER_PERMANENT_CREATURE_OR_PLANESWALKER_A, 1, null ); effect.setTargetPointer(new FixedTarget(playerId, game)); effect.apply(game, source); } } }); return true; }

Target:
public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller == null) { return false; } List<UUID> perms = new ArrayList<>(); List<UUID> cantSac = new ArrayList<>(); for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { FilterControlledPermanent filter = new FilterControlledPermanent(); filter.add(Predicates.or( new CardTypePredicate(CardType.CREATURE), new CardTypePredicate(CardType.PLANESWALKER))); TargetControlledPermanent target = new TargetControlledPermanent(1, 1, filter, true); if (target.canChoose(player.getId(), game)) { while (!target.isChosen() && player.canRespond()) { player.choose(Outcome.Sacrifice, target, source.getSourceId(), game); } perms.addAll(target.getTargets()); } else { cantSac.add(playerId); } } } for (UUID permID : perms) { Permanent permanent = game.getPermanent(permID); if (permanent != null) { permanent.sacrifice(source.getSourceId(), game); } } for (UUID playerId : cantSac) { Effect discardEffect = new DiscardTargetEffect(1); discardEffect.setTargetPointer(new FixedTarget(playerId, game)); discardEffect.apply(game, source); } return true; }
Source:
protected CloseResourceAction(IShellProvider provider, String text) { super(provider, text); }

Target:
protected CloseResourceAction(IShellProvider provider, String text) { this(provider, text, IDEWorkbenchMessages.CloseResourceAction_toolTip, IDEWorkbenchMessages.CloseResourceAction_text_plural, IDEWorkbenchMessages.CloseResourceAction_toolTip_plural); }
Source:
public void updateMenuState(int numSelectedProjects, int numProjects) { boolean allowDelete = !isReadOnly && numSelectedProjects > 0; boolean allowExport = numSelectedProjects > 0; boolean allowExportAll = numProjects > 0; boolean allowExportSelected = numSelectedProjects > 1; fileDropDown.setItemEnabled(MESSAGES.deleteProjectMenuItem(), allowDelete); fileDropDown.setItemEnabled(MESSAGES.exportProjectMenuItem(), allowExport); fileDropDown.setItemEnabled(MESSAGES.exportAllProjectsMenuItem(), allowExportAll); fileDropDown.setItemEnabled(MESSAGES.exportSelectedProjectsMenuItem(), allowExportSelected); }

Target:
public void updateMenuState(int numSelectedProjects, int numProjects) { boolean allowDelete = !isReadOnly && numSelectedProjects > 0; boolean allowExport = numSelectedProjects > 0; boolean allowExportAll = numProjects > 0; String exportProjectLabel = numSelectedProjects > 1 ? MESSAGES.exportSelectedProjectsMenuItem(numSelectedProjects) : MESSAGES.exportProjectMenuItem(); fileDropDown.setItemHtmlById(WIDGET_NAME_EXPORTPROJECT, exportProjectLabel); fileDropDown.setItemEnabled(MESSAGES.deleteProjectMenuItem(), allowDelete); fileDropDown.setItemEnabledById(WIDGET_NAME_EXPORTPROJECT, allowExport); fileDropDown.setItemEnabled(MESSAGES.exportAllProjectsMenuItem(), allowExportAll); }
Source:
protected abstract BatchJob createJob(ProcessContext process) throws Exception; private void logParameters(ProcessContext process) { String output = "Parameter \"%s\": %s"; getParameters().forEach(param -> { String value = process.getParameter(param).map(NLS::toUserString).orElse(""); process.log(ProcessLog.info().withFormattedMessage(output, param.getLabel(), value)); }); }

Target:
protected abstract BatchJob createJob(ProcessContext process) throws Exception; private void logParameters(ProcessContext process) { StringBuilder output = new StringBuilder(); output.append("Parameter:\n\n"); getParameters().forEach(param -> { String value = process.getParameter(param).map(NLS::toUserString).orElse(""); output.append(param.getLabel()); output.append(": "); output.append(value); output.append("\n"); }); process.log(ProcessLog.info().withMessage(output.toString().trim())); }
Source:
public TBuilder setParentContextUID(UID parentUID) { if (parentUID == null) { this.getTypeInstance().setParentContext(null); } else { ContextEntity c = this.daoContext.get(parentUID); BillyValidator.found(c, ContextBuilderImpl.LOCALIZER.getString("field.parent_context")); if (!this.getTypeInstance().isNew() && this.daoContext.isSameOrSubContext(c, this.getTypeInstance())) { throw new BillyRuntimeException(); } this.getTypeInstance().setParentContext(c); } return this.getBuilder(); }

Target:
public TBuilder setParentContextUID(UID parentUID) { if (parentUID == null) { this.getTypeInstance().setParentContext(null); } else { ContextEntity c = this.daoContext.get(parentUID); BillyValidator.found(c, ContextBuilderImpl.LOCALIZER.getString("field.parent_context")); if (!this.getTypeInstance().isNew() && this.daoContext.isSameOrSubContext(c, this.getTypeInstance())) { throw new BillyRuntimeException("Can't set Parent Context on old instance, itself or sub context"); } this.getTypeInstance().setParentContext(c); } return this.getBuilder(); }
Source:
protected void executeVdsBrokerCommand() { GlusterVolumeGeoRepSessionVDSParameters parameter = getParameters(); if (parameter.getVolumeName() == null) { result = getBroker().glusterVolumeGeoRepStatus(); } else if (parameter.getVolumeName() != null && (parameter.getSlaveHost() == null || parameter.getSlaveVolume() == null)) { result = getBroker().glusterVolumeGeoRepStatus(parameter.getVolumeName()); } else { result = getBroker().glusterVolumeGeoRepStatus(parameter.getVolumeName(), parameter.getSlaveHost(), parameter.getSlaveVolume()); } proceedProxyReturnValue(); if (getVDSReturnValue().getSucceeded()) { setReturnValue(result.getGeoRepSessions()); } }

Target:
protected void executeVdsBrokerCommand() { GlusterVolumeGeoRepSessionVDSParameters parameter = getParameters(); if (parameter.getVolumeName() == null) { result = getBroker().glusterVolumeGeoRepStatus(); } else if (parameter.getSlaveHost() == null || parameter.getSlaveVolume() == null) { result = getBroker().glusterVolumeGeoRepStatus(parameter.getVolumeName()); } else { result = getBroker().glusterVolumeGeoRepStatus(parameter.getVolumeName(), parameter.getSlaveHost(), parameter.getSlaveVolume()); } proceedProxyReturnValue(); if (getVDSReturnValue().getSucceeded()) { setReturnValue(result.getGeoRepSessions()); } }
Source:
public void startListeners(ClientInterface cif) { m_ci = cif; m_migrateRowAdapter = new SimpleClientResponseAdapter( ClientInterface.MIGRATE_ROWS_DELETE_CID, "MigrateRowsAdapter"); m_ci.bindAdapter(m_migrateRowAdapter, null); m_migratePartitionAdapter = new SimpleClientResponseAdapter( ClientInterface.EXPORT_MANAGER_CID, getClass().getSimpleName()); cif.bindAdapter(m_migratePartitionAdapter, new ClientInterfaceRepairCallback() { @Override public void repairCompleted(int partitionId, long initiatorHSId) { handlePartitionLeader(partitionId, initiatorHSId); } @Override public void leaderMigrated(int partitionId, long initiatorHSId) { handlePartitionLeader(partitionId, initiatorHSId); } private void handlePartitionLeader(int partitionId, long initiatorHSId) { if (partitionId == MpInitiator.MP_INIT_PID) { return; } onPartitionLeaderMigrated(isLocalHost(initiatorHSId), partitionId); } private boolean isLocalHost(long hsId) { return CoreUtils.getHostIdFromHSId(hsId) == m_hostId; } }); }

Target:
public void startListeners(ClientInterface cif) { m_ci = cif; m_migratePartitionAdapter = new SimpleClientResponseAdapter( ClientInterface.EXPORT_MANAGER_CID, getClass().getSimpleName()); cif.bindAdapter(m_migratePartitionAdapter, new ClientInterfaceRepairCallback() { @Override public void repairCompleted(int partitionId, long initiatorHSId) { handlePartitionLeader(partitionId, initiatorHSId); } @Override public void leaderMigrated(int partitionId, long initiatorHSId) { handlePartitionLeader(partitionId, initiatorHSId); } private void handlePartitionLeader(int partitionId, long initiatorHSId) { if (partitionId == MpInitiator.MP_INIT_PID) { return; } onPartitionLeaderMigrated(isLocalHost(initiatorHSId), partitionId); } private boolean isLocalHost(long hsId) { return CoreUtils.getHostIdFromHSId(hsId) == m_hostId; } }); }
Source:
protected void listenerRemoved(ViatraQueryModelUpdateListener listener) { ChangeLevel changeLevel = listener.getLevel(); Collection<ViatraQueryModelUpdateListener> old = listenerMap.getOrDefault(changeLevel, Collections.emptySet()); boolean removed = old.remove(listener); if(!removed) { handleUnsuccesfulRemove(listener); } updateMaxLevel(); if(listenerMap.isEmpty()) { this.queryEngine.removeLifecycleListener(selfListener); removeBaseIndexChangeListener(); } }

Target:
protected void listenerRemoved(ViatraQueryModelUpdateListener listener) { ChangeLevel changeLevel = listener.getLevel(); Collection<ViatraQueryModelUpdateListener> old = listenerMap.getOrDefault(changeLevel, Collections.emptySet()); boolean removed = old.remove(listener); if(removed) { if (old.isEmpty()) listenerMap.remove(changeLevel); } else { handleUnsuccesfulRemove(listener); } updateMaxLevel(); if(listenerMap.isEmpty()) { this.queryEngine.removeLifecycleListener(selfListener); removeBaseIndexChangeListener(); } }
Source:
private void initialize() { chaserThing = ThingBuilder.create(THING_TYPE_CHASER, "testchaser").withLabel("Chaser Thing") .withBridge(bridge.getUID()).withConfiguration(new Configuration(thingProperties)).build(); managedThingProvider.add(bridge); dmxBridgeHandler = (TestBridgeHandler) waitForAssert(() -> { final ThingHandler thingHandler = bridge.getHandler(); assertThat(thingHandler, notNullValue()); return thingHandler; }); managedThingProvider.add(chaserThing); chaserThingHandler = (ChaserThingHandler) waitForAssert(() -> { final ThingHandler thingHandler = chaserThing.getHandler(); assertThat(thingHandler, notNullValue()); return thingHandler; }); final ManagedItemChannelLinkProvider itemChannelLinkProvider = waitForAssert(() -> { final ManagedItemChannelLinkProvider tmp = getService(ManagedItemChannelLinkProvider.class); assertThat(tmp, is(notNullValue())); return tmp; }); switchItem = new DimmerItem(TEST_SWITCHITEM_NAME); itemRegistry.add(switchItem); itemChannelLinkProvider .add(new ItemChannelLink(TEST_SWITCHITEM_NAME, new ChannelUID(chaserThing.getUID(), CHANNEL_SWITCH))); }

Target:
private void initialize() { chaserThing = ThingBuilder.create(THING_TYPE_CHASER, "testchaser").withLabel("Chaser Thing") .withBridge(bridge.getUID()).withConfiguration(new Configuration(thingProperties)) .withChannel( ChannelBuilder.create(CHANNEL_UID_SWITCH, "Switch").withType(SWITCH_CHANNEL_TYPEUID).build()) .build(); chaserThingHandler = new ChaserThingHandler(chaserThing) { @Override protected @Nullable Bridge getBridge() { return bridge; } }; initializeHandler(chaserThingHandler); }
Source:
protected void performOK() { if (isIndexerAffected) return; ICResourceDescription res = getResDesc(); IResourceInfo info = getResCfg(res); ITool[] t1; if (info instanceof IFolderInfo){ t1 = ((IFolderInfo)info).getFilteredTools(); } else if (info instanceof IFileInfo) { t1 = ((IFileInfo)info).getToolsToInvoke(); } else return; isIndexerAffected = false; for (ITool t : t1) { IOption op1[] = t.getOptions(); for (IOption op : op1) { if (((Option)op).isDirty()) { if (op.isForScannerDiscovery()) isIndexerAffected = true; else { try { switch (op.getValueType()) { case IOption.INCLUDE_PATH : case IOption.PREPROCESSOR_SYMBOLS : case IOption.LIBRARIES : case IOption.INCLUDE_FILES: case IOption.MACRO_FILES: case IOption.UNDEF_INCLUDE_PATH: case IOption.UNDEF_PREPROCESSOR_SYMBOLS: case IOption.UNDEF_INCLUDE_FILES: case IOption.UNDEF_LIBRARY_PATHS: case IOption.UNDEF_LIBRARY_FILES: case IOption.UNDEF_MACRO_FILES: isIndexerAffected = true; break; } } catch (BuildException e) { } } } } } super.performOK(); }

Target:
protected void performOK() { isIndexerAffected = false; if (!isDirty()) { super.performOK(); return; } ICResourceDescription res = getResDesc(); IResourceInfo info = getResCfg(res); ITool[] t1; if (info instanceof IFolderInfo){ t1 = ((IFolderInfo)info).getFilteredTools(); } else if (info instanceof IFileInfo) { t1 = ((IFileInfo)info).getToolsToInvoke(); } else return; for (ITool t : t1) { IOption op1[] = t.getOptions(); for (IOption op : op1) { if (((Option)op).isDirty()) { if (op.isForScannerDiscovery()) isIndexerAffected = true; else { try { switch (op.getValueType()) { case IOption.INCLUDE_PATH : case IOption.PREPROCESSOR_SYMBOLS : case IOption.INCLUDE_FILES: case IOption.MACRO_FILES: case IOption.UNDEF_INCLUDE_PATH: case IOption.UNDEF_PREPROCESSOR_SYMBOLS: case IOption.UNDEF_INCLUDE_FILES: case IOption.UNDEF_LIBRARY_PATHS: case IOption.UNDEF_LIBRARY_FILES: case IOption.UNDEF_MACRO_FILES: isIndexerAffected = true; break; } } catch (BuildException e) { } } } } } super.performOK(); }
Source:
public Set<Project> searchByReleaseId(String id, User user) { Set<String> ids = new HashSet<>(Arrays.asList(id)); return searchByReleaseId(ids, user); }

Target:
public Set<Project> searchByReleaseId(String id, User user) { return searchByReleaseId(Collections.singleton(id), user); }
Source:
public void deleteStep(final WorkflowStep step) throws DotDataException { Savepoint savepoint = null; try { for(WorkflowStep otherStep : findSteps(findScheme(step.getSchemeId()))){ for(WorkflowAction action : findActions(otherStep, APILocator.getUserAPI().getSystemUser())){ if(action.getNextStep().equals(step.getId())) { throw new DotDataException("</br> <b> Step : '" + step.getName() + "' is being referenced by </b> </br></br>" + " Step : '"+otherStep.getName() + "' -> Action : '" + action.getName() + "' </br></br>"); } } } final int countContentletsReferencingStep = getCountContentletsReferencingStep(step); if(countContentletsReferencingStep > 0){ throw new DotDataException("</br> <b> Step : '" + step.getName() + "' is being referenced by: "+countContentletsReferencingStep+" contenlet(s)</b> </br></br>"); } this.workFlowFactory.deleteActions(step); this.workFlowFactory.deleteStep(step); } catch(Exception e){ throw new DotDataException(e.getMessage(), e); } }

Target:
public void deleteStep(final WorkflowStep step) throws DotDataException { try { for(WorkflowStep otherStep : findSteps(findScheme(step.getSchemeId()))){ for(WorkflowAction action : findActions(otherStep, APILocator.getUserAPI().getSystemUser())){ if(action.getNextStep().equals(step.getId())) { throw new DotDataException("</br> <b> Step : '" + step.getName() + "' is being referenced by </b> </br></br>" + " Step : '"+otherStep.getName() + "' -> Action : '" + action.getName() + "' </br></br>"); } } } final int countContentletsReferencingStep = getCountContentletsReferencingStep(step); if(countContentletsReferencingStep > 0){ throw new DotDataException("</br> <b> Step : '" + step.getName() + "' is being referenced by: "+countContentletsReferencingStep+" contenlet(s)</b> </br></br>"); } this.workFlowFactory.deleteActions(step); this.workFlowFactory.deleteStep(step); } catch(Exception e){ throw new DotDataException(e.getMessage(), e); } }
Source:
private static Map<Long, SMRGarbageEntry> generateGarbageEntries(long markerAddress, List<SMRRecordLocator> locators) { Map<Long, SMRGarbageEntry> garbage = new TreeMap<>(); locators.forEach(locator -> { int serializedSize = locator.getSerializedSize(); SMRGarbageRecord garbageRecord = new SMRGarbageRecord(markerAddress, serializedSize); long globalAddress = locator.getGlobalAddress(); garbage.compute(globalAddress, (a, smrGabageEntry) -> { if (smrGabageEntry == null) { smrGabageEntry = new SMRGarbageEntry(); smrGabageEntry.setGlobalAddress(a); } smrGabageEntry.add(locator.getStreamId(), locator.getIndex(), garbageRecord); return smrGabageEntry; }); }); return garbage; }

Target:
private List<SMRGarbageEntry> generateGarbageEntries(long markerAddress, List<SMRRecordLocator> locators) { Map<Long, SMRGarbageEntry> garbage = new HashMap<>(); locators.forEach(locator -> { int serializedSize = locator.getSerializedSize(); SMRGarbageRecord garbageRecord = new SMRGarbageRecord(markerAddress, serializedSize); long globalAddress = locator.getGlobalAddress(); garbage.compute(globalAddress, (a, smrGarbageEntry) -> { if (smrGarbageEntry == null) { smrGarbageEntry = new SMRGarbageEntry(); smrGarbageEntry.setGlobalAddress(a); } smrGarbageEntry.add(locator.getStreamId(), locator.getIndex(), garbageRecord); return smrGarbageEntry; }); }); return new ArrayList<>(garbage.values()); }
Source:
private void addBlockingPanels() { RepeatingView rv; addOrReplace(rv = new RepeatingView("lazy2")); for (int i = 0; i < 5; i++) rv.add(new AjaxLazyLoadPanel(rv.newChildId()) { private static final long serialVersionUID = 1L; private int seconds = r.nextInt(5); @Override public Component getLazyLoadComponent(String markupId) { try { System.out.println("Starting sleep"); Thread.sleep(seconds * 1000); System.out.println("Slept " + seconds + " seconds"); } catch (InterruptedException e) { } return new Label(markupId, "Lazy loaded after blocking the Wicket thread for " + seconds + " seconds"); } }); }

Target:
private void addBlockingPanels() { RepeatingView rv; addOrReplace(rv = new RepeatingView("lazy2")); for (int i = 0; i < 5; i++) rv.add(new AjaxLazyLoadPanel(rv.newChildId()) { private static final long serialVersionUID = 1L; private int seconds = r.nextInt(5); @Override public Component getLazyLoadComponent(String markupId) { try { Thread.sleep(seconds * 1000); } catch (InterruptedException e) { } return new Label(markupId, "Lazy loaded after blocking the Wicket thread for " + seconds + " seconds"); } }); }
Source:
public void createArchive() { WebArchive war = ShrinkWrap.create(WebArchive.class, WAR_NAME); war.addClasses(FooResource.class, TestApplication.class, TestServlet.class); war.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); war.addAsWebInfResource(CDIResourceTest.class.getPackage(), "web-resteasy1082.xml", "web.xml"); war.addAsManifestResource(PermissionUtil.createPermissionsXmlAsset( new SecurityPermission("insertProvider"), new SecurityPermission("insertProvider.BC"), new RuntimePermission("accessDeclaredMembers") ), "permissions.xml"); war.as(ZipExporter.class).exportTo(exportFile, true); }

Target:
public void createArchive() { WebArchive war = ShrinkWrap.create(WebArchive.class, WAR_NAME); war.addClasses(FooResource.class, TestApplication.class, TestServlet.class); war.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); war.addAsWebInfResource(CDIResourceTest.class.getPackage(), "web-resteasy1082.xml", "web.xml"); war.addAsManifestResource(PermissionUtil.createPermissionsXmlAsset( new RuntimePermission("accessDeclaredMembers") ), "permissions.xml"); war.as(ZipExporter.class).exportTo(exportFile, true); }
Source:
public Object dynamicInvoke(InternalEObject target, EList<?> arguments) throws InvocationTargetException { final Map<String, Object> variables = new HashMap<String, Object>(); variables.put("self", target); for (int index = 0; index < parameterNames.size(); index++) { variables.put(parameterNames.get(index), arguments.get(index)); } final EvaluationResult evaluationResult; try { evaluationResult = engine.eval(astResult, variables); } catch (Exception e) { throw new InvocationTargetException(e); } if (evaluationResult.getDiagnostic().getSeverity() == Diagnostic.ERROR) { throw new InvocationTargetException(new AcceleoQueryEvaluationException(evaluationResult .getDiagnostic().getMessage())); } return evaluationResult.getResult(); }

Target:
public Object dynamicInvoke(InternalEObject target, EList<?> arguments) throws InvocationTargetException { if (arguments.size() != parameterNames.size()) { throw new IllegalArgumentException("number of arguments mismatch " + arguments.size() + " instead of " + parameterNames.size()); } final Map<String, Object> variables = new HashMap<String, Object>(); variables.put("self", target); for (int index = 0; index < parameterNames.size(); index++) { variables.put(parameterNames.get(index), arguments.get(index)); } final EvaluationResult evaluationResult; try { evaluationResult = engine.eval(astResult, variables); } catch (Exception e) { throw new InvocationTargetException(e); } if (evaluationResult.getDiagnostic().getSeverity() == Diagnostic.ERROR) { throw new InvocationTargetException(new AcceleoQueryEvaluationException(evaluationResult .getDiagnostic().getMessage())); } return evaluationResult.getResult(); }
Source:
public IdToken idTokenWithAudience(String targetAudience, List<Option> options) throws IOException { JsonFactory jsonFactory = OAuth2Utils.JSON_FACTORY; GenericData tokenRequest = new GenericData(); tokenRequest.set("grant_type", GRANT_TYPE); tokenRequest.set("client_id", GOOGLE_CLIENT_ID); tokenRequest.set("client_secret", GOOGLE_CLIENT_SECRET); tokenRequest.set("refresh_token", this.refreshToken); Iterator<String> it = this.scopes.iterator(); String customScopes = it.next(); while (it.hasNext()) { customScopes += "+" + it.next(); } tokenRequest.set("scope", customScopes); UrlEncodedContent content = new UrlEncodedContent(tokenRequest, true); HttpRequestFactory requestFactory = transportFactory.create().createRequestFactory(); HttpRequest request = requestFactory.buildPostRequest(new GenericUrl(tokenServerUri), content); request.setParser(new JsonObjectParser(jsonFactory)); request.setCurlLoggingEnabled(true); HttpResponse response = request.execute(); GenericData responseData = response.parseAs(GenericData.class); String rawToken = OAuth2Utils.validateString(responseData, "id_token", PARSE_ERROR_PREFIX); return IdToken.create(rawToken); }

Target:
public IdToken idTokenWithAudience(String targetAudience, List<Option> options) throws IOException { JsonFactory jsonFactory = OAuth2Utils.JSON_FACTORY; GenericData tokenRequest = new GenericData(); tokenRequest.set("grant_type", GRANT_TYPE); tokenRequest.set("client_id", GOOGLE_CLIENT_ID); tokenRequest.set("client_secret", GOOGLE_CLIENT_SECRET); tokenRequest.set("refresh_token", this.refreshToken); UrlEncodedContent content = new UrlEncodedContent(tokenRequest); HttpRequestFactory requestFactory = transportFactory.create().createRequestFactory(); HttpRequest request = requestFactory.buildPostRequest(new GenericUrl(tokenServerUri), content); request.setParser(new JsonObjectParser(jsonFactory)); request.setCurlLoggingEnabled(true); HttpResponse response = request.execute(); GenericData responseData = response.parseAs(GenericData.class); String rawToken = OAuth2Utils.validateString(responseData, "id_token", PARSE_ERROR_PREFIX); return IdToken.create(rawToken); }
Source:
public void setListenerOperation(String operation) { listener.setOperation(operation); }

Target:
void setListenerOperation(String operation) { listener.setOperation(operation); }
Source:
public void testExceptionInOnMessage() throws Exception { Nats.shutdownMsgDeliveryThreadPool(); final byte[] payload = "hello".getBytes(); for (int tests=0; tests<2; tests++) { final CountDownLatch latch = new CountDownLatch(1); try (NatsServer srv = runDefaultServer()) { try (final Connection conn = newDefaultConnection()) { try (final Connection pub = newDefaultConnection()) { try (Subscription sub = conn.subscribe("foo", new MessageHandler() { private int count = 0; public void onMessage(Message message) { if (this.count++ == 0) { throw new RuntimeException("On purpose"); } else { latch.countDown(); } } })) { conn.flush(); send(pub, "foo", payload, 2); if (!latch.await(2, TimeUnit.SECONDS)) { fail("Failed to continue receiving messages after exception in message callback"); } } } } } Nats.setMsgDeliveryThreadPoolSize(1); } }

Target:
public void testExceptionInOnMessage() throws Exception { Nats.shutdownMsgDeliveryThreadPool(); final byte[] payload = "hello".getBytes(); for (int tests=0; tests<2; tests++) { final CountDownLatch latch = new CountDownLatch(1); try (NatsServer srv = runDefaultServer()) { try (final Connection conn = newDefaultConnection()) { try (Subscription sub = conn.subscribe("foo", new MessageHandler() { private int count = 0; public void onMessage(Message message) { if (this.count++ == 0) { throw new RuntimeException("On purpose"); } else { latch.countDown(); } } })) { conn.flush(); send(conn, "foo", payload, 2); if (!latch.await(2, TimeUnit.SECONDS)) { fail("Failed to continue receiving messages after exception in message callback"); } } } } if (tests == 0) { Nats.createMsgDeliveryThreadPool(1); } } }
Source:
public String addDataMovementProtocol(String resourceId, DMType dmType, DataMovementInterface dataMovementInterface) throws AppCatalogException { if (dmType.equals(DMType.COMPUTE_RESOURCE)){ return (new DataMovementRepository()).addDataMovementProtocol(resourceId, dataMovementInterface); } else if (dmType.equals(DMType.STORAGE_RESOURCE)){ Mapper mapper = ObjectMapperSingleton.getInstance(); StorageInterfaceEntity storageInterfaceEntity = mapper.map(dataMovementInterface, StorageInterfaceEntity.class); storageInterfaceEntity.setStorageResourceId(resourceId); execute(entityManager -> entityManager.merge(storageInterfaceEntity)); return storageInterfaceEntity.getStorageResourceId(); } return null; }

Target:
public String addDataMovementProtocol(String resourceId, DMType dmType, DataMovementInterface dataMovementInterface) throws AppCatalogException { return (new DataMovementRepository()).addDataMovementProtocol(resourceId, dataMovementInterface); }
Source:
public RandomSampler(float rate) { checkArgument(rate > 0 && rate < 1, "rate should be between 0 and 1: was %s", rate); this.rate = rate; this.random = new Random(); }

Target:
public RandomSampler(float rate) { checkArgument(rate >= 0 && rate <= 1, "rate should be between 0 and 1: was %s", rate); this.rate = rate; }
Source:
public void runCommandAsync(String script) { if (script != null) { KitodoServiceLoader<CommandInterface> serviceLoader = new KitodoServiceLoader<>(CommandInterface.class, ConfigCore.getParameter("moduleFolder")); CommandInterface commandInterface = serviceLoader.loadModule(); Flowable<CommandResult> source = Flowable.fromCallable(() -> { return commandInterface.runCommand(generateId(), script); }); Flowable<CommandResult> commandBackgroundWorker = source.subscribeOn(Schedulers.io()); Flowable<CommandResult> commandResultListener = commandBackgroundWorker.observeOn(Schedulers.single()); commandResultListener.subscribe(commandResult -> handleCommandResult(commandResult), Throwable::printStackTrace); } }

Target:
public void runCommandAsync(String script) { if (script != null) { KitodoServiceLoader<CommandInterface> serviceLoader = new KitodoServiceLoader<>(CommandInterface.class, ConfigCore.getParameter("moduleFolder")); CommandInterface commandInterface = serviceLoader.loadModule(); Flowable<CommandResult> source = Flowable.fromCallable(() -> { return commandInterface.runCommand(generateId(), script); }); Flowable<CommandResult> commandBackgroundWorker = source.subscribeOn(Schedulers.io()); Flowable<CommandResult> commandResultListener = commandBackgroundWorker.observeOn(Schedulers.single()); commandResultListener.subscribe(commandResult -> handleCommandResult(commandResult)); } }
Source:
public void testDuplicateComponentModels() { WMessageBox messageBox = new WMessageBox(WMessageBox.Type.SUCCESS); assertNoDuplicateComponentModels(messageBox, "type", WMessageBox.Type.INFO); }

Target:
public void testDuplicateComponentModels() { WMessageBox messageBox = new WMessageBox(WMessageBox.Type.SUCCESS); assertNoDuplicateComponentModels(messageBox, "type", WMessageBox.Type.INFO); assertNoDuplicateComponentModels(messageBox, "titleText", "Test", new Serializable[]{}); }
Source:
public boolean apply(SshKey key) { checkNotNull(key, "key cannot be null"); checkNotNull(key.getPublicKey(), "key cannot be null"); return fingerprint.equals(computeFingerprint(key.getPublicKey())); }

Target:
public boolean apply(SshKey key) { checkNotNull(key, "key cannot be null"); checkNotNull(key.getPublicKey(), "public key cannot be null"); return fingerprint.equals(computeFingerprint(key.getPublicKey())); }
Source:
public void testSessionExpiry() throws Exception { HiveConf conf = new HiveConf(); conf.addResource(TestSessionExpiry.class.getResourceAsStream("/grill-site.xml")); conf.setVar(HiveConf.ConfVars.HIVE_SESSION_IMPL_CLASSNAME, GrillSessionImpl.class.getName()); conf.setLong(GrillConfConstants.GRILL_SESSION_TIMEOUT_SECONDS, 1L); CLIService cliService = new CLIService(); cliService.init(conf); HiveSessionService grillService = new HiveSessionService(cliService); grillService.init(conf); grillService.start(); try { GrillSessionHandle sessionHandle = grillService.openSession("foo", "bar", new HashMap<String, String>()); GrillSessionImpl session = grillService.getSession(sessionHandle); assertTrue(session.isActive()); session.setLastAccessTime(session.getLastAccessTime() - 2000 * conf.getLong(GrillConfConstants.GRILL_SESSION_TIMEOUT_SECONDS, GrillConfConstants.GRILL_SESSION_TIMEOUT_SECONDS_DEFAULT)); assertFalse(session.isActive()); grillService.getSessionExpiryRunnable().run(); try { grillService.getSession(sessionHandle); fail("Expected get session to fail for session " + sessionHandle.getPublicId()); } catch (Exception e) { } } finally { grillService.stop(); } }

Target:
public void testSessionExpiry() throws Exception { HiveConf conf = GrillServerConf.get(); conf.setVar(HiveConf.ConfVars.HIVE_SESSION_IMPL_CLASSNAME, GrillSessionImpl.class.getName()); conf.setLong(GrillConfConstants.GRILL_SESSION_TIMEOUT_SECONDS, 1L); CLIService cliService = new CLIService(); cliService.init(conf); HiveSessionService grillService = new HiveSessionService(cliService); grillService.init(conf); grillService.start(); try { GrillSessionHandle sessionHandle = grillService.openSession("foo", "bar", new HashMap<String, String>()); GrillSessionImpl session = grillService.getSession(sessionHandle); assertTrue(session.isActive()); session.setLastAccessTime(session.getLastAccessTime() - 2000 * conf.getLong(GrillConfConstants.GRILL_SESSION_TIMEOUT_SECONDS, GrillConfConstants.GRILL_SESSION_TIMEOUT_SECONDS_DEFAULT)); assertFalse(session.isActive()); grillService.getSessionExpiryRunnable().run(); try { grillService.getSession(sessionHandle); fail("Expected get session to fail for session " + sessionHandle.getPublicId()); } catch (Exception e) { } } finally { grillService.stop(); } }
Source:
int getAvailableHeightBellow(int height) { int partialBottomIndex = getPartialBottomIndex(); int topY = getLinePixel(partialBottomIndex); int lineHeight = renderer.getLineHeight(partialBottomIndex); int availableHeight = 0; int clientAreaHeight = this.clientAreaHeight - topMargin - bottomMargin; if (topY + lineHeight > clientAreaHeight) { availableHeight = lineHeight - (clientAreaHeight - topY); } int lineIndex = partialBottomIndex + 1; int lineCount = content.getLineCount(); while (height > availableHeight && lineIndex < lineCount) { availableHeight += renderer.getCachedLineHeight(lineIndex++); } return Math.min(height, availableHeight); }

Target:
int getAvailableHeightBellow(int height) { int partialBottomIndex = getPartialBottomIndex(); int topY = getLinePixel(partialBottomIndex); int lineHeight = renderer.getLineHeight(partialBottomIndex); int availableHeight = 0; int clientAreaHeight = this.clientAreaHeight - topMargin - bottomMargin; if (topY + lineHeight > clientAreaHeight) { availableHeight = lineHeight - (clientAreaHeight - topY); } int lineIndex = partialBottomIndex + 1; int lineCount = content.getLineCount(); while (height > availableHeight && lineIndex < lineCount) { availableHeight += renderer.getLineHeight(lineIndex++); } return Math.min(height, availableHeight); }
Source:
public List<KeySlice> get_range_slices(String kvsMethodName, TableReference tableRef, SlicePredicate predicate, KeyRange range, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException { int numberOfQueriedRows = range.count; return qosClient.executeRead( () -> client.get_range_slices(kvsMethodName, tableRef, predicate, range, consistency_level), ThriftQueryWeighers.getRangeSlices(numberOfQueriedRows)); }

Target:
public List<KeySlice> get_range_slices(String kvsMethodName, TableReference tableRef, SlicePredicate predicate, KeyRange range, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException { return qosClient.executeRead( () -> client.get_range_slices(kvsMethodName, tableRef, predicate, range, consistency_level), ThriftQueryWeighers.getRangeSlices(range)); }
Source:
public int disableSegments(String dataSource, Interval interval) { try { return connector.getDBI().withHandle( handle -> handle .createStatement(StringUtils.format( "UPDATE %s SET used=false WHERE datasource = :datasource and created_date between :start_date and :end_date", getSegmentsTable() )) .bind("datasource", dataSource) .bind("start_data", interval.getStart().toString()) .bind("end_data", interval.getEnd().toString()) .execute() ); } catch (Exception e) { throw new RuntimeException(e); } }

Target:
public int disableSegments(String dataSource, Interval interval) { try { return connector.getDBI().withHandle( handle -> handle .createStatement( StringUtils .format( "UPDATE %s SET used=false WHERE datasource = :datasource " + "AND start >= :start AND %2$send%2$s <= :end", getSegmentsTable(), connector.getQuoteString() )) .bind("datasource", dataSource) .bind("start", interval.getStart().toString()) .bind("end", interval.getEnd().toString()) .execute() ); } catch (Exception e) { throw new RuntimeException(e); } }
Source:
protected void handleUiEditElement(JsonEvent event) { String content = event.getData().getString(PROP_ELEMENT_CONTENT); String slot = event.getData().getString(PROP_SLOT); String elementId = event.getData().getString(PROP_ELEMENT_ID); getModel().getUIFacade().editElementFromUi(new ContentElement(content, slot, elementId)); }

Target:
protected void handleUiEditElement(JsonEvent event) { JSONObject data = event.getData(); String content = data.getString(PROP_ELEMENT_CONTENT); String slot = data.getString(PROP_SLOT); String elementId = data.getString(PROP_ELEMENT_ID); getModel().getUIFacade().editElementFromUi(new ContentElement(content, slot, elementId)); }
Source:
private Map<String, Pair<FieldType, FlattenExpr>> generateFieldPaths(List<FieldSpec> fieldSpecs) { Map<String, Pair<FieldType, FlattenExpr>> map = new LinkedHashMap<>(); for (FieldSpec fieldSpec : fieldSpecs) { String fieldName = fieldSpec.getName(); if (map.get(fieldName) != null) { throw new IllegalArgumentException("Cannot have duplicate field definition: " + fieldName); } FlattenExpr path = null; if (fieldSpec.getType() == FieldType.PATH) { path = new FlattenExpr(JsonPath.compile(fieldSpec.getExpr())); } else if (fieldSpec.getType() == FieldType.JQ) { try { path = new FlattenExpr(JsonQuery.compile(fieldSpec.getExpr())); } catch (JsonQueryException e) { throw new ParseException(e, "Unable to compile JQ expression [%s]", fieldSpec.getExpr()); } } Pair<FieldType, FlattenExpr> pair = new Pair<>(fieldSpec.getType(), path); map.put(fieldName, pair); } return map; }

Target:
private Map<String, Pair<FieldType, FlattenExpr>> generateFieldPaths(List<FieldSpec> fieldSpecs) { Map<String, Pair<FieldType, FlattenExpr>> map = new LinkedHashMap<>(); for (FieldSpec fieldSpec : fieldSpecs) { String fieldName = fieldSpec.getName(); if (map.get(fieldName) != null) { throw new IllegalArgumentException("Cannot have duplicate field definition: " + fieldName); } FlattenExpr path = null; if (fieldSpec.getType() == FieldType.PATH) { path = new FlattenExpr(JsonPath.compile(fieldSpec.getExpr())); } else if (fieldSpec.getType() == FieldType.JQ) { try { path = new FlattenExpr(JsonQuery.compile(fieldSpec.getExpr())); } catch (JsonQueryException e) { throw new IllegalArgumentException("Unable to compile JQ expression: " + fieldSpec.getExpr()); } } Pair<FieldType, FlattenExpr> pair = new Pair<>(fieldSpec.getType(), path); map.put(fieldName, pair); } return map; }
Source:
public List<FeatureTypeStyle> transformInternal(MBStyle styleContext) { MBStyleTransformer transformer = new MBStyleTransformer(parse); Fill fill; if (hasBackgroundPattern()) { ExternalGraphic eg = transformer.createExternalGraphicForSprite(backgroundPattern(), styleContext); GraphicFill gf = sf.graphicFill(Arrays.asList(eg), backgroundOpacity(), null, null, null, null); fill = sf.fill(gf, backgroundColor(), backgroundOpacity()); } else { fill = sf.fill(null, backgroundColor(), backgroundOpacity()); } Symbolizer symbolizer = sf.polygonSymbolizer(getId(), ff.property((String) null), sf.description(Text.text("fill"), null), NonSI.PIXEL, null, fill, null, ff.literal(0)); List<Symbolizer> symbolizers = new ArrayList<Symbolizer>(); symbolizers.add(symbolizer); MBFilter filter = getFilter(); List<org.opengis.style.Rule> rules = new ArrayList<>(); Rule rule = sf.rule( getId(), null, null, 0.0, Double.POSITIVE_INFINITY, symbolizers, filter.filter()); rule.setLegendGraphic(new Graphic[0]); rules.add(rule); List<FeatureTypeStyle> style = new ArrayList<>(); style.add(sf.featureTypeStyle(getId(), sf.description(Text.text("MBStyle " + getId()), Text.text("Generated for " + getSourceLayer())), null, Collections.emptySet(), filter.semanticTypeIdentifiers(), rules)); return style; }

Target:
public List<FeatureTypeStyle> transformInternal(MBStyle styleContext) { MBStyleTransformer transformer = new MBStyleTransformer(parse); Fill fill; if (hasBackgroundPattern()) { ExternalGraphic eg = transformer.createExternalGraphicForSprite(backgroundPattern(), styleContext); GraphicFill gf = sf.graphicFill(Arrays.asList(eg), backgroundOpacity(), null, null, null, null); fill = sf.fill(gf, backgroundColor(), backgroundOpacity()); } else { fill = sf.fill(null, backgroundColor(), backgroundOpacity()); } Symbolizer symbolizer = sf.polygonSymbolizer(getId(), ff.property((String) null), sf.description(Text.text("fill"), null), NonSI.PIXEL, null, fill, null, ff.literal(0)); List<Symbolizer> symbolizers = new ArrayList<Symbolizer>(); symbolizers.add(symbolizer); MBFilter filter = getFilter(); List<org.opengis.style.Rule> rules = new ArrayList<>(); Rule rule = sf.rule( getId(), null, null, 0.0, Double.POSITIVE_INFINITY, symbolizers, filter.filter()); rule.setLegendGraphic(new Graphic[0]); rules.add(rule); return Collections.singletonList(sf.featureTypeStyle(getId(), sf.description(Text.text("MBStyle " + getId()), Text.text("Generated for " + getSourceLayer())), null, Collections.emptySet(), filter.semanticTypeIdentifiers(), rules)); }