Skip to content

Commit

Permalink
SAK-30828 Lombok @CommonsLog migrated to @slf4j
Browse files Browse the repository at this point in the history
  • Loading branch information
ern committed Apr 29, 2016
1 parent f4e8903 commit a438bdc
Show file tree
Hide file tree
Showing 33 changed files with 86 additions and 120 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import lombok.extern.apachecommons.CommonsLog;

import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
Expand All @@ -30,7 +29,7 @@
* @author Steve Swinsburg ([email protected])
*
*/
@CommonsLog
@Slf4j
public class DownloadServlet extends HttpServlet {

private static final long serialVersionUID = 1L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,17 @@
import java.util.Date;
import java.util.Optional;

import lombok.extern.slf4j.Slf4j;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.AbstractTransactionalJUnit4SpringContextTests;

import lombok.extern.apachecommons.CommonsLog;

/**
* Testing for the Evaluation Data Access Layer
*/
@CommonsLog
@Slf4j
@ContextConfiguration({ "/hibernate-test.xml", "/spring-hibernate.xml" })
public class ContentReviewDaoImplTest extends AbstractTransactionalJUnit4SpringContextTests {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.util.SortedSet;
import java.util.stream.Collectors;

import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.sakaiproject.component.api.ServerConfigurationService;
import org.sakaiproject.content.api.ContentResource;
Expand All @@ -39,12 +40,11 @@
import org.sakaiproject.tool.api.ToolManager;

import lombok.Setter;
import lombok.extern.apachecommons.CommonsLog;

/* This class is passed a list of providers in the bean as references, it will use the first
* by default unless overridden by a site property.
*/
@CommonsLog
@Slf4j
public class ContentReviewFederatedServiceImpl implements ContentReviewService {

@Setter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.util.Objects;
import java.util.Optional;

import lombok.extern.slf4j.Slf4j;
import org.sakaiproject.content.api.ContentResource;
import org.sakaiproject.contentreview.dao.ContentReviewConstants;
import org.sakaiproject.contentreview.dao.ContentReviewItem;
Expand All @@ -30,9 +31,8 @@
import org.springframework.transaction.annotation.Transactional;

import lombok.Setter;
import lombok.extern.apachecommons.CommonsLog;

@CommonsLog
@Slf4j
public class ContentReviewQueueServiceImpl implements ContentReviewQueueService {

@Setter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@
import java.net.SocketAddress;
import java.util.Map;

import lombok.extern.slf4j.Slf4j;
import org.sakaiproject.component.api.ServerConfigurationService;
import org.sakaiproject.contentreview.exception.SubmissionException;
import org.sakaiproject.contentreview.exception.TransientSubmissionException;
import org.sakaiproject.contentreview.turnitin.util.TurnitinAPIUtil;
import org.w3c.dom.Document;

import lombok.extern.apachecommons.CommonsLog;

/**
* This class contains the properties and utility methods so it can be used to
* make API calls and connections to a specific Turnitin Account.
Expand All @@ -43,7 +42,7 @@
* @author sgithens
*
*/
@CommonsLog
@Slf4j
public class TurnitinAccountConnection {

private String aid = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import java.io.IOException;

import lombok.extern.slf4j.Slf4j;
import org.apache.poi.hpsf.SummaryInformation;
import org.apache.poi.hwpf.HWPFDocument;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
Expand All @@ -26,8 +27,6 @@
import org.sakaiproject.entity.api.ResourceProperties;
import org.sakaiproject.exception.ServerOverloadException;

import lombok.extern.apachecommons.CommonsLog;

/**
* This class contains the implementation of
* {@link ContentReviewService.isAcceptableContent}. This includes other
Expand All @@ -37,7 +36,7 @@
* @author sgithens
*
*/
@CommonsLog
@Slf4j
public class TurnitinContentValidator {

private int tii_Max_Fil_Size;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import java.util.Set;
import java.util.SortedSet;

import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.validator.routines.EmailValidator;
Expand Down Expand Up @@ -84,9 +85,8 @@
import org.w3c.dom.NodeList;

import lombok.Setter;
import lombok.extern.apachecommons.CommonsLog;

@CommonsLog
@Slf4j
public class TurnitinReviewServiceImpl implements ContentReviewService {

public static final String TURNITIN_DATETIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
Expand Down Expand Up @@ -561,9 +561,9 @@ public void syncGrades(Map<String, Object> data) {
try {
document = turnitinConn.callTurnitinReturnDocument(params);
} catch (TransientSubmissionException e) {
log.error(e);
log.error(e.getMessage());
} catch (SubmissionException e) {
log.warn("SubmissionException error. " + e);
log.warn("SubmissionException error. " + e.getMessage());
}
Element root = document.getDocumentElement();
if (((CharacterData) (root.getElementsByTagName("rcode").item(0).getFirstChild())).getData().trim()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@
import java.util.HashMap;
import java.util.Map;

import lombok.extern.slf4j.Slf4j;
import org.sakaiproject.contentreview.exception.SubmissionException;
import org.sakaiproject.contentreview.exception.TransientSubmissionException;
import org.w3c.dom.CharacterData;
import org.w3c.dom.Document;
import org.w3c.dom.Element;

import lombok.extern.apachecommons.CommonsLog;

/**
* This contains a few functional utilities to help with logging in and out of
* Turnitin using fids 17 and 18.
Expand All @@ -38,7 +37,7 @@
* @author sgithens
*
*/
@CommonsLog
@Slf4j
public class TurnitinSessionFuncs {
/**
* Logs in to turnitin. Scrapes the response XML and returns the session id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -59,16 +60,14 @@
import org.sakaiproject.util.Xml;
import org.w3c.dom.Document;

import lombok.extern.apachecommons.CommonsLog;

/**
* This is a utility class for wrapping the physical https calls to the
* Turn It In Service.
*
* @author sgithens
*
*/
@CommonsLog
@Slf4j
public class TurnitinAPIUtil {

private static final Logger apiTraceLog = LoggerFactory.getLogger("org.sakaiproject.turnitin.util.TurnitinAPIUtil.apicalltrace");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import java.util.Optional;
import java.util.SortedSet;

import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.http.HttpResponse;
Expand Down Expand Up @@ -80,9 +81,8 @@
import org.sakaiproject.user.api.UserNotDefinedException;

import lombok.Setter;
import lombok.extern.apachecommons.CommonsLog;

@CommonsLog
@Slf4j
public class ContentReviewServiceVeriCite implements ContentReviewService {

@Setter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

import lombok.Getter;
import lombok.Setter;
import lombok.extern.apachecommons.CommonsLog;

import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.sakaiproject.authz.api.SecurityService;
import org.sakaiproject.component.cover.ComponentManager;
Expand Down Expand Up @@ -49,7 +48,7 @@
/**
* Entity provider for the Content / Resources tool
*/
@CommonsLog
@Slf4j
public class ContentEntityProvider extends AbstractEntityProvider implements EntityProvider, AutoRegisterEntityProvider, ActionsExecutable, Outputable, Describeable {

public final static String ENTITY_PREFIX = "content";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

import lombok.Getter;
import lombok.Setter;
import lombok.extern.apachecommons.CommonsLog;

import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.sakaiproject.authz.api.SecurityService;
import org.sakaiproject.content.api.ContentHostingService;
Expand Down Expand Up @@ -36,7 +35,7 @@
/**
* Entity provider for the Dropbox tool
*/
@CommonsLog
@Slf4j
public class DropboxEntityProvider extends AbstractEntityProvider implements EntityProvider, AutoRegisterEntityProvider, ActionsExecutable, Outputable, Describeable {

public final static String ENTITY_PREFIX = "dropbox";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import java.util.UUID;

import lombok.Setter;
import lombok.extern.apachecommons.CommonsLog;
import lombok.extern.slf4j.Slf4j;
import net.fortuna.ical4j.data.CalendarOutputter;
import net.fortuna.ical4j.model.Calendar;
import net.fortuna.ical4j.model.DateTime;
Expand All @@ -54,16 +54,13 @@
import org.sakaiproject.time.api.TimeRange;
import org.sakaiproject.user.api.User;




/**
* Implementation of {@link ExternalCalendaringService}
*
* @author Steve Swinsburg ([email protected])
*
*/
@CommonsLog
@Slf4j
public class ExternalCalendaringServiceImpl implements ExternalCalendaringService {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
import java.io.File;

import lombok.Setter;
import lombok.extern.apachecommons.CommonsLog;

import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.sakaiproject.authz.api.SecurityService;
import org.sakaiproject.component.api.ServerConfigurationService;
Expand All @@ -37,7 +36,7 @@
* @author Steve Swinsburg ([email protected])
*
*/
@CommonsLog
@Slf4j
public class SakaiProxyImpl implements SakaiProxy {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
import java.util.Map;

import lombok.Setter;
import lombok.extern.apachecommons.CommonsLog;

import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.sakaiproject.authz.api.SecurityService;
import org.sakaiproject.entitybroker.EntityReference;
Expand Down Expand Up @@ -43,7 +42,7 @@
* This is a provider for looking up and adding/editing Gradebook Items.
* It is actually passing along to a gradebook UI via RSF and does not provide any rest access to grades data
*/
@CommonsLog
@Slf4j
public class GradebookEntityProvider extends AbstractEntityProvider implements
AutoRegisterEntityProvider, CoreEntityProvider,
EntityViewParamsInferrer, Describeable, Sampleable, ActionsExecutable,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import javax.xml.bind.JAXBException;

import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.builder.CompareToBuilder;
import org.apache.commons.lang.math.NumberUtils;
Expand Down Expand Up @@ -66,7 +67,6 @@
import org.sakaiproject.util.ResourceLoader;

import lombok.Setter;
import lombok.extern.apachecommons.CommonsLog;

/**
* Business service for GradebookNG
Expand All @@ -80,7 +80,7 @@
// TODO add permission checks! Remove logic from entityprovider if there is a double up
// TODO some of these methods pass in empty lists and its confusing. If we aren't doing paging, remove this.

@CommonsLog
@Slf4j
public class GradebookNgBusinessService {

@Setter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.util.List;
import java.util.Map;

import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
Expand All @@ -28,12 +29,11 @@
import org.sakaiproject.util.BaseResourcePropertiesEdit;

import au.com.bytecode.opencsv.CSVReader;
import lombok.extern.apachecommons.CommonsLog;

/**
* Created by chmaurer on 1/21/15.
*/
@CommonsLog
@Slf4j
public class ImportGradesHelper extends BaseImportHelper {

private static final String IMPORT_USER_ID = "Student ID";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
import java.text.SimpleDateFormat;
import java.util.Date;

import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;

import lombok.extern.apachecommons.CommonsLog;

@CommonsLog
@Slf4j
public class FormatHelper {

/**
Expand Down
Loading

0 comments on commit a438bdc

Please sign in to comment.