Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
platform: [ ubuntu-latest ]
java-version: [ 8, 11, 17, 21 ]
java-version: [ 21, 25 ]
fail-fast: false

runs-on: ${{ matrix.platform }}
Expand Down
12 changes: 6 additions & 6 deletions bamboo-specs/bamboo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ stages:
manual: false
final: false
jobs:
- Build and Test JDK 8
- Build and Test JDK 21
- Deploy:
manual: false
final: false
Expand All @@ -22,8 +22,8 @@ stages:
jobs:
- Release to Maven

Build and Test JDK 8:
key: BTJ8
Build and Test JDK 21:
key: BTJ21
tasks:
- checkout:
force-clean-build: 'false'
Expand All @@ -34,7 +34,7 @@ Build and Test JDK 8:
- |-
#!/bin/bash -eu
set -x
export IMAGE="maven:3.9.9-amazoncorretto-8"
export IMAGE="maven:3.9.9-amazoncorretto-21"
docker pull ${IMAGE}
docker run -v m2-repo:/root/.m2/repository -v ${PWD}:/module --rm -w="/module" ${IMAGE} bash -c 'mvn clean package && chmod -R 777 .'
description: Build and test
Expand Down Expand Up @@ -63,7 +63,7 @@ Deploy to Maven:
- |-
#!/bin/bash -eu
set -x
export IMAGE="maven:3.9.9-amazoncorretto-8"
export IMAGE="maven:3.9.9-amazoncorretto-21"
docker pull ${IMAGE}
docker run -v m2-repo:/root/.m2/repository -v ~/.m2/settings.xml:/.m2/settings.xml:ro -v ${PWD}:/module --rm -w="/module" ${IMAGE} bash -c 'mvn deploy -DskipTests --settings /.m2/settings.xml'
description: Deploy
Expand Down Expand Up @@ -97,7 +97,7 @@ Release to Maven:
- |-
#!/bin/bash -eu
set -x
export IMAGE="maven:3.9.9-amazoncorretto-8"
export IMAGE="maven:3.9.9-amazoncorretto-21"
docker pull ${IMAGE}
docker run \
-v m2-repo:/root/.m2/repository \
Expand Down
6 changes: 3 additions & 3 deletions integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.openmrs.module</groupId>
<artifactId>webservices.rest</artifactId>
<version>3.2.0-SNAPSHOT</version>
<version>4.0.0-SNAPSHOT</version>
</parent>
<artifactId>webservices.rest-integration-tests</artifactId>
<packaging>jar</packaging>
Expand Down Expand Up @@ -51,8 +51,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<source>21</source>
<target>21</target>
</configuration>
</plugin>
<plugin>
Expand Down
4 changes: 2 additions & 2 deletions omod-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.openmrs.module</groupId>
<artifactId>webservices.rest</artifactId>
<version>3.2.0-SNAPSHOT</version>
<version>4.0.0-SNAPSHOT</version>
</parent>
<artifactId>webservices.rest-omod-common</artifactId>
<packaging>jar</packaging>
Expand All @@ -13,7 +13,7 @@
<dependencies>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>jasper</artifactId>
<artifactId>tomcat-jasper</artifactId>
<version>${apacheTomcatVersion}</version>
<scope>provided</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
package org.openmrs.module.webservices.docs.swagger;

import com.fasterxml.jackson.annotation.JsonGetter;
import org.codehaus.jackson.annotate.JsonProperty;
import com.fasterxml.jackson.annotation.JsonProperty;

/* The object provides metadata about the API.*/
public class Info {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import com.fasterxml.jackson.annotation.JsonGetter;
import com.fasterxml.jackson.annotation.JsonSetter;
import org.codehaus.jackson.annotate.JsonProperty;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import io.swagger.models.properties.RefProperty;
import io.swagger.models.properties.StringProperty;
import io.swagger.util.Json;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Level;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import org.openmrs.util.PrivilegeConstants;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.ServletContext;
import jakarta.servlet.ServletContext;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
import java.io.IOException;
import java.util.LinkedHashMap;

import org.codehaus.jackson.JsonParseException;
import org.codehaus.jackson.map.JsonMappingException;
import org.codehaus.jackson.map.ObjectMapper;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.openmrs.module.webservices.rest.util.SimpleObjectConverter;

import com.thoughtworks.xstream.annotations.XStreamAlias;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public HttpMessageConverter<?> getMappingJacksonHttpMessageConverter() throws Ex
clazz = Context.loadClass("org.springframework.http.converter.json.MappingJacksonHttpMessageConverter");
}

return (HttpMessageConverter<?>) clazz.newInstance();
return (HttpMessageConverter<?>) clazz.getDeclaredConstructor().newInstance();
}

/**
Expand Down Expand Up @@ -75,7 +75,7 @@ public AbstractHandlerExceptionResolver getHandlerExceptionResolver() throws Exc
Class<?> clazz = Context
.loadClass("org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver");

bean = (AbstractHandlerExceptionResolver) clazz.newInstance();
bean = (AbstractHandlerExceptionResolver) clazz.getDeclaredConstructor().newInstance();

Method method = bean.getClass().getMethod("setMessageConverters", HttpMessageConverter[].class);
method.invoke(bean, new Object[] { new HttpMessageConverter[] { stringHttpMessageConverter,
Expand All @@ -85,7 +85,7 @@ public AbstractHandlerExceptionResolver getHandlerExceptionResolver() throws Exc
Class<?> clazz = Context
.loadClass("org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver");

bean = (AbstractHandlerExceptionResolver) clazz.newInstance();
bean = (AbstractHandlerExceptionResolver) clazz.getDeclaredConstructor().newInstance();

Method method = bean.getClass().getMethod("setMessageConverters", List.class);
method.invoke(bean, Arrays.asList(stringHttpMessageConverter,
Expand Down Expand Up @@ -115,6 +115,6 @@ public AbstractHandlerMapping getHandlerMapping() throws Exception {
clazz = Context.loadClass("org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping");
}

return (AbstractHandlerMapping) clazz.newInstance();
return (AbstractHandlerMapping) clazz.getDeclaredConstructor().newInstance();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
package org.openmrs.module.webservices.rest.web;

import org.codehaus.jackson.annotate.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnore;

import com.thoughtworks.xstream.annotations.XStreamAlias;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
import java.net.URLEncoder;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import org.openmrs.api.APIException;
import org.openmrs.module.webservices.rest.web.representation.DefaultRepresentation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
package org.openmrs.module.webservices.rest.web;

import javax.annotation.PostConstruct;
import jakarta.annotation.PostConstruct;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
package org.openmrs.module.webservices.rest.web;

import org.apache.commons.beanutils.PropertyUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.openmrs.GlobalProperty;
Expand All @@ -34,8 +34,8 @@
import org.springframework.web.bind.ServletRequestUtils;
import org.springframework.web.bind.annotation.ResponseStatus;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.net.InetAddress;
Expand Down Expand Up @@ -496,7 +496,7 @@ public static RequestContext getRequestContext(HttpServletRequest request, HttpS
* @param request the current http web request
* @param response the current http web response
* @return a {@link RequestContext} object filled with all the necessary values
* @see getRequestContext(javax.servlet.http.HttpServletRequest,
* @see getRequestContext(jakarta.servlet.http.HttpServletRequest,
* org.openmrs.module.webservices.rest.web.representation.Representation)
*/
public static RequestContext getRequestContext(HttpServletRequest request, HttpServletResponse response) {
Expand Down Expand Up @@ -552,11 +552,7 @@ public static Boolean getBooleanParam(HttpServletRequest request, String param)
public static void setResponseStatus(Throwable ex, HttpServletResponse response) {
ResponseStatus ann = ex.getClass().getAnnotation(ResponseStatus.class);
if (ann != null) {
if (StringUtils.isNotBlank(ann.reason())) {
response.setStatus(ann.value().value(), ann.reason());
} else {
response.setStatus(ann.value().value());
}
response.setStatus(ann.value().value());
} else {
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
}
Expand Down
Loading
Loading