Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to Spring 4 #508

Draft
wants to merge 2 commits into
base: development
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gemma-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@
<version>1.5</version>
<dependencies><!-- yes, this needs to be here. -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<version>${mysql.version}</version>
<scope>runtime</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
package ubic.gemma.core.association.phenotype;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import ubic.gemma.core.annotation.reference.BibliographicReferenceService;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package ubic.gemma.core.metrics;

import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.binder.cache.EhCache2Metrics;
import net.sf.ehcache.Ehcache;
import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;
import ubic.gemma.core.metrics.binder.cache.EhCache24Metrics;

/**
* Add metrics from each available {@link Ehcache} in the given {@link CacheManager} to the supplied meter registry.
* @author poirigui
* @see EhCache24Metrics
* @see EhCache2Metrics
*/
public class MeterRegistryEhcacheConfigurer extends AbstractMeterRegistryConfigurer {

Expand All @@ -25,7 +25,7 @@ public void configure( MeterRegistry registry ) {
for ( String cacheName : cacheManager.getCacheNames() ) {
Cache cache = cacheManager.getCache( cacheName );
if ( cache.getNativeCache() instanceof Ehcache ) {
EhCache24Metrics.monitor( registry, ( Ehcache ) cache.getNativeCache() );
EhCache2Metrics.monitor( registry, ( Ehcache ) cache.getNativeCache() );
}
}
}
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.hibernate.*;
import org.hibernate.engine.spi.CascadeStyle;
import org.hibernate.engine.spi.CascadingAction;
import org.hibernate.engine.spi.CascadingActions;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.type.Type;
import org.slf4j.Logger;
Expand Down Expand Up @@ -180,18 +181,18 @@ private void processAuditable( Signature method, OperationType operationType, Au
*/
private void addCreateAuditEvent( Signature method, Auditable auditable, User user, Date date ) {
addAuditEvent( method, auditable, AuditAction.CREATE, "", user, date );
cascadeAuditEvent( method, AuditAction.CREATE, auditable, user, date, CascadingAction.PERSIST );
cascadeAuditEvent( method, AuditAction.CREATE, auditable, user, date, CascadingActions.PERSIST );
}

private void addSaveAuditEvent( Signature method, Auditable auditable, User user, Date date ) {
AuditAction auditAction;
CascadingAction cascadingAction;
if ( auditable.getId() != null ) {
auditAction = AuditAction.UPDATE;
cascadingAction = CascadingAction.MERGE;
cascadingAction = CascadingActions.MERGE;
} else {
auditAction = AuditAction.CREATE;
cascadingAction = CascadingAction.PERSIST;
cascadingAction = CascadingActions.PERSIST;
}
addAuditEvent( method, auditable, auditAction, "", user, date );
// we only propagate a CREATE event through cascade for entities that were created in the save
Expand All @@ -214,15 +215,15 @@ private void addUpdateAuditEvent( Signature method, Auditable auditable, User us
addAuditEvent( method, auditable, AuditAction.UPDATE, "", user, date );
// we only propagate a CREATE event through cascade for entities that were created in the update
// Note: CREATE events are skipped if the audit trail already contains one
cascadeAuditEvent( method, AuditAction.CREATE, auditable, user, date, CascadingAction.SAVE_UPDATE );
cascadeAuditEvent( method, AuditAction.CREATE, auditable, user, date, CascadingActions.SAVE_UPDATE );
}

private void addDeleteAuditEvent( Signature method, Auditable auditable, User user, Date date ) {
if ( auditable.getId() == null ) {
throw new IllegalArgumentException( String.format( "Transient instance passed to delete auditing [%s on %s by %s]", method, auditable, user.getUserName() ) );
}
addAuditEvent( method, auditable, AuditAction.DELETE, "", user, date );
cascadeAuditEvent( method, AuditAction.DELETE, auditable, user, date, CascadingAction.DELETE );
cascadeAuditEvent( method, AuditAction.DELETE, auditable, user, date, CascadingActions.DELETE );
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class Filter {
*/
private static final ConfigurableConversionService conversionService = new GenericConversionService();

private static <T> void addConverter( Class<?> targetClass, Converter<String, T> converter, Converter<T, String> reverseConverter ) {
private static <T> void addConverter( Class<T> targetClass, Converter<String, T> converter, Converter<T, String> reverseConverter ) {
conversionService.addConverter( String.class, targetClass, converter );
conversionService.addConverter( targetClass, String.class, reverseConverter );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<property name="compass" ref="compassExpression"/>
<property name="gpsDevices">
<list>
<ref local="hibernateGpsDevice"/>
<ref bean="hibernateGpsDevice"/>
</list>
</property>
</bean>
Expand All @@ -40,7 +40,7 @@
<property name="compass" ref="compassGene"/>
<property name="gpsDevices">
<list>
<ref local="hibernateGpsDevice"/>
<ref bean="hibernateGpsDevice"/>
</list>
</property>
</bean>
Expand All @@ -49,7 +49,7 @@
<property name="compass" ref="compassArray"/>
<property name="gpsDevices">
<list>
<ref local="hibernateGpsDevice"/>
<ref bean="hibernateGpsDevice"/>
</list>
</property>
</bean>
Expand All @@ -58,7 +58,7 @@
<property name="compass" ref="compassBibliographic"/>
<property name="gpsDevices">
<list>
<ref local="hibernateGpsDevice"/>
<ref bean="hibernateGpsDevice"/>
</list>
</property>
</bean>
Expand All @@ -67,7 +67,7 @@
<property name="compass" ref="compassProbe"/>
<property name="gpsDevices">
<list>
<ref local="hibernateGpsDevice"/>
<ref bean="hibernateGpsDevice"/>
</list>
</property>
</bean>
Expand All @@ -76,7 +76,7 @@
<property name="compass" ref="compassBiosequence"/>
<property name="gpsDevices">
<list>
<ref local="hibernateGpsDevice"/>
<ref bean="hibernateGpsDevice"/>
</list>
</property>
</bean>
Expand All @@ -85,7 +85,7 @@
<property name="compass" ref="compassGeneSet"/>
<property name="gpsDevices">
<list>
<ref local="hibernateGpsDevice"/>
<ref bean="hibernateGpsDevice"/>
</list>
</property>
</bean>
Expand All @@ -94,7 +94,7 @@
<property name="compass" ref="compassExperimentSet"/>
<property name="gpsDevices">
<list>
<ref local="hibernateGpsDevice"/>
<ref bean="hibernateGpsDevice"/>
</list>
</property>
</bean>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@
are listed in a resource. If the resource is in your classpath, list in in 'locations'. Other config files can be added by
defining PropertiesConfiguration instances -->
<bean id="userPropertiesFileHandler" class="org.apache.commons.configuration2.io.FileHandler" init-method="load">
<constructor-arg index="0">
<ref local="userProperties"/>
</constructor-arg>
<constructor-arg index="0" ref="userProperties"/>
<property name="fileName" value="Gemma.properties"/>
</bean>

Expand All @@ -33,9 +31,7 @@
<bean id="configurationPropertyConfigurer"
class="ubic.gemma.persistence.util.CommonsConfigurationPropertyPlaceholderConfigurer"
depends-on="userPropertiesFileHandler">
<property name="configuration">
<ref local="userProperties"/>
</property>
<property name="configuration" ref="userProperties"/>
<property name="locations">
<list>
<value>classpath:default.properties</value>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package ubic.gemma.persistence.service.common.description;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
Expand Down
8 changes: 2 additions & 6 deletions gemma-core/src/test/resources/test.spring.config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@

<bean id="configurationPropertyConfigurer"
class="ubic.gemma.persistence.util.CommonsConfigurationPropertyPlaceholderConfigurer">
<property name="configuration">
<ref local="buildProperties"/>
</property>
<property name="configuration" ref="buildProperties"/>
<property name="locations">
<list>
<value>classpath:default.properties</value>
Expand All @@ -18,9 +16,7 @@
</bean>

<bean id="buildPropertiesFileHandler" class="org.apache.commons.configuration2.io.FileHandler" init-method="load">
<constructor-arg index="0">
<ref local="buildProperties"/>
</constructor-arg>
<constructor-arg index="0" ref="buildProperties"/>
<property name="fileName" value="default.properties"/>
</bean>

Expand Down
1 change: 1 addition & 0 deletions gemma-web/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/bin
/src/main/java/org
Loading