Skip to content

Commit

Permalink
vscode suppress type warnings (#6987)
Browse files Browse the repository at this point in the history
  • Loading branch information
pethers authored Jan 11, 2025
1 parent 475a782 commit 298669d
Show file tree
Hide file tree
Showing 27 changed files with 63 additions and 24 deletions.
6 changes: 6 additions & 0 deletions citizen-intelligence-agency/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,19 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jpamodelgen</artifactId>
<version>${cia.project.versions.hibernate}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>javax.persistence-api</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents.core5</groupId>
<artifactId>httpcore5</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ private void createDashboardMonarch(final ResponsiveRow row) {
/**
* Create a section for Government info.
*/
@SuppressWarnings("unchecked")
private void createDashboardGovernment(final ResponsiveRow row) {
final VerticalLayout govLayout = createLayoutWithTitle("Government");
final HorizontalLayout statsLayout = new HorizontalLayout();
Expand Down Expand Up @@ -201,6 +202,7 @@ private void createDashboardGovernment(final ResponsiveRow row) {
/**
* Create a section for Parliament info.
*/
@SuppressWarnings("unchecked")
private void createDashboardParliament(final ResponsiveRow row) {
final VerticalLayout parliamentLayout = createLayoutWithTitle("Parliament");
final HorizontalLayout statsLayout = new HorizontalLayout();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public class LeaderCardUtil {
*
* @return the list
*/
@SuppressWarnings("unchecked")
public List<ViewRiksdagenGovermentRoleMember> loadActiveGovernmentRoleMembers() {
final DataContainer<ViewRiksdagenGovermentRoleMember, String> govermentRoleMemberDataContainer = applicationManager
.getDataContainer(ViewRiksdagenGovermentRoleMember.class);
Expand All @@ -67,6 +68,7 @@ public List<ViewRiksdagenGovermentRoleMember> loadActiveGovernmentRoleMembers()
*
* @return the map
*/
@SuppressWarnings("unchecked")
public Map<String, List<ViewRiksdagenPolitician>> loadActivePoliticiansByPersonId() {
final DataContainer<ViewRiksdagenPolitician, String> politicianDataContainer = applicationManager
.getDataContainer(ViewRiksdagenPolitician.class);
Expand Down Expand Up @@ -428,6 +430,7 @@ private void addPartyExperince(VerticalLayout layout, ViewRiksdagenPartyRoleMemb
* @param leader the leader
* @return the view riksdagen goverment role member
*/
@SuppressWarnings("unchecked")
private ViewRiksdagenGovermentRoleMember findGovernmentRoleForLeader(ViewRiksdagenPolitician leader) {
final DataContainer<ViewRiksdagenGovermentRoleMember, String> govermentRoleMemberDataContainer = applicationManager
.getDataContainer(ViewRiksdagenGovermentRoleMember.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public static Map<String, Boolean> computePartyLeaders(ApplicationManager applic
return result;
}

@SuppressWarnings("unchecked")
private static List<ViewRiksdagenPartyRoleMember> getActiveRoles(ApplicationManager applicationManager, String personId) {
return applicationManager.getDataContainer(ViewRiksdagenPartyRoleMember.class)
.findListByProperty(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public CommitteeCurrentMembersHistoryPageModContentFactoryImpl() {
super();
}

@SuppressWarnings("unchecked")
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public MinistryCurrentMembersPageModContentFactoryImpl() {
super();
}

@SuppressWarnings("unchecked")
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public PartyCommitteeRolesPageModContentFactoryImpl() {
super();
}

@SuppressWarnings("unchecked")
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public PartyCurrentLeadersPageModContentFactoryImpl() {
super();
}

@SuppressWarnings("unchecked")
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public PartyCurrentMembersPageModContentFactoryImpl() {
super();
}

@SuppressWarnings("unchecked")
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public PartyGovernmentRolesPageModContentFactoryImpl() {
super();
}

@SuppressWarnings("unchecked")
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ public PartyRankingDataGridPageModContentFactoryImpl() {
* @param panel the panel
* @return the layout
*/
@SuppressWarnings("unchecked")
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ public PoliticianRankingDataGridPageModContentFactoryImpl() {
super();
}

@SuppressWarnings("unchecked")
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;

import org.junit.After;
import org.junit.AfterClass;
Expand Down Expand Up @@ -166,6 +165,7 @@ public final void closeWebDriver() {
*
* @return the web driver
*/
@SuppressWarnings("null")
protected final synchronized WebDriver getWebDriver() {

WebDriver driver = null;
Expand All @@ -182,11 +182,10 @@ protected final synchronized WebDriver getWebDriver() {
fail("No valid browser parameter:" + browser);
}

driver.manage().timeouts().pageLoadTimeout(90, TimeUnit.SECONDS);
driver.manage().timeouts().setScriptTimeout(90, TimeUnit.SECONDS);
driver.manage().timeouts().pageLoadTimeout(java.time.Duration.ofSeconds(90));
driver.manage().timeouts().scriptTimeout(java.time.Duration.ofSeconds(90));


webDriverMap.put(browser, driver);
webDriverMap.put(browser, driver);
return driver;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ private static Method getCaseInsensitiveDeclaredMethod(final Object obj, final S
* the method name
* @return the case insensitive static declared method
*/
@SuppressWarnings("rawtypes")
private static Method getCaseInsensitiveStaticDeclaredMethod(final Class clazz, final String methodName) {
final Method[] methods = clazz.getMethods();
Method method = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class ComplianceCheckPageItemRendererClickListenerTest extends AbstractUn
/**
* Click party test.
*/
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
@Test
public void clickPartyTest() {
final ComplianceCheckPageItemRendererClickListener listener = new ComplianceCheckPageItemRendererClickListener();
Expand All @@ -61,7 +61,7 @@ public void clickPartyTest() {
/**
* Click politician test.
*/
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
@Test
public void clickPoliticianTest() {
final ComplianceCheckPageItemRendererClickListener listener = new ComplianceCheckPageItemRendererClickListener();
Expand All @@ -83,7 +83,7 @@ public void clickPoliticianTest() {
/**
* Selection change event source empty test.
*/
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
@Test
public void selectionChangeEventSourceEmptyTest() {
final ComplianceCheckPageItemRendererClickListener listener = new ComplianceCheckPageItemRendererClickListener();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class DecisionFlowValueChangeListenerTest extends AbstractUnitTest {
/**
* Selection value change event source empty test.
*/
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
@Test
public void selectionValueChangeEventSourceEmptyTest() {
final String pageName = "pageName";
Expand All @@ -58,7 +58,7 @@ public void selectionValueChangeEventSourceEmptyTest() {
/**
* Selection value change test.
*/
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
@Test
public void selectionValueChangeTest() {
final String pageName = "pageName";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public final class PageItemPropertyClickListenerTest extends AbstractUnitTest {
/**
* Check correct page id click success test.
*/
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
@Test
public void checkCorrectPageIdClickSuccessTest() {
final PageItemPropertyClickListener pageItemPropertyClickListener = new PageItemPropertyClickListener(UserViews.POLITICIAN_VIEW_NAME,"personId");
Expand Down Expand Up @@ -83,7 +83,7 @@ public void checkCorrectPageIdFailureTest() {
/**
* Selection change empty test.
*/
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
@Test
public void selectionChangeEmptyTest() {
final PageItemPropertyClickListener listener = new PageItemPropertyClickListener(UserViews.POLITICIAN_VIEW_NAME,"wrongProperty");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class RuleViolationPageItemRendererClickListenerTest extends AbstractUnit
/**
* Click party test.
*/
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
@Test
public void clickPartyTest() {
final RuleViolationPageItemRendererClickListener listener = new RuleViolationPageItemRendererClickListener();
Expand All @@ -59,7 +59,7 @@ public void clickPartyTest() {
/**
* Click politician test.
*/
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
@Test
public void clickPoliticianTest() {
final RuleViolationPageItemRendererClickListener listener = new RuleViolationPageItemRendererClickListener();
Expand All @@ -81,7 +81,7 @@ public void clickPoliticianTest() {
/**
* Selection change event source empty test.
*/
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
@Test
public void selectionChangeEventSourceEmptyTest() {
final RuleViolationPageItemRendererClickListener listener = new RuleViolationPageItemRendererClickListener();
Expand Down
6 changes: 6 additions & 0 deletions parent-service-pom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,12 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jpamodelgen</artifactId>
<version>${hibernate.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ List<T> findOrderedListByProperty(SingularAttribute<T, ? extends Object> orderBy
* the value
* @return the t
*/
@SuppressWarnings("hiding")
<T, V> T findByQueryProperty(Class<T> clazz, SingularAttribute<T, ? extends Object> property, Class<V> clazz2,
SingularAttribute<V, ? extends Object> property2, Object value);

Expand All @@ -166,6 +167,7 @@ <T, V> T findByQueryProperty(Class<T> clazz, SingularAttribute<T, ? extends Obje
* the value
* @return the list
*/
@SuppressWarnings("hiding")
<T, V> List<T> findListByEmbeddedProperty(Class<T> clazz, SingularAttribute<T, V> property, Class<V> clazz2,
SingularAttribute<V, ? extends Object> property2, Object value);

Expand All @@ -190,6 +192,7 @@ <T, V> List<T> findListByEmbeddedProperty(Class<T> clazz, SingularAttribute<T, V
* the order by property
* @return the list
*/
@SuppressWarnings("hiding")
<T, V> List<T> findOrderedListByEmbeddedProperty(Class<T> clazz, SingularAttribute<T, V> property, Class<V> clazz2,
SingularAttribute<V, ? extends Object> property2, Object value,
SingularAttribute<V, ? extends Object> orderByProperty);
Expand All @@ -215,6 +218,7 @@ <T, V> List<T> findOrderedListByEmbeddedProperty(Class<T> clazz, SingularAttribu
* the order by property
* @return the list
*/
@SuppressWarnings("hiding")
<T, V> List<T> findOrderedByPropertyListByEmbeddedProperty(Class<T> clazz, SingularAttribute<T, V> property,
Class<V> clazz2, SingularAttribute<V, ? extends Object> property2, Object value,
SingularAttribute<T, ? extends Object> orderByProperty);
Expand Down
1 change: 1 addition & 0 deletions service.api/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
exports com.hack23.cia.service.api.action.user;
exports com.hack23.cia.service.api.action.kpi;

requires transitive java.persistence; // Added for SingularAttribute
requires java.validation;
requires org.apache.commons.lang3;
requires org.apache.commons.collections4;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public AuditableAspectConfiguration() {
* @param txManager the tx manager
* @return the javers
*/
@SuppressWarnings("rawtypes")
@Bean
public Javers getJavers(final PlatformTransactionManager txManager) {
final JaversSqlRepository sqlRepository = SqlRepositoryBuilder.sqlRepository()
Expand Down
14 changes: 7 additions & 7 deletions service.data.impl/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
requires org.postgresql.jdbc;
requires transitive java.naming;

requires java.persistence;
requires org.hibernate.orm.core;
requires java.transaction;
requires transitive java.persistence; // Changed from requires java.persistence
requires transitive org.hibernate.orm.core;
requires transitive java.transaction;
requires ehcache;
requires cache.api;

Expand All @@ -71,10 +71,10 @@
requires org.apache.commons.lang3;
requires lucene.analyzers.common;

requires javers.spring;
requires javers.spring.jpa;
requires javers.persistence.sql;
requires javers.core;
requires transitive javers.spring;
requires transitive javers.spring.jpa;
requires transitive javers.persistence.sql;
requires transitive javers.core;


requires com.google.common;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ private static XSSFWorkbook createGovermentOperationsWorkBook() throws IOExcepti
.getResourceAsStream("/sdds-plus-august-20202.xlsx"));
}

@SuppressWarnings("rawtypes")
@Override
public List<GovernmentOperationPeriodOutcome> getReport() throws IOException {
final List<GovernmentOperationPeriodOutcome> result = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public <T extends Serializable, V extends Serializable> DataContainer<T, V> getD
return result;
}

@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
@Secured({"ROLE_ANONYMOUS","ROLE_USER", "ROLE_ADMIN" })
@Override
public ServiceResponse service(final ServiceRequest serviceRequest) {
Expand All @@ -126,7 +126,7 @@ public Future<ServiceResponse> asyncService(final ServiceRequest serviceRequest)
}


@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void setApplicationContext(final ApplicationContext applicationContext) {
final Map<String, BusinessService> beansOfType = applicationContext.getBeansOfType(BusinessService.class);
Expand Down
Loading

0 comments on commit 298669d

Please sign in to comment.