From 3cd268f7b436941443f9ea25b23cadb858c4c0a9 Mon Sep 17 00:00:00 2001 From: brinn <brinn> Date: Fri, 26 Oct 2012 19:57:31 +0000 Subject: [PATCH] Cleanup: fix code warnings. SVN: 27378 --- .../etlserver/plugins/SimpleShuffling.java | 1 - ...tOmniscientTopLevelDataSetRegistrator.java | 7 +++ .../JavaV2TestcaseRegistrationContext.java | 12 +++-- .../izpack/OpenGettingStartedPageAction.java | 1 - .../conversation/annotation/Progress.java | 4 +- ...rtyTypeListDeletionConfirmationDialog.java | 3 -- .../SampleListDeletionConfirmationDialog.java | 4 -- .../application/ui/script/ScriptGrid.java | 3 -- .../datasetlister/DataSetLister.java | 3 -- .../openbis/generic/shared/dto/DataPE.java | 4 -- .../shared/dto/DataStoreServicePE.java | 1 - .../openbis/generic/shared/dto/EventPE.java | 1 - .../generic/shared/dto/ExperimentPE.java | 1 - .../generic/shared/dto/MaterialPE.java | 1 - .../openbis/generic/shared/dto/SamplePE.java | 4 -- .../application/module/QueryBrowserGrid.java | 13 ++++-- .../generic/server/CommonServerTest.java | 46 +++++++++---------- .../business/bo/PropertyValidatorTest.java | 46 +++++++++---------- .../server/business/bo/ScriptBOTest.java | 25 +++++----- .../db/EntityPropertyTypeDAOTest.java | 14 +++--- .../dataaccess/db/ExperimentDAOTest.java | 9 ++-- .../dataaccess/db/HibernateSearchDAOTest.java | 11 ++--- .../dataaccess/db/PropertyTypeDAOTest.java | 11 ++--- .../server/dataaccess/db/ScriptDAOTest.java | 9 ++-- .../db/search/IndexingQueryOptimizerTest.java | 20 -------- .../server/util/SimpleDateRendererTest.java | 9 ++-- .../NewSampleParserObjectFactoryTest.java | 32 ++++++------- .../UpdatedSampleParserObjectFactoryTest.java | 25 +++++----- .../plugin/generic/GenericSystemTestCase.java | 8 ++-- .../TransferAuthorizationAnnotations.java | 10 ++-- .../proteomics/ResultDataSetUploaderTest.java | 4 -- .../api/v1/ProteomicsDataServiceTest.java | 8 ++-- .../ScreeningJythonIngestionService.java | 4 +- .../systemtests/JsonAnnotationTest.java | 1 - 34 files changed, 155 insertions(+), 200 deletions(-) diff --git a/datastore_server/source/java/ch/systemsx/cisd/etlserver/plugins/SimpleShuffling.java b/datastore_server/source/java/ch/systemsx/cisd/etlserver/plugins/SimpleShuffling.java index d5671494a81..66138fb4cbc 100644 --- a/datastore_server/source/java/ch/systemsx/cisd/etlserver/plugins/SimpleShuffling.java +++ b/datastore_server/source/java/ch/systemsx/cisd/etlserver/plugins/SimpleShuffling.java @@ -27,7 +27,6 @@ import java.util.Properties; import org.apache.commons.io.FileUtils; import ch.rinn.restrictions.Private; -import ch.systemsx.cisd.base.exceptions.CheckedExceptionTunnel; import ch.systemsx.cisd.common.logging.ISimpleLogger; import ch.systemsx.cisd.common.logging.LogCategory; import ch.systemsx.cisd.common.logging.LogFactory; diff --git a/datastore_server/source/java/ch/systemsx/cisd/etlserver/registrator/AbstractOmniscientTopLevelDataSetRegistrator.java b/datastore_server/source/java/ch/systemsx/cisd/etlserver/registrator/AbstractOmniscientTopLevelDataSetRegistrator.java index 5d1ba0c7080..e6269f83a97 100644 --- a/datastore_server/source/java/ch/systemsx/cisd/etlserver/registrator/AbstractOmniscientTopLevelDataSetRegistrator.java +++ b/datastore_server/source/java/ch/systemsx/cisd/etlserver/registrator/AbstractOmniscientTopLevelDataSetRegistrator.java @@ -304,6 +304,7 @@ public abstract class AbstractOmniscientTopLevelDataSetRegistrator<T extends Dat } + @Override public OmniscientTopLevelDataSetRegistratorState getRegistratorState() { return state; @@ -315,6 +316,7 @@ public abstract class AbstractOmniscientTopLevelDataSetRegistrator<T extends Dat return state.registrationLock; } + @Override public File getRollBackStackParentFolder() { return getGlobalState().getDssInternalTempDir(); @@ -643,6 +645,7 @@ public abstract class AbstractOmniscientTopLevelDataSetRegistrator<T extends Dat * Subclasses may override, but should call super. */ + @Override public void didRollbackTransaction(DataSetRegistrationService<T> dataSetRegistrationService, DataSetRegistrationTransaction<T> transaction, DataSetStorageAlgorithmRunner<T> algorithm, Throwable ex) @@ -655,6 +658,7 @@ public abstract class AbstractOmniscientTopLevelDataSetRegistrator<T extends Dat * <p> * Subclasses can override and implement their own handling logic. */ + @Override public void didCommitTransaction(DataSetRegistrationService<T> dataSetRegistrationService, DataSetRegistrationTransaction<T> transaction) { @@ -665,6 +669,7 @@ public abstract class AbstractOmniscientTopLevelDataSetRegistrator<T extends Dat * <p> * Subclasses can override and implement their own handling logic. */ + @Override public void didPreRegistration(DataSetRegistrationService<T> service, DataSetRegistrationContext.IHolder registrationContextHolder) { @@ -675,6 +680,7 @@ public abstract class AbstractOmniscientTopLevelDataSetRegistrator<T extends Dat * <p> * Subclasses can override and implement their own handling logic. */ + @Override public void didPostRegistration(DataSetRegistrationService<T> service, DataSetRegistrationContext.IHolder registrationContextHolder) { @@ -685,6 +691,7 @@ public abstract class AbstractOmniscientTopLevelDataSetRegistrator<T extends Dat * <p> * Subclasses can override and implement their own handling logic. */ + @Override public void didEncounterSecondaryTransactionErrors( DataSetRegistrationService<T> dataSetRegistrationService, DataSetRegistrationTransaction<T> transaction, diff --git a/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/registrator/JavaV2TestcaseRegistrationContext.java b/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/registrator/JavaV2TestcaseRegistrationContext.java index e08301fedf3..8d0fa4c5973 100644 --- a/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/registrator/JavaV2TestcaseRegistrationContext.java +++ b/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/registrator/JavaV2TestcaseRegistrationContext.java @@ -123,20 +123,22 @@ public class JavaV2TestcaseRegistrationContext implements IJavaDataSetRegistrati String name, String expected) { Object value = context.getPersistentMap().get(name); - if ((expected == null && expected != value) - || (expected != null && (false == expected.equals(value)))) + String expectedString = expected; + if ((expectedString == null && expectedString != value) + || (expectedString != null && (false == expectedString.equals(value)))) { - if (value != null && expected != null && value.getClass() != expected.getClass()) + if (value != null && expectedString != null + && value.getClass() != expectedString.getClass()) { value = String.format("%s:%s", value.getClass(), value); - expected = String.format("%s:%s", expected.getClass(), expected); + expectedString = String.format("%s:%s", expectedString.getClass(), expected); } try { jythonHookTestTool .log(String .format("transaction context failed.in %s the value of %s should have been '%s', but was '%s'", - caller, name, expected, value)); + caller, name, expectedString, value)); } catch (IOException ex) { throw CheckedExceptionTunnel.wrapIfNecessary(ex); diff --git a/installation/source/java/ch/systemsx/cisd/openbis/installer/izpack/OpenGettingStartedPageAction.java b/installation/source/java/ch/systemsx/cisd/openbis/installer/izpack/OpenGettingStartedPageAction.java index 71319a25afc..40f1e356415 100644 --- a/installation/source/java/ch/systemsx/cisd/openbis/installer/izpack/OpenGettingStartedPageAction.java +++ b/installation/source/java/ch/systemsx/cisd/openbis/installer/izpack/OpenGettingStartedPageAction.java @@ -21,7 +21,6 @@ import java.io.File; import java.io.IOException; import com.izforge.izpack.api.data.AutomatedInstallData; -import com.izforge.izpack.api.data.Info; import com.izforge.izpack.api.data.PanelActionConfiguration; import com.izforge.izpack.api.handler.AbstractUIHandler; import com.izforge.izpack.data.PanelAction; diff --git a/openbis-common/source/java/ch/systemsx/cisd/openbis/common/conversation/annotation/Progress.java b/openbis-common/source/java/ch/systemsx/cisd/openbis/common/conversation/annotation/Progress.java index dcd935bd959..85a0715efdb 100644 --- a/openbis-common/source/java/ch/systemsx/cisd/openbis/common/conversation/annotation/Progress.java +++ b/openbis-common/source/java/ch/systemsx/cisd/openbis/common/conversation/annotation/Progress.java @@ -26,7 +26,7 @@ public enum Progress /** * Progress has to be reported by calling - * {@link ch.systemsx.cisd.common.conversation.progress.IServiceConversationProgressListener#update + * {@link ch.systemsx.cisd.openbis.common.conversation.progress.IServiceConversationProgressListener#update * IServiceConversationProgressListener.update} method. This option should be used when we know * how much progress has been made, e.g. we processed 12 out of 100 data sets. If the method * execution hangs the progress won't be reported and the conversation will time out. @@ -35,7 +35,7 @@ public enum Progress /** * A separate thread regularly sends progress information without a need of calling - * {@link ch.systemsx.cisd.common.conversation.progress.IServiceConversationProgressListener#update + * {@link ch.systemsx.cisd.openbis.common.conversation.progress.IServiceConversationProgressListener#update * IServiceConversationProgressListener.update} method. This option is useful for methods where * we don't have any information about the current progress (e.g. user defined Python script * execution) but we still want to notify the client that the processing is in progress and the diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/PropertyTypeListDeletionConfirmationDialog.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/PropertyTypeListDeletionConfirmationDialog.java index bc852a19ae0..ccd971fb36a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/PropertyTypeListDeletionConfirmationDialog.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/property_type/PropertyTypeListDeletionConfirmationDialog.java @@ -33,8 +33,6 @@ public final class PropertyTypeListDeletionConfirmationDialog extends AbstractDataListPermanentDeletionConfirmationDialog<TableModelRowWithObject<PropertyType>> { - private final IViewContext<ICommonClientServiceAsync> viewContext; - public PropertyTypeListDeletionConfirmationDialog( IViewContext<ICommonClientServiceAsync> viewContext, List<TableModelRowWithObject<PropertyType>> propertyTypes, @@ -42,7 +40,6 @@ public final class PropertyTypeListDeletionConfirmationDialog extends { super(viewContext, propertyTypes, callback); this.setId("deletion-confirmation-dialog"); - this.viewContext = viewContext; } @Override diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleListDeletionConfirmationDialog.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleListDeletionConfirmationDialog.java index cc53c1fdaec..8e26a6e3c7b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleListDeletionConfirmationDialog.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/sample/SampleListDeletionConfirmationDialog.java @@ -39,8 +39,6 @@ public final class SampleListDeletionConfirmationDialog<T extends IIdHolder> ext AbstractDataListDeletionConfirmationDialog<T> { - private final IViewContext<ICommonClientServiceAsync> viewContext; - private final DisplayedAndSelectedEntities<T> selectedAndDisplayedItemsOrNull; private final T singleDataOrNull; @@ -51,7 +49,6 @@ public final class SampleListDeletionConfirmationDialog<T extends IIdHolder> ext { super(viewContext, data, callback); this.withRadio(); - this.viewContext = viewContext; this.singleDataOrNull = null; this.selectedAndDisplayedItemsOrNull = selectedAndDisplayedItems; } @@ -61,7 +58,6 @@ public final class SampleListDeletionConfirmationDialog<T extends IIdHolder> ext AsyncCallback<Void> deletionCallback, T sample) { super(viewContext, data, deletionCallback); - this.viewContext = viewContext; this.singleDataOrNull = sample; this.selectedAndDisplayedItemsOrNull = null; } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/script/ScriptGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/script/ScriptGrid.java index 2b69faa7009..b6c8d98b09a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/script/ScriptGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/client/application/ui/script/ScriptGrid.java @@ -251,14 +251,11 @@ public class ScriptGrid extends TypedTableGrid<Script> AbstractDataListPermanentDeletionConfirmationDialog<TableModelRowWithObject<Script>> { - private final IViewContext<ICommonClientServiceAsync> viewContext; - public ScriptListDeletionConfirmationDialog( IViewContext<ICommonClientServiceAsync> viewContext, List<TableModelRowWithObject<Script>> data, AbstractAsyncCallback<Void> callback) { super(viewContext, data, callback); - this.viewContext = viewContext; } @Override diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/fetchoptions/datasetlister/DataSetLister.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/fetchoptions/datasetlister/DataSetLister.java index 187d21e1916..5c54030338a 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/fetchoptions/datasetlister/DataSetLister.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/server/business/bo/fetchoptions/datasetlister/DataSetLister.java @@ -56,8 +56,6 @@ public class DataSetLister implements IDataSetLister private IDataSetListingQuery query; - private PersonPE person; - public DataSetLister(IAuthorizationDAOFactory daoFactory, PersonPE person) { this(QueryTool.getQuery(DatabaseContextUtils.getConnection(daoFactory), @@ -75,7 +73,6 @@ public class DataSetLister implements IDataSetLister throw new IllegalArgumentException("Person was null"); } this.query = query; - this.person = person; } @Override diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataPE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataPE.java index 2cf131ad936..801dee8af00 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataPE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataPE.java @@ -419,7 +419,6 @@ public class DataPE extends AbstractIdAndCodeHolder<DataPE> implements } // used only by Hibernate Search - @SuppressWarnings("unused") @Transient @Field(index = Index.UN_TOKENIZED, store = Store.YES, name = SearchFieldConstants.SAMPLE_ID) private Long getSampleId() @@ -523,7 +522,6 @@ public class DataPE extends AbstractIdAndCodeHolder<DataPE> implements } // used only by Hibernate Search - @SuppressWarnings("unused") @Transient @Field(index = Index.UN_TOKENIZED, store = Store.YES, name = SearchFieldConstants.CONTAINER_ID) private Long getContainerId() @@ -632,7 +630,6 @@ public class DataPE extends AbstractIdAndCodeHolder<DataPE> implements } // used only by Hibernate Search - @SuppressWarnings("unused") @Transient @Field(index = Index.UN_TOKENIZED, store = Store.YES, name = SearchFieldConstants.EXPERIMENT_ID) private Long getExperimentId() @@ -815,7 +812,6 @@ public class DataPE extends AbstractIdAndCodeHolder<DataPE> implements this.deletion = deletion; } - @SuppressWarnings("unused") @ManyToMany(fetch = FetchType.LAZY) @Fetch(FetchMode.SUBSELECT) @JoinTable(name = TableNames.METAPROJECT_ASSIGNMENTS_VIEW, joinColumns = diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataStoreServicePE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataStoreServicePE.java index 8f3e2a3e7d2..8646f7ed9cf 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataStoreServicePE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/DataStoreServicePE.java @@ -74,7 +74,6 @@ public class DataStoreServicePE implements Serializable // which types of datasets can be processed by this plugin? private Set<DataSetTypePE> datasetTypes; - @SuppressWarnings("unused") @Id @SequenceGenerator(name = SequenceNames.DATA_STORE_SERVICE_SEQUENCE, sequenceName = SequenceNames.DATA_STORE_SERVICE_SEQUENCE, allocationSize = 1) @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = SequenceNames.DATA_STORE_SERVICE_SEQUENCE) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/EventPE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/EventPE.java index 15bd66e0192..4b70ec81f2c 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/EventPE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/EventPE.java @@ -118,7 +118,6 @@ public class EventPE extends HibernateAbstractRegistrationHolder implements IIdH this.entityType = entityType; } - @SuppressWarnings("unused") @NotNull(message = ValidationMessages.IDENTIFIER_NOT_NULL_MESSAGE) @Column(name = ColumnNames.IDENTIFIERS) private String getIdentifiersInternal() diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ExperimentPE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ExperimentPE.java index d7e7bc32c2d..aa52fae658b 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ExperimentPE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/ExperimentPE.java @@ -554,7 +554,6 @@ public class ExperimentPE extends AttachmentHolderPE implements this.permId = permId; } - @SuppressWarnings("unused") @ManyToMany(fetch = FetchType.LAZY) @Fetch(FetchMode.SUBSELECT) @JoinTable(name = TableNames.METAPROJECT_ASSIGNMENTS_VIEW, joinColumns = diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/MaterialPE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/MaterialPE.java index 1936495bed1..ac216f9baa0 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/MaterialPE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/MaterialPE.java @@ -382,7 +382,6 @@ public class MaterialPE implements IIdAndCodeHolder, Comparable<MaterialPE>, return createPermId(code, materialType.getCode()); } - @SuppressWarnings("unused") @ManyToMany(fetch = FetchType.LAZY) @Fetch(FetchMode.SUBSELECT) @JoinTable(name = TableNames.METAPROJECT_ASSIGNMENTS_VIEW, joinColumns = diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SamplePE.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SamplePE.java index 23ca3bfe2e0..fa8a25f4cdf 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SamplePE.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/dto/SamplePE.java @@ -388,7 +388,6 @@ public class SamplePE extends AttachmentHolderPE implements IIdAndCodeHolder, Co } // used only by Hibernate Search - @SuppressWarnings("unused") @Transient @Field(index = Index.UN_TOKENIZED, store = Store.YES, name = SearchFieldConstants.CONTAINER_ID) private Long getContainerId() @@ -489,7 +488,6 @@ public class SamplePE extends AttachmentHolderPE implements IIdAndCodeHolder, Co } // used only by Hibernate Search - @SuppressWarnings("unused") @Transient @Field(index = Index.UN_TOKENIZED, store = Store.YES, name = SearchFieldConstants.EXPERIMENT_ID) private Long getExperimentId() @@ -527,7 +525,6 @@ public class SamplePE extends AttachmentHolderPE implements IIdAndCodeHolder, Co } // used only by Hibernate Search - @SuppressWarnings("unused") @Transient @Field(index = Index.TOKENIZED, store = Store.YES, name = SearchFieldConstants.CODE) private String getFullCode() @@ -812,7 +809,6 @@ public class SamplePE extends AttachmentHolderPE implements IIdAndCodeHolder, Co return map; } - @SuppressWarnings("unused") @ManyToMany(fetch = FetchType.LAZY) @Fetch(FetchMode.SUBSELECT) @JoinTable(name = TableNames.METAPROJECT_ASSIGNMENTS_VIEW, joinColumns = diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/application/module/QueryBrowserGrid.java b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/application/module/QueryBrowserGrid.java index 1ac4139fdca..65ef16ec674 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/application/module/QueryBrowserGrid.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/plugin/query/client/web/client/application/module/QueryBrowserGrid.java @@ -70,7 +70,11 @@ public class QueryBrowserGrid extends TypedTableGrid<QueryExpression> List<TableModelRowWithObject<QueryExpression>> data, AbstractAsyncCallback<Void> callback) { - super(viewContext, data, viewContext.getMessage(ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict.DELETE_CONFIRMATION_TITLE)); + super( + viewContext, + data, + viewContext + .getMessage(ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict.DELETE_CONFIRMATION_TITLE)); this.callback = callback; this.viewContext = viewContext; } @@ -108,6 +112,7 @@ public class QueryBrowserGrid extends TypedTableGrid<QueryExpression> return new DatabaseModificationAwareComponent(browser, browser); } + @SuppressWarnings("hiding") private final IViewContext<IQueryClientServiceAsync> viewContext; QueryBrowserGrid(IViewContext<IQueryClientServiceAsync> viewContext) @@ -136,7 +141,8 @@ public class QueryBrowserGrid extends TypedTableGrid<QueryExpression> addButton(addButton); final Button editButton = createSelectedItemButton( - viewContext.getMessage(ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict.BUTTON_EDIT), + viewContext + .getMessage(ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict.BUTTON_EDIT), new ISelectedEntityInvoker<BaseEntityModel<TableModelRowWithObject<QueryExpression>>>() { @Override @@ -153,7 +159,8 @@ public class QueryBrowserGrid extends TypedTableGrid<QueryExpression> }); addButton(editButton); Button deleteButton = - createSelectedItemsButton(viewContext.getMessage(ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict.BUTTON_DELETE), + createSelectedItemsButton( + viewContext.getMessage(ch.systemsx.cisd.openbis.generic.client.web.client.application.Dict.BUTTON_DELETE), new AbstractCreateDialogListener() { @Override diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/CommonServerTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/CommonServerTest.java index 6d034293708..629f3156846 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/CommonServerTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/CommonServerTest.java @@ -190,12 +190,12 @@ public final class CommonServerTest extends AbstractServerTestCase @Test public void testLogout() { - final Session session = createSession(CommonTestUtils.USER_ID); + final Session mySession = createSession(CommonTestUtils.USER_ID); context.checking(new Expectations() { { allowing(sessionManager).getSession(SESSION_TOKEN); - will(returnValue(session)); + will(returnValue(mySession)); one(sessionManager).closeSession(SESSION_TOKEN); } }); @@ -209,13 +209,13 @@ public final class CommonServerTest extends AbstractServerTestCase { final String user = "user"; final String password = "password"; - final Session session = createSession(user); + final Session mySession = createSession(user); context.checking(new Expectations() { { // Artefact of our test code allowing(sessionManager).getSession(SESSION_TOKEN); - will(returnValue(session)); + will(returnValue(mySession)); one(sessionManager).tryToOpenSession(user, password); will(returnValue(null)); @@ -232,7 +232,7 @@ public final class CommonServerTest extends AbstractServerTestCase { final String user = "user"; final String password = "password"; - final Session session = createSession(user); + final Session mySession = createSession(user); final PersonPE systemPerson = createSystemUser(); final PersonPE person = createPersonWithRoleAssignmentsFromPrincipal(PRINCIPAL); context.checking(new Expectations() @@ -242,7 +242,7 @@ public final class CommonServerTest extends AbstractServerTestCase will(returnValue(SESSION_TOKEN)); allowing(sessionManager).getSession(SESSION_TOKEN); - will(returnValue(session)); + will(returnValue(mySession)); one(personDAO).listPersons(); will(returnValue(Arrays.asList(systemPerson))); // only 'system' in database @@ -279,7 +279,7 @@ public final class CommonServerTest extends AbstractServerTestCase { final String user = "user"; final String password = "password"; - final Session session = createSession(user); + final Session mySession = createSession(user); final PersonPE systemPerson = createSystemUser(); final PersonPE person = createPersonWithRoleAssignmentsFromPrincipal(PRINCIPAL); context.checking(new Expectations() @@ -289,7 +289,7 @@ public final class CommonServerTest extends AbstractServerTestCase will(returnValue(SESSION_TOKEN)); allowing(sessionManager).getSession(SESSION_TOKEN); - will(returnValue(session)); + will(returnValue(mySession)); one(personDAO).listPersons(); will(returnValue(Arrays.asList(systemPerson, person))); @@ -316,7 +316,7 @@ public final class CommonServerTest extends AbstractServerTestCase { final String user = "user"; final String password = "password"; - final Session session = createSession(user); + final Session mySession = createSession(user); final PersonPE person = createPersonWithRoleAssignmentsFromPrincipal(PRINCIPAL); context.checking(new Expectations() { @@ -325,13 +325,13 @@ public final class CommonServerTest extends AbstractServerTestCase will(returnValue(SESSION_TOKEN)); allowing(sessionManager).getSession(SESSION_TOKEN); - will(returnValue(session)); + will(returnValue(mySession)); one(personDAO).tryFindPersonByUserId(user); will(returnValue(person)); } }); - assertEquals(null, session.tryGetPerson()); + assertEquals(null, mySession.tryGetPerson()); final SessionContextDTO s = createServer().tryToAuthenticate(user, password); @@ -346,15 +346,15 @@ public final class CommonServerTest extends AbstractServerTestCase final DatabaseInstanceIdentifier identifier = DatabaseInstanceIdentifier.createHome(); final SpacePE g1 = CommonTestUtils.createSpace("g1", homeDatabaseInstance); final SpacePE g2 = CommonTestUtils.createSpace("g2", homeDatabaseInstance); - final Session session = createSession(CommonTestUtils.USER_ID); - session.setPerson(person); + final Session mySession = createSession(CommonTestUtils.USER_ID); + mySession.setPerson(person); person.setHomeSpace(g1); g1.setId(42L); context.checking(new Expectations() { { allowing(sessionManager).getSession(SESSION_TOKEN); - will(returnValue(session)); + will(returnValue(mySession)); one(groupDAO).listSpaces(homeDatabaseInstance); will(returnValue(Arrays.asList(g1, g2))); } @@ -1535,9 +1535,9 @@ public final class CommonServerTest extends AbstractServerTestCase { { allowing(sessionManager).getSession(SESSION_TOKEN); - Session session = createSession(CommonTestUtils.USER_ID); - session.setPerson(person); - will(returnValue(session)); + Session mySession = createSession(CommonTestUtils.USER_ID); + mySession.setPerson(person); + will(returnValue(mySession)); one(personDAO).updatePerson(person); } @@ -1593,9 +1593,9 @@ public final class CommonServerTest extends AbstractServerTestCase { { allowing(sessionManager).getSession(SESSION_TOKEN); - Session session = createSession(CommonTestUtils.USER_ID); - session.setPerson(person); - will(returnValue(session)); + Session mySession = createSession(CommonTestUtils.USER_ID); + mySession.setPerson(person); + will(returnValue(mySession)); one(groupDAO).getByTechId(groupId); will(returnValue(group)); @@ -1622,9 +1622,9 @@ public final class CommonServerTest extends AbstractServerTestCase { { allowing(sessionManager).getSession(SESSION_TOKEN); - Session session = createSession(CommonTestUtils.USER_ID); - session.setPerson(person); - will(returnValue(session)); + Session mySession = createSession(CommonTestUtils.USER_ID); + mySession.setPerson(person); + will(returnValue(mySession)); } }); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/PropertyValidatorTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/PropertyValidatorTest.java index ef07c94e8a5..c62f13f3563 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/PropertyValidatorTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/PropertyValidatorTest.java @@ -27,13 +27,13 @@ import org.testng.annotations.Test; import ch.rinn.restrictions.Friend; import ch.systemsx.cisd.common.exception.UserFailureException; import ch.systemsx.cisd.openbis.generic.server.dataaccess.PropertyValidator; -import ch.systemsx.cisd.openbis.generic.shared.util.SimplePropertyValidator.SupportedDatePattern; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.DataTypeCode; import ch.systemsx.cisd.openbis.generic.shared.dto.DataTypePE; import ch.systemsx.cisd.openbis.generic.shared.dto.MaterialTypePE; import ch.systemsx.cisd.openbis.generic.shared.dto.PropertyTypePE; import ch.systemsx.cisd.openbis.generic.shared.dto.VocabularyPE; import ch.systemsx.cisd.openbis.generic.shared.dto.VocabularyTermPE; +import ch.systemsx.cisd.openbis.generic.shared.util.SimplePropertyValidator.SupportedDatePattern; import ch.systemsx.cisd.openbis.generic.shared.util.XmlUtilsTest; /** @@ -104,41 +104,39 @@ public final class PropertyValidatorTest extends AbstractBOTest return propertyType; } - @SuppressWarnings("unused") @DataProvider private final static Object[][] getNonWorkingValues() { return new Object[][] { - { createTimestampPropertyType(), DateFormatUtils.format(new Date(), "yyyy") }, - { createIntegerPropertyType(), "a" }, - { createIntegerPropertyType(), "1.1" }, - { createRealPropertyType(), "b" }, - { createBooleanPropertyType(), "BOB" }, }; + { createTimestampPropertyType(), DateFormatUtils.format(new Date(), "yyyy") }, + { createIntegerPropertyType(), "a" }, + { createIntegerPropertyType(), "1.1" }, + { createRealPropertyType(), "b" }, + { createBooleanPropertyType(), "BOB" }, }; } - @SuppressWarnings("unused") @DataProvider private final static Object[][] getWorkingValues() { return new Object[][] { - { createVarcharPropertyType(), "" }, - { createVarcharPropertyType(), "varchar" }, - { - createTimestampPropertyType(), - DateFormatUtils.format(new Date(), - SupportedDatePattern.CANONICAL_DATE_PATTERN.getPattern()) }, - { - createTimestampPropertyType(), - DateFormatUtils.format(new Date(), - SupportedDatePattern.US_DATE_TIME_24_PATTERN.getPattern()) }, - { createIntegerPropertyType(), "1" }, - { createRealPropertyType(), "1" }, - { createRealPropertyType(), "1.1" }, - { createBooleanPropertyType(), "yes" }, - { createBooleanPropertyType(), "1" }, - { createBooleanPropertyType(), "true" } }; + { createVarcharPropertyType(), "" }, + { createVarcharPropertyType(), "varchar" }, + { + createTimestampPropertyType(), + DateFormatUtils.format(new Date(), + SupportedDatePattern.CANONICAL_DATE_PATTERN.getPattern()) }, + { + createTimestampPropertyType(), + DateFormatUtils.format(new Date(), + SupportedDatePattern.US_DATE_TIME_24_PATTERN.getPattern()) }, + { createIntegerPropertyType(), "1" }, + { createRealPropertyType(), "1" }, + { createRealPropertyType(), "1.1" }, + { createBooleanPropertyType(), "yes" }, + { createBooleanPropertyType(), "1" }, + { createBooleanPropertyType(), "true" } }; } @Test diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ScriptBOTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ScriptBOTest.java index e987fc8d70f..07f50bb492c 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ScriptBOTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/business/bo/ScriptBOTest.java @@ -45,24 +45,23 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.properties.EntityKind; public final class ScriptBOTest extends AbstractBOTest { - @SuppressWarnings("unused") @DataProvider private final static Object[][] scriptTypes() { return new Object[][] { - { - ScriptType.DYNAMIC_PROPERTY, - "Error evaluating '1+': SyntaxError: " - + "(\"no viable alternative at input ')'\", " - + "('expression: 1+', 1, 14, '__result__=(1+)\\n'))" }, - { - ScriptType.MANAGED_PROPERTY, - "SyntaxError: (\"no viable alternative at input '\\\\n\\\\n'\", " - + "('<string>', 1, 2, '1+\\n'))" } - - }; - } + { + ScriptType.DYNAMIC_PROPERTY, + "Error evaluating '1+': SyntaxError: " + + "(\"no viable alternative at input ')'\", " + + "('expression: 1+', 1, 14, '__result__=(1+)\\n'))" }, + { + ScriptType.MANAGED_PROPERTY, + "SyntaxError: (\"no viable alternative at input '\\\\n\\\\n'\", " + + "('<string>', 1, 2, '1+\\n'))" } + + }; +} private static final String SCRIPT = "1+1"; diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/EntityPropertyTypeDAOTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/EntityPropertyTypeDAOTest.java index 4b7d0d6a750..8139a043765 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/EntityPropertyTypeDAOTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/EntityPropertyTypeDAOTest.java @@ -168,25 +168,23 @@ public class EntityPropertyTypeDAOTest extends AbstractDAOTest return assignment; } - @SuppressWarnings("unused") @DataProvider private final static Object[][] entityKindsWithEntityTypeAndPropertyTypeMandatory() { return new Object[][] { - { EntityKind.EXPERIMENT, "SIRNA_HCS", "DESCRIPTION" }, - { EntityKind.SAMPLE, "CONTROL_LAYOUT", "$PLATE_GEOMETRY" }, - { EntityKind.MATERIAL, "BACTERIUM", "DESCRIPTION" } }; + { EntityKind.EXPERIMENT, "SIRNA_HCS", "DESCRIPTION" }, + { EntityKind.SAMPLE, "CONTROL_LAYOUT", "$PLATE_GEOMETRY" }, + { EntityKind.MATERIAL, "BACTERIUM", "DESCRIPTION" } }; } - @SuppressWarnings("unused") @DataProvider private final static Object[][] entityKindsWithEntityTypeAndPropertyTypeNotAssigned() { return new Object[][] { - { EntityKind.EXPERIMENT, "SIRNA_HCS", "IS_VALID" }, - { EntityKind.SAMPLE, "CONTROL_LAYOUT", "IS_VALID" }, - { EntityKind.MATERIAL, "BACTERIUM", "IS_VALID" }, }; + { EntityKind.EXPERIMENT, "SIRNA_HCS", "IS_VALID" }, + { EntityKind.SAMPLE, "CONTROL_LAYOUT", "IS_VALID" }, + { EntityKind.MATERIAL, "BACTERIUM", "IS_VALID" }, }; } } diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/ExperimentDAOTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/ExperimentDAOTest.java index e3b82e7f93b..18568fee2e5 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/ExperimentDAOTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/ExperimentDAOTest.java @@ -620,16 +620,15 @@ public class ExperimentDAOTest extends AbstractDAOTest assertEquals(e1.getRegistrationDate(), e2.getRegistrationDate()); } - @SuppressWarnings("unused") @DataProvider private final static Object[][] illegalCodesProvider() { return new Object[][] { - { EXCEED_CODE_LENGTH_CHARACTERS }, - { "" }, - { null }, - { "@XPERIMENT" }, }; + { EXCEED_CODE_LENGTH_CHARACTERS }, + { "" }, + { null }, + { "@XPERIMENT" }, }; } @Test diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/HibernateSearchDAOTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/HibernateSearchDAOTest.java index 78e7fc85f10..c6dc42be7f1 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/HibernateSearchDAOTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/HibernateSearchDAOTest.java @@ -79,15 +79,14 @@ public final class HibernateSearchDAOTest extends AbstractDAOTest private static final String FILE_TYPE_XML = "XML"; - @SuppressWarnings("unused") @DataProvider(name = "registratorTerm") private final static Object[][] getRegistratorTerm() { return new Object[][] { - { "john" }, - { "Jo?n" }, - { "*ohn" } }; + { "john" }, + { "Jo?n" }, + { "*ohn" } }; } @Test @@ -143,8 +142,8 @@ public final class HibernateSearchDAOTest extends AbstractDAOTest { return new Object[][] { - { "exp-*", "exp-", true }, - { "exp-", "exp-", false } }; + { "exp-*", "exp-", true }, + { "exp-", "exp-", false } }; } @Test(dataProvider = "experimentQueriestAndModeToTest") diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/PropertyTypeDAOTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/PropertyTypeDAOTest.java index 93738b145e0..ec30456c793 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/PropertyTypeDAOTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/PropertyTypeDAOTest.java @@ -111,17 +111,16 @@ public final class PropertyTypeDAOTest extends AbstractDAOTest assertNotNull(propertyTypeDAO.getDataTypeByCode(DataTypeCode.INTEGER)); } - @SuppressWarnings("unused") @DataProvider private final Object[][] getEntityDataType() { return new Object[][] { - { DataTypeCode.BOOLEAN }, - { DataTypeCode.INTEGER }, - { DataTypeCode.REAL }, - { DataTypeCode.TIMESTAMP }, - { DataTypeCode.VARCHAR }, }; + { DataTypeCode.BOOLEAN }, + { DataTypeCode.INTEGER }, + { DataTypeCode.REAL }, + { DataTypeCode.TIMESTAMP }, + { DataTypeCode.VARCHAR }, }; } @Test(dataProvider = "getEntityDataType") diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/ScriptDAOTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/ScriptDAOTest.java index 2879d7051e2..0c80c371620 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/ScriptDAOTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/ScriptDAOTest.java @@ -43,17 +43,16 @@ import ch.systemsx.cisd.openbis.generic.shared.dto.SpacePE; public final class ScriptDAOTest extends AbstractDAOTest { - @SuppressWarnings("unused") @DataProvider private final static Object[][] scriptTypes() { return new Object[][] { - { ScriptType.DYNAMIC_PROPERTY }, - { ScriptType.MANAGED_PROPERTY } + { ScriptType.DYNAMIC_PROPERTY }, + { ScriptType.MANAGED_PROPERTY } - }; - } + }; +} private static final String DESCRIPTION = "desc"; diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/IndexingQueryOptimizerTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/IndexingQueryOptimizerTest.java index 3b94d46d1bc..bffebf8ce94 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/IndexingQueryOptimizerTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/dataaccess/db/search/IndexingQueryOptimizerTest.java @@ -67,7 +67,6 @@ public class IndexingQueryOptimizerTest class Entity { - @SuppressWarnings("unused") @ManyToOne(fetch = FetchType.EAGER) public Object getContent() { @@ -95,7 +94,6 @@ public class IndexingQueryOptimizerTest class OuterContent { - @SuppressWarnings("unused") @IndexedEmbedded public InnerContent getInnerContent() { @@ -105,7 +103,6 @@ public class IndexingQueryOptimizerTest class Entity { - @SuppressWarnings("unused") @IndexedEmbedded public OuterContent getContent() { @@ -129,56 +126,48 @@ public class IndexingQueryOptimizerTest final class LazyEagerEntity { - @SuppressWarnings("unused") @OneToOne(fetch = FetchType.LAZY) public Object getOneToOneLazily() { return null; } - @SuppressWarnings("unused") @OneToOne(fetch = FetchType.EAGER) public Object getOneToOneEagerly() { return null; } - @SuppressWarnings("unused") @OneToMany(fetch = FetchType.LAZY) public Object getOneToManyLazily() { return null; } - @SuppressWarnings("unused") @OneToMany(fetch = FetchType.EAGER) public Object getOneToManyEagerly() { return null; } - @SuppressWarnings("unused") @ManyToOne(fetch = FetchType.LAZY) public Object getManyToOneLazily() { return null; } - @SuppressWarnings("unused") @ManyToOne(fetch = FetchType.EAGER) public Object getManyToOneEagerly() { return null; } - @SuppressWarnings("unused") @ManyToMany(fetch = FetchType.LAZY) public Object getManyToManyLazily() { return null; } - @SuppressWarnings("unused") @ManyToMany(fetch = FetchType.EAGER) public Object getManyToManyEagerly() { @@ -206,21 +195,18 @@ public class IndexingQueryOptimizerTest final class NonPublicEntity { - @SuppressWarnings("unused") @OneToOne(fetch = FetchType.EAGER) protected Object getProtected() { return null; } - @SuppressWarnings("unused") @ManyToOne(fetch = FetchType.EAGER) Object getPackageProtected() { return null; } - @SuppressWarnings("unused") @IndexedEmbedded private Object getPrivate() { @@ -277,14 +263,12 @@ public class IndexingQueryOptimizerTest { final class RecursiveEntity { - @SuppressWarnings("unused") @IndexedEmbedded public RecursiveEntity getSelf() { return null; } - @SuppressWarnings("unused") @IndexedEmbedded public Object getSome() { @@ -307,7 +291,6 @@ public class IndexingQueryOptimizerTest class Super { - @SuppressWarnings("unused") @IndexedEmbedded public Object getObject() { @@ -317,7 +300,6 @@ public class IndexingQueryOptimizerTest class Derived extends Super { - @SuppressWarnings("unused") @IndexedEmbedded public Object getAnotherObject() { @@ -341,7 +323,6 @@ public class IndexingQueryOptimizerTest { class AnotherEntity { - @SuppressWarnings("unused") @IndexedEmbedded public Object getValue() { @@ -350,7 +331,6 @@ public class IndexingQueryOptimizerTest } class Entity { - @SuppressWarnings("unused") @IndexedEmbedded public Set<AnotherEntity> getSet() { diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/util/SimpleDateRendererTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/util/SimpleDateRendererTest.java index e8fb191a679..50e4856adbe 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/util/SimpleDateRendererTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/server/util/SimpleDateRendererTest.java @@ -34,15 +34,14 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.SimpleDateRenderer; */ public class SimpleDateRendererTest extends AssertJUnit { - @SuppressWarnings("unused") @DataProvider(name = "dates") private Object[][] getDates() { return new Object[][] { - { toDate(1991, 12, 3, 3, 13, 59, "CET"), "1991-12-03 03:13:59 GMT+01:00" }, - { toDate(2008, 12, 6, 15, 35, 17, "CET"), "2008-12-06 15:35:17 GMT+01:00" }, - { toDate(2008, 7, 31, 1, 2, 3, "CET"), "2008-07-31 01:02:03 GMT+02:00" } }; + { toDate(1991, 12, 3, 3, 13, 59, "CET"), "1991-12-03 03:13:59 GMT+01:00" }, + { toDate(2008, 12, 6, 15, 35, 17, "CET"), "2008-12-06 15:35:17 GMT+01:00" }, + { toDate(2008, 7, 31, 1, 2, 3, "CET"), "2008-07-31 01:02:03 GMT+02:00" } }; } @Test(dataProvider = "dates") @@ -51,7 +50,7 @@ public class SimpleDateRendererTest extends AssertJUnit String renderDate = SimpleDateRenderer.renderDate(date); assertEquals(formattedDate, renderDate); } - + @Test public void testDateRendererForNullArgument() { diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/parser/NewSampleParserObjectFactoryTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/parser/NewSampleParserObjectFactoryTest.java index ed80876c42c..bd98454124a 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/parser/NewSampleParserObjectFactoryTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/parser/NewSampleParserObjectFactoryTest.java @@ -93,35 +93,33 @@ public final class NewSampleParserObjectFactoryTest } } - @SuppressWarnings("unused") @DataProvider private final static Object[][] getLineTokensForAutoGeneratedCodes() { return new Object[][] { - { new String[] - { "", "" }, 0 }, - { new String[] - { null, null }, 0 }, - { new String[] - { "1", "hello" }, 2 }, - - }; - } + { new String[] + { "", "" }, 0 }, + { new String[] + { null, null }, 0 }, + { new String[] + { "1", "hello" }, 2 }, + + }; +} - @SuppressWarnings("unused") @DataProvider private final static Object[][] getLineTokens() { return new Object[][] { - { new String[] - { "", "", "", "", "", "" }, 0 }, - { new String[] - { "ignoreMe", "id1", "cont1", "par1", "1", "hello" }, 2 }, + { new String[] + { "", "", "", "", "", "" }, 0 }, + { new String[] + { "ignoreMe", "id1", "cont1", "par1", "1", "hello" }, 2 }, - }; - } + }; +} @Test(dataProvider = "getLineTokens") public final void testFailCreateObjectForAutoGeneratedCodesWithIdentifierSpecified( diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/parser/UpdatedSampleParserObjectFactoryTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/parser/UpdatedSampleParserObjectFactoryTest.java index cf8ef8e11b4..f15efeb94e4 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/parser/UpdatedSampleParserObjectFactoryTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/parser/UpdatedSampleParserObjectFactoryTest.java @@ -65,24 +65,23 @@ public final class UpdatedSampleParserObjectFactoryTest return propertyMapper; } - @SuppressWarnings("unused") @DataProvider private final static Object[][] getLineTokens() { return new Object[][] { - { new String[] - { "", "", "", "" }, 0, 0 }, - { new String[] - { "id1", "cont1", "1", "hello" }, 2, 2 }, - { new String[] - { "id1", "", "1", "" }, 1, 1 }, - { new String[] - { "", "cont1", "", "hello" }, 1, 1 }, - { new String[] - { "id1", "cont1", "--DELETE--", "__DELETE__" }, 0, 2 }, - { new String[] - { "__DELETE__", "--DELETE--", "--DELETE--", "hello" }, 1, 2 } }; + { new String[] + { "", "", "", "" }, 0, 0 }, + { new String[] + { "id1", "cont1", "1", "hello" }, 2, 2 }, + { new String[] + { "id1", "", "1", "" }, 1, 1 }, + { new String[] + { "", "cont1", "", "hello" }, 1, 1 }, + { new String[] + { "id1", "cont1", "--DELETE--", "__DELETE__" }, 0, 2 }, + { new String[] + { "__DELETE__", "--DELETE--", "--DELETE--", "hello" }, 1, 2 } }; } @Test(dataProvider = "getLineTokens") diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/generic/GenericSystemTestCase.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/generic/GenericSystemTestCase.java index 2039f990fe7..eef627556d4 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/generic/GenericSystemTestCase.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/plugin/generic/GenericSystemTestCase.java @@ -30,18 +30,18 @@ import ch.systemsx.cisd.openbis.plugin.generic.shared.IGenericServer; import ch.systemsx.cisd.openbis.systemtest.SystemTestCase; /** - * - * * @author Franz-Josef Elmer */ public class GenericSystemTestCase extends SystemTestCase { + @SuppressWarnings("hiding") @Autowired protected IGenericClientService genericClientService; - + + @SuppressWarnings("hiding") @Autowired protected IGenericServer genericServer; - + protected void addMultiPartFile(String sessionAttributeKey, String fileName, byte[] data) { HttpSession session = request.getSession(); diff --git a/openbis_all/source/java/TransferAuthorizationAnnotations.java b/openbis_all/source/java/TransferAuthorizationAnnotations.java index 2483347da94..cf10d7ebec7 100644 --- a/openbis_all/source/java/TransferAuthorizationAnnotations.java +++ b/openbis_all/source/java/TransferAuthorizationAnnotations.java @@ -98,12 +98,16 @@ public class TransferAuthorizationAnnotations void addMethodSignatureLine(String line) { + final String methodSignatureLine; if (line.lastIndexOf(';') >= 0) { - line = line.substring(0, line.lastIndexOf(';')); + methodSignatureLine = line.substring(0, line.lastIndexOf(';')); + } else + { + methodSignatureLine = line; } - signatureLines.add(line); - joinedSignatureLines += line.trim(); + signatureLines.add(methodSignatureLine); + joinedSignatureLines += methodSignatureLine.trim(); } String getSignature() diff --git a/rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/etlserver/proteomics/ResultDataSetUploaderTest.java b/rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/etlserver/proteomics/ResultDataSetUploaderTest.java index f67522ca11e..f2476642689 100644 --- a/rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/etlserver/proteomics/ResultDataSetUploaderTest.java +++ b/rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/etlserver/proteomics/ResultDataSetUploaderTest.java @@ -38,9 +38,6 @@ import ch.systemsx.cisd.common.exception.UserFailureException; import ch.systemsx.cisd.common.test.AssertionUtil; import ch.systemsx.cisd.openbis.dss.generic.shared.IEncapsulatedOpenBISService; import ch.systemsx.cisd.openbis.dss.generic.shared.dto.DataSetInformation; -import ch.systemsx.cisd.openbis.etlserver.proteomics.IProtDAO; -import ch.systemsx.cisd.openbis.etlserver.proteomics.ProteinDescription; -import ch.systemsx.cisd.openbis.etlserver.proteomics.ResultDataSetUploader; import ch.systemsx.cisd.openbis.etlserver.proteomics.dto.AminoAcidMass; import ch.systemsx.cisd.openbis.etlserver.proteomics.dto.AnnotatedProtein; import ch.systemsx.cisd.openbis.etlserver.proteomics.dto.DataSet; @@ -64,7 +61,6 @@ import ch.systemsx.cisd.openbis.generic.shared.basic.dto.NewSample; import ch.systemsx.cisd.openbis.generic.shared.basic.dto.Space; import ch.systemsx.cisd.openbis.generic.shared.dto.ListSamplesByPropertyCriteria; import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.ExperimentIdentifier; -import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.SpaceIdentifier; import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.SampleIdentifier; import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.SpaceIdentifier; import ch.systemsx.cisd.openbis.plugin.proteomics.shared.basic.CommonConstants; diff --git a/rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/proteomics/server/api/v1/ProteomicsDataServiceTest.java b/rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/proteomics/server/api/v1/ProteomicsDataServiceTest.java index 02f30261ee5..5196e4e3594 100644 --- a/rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/proteomics/server/api/v1/ProteomicsDataServiceTest.java +++ b/rtd_phosphonetx/sourceTest/java/ch/systemsx/cisd/openbis/plugin/proteomics/server/api/v1/ProteomicsDataServiceTest.java @@ -369,17 +369,17 @@ public class ProteomicsDataServiceTest extends AbstractServerTestCase context.assertIsSatisfied(); } - private void prepareLoginLogout(final SessionContextDTO session) + private void prepareLoginLogout(final SessionContextDTO mySession) { context.checking(new Expectations() { { one(internalService).tryToAuthenticate("abc", "dummy-password"); - will(returnValue(session)); + will(returnValue(mySession)); - if (session != null) + if (mySession != null) { - one(internalService).logout(session.getSessionToken()); + one(internalService).logout(mySession.getSessionToken()); } } }); diff --git a/screening/source/java/ch/systemsx/cisd/openbis/dss/screening/server/plugins/jython/ScreeningJythonIngestionService.java b/screening/source/java/ch/systemsx/cisd/openbis/dss/screening/server/plugins/jython/ScreeningJythonIngestionService.java index 7090932f069..9e89cf55c41 100644 --- a/screening/source/java/ch/systemsx/cisd/openbis/dss/screening/server/plugins/jython/ScreeningJythonIngestionService.java +++ b/screening/source/java/ch/systemsx/cisd/openbis/dss/screening/server/plugins/jython/ScreeningJythonIngestionService.java @@ -69,8 +69,8 @@ public class ScreeningJythonIngestionService extends JythonIngestionService NoOpDelegate delegate) { IDataSetRegistrationDetailsFactory<DataSetInformation> registrationDetailsFactory = - (IDataSetRegistrationDetailsFactory<DataSetInformation>) new JythonPlateDatasetFactory( - getRegistratorState(), null); + new JythonPlateDatasetFactory( + getRegistratorState(), null); DataSetRegistrationService<DataSetInformation> service = new DataSetRegistrationService<DataSetInformation>(this, incoming, diff --git a/screening/sourceTest/java/ch/systemsx/cisd/openbis/screening/systemtests/JsonAnnotationTest.java b/screening/sourceTest/java/ch/systemsx/cisd/openbis/screening/systemtests/JsonAnnotationTest.java index ff4282d51fc..2db9fa9cbf0 100644 --- a/screening/sourceTest/java/ch/systemsx/cisd/openbis/screening/systemtests/JsonAnnotationTest.java +++ b/screening/sourceTest/java/ch/systemsx/cisd/openbis/screening/systemtests/JsonAnnotationTest.java @@ -61,7 +61,6 @@ public class JsonAnnotationTest new HashMap<String, Collection<Class<?>>>(); // Used by TestNG - @SuppressWarnings("unused") @BeforeClass private void findAllClassesUsedByJsonRpcApi() { -- GitLab