Skip to content

Commit

Permalink
cleanup - remove explicit type checks with diamond operator
Browse files Browse the repository at this point in the history
  • Loading branch information
SavvasMisaghMoayyed committed Mar 5, 2018
1 parent 03c20c5 commit 68cd719
Show file tree
Hide file tree
Showing 360 changed files with 1,326 additions and 1,325 deletions.
Expand Up @@ -84,13 +84,13 @@ public SystemConfigPanel(String id, IModel<SystemConfigurationDto> model) {
}

protected void initLayout() {
ChooseTypePanel<SecurityPolicyType> securityPolicyChoosePanel = new ChooseTypePanel<SecurityPolicyType>(ID_GLOBAL_SECURITY_POLICY_CHOOSER,
new PropertyModel<ObjectViewDto<SecurityPolicyType>>(getModel(), SystemConfigurationDto.F_SECURITY_POLICY));
ChooseTypePanel<SecurityPolicyType> securityPolicyChoosePanel = new ChooseTypePanel<>(ID_GLOBAL_SECURITY_POLICY_CHOOSER,
new PropertyModel<>(getModel(), SystemConfigurationDto.F_SECURITY_POLICY));

add(securityPolicyChoosePanel);

ObjectPolicyConfigurationEditor objectPolicyEditor = new ObjectPolicyConfigurationEditor(ID_OBJECT_POLICY_EDITOR,
new PropertyModel<List<ObjectPolicyConfigurationTypeDto>>(getModel(), SystemConfigurationDto.F_OBJECT_POLICY_LIST));
new PropertyModel<>(getModel(), SystemConfigurationDto.F_OBJECT_POLICY_LIST));
add(objectPolicyEditor);

DropDownFormGroup assignmentPolicyEnforcementLevel = new DropDownFormGroup(ID_GLOBAL_CHOOSEASSIGNEMNTPOLICYENFORCEMENT,
Expand Down Expand Up @@ -144,18 +144,18 @@ protected void initLayout() {
null, true, CLEANUP_LABEL_SIZE, CLEANUP_INPUT_SIZE, false, false);
add(resultsRecordsField);

TextFormGroup deploymentInfoName = new TextFormGroup(ID_DEPLOYMENT_INFO_NAME, new PropertyModel<String>(getModel(), "deploymentInformation.name"), createStringResource("SystemConfigPanel.deploymentInformation.name"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
TextAreaFormGroup deploymentInfoDescription = new TextAreaFormGroup(ID_DEPLOYMENT_INFO_DESCRIPTION, new PropertyModel<String>(getModel(), "deploymentInformation.description"), createStringResource("SystemConfigPanel.deploymentInformation.description"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
TextFormGroup deploymentInfoHeaderColor = new TextFormGroup(ID_DEPLOYMENT_INFO_HEADER_COLOR, new PropertyModel<String>(getModel(), "deploymentInformation.headerColor"), createStringResource("SystemConfigPanel.deploymentInformation.headerColor"),"SystemConfigPanel.tooltip.color", true, ID_LABEL_SIZE, ID_INPUT_SIZE, false , false); // TODO change to a more user friendly solution
TextFormGroup deploymentInfoName = new TextFormGroup(ID_DEPLOYMENT_INFO_NAME, new PropertyModel<>(getModel(), "deploymentInformation.name"), createStringResource("SystemConfigPanel.deploymentInformation.name"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
TextAreaFormGroup deploymentInfoDescription = new TextAreaFormGroup(ID_DEPLOYMENT_INFO_DESCRIPTION, new PropertyModel<>(getModel(), "deploymentInformation.description"), createStringResource("SystemConfigPanel.deploymentInformation.description"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
TextFormGroup deploymentInfoHeaderColor = new TextFormGroup(ID_DEPLOYMENT_INFO_HEADER_COLOR, new PropertyModel<>(getModel(), "deploymentInformation.headerColor"), createStringResource("SystemConfigPanel.deploymentInformation.headerColor"),"SystemConfigPanel.tooltip.color", true, ID_LABEL_SIZE, ID_INPUT_SIZE, false , false); // TODO change to a more user friendly solution

TextFormGroup deploymentInfoImageUrl = new TextFormGroup(ID_DEPLOYMENT_INFO_LOGO_IMAGEURL, new PropertyModel<String>(getModel(), "deploymentInformation.logo.imageUrl"), createStringResource("SystemConfigPanel.deploymentInformation.logoImageUrl"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
TextFormGroup deploymentInfoCssClass = new TextFormGroup(ID_DEPLOYMENT_INFO_LOGO_CSS, new PropertyModel<String>(getModel(), "deploymentInformation.logo.cssClass"), createStringResource("SystemConfigPanel.deploymentInformation.logoCssClass"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
TextFormGroup deploymentInfoImageUrl = new TextFormGroup(ID_DEPLOYMENT_INFO_LOGO_IMAGEURL, new PropertyModel<>(getModel(), "deploymentInformation.logo.imageUrl"), createStringResource("SystemConfigPanel.deploymentInformation.logoImageUrl"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
TextFormGroup deploymentInfoCssClass = new TextFormGroup(ID_DEPLOYMENT_INFO_LOGO_CSS, new PropertyModel<>(getModel(), "deploymentInformation.logo.cssClass"), createStringResource("SystemConfigPanel.deploymentInformation.logoCssClass"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);


TextFormGroup deploymentInfoSkin = new TextFormGroup(ID_DEPLOYMENT_INFO_SKIN, new PropertyModel<String>(getModel(), "deploymentInformation.skin"), createStringResource("SystemConfigPanel.deploymentInformation.skin"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
TextFormGroup deploymentInfoCustomerUrl = new TextFormGroup(ID_DEPLOYMENT_INFO_CUSTOMER_URL, new PropertyModel<String>(getModel(), "deploymentInformation.customerUrl"), createStringResource("SystemConfigPanel.deploymentInformation.customerUrl"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
TextFormGroup deploymentInfoPartnerName = new TextFormGroup(ID_DEPLOYMENT_INFO_PARTNER_NAME, new PropertyModel<String>(getModel(), "deploymentInformation.partnerName"), createStringResource("SystemConfigPanel.deploymentInformation.partnerName"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
TextFormGroup deploymentInfoSubscriptionId = new TextFormGroup(ID_DEPLOYMENT_INFO_SUBSCRIPTION_ID, new PropertyModel<String>(getModel(), "deploymentInformation.subscriptionIdentifier"), createStringResource("SystemConfigPanel.deploymentInformation.subscriptionIdentifier"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
TextFormGroup deploymentInfoSkin = new TextFormGroup(ID_DEPLOYMENT_INFO_SKIN, new PropertyModel<>(getModel(), "deploymentInformation.skin"), createStringResource("SystemConfigPanel.deploymentInformation.skin"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
TextFormGroup deploymentInfoCustomerUrl = new TextFormGroup(ID_DEPLOYMENT_INFO_CUSTOMER_URL, new PropertyModel<>(getModel(), "deploymentInformation.customerUrl"), createStringResource("SystemConfigPanel.deploymentInformation.customerUrl"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
TextFormGroup deploymentInfoPartnerName = new TextFormGroup(ID_DEPLOYMENT_INFO_PARTNER_NAME, new PropertyModel<>(getModel(), "deploymentInformation.partnerName"), createStringResource("SystemConfigPanel.deploymentInformation.partnerName"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);
TextFormGroup deploymentInfoSubscriptionId = new TextFormGroup(ID_DEPLOYMENT_INFO_SUBSCRIPTION_ID, new PropertyModel<>(getModel(), "deploymentInformation.subscriptionIdentifier"), createStringResource("SystemConfigPanel.deploymentInformation.subscriptionIdentifier"), ID_LABEL_SIZE, ID_INPUT_SIZE, false);

WebMarkupContainer deploymentInfoContainer = new WebMarkupContainer(ID_DEPLOYMENT_INFO_CONTAINER);

Expand All @@ -174,7 +174,7 @@ protected void initLayout() {
add(deploymentInfoContainer);


CheckFormGroup experimentalCodeCheck = new CheckFormGroup(ID_EXPERIMENTAL_CODE_CHECKBOX, new PropertyModel<Boolean>(getModel(), SystemConfigurationDto.F_ENABLE_EXPERIMENTAL_CODE), createStringResource("SystemConfigPanel.misc.enableExperimentalCode"), ID_LABEL_SIZE, ID_INPUT_SIZE);
CheckFormGroup experimentalCodeCheck = new CheckFormGroup(ID_EXPERIMENTAL_CODE_CHECKBOX, new PropertyModel<>(getModel(), SystemConfigurationDto.F_ENABLE_EXPERIMENTAL_CODE), createStringResource("SystemConfigPanel.misc.enableExperimentalCode"), ID_LABEL_SIZE, ID_INPUT_SIZE);
add(experimentalCodeCheck);

}
Expand Down
Expand Up @@ -39,7 +39,7 @@ public static enum Operation {
private Map<String, String> resourceFocusMap = new HashMap<>();

public DebugConfDialogDto(){
this(null, new ArrayList<DebugObjectItem>(), null);
this(null, new ArrayList<>(), null);
}

public DebugConfDialogDto(Operation operation, List<DebugObjectItem> objects, Class<? extends ObjectType> type) {
Expand Down
Expand Up @@ -121,6 +121,6 @@ public void setStatus(OperationResultStatusType status) {

@Override
public List<InlineMenuItem> getMenuItems() {
return new ArrayList<InlineMenuItem>();
return new ArrayList<>();
}
}
Expand Up @@ -34,7 +34,7 @@ public class FilterConfiguration extends Selectable implements Editable {

private boolean editing;
private LoggingLevelType level;
private List<String> appenders = new ArrayList<String>();
private List<String> appenders = new ArrayList<>();
private LoggingComponentType component;

public FilterConfiguration(SubSystemLoggerConfigurationType config) {
Expand Down
Expand Up @@ -294,10 +294,10 @@ private ObjectViewDto<SecurityPolicyType> loadSecurityPolicy(SystemConfiguration
ObjectReferenceType securityPolicy = config.getGlobalSecurityPolicyRef();

if (securityPolicy != null) {
securityPolicyDto = new ObjectViewDto<SecurityPolicyType>(securityPolicy.getOid(),
WebComponentUtil.getName(securityPolicy));
securityPolicyDto = new ObjectViewDto<>(securityPolicy.getOid(),
WebComponentUtil.getName(securityPolicy));
} else {
securityPolicyDto = new ObjectViewDto<SecurityPolicyType>();
securityPolicyDto = new ObjectViewDto<>();
}

securityPolicyDto.setType(SecurityPolicyType.class);
Expand Down
Expand Up @@ -78,7 +78,7 @@ public class PageDashboard extends PageAdminHome {
private static final String ID_PERSONAL_INFO = "personalInfo";
private static final String ID_SYSTEM_INFO = "systemInfo";

private final Model<PrismObject<UserType>> principalModel = new Model<PrismObject<UserType>>();
private final Model<PrismObject<UserType>> principalModel = new Model<>();

public PageDashboard() {
principalModel.setObject(loadUserSelf());
Expand Down Expand Up @@ -174,7 +174,7 @@ private <F extends FocusType> InfoBoxPanel createFocusInfoBoxPanel(String id, Cl
infoBoxType.setNumber("ERROR: "+e.getMessage());
}

Model<InfoBoxType> boxModel = new Model<InfoBoxType>(infoBoxType);
Model<InfoBoxType> boxModel = new Model<>(infoBoxType);

return new InfoBoxPanel(id, boxModel, linkPage);
}
Expand Down Expand Up @@ -211,7 +211,7 @@ private Component createResourceInfoBoxPanel(OperationResult result, Task task)
infoBoxType.setNumber("ERROR: "+e.getMessage());
}

Model<InfoBoxType> boxModel = new Model<InfoBoxType>(infoBoxType);
Model<InfoBoxType> boxModel = new Model<>(infoBoxType);

return new InfoBoxPanel(ID_INFO_BOX_RESOURCES, boxModel, PageResources.class);
}
Expand Down Expand Up @@ -247,7 +247,7 @@ private Component createTaskInfoBoxPanel(OperationResult result, Task task) {
infoBoxType.setNumber("ERROR: "+e.getMessage());
}

Model<InfoBoxType> boxModel = new Model<InfoBoxType>(infoBoxType);
Model<InfoBoxType> boxModel = new Model<>(infoBoxType);

return new InfoBoxPanel(ID_INFO_BOX_TASKS, boxModel, PageTasks.class);
}
Expand Down
Expand Up @@ -150,7 +150,7 @@ public List<SecurityQuestionAnswerDTO> createUsersSecurityQuestionsList(PrismObj
if (secQuestAnsList != null) {

LOGGER.debug("User SecurityQuestion ANswer List is Not null");
List<SecurityQuestionAnswerDTO> secQuestAnswListDTO = new ArrayList<SecurityQuestionAnswerDTO>();
List<SecurityQuestionAnswerDTO> secQuestAnswListDTO = new ArrayList<>();
for (Iterator iterator = secQuestAnsList.iterator(); iterator
.hasNext(); ) {
SecurityQuestionAnswerType securityQuestionAnswerType = (SecurityQuestionAnswerType) iterator
Expand Down Expand Up @@ -184,7 +184,7 @@ public void initLayout(){
Form mainForm = new com.evolveum.midpoint.web.component.form.Form(ID_MAIN_FORM);

//question panel list
pqPanels = new ArrayList<MyPasswordQuestionsPanel>();
pqPanels = new ArrayList<>();
OperationResult result = new OperationResult(OPERATION_LOAD_QUESTION_POLICY);
try{

Expand All @@ -207,7 +207,7 @@ public void initLayout(){
policyQuestionList = credPolicy.getSecurityQuestions().getQuestion();
} else {
questionNumber = 0;
policyQuestionList = new ArrayList<SecurityQuestionDefinitionType>();
policyQuestionList = new ArrayList<>();
}
}catch(Exception ex){
ex.printStackTrace();
Expand Down
Expand Up @@ -41,12 +41,12 @@ public MyAccountsPanel(String id, IModel<List<SimpleAccountDto>> model) {

@Override
protected void initLayout() {
List<IColumn<SimpleAccountDto, String>> columns = new ArrayList<IColumn<SimpleAccountDto, String>>();
List<IColumn<SimpleAccountDto, String>> columns = new ArrayList<>();
columns.add(new PropertyColumn(createStringResource("MyAccountsPanel.account.name"), "accountName"));
columns.add(new PropertyColumn(createStringResource("MyAccountsPanel.account.resource"), "resourceName"));

ISortableDataProvider provider = new ListDataProvider(this, getModel());
TablePanel accountsTable = new TablePanel<SimpleAccountDto>(ID_ACCOUNTS_TABLE, provider, columns);
TablePanel accountsTable = new TablePanel<>(ID_ACCOUNTS_TABLE, provider, columns);
accountsTable.setShowPaging(false);

add(accountsTable);
Expand Down
Expand Up @@ -51,7 +51,7 @@ public MyAssignmentsPanel(String id, IModel<List<AssignmentItemDto>> model) {
}

private void initLayout() {
List<IColumn<AssignmentItemDto, String>> columns = new ArrayList<IColumn<AssignmentItemDto, String>>();
List<IColumn<AssignmentItemDto, String>> columns = new ArrayList<>();
columns.add(new IconColumn<AssignmentItemDto>(null) {
private static final long serialVersionUID = 1L;

Expand Down Expand Up @@ -94,7 +94,7 @@ public void populateItem(Item<ICellPopulator<AssignmentItemDto>> cellItem, Strin


ISortableDataProvider provider = new ListDataProvider(this, getModel());
TablePanel accountsTable = new TablePanel<AssignmentItemDto>(ID_ASSIGNMETNS_TABLE, provider, columns);
TablePanel accountsTable = new TablePanel<>(ID_ASSIGNMETNS_TABLE, provider, columns);
accountsTable.setShowPaging(false);

add(accountsTable);
Expand Down
Expand Up @@ -64,7 +64,7 @@ public void initLayout() {
*/
@Override
public List<FormComponent> getFormComponents() {
List<FormComponent> list = new ArrayList<FormComponent>();
List<FormComponent> list = new ArrayList<>();
list.add((FormComponent) get(F_QUESTION));
list.add((FormComponent) get(F_ANSWER));

Expand Down
Expand Up @@ -31,7 +31,7 @@ public class AccountCallableResult<T> extends CallableResult<T> {

public List<OperationResult> getFetchResults() {
if (fetchResults == null) {
fetchResults = new ArrayList<OperationResult>();
fetchResults = new ArrayList<>();
}
return fetchResults;
}
Expand Down
Expand Up @@ -32,35 +32,35 @@ public class AdminHomeDto implements Serializable {

public List<SimpleAssignmentDto> getOrgAssignments() {
if (orgAssignments == null) {
orgAssignments = new ArrayList<SimpleAssignmentDto>();
orgAssignments = new ArrayList<>();
}
return orgAssignments;
}

public List<SimpleAccountDto> getAccounts() {
if (accounts == null) {
accounts = new ArrayList<SimpleAccountDto>();
accounts = new ArrayList<>();
}
return accounts;
}

public List<SimpleAssignmentDto> getAssignments() {
if (assignments == null) {
assignments = new ArrayList<SimpleAssignmentDto>();
assignments = new ArrayList<>();
}
return assignments;
}

public List<String> getResources() {
if (resources == null) {
resources = new ArrayList<String>();
resources = new ArrayList<>();
}
return resources;
}

public List<WorkItemDto> getWorkItems() {
if (workItems == null) {
workItems = new ArrayList<WorkItemDto>();
workItems = new ArrayList<>();
}
return workItems;
}
Expand Down
Expand Up @@ -41,7 +41,7 @@ public class MyPasswordsDto implements Serializable {

public List<PasswordAccountDto> getAccounts() {
if (accounts == null) {
accounts = new ArrayList<PasswordAccountDto>();
accounts = new ArrayList<>();
}
return accounts;
}
Expand Down
Expand Up @@ -194,7 +194,7 @@ protected boolean isWarnMessageVisible(){
protected void changeTabPerformed(int index){
if (roots != null && index >= 0 && index <= roots.size()){
SessionStorage storage = getPageBase().getSessionStorage();
SelectableBean<OrgType> selected = new SelectableBean<OrgType>();
SelectableBean<OrgType> selected = new SelectableBean<>();
selected.setValue(roots.get(index).asObjectable());
storage.getUsers().setSelectedItem(selected);
storage.getUsers().setSelectedTabId(index);
Expand Down
Expand Up @@ -149,11 +149,11 @@ protected List<InlineMenuItem> createInlineMenuItems(OrgType org) {
List<IColumn<SelectableBean<OrgType>, String>> columns = new ArrayList<>();

if (selectable) {
columns.add(new CheckBoxHeaderColumn<SelectableBean<OrgType>>());
columns.add(new CheckBoxHeaderColumn<>());
}

columns.add(new TreeColumn<SelectableBean<OrgType>, String>(
createStringResource("TreeTablePanel.hierarchy")));
columns.add(new TreeColumn<>(
createStringResource("TreeTablePanel.hierarchy")));
columns.add(new InlineMenuHeaderColumn(createTreeChildrenMenu(null)));

WebMarkupContainer treeContainer = new WebMarkupContainer(ID_TREE_CONTAINER) {
Expand Down Expand Up @@ -264,7 +264,7 @@ protected void onModelChanged() {
private static class TreeStateModel extends AbstractReadOnlyModel<Set<SelectableBean<OrgType>>> {
private static final long serialVersionUID = 1L;

private TreeStateSet<SelectableBean<OrgType>> set = new TreeStateSet<SelectableBean<OrgType>>();
private TreeStateSet<SelectableBean<OrgType>> set = new TreeStateSet<>();
private ISortableTreeProvider provider;
private OrgTreePanel panel;

Expand Down
Expand Up @@ -166,7 +166,7 @@ private void initAuditLogHistoryPanel(WebMarkupContainer eventPanel){
private static final long serialVersionUID = 1L;

public Map<String, Object> getParameters() {
Map<String, Object> parameters = new HashMap<String, Object>();
Map<String, Object> parameters = new HashMap<>();
parameters.put(AuditEventRecordProvider.PARAMETER_TASK_IDENTIFIER, recordModel.getObject().getTaskIdentifier());
return parameters;
}
Expand Down
Expand Up @@ -90,7 +90,7 @@ public class PageNewReport extends PageAdminReports {
private Model<String> xmlEditorModel;

public PageNewReport() {
xmlEditorModel = new Model<String>(null);
xmlEditorModel = new Model<>(null);

initLayout();
}
Expand All @@ -107,7 +107,7 @@ private void initLayout() {
buttonBar.setOutputMarkupId(true);
mainForm.add(buttonBar);

final IModel<Integer> groupModel = new Model<Integer>(INPUT_FILE);
final IModel<Integer> groupModel = new Model<>(INPUT_FILE);
RadioGroup importRadioGroup = new RadioGroup(ID_IMPORT_RADIO_GROUP, groupModel);
importRadioGroup.add(new AjaxFormChoiceComponentUpdatingBehavior() {

Expand Down Expand Up @@ -278,4 +278,4 @@ private void importReportFromStreamPerformed(AjaxRequestTarget target) {
showResult(result);
target.add(getFeedbackPanel());
}
}
}

0 comments on commit 68cd719

Please sign in to comment.