Skip to content

Commit

Permalink
Merge branch 'hotfix-1.29.13'
Browse files Browse the repository at this point in the history
  • Loading branch information
arteymix committed May 30, 2023
2 parents fa1abe4 + 43ea748 commit c3ab512
Show file tree
Hide file tree
Showing 8 changed files with 166 additions and 163 deletions.
2 changes: 1 addition & 1 deletion gemma-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>gemma</artifactId>
<groupId>gemma</groupId>
<version>1.29.12</version>
<version>1.29.13</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>gemma-cli</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion gemma-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>gemma</artifactId>
<groupId>gemma</groupId>
<version>1.29.12</version>
<version>1.29.13</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>gemma-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,8 @@ private int leastReplicates( ExpressionExperiment ee ) {
List<ExperimentalFactor> keepEfs = new ArrayList<>( GeeqServiceImpl.MAX_EFS_REPLICATE_CHECK );

for ( BioAssay ba : bas ) {
Collection<FactorValue> fvs = ba.getSampleUsed().getFactorValues();
// we need a copy here, otherwise the model will be mutated
Collection<FactorValue> fvs = new HashSet<>( ba.getSampleUsed().getFactorValues() );

//only keep up to MAX_EFS_REPLICATE_CHECK categorical factors, ignoring batch factor and DE_EXCLUDE
Collection<FactorValue> removeFvs = new LinkedList<>();
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion gemma-web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>gemma</artifactId>
<groupId>gemma</groupId>
<version>1.29.12</version>
<version>1.29.13</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>gemma-web</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

/**
* Implementation of {@link AuthenticationEntryPoint} for the RESTful API to handle authentication.
Expand Down Expand Up @@ -61,7 +62,10 @@ public void commence( final HttpServletRequest request, final HttpServletRespons
response.setContentType( MediaType.APPLICATION_JSON );
// using 'xBasic' instead of 'basic' to prevent default browser login popup
response.addHeader( "WWW-Authenticate", "xBasic realm=" + realm );
response.sendError( HttpServletResponse.SC_UNAUTHORIZED, objectMapper.writeValueAsString( errorObject ) );
response.setStatus( HttpServletResponse.SC_UNAUTHORIZED );
response.setCharacterEncoding( StandardCharsets.UTF_8.name() );
objectMapper.writeValue( response.getWriter(), errorObject );
response.flushBuffer();
}

@Override
Expand Down
18 changes: 8 additions & 10 deletions gemma-web/src/main/java/ubic/gemma/web/util/JsonUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.Writer;
import java.nio.charset.StandardCharsets;

/**
* Utilities for writing JSON payloads to {@link HttpServletResponse}.
Expand All @@ -18,24 +18,22 @@ public static void writeErrorToResponse( AuthenticationException e, HttpServletR
JSONObject json = new JSONObject();
json.put( "success", false );
json.put( "message", ExceptionUtils.getRootCauseMessage( e ) );
response.setContentType( MediaType.APPLICATION_JSON_VALUE );
response.sendError( HttpServletResponse.SC_UNAUTHORIZED, json.toString() );
response.setStatus( HttpServletResponse.SC_UNAUTHORIZED );
writeToResponse( json, response );
}

public static void writeErrorToResponse( Exception e, HttpServletResponse response ) throws IOException {
JSONObject json = new JSONObject();
json.put( "success", false );
json.put( "message", ExceptionUtils.getRootCauseMessage( e ) );
response.setContentType( MediaType.APPLICATION_JSON_VALUE );
response.sendError( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, json.toString() );
response.setStatus( HttpServletResponse.SC_INTERNAL_SERVER_ERROR );
writeToResponse( json, response );
}

public static void writeToResponse( JSONObject json, HttpServletResponse response ) throws IOException {
String jsonText = json.toString();
response.setContentType( MediaType.APPLICATION_JSON_VALUE );
response.setContentLength( jsonText.length() );
try ( Writer out = response.getWriter() ) {
out.write( jsonText );
}
response.setCharacterEncoding( StandardCharsets.UTF_8.name() );
json.write( response.getWriter() );
response.flushBuffer();
}
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<name>Gemma</name>
<groupId>gemma</groupId>
<artifactId>gemma</artifactId>
<version>1.29.12</version>
<version>1.29.13</version>
<inceptionYear>2005</inceptionYear>
<description>The Gemma Project for meta-analysis of genomics data</description>
<url>https://gemma.msl.ubc.ca</url>
Expand Down

0 comments on commit c3ab512

Please sign in to comment.