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

SAK-31796 - Clean up instances of e.printStackTrace in the rest of Sakai #5113

Merged
merged 76 commits into from
Dec 12, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
4523959
Search - Clean up instances of e.printStackTrace
Dec 5, 2017
6a29191
Sections - Clean up instances of printStackTrace
Dec 5, 2017
a586309
Shortened - Clean up instances of e.printStackTrace
Dec 5, 2017
ece944d
SimpleRSS - Clean up instances of e.printStackTrace
Dec 5, 2017
6aaa55d
Site - Clean up instances of e.printStackTrace
Dec 5, 2017
869a189
sitedescription - Clean up instances of e.printStackTrace
Dec 5, 2017
ecaceae
Taggable - Clean up instances of e.printStackTrace
Dec 5, 2017
520f6c5
Signup - Clean up instances of e.printStackTrace
Dec 5, 2017
980ada3
Sitemanage - Clean up instances of e.printStackTrace
Dec 5, 2017
32cb89b
Access - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
7569dbb
Admin-tools - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
18bae86
Announcement - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
7290b3d
Archive - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
01d4981
Assignment - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
d10b521
Basiclti - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
0f4f4d3
Calendar - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
221b567
Chat - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
c1f21e5
Sitestats - Clean up instances of e.printStackTrace
Dec 5, 2017
bb1cd32
Citations - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
1804d43
Cloud-content - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
f0ce88e
Cmprovider - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
9e825c3
Common - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
0d98691
Commons - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
7a9fbbe
Content - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
1bcc80f
Courier - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
719a23b
Dav - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
a036a03
Delegatedaccess - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
7910656
Edu-services - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
130c0aa
Content-review - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
767c672
Citations - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
7e3266e
Emailtemplateservice - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
9397592
Endorsed - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
00c1005
Entitybroker - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
fda3674
External-calendaring-service - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
594cd9a
External-calendaring-service - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
2cab54d
Feedback - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
28f618c
Syllabus - Clean up instances of e.printStackTrace
Dec 5, 2017
4e13885
Tags - Clean up instances of e.printStackTrace
Dec 5, 2017
c774917
Gradebook - Clean up instances of printStackTrace
josecebe Dec 5, 2017
610feae
Textarea - Clean up printStackTrace
Dec 5, 2017
9ef9156
Tool - Clean up printStackTrace
Dec 5, 2017
61846a4
Gradebookng - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
00298c9
Help - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
06cc79a
Hierarchy - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
65c9225
Jobsscheduler - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
75e4f95
Jsf - Clean up instances of e.printStackTrace
josecebe Dec 5, 2017
a5200e7
User - Clean up instances of printStackTrace
Dec 5, 2017
24329cf
useraudit - Clean up instances of printStack
Dec 5, 2017
4abf798
usermembership - Clean up instances of printStackTrace
Dec 5, 2017
ae2bf0e
Velocity - Clean up instances of printStackTrace
Dec 5, 2017
99d8719
Web - Clean up instances of printStackTrace
Dec 5, 2017
364406f
Webservices - Clean up instances of printStackTrace
Dec 5, 2017
1cb3169
Rwiki - Clean up instances of printStackTrace
Dec 11, 2017
91b863c
rubrics - Clean up instances of printStackTrace
Dec 11, 2017
a18cd74
rsf - Clean up instances of printStackTrace
Dec 11, 2017
bb18392
roster2 - Clean up instances of printStackTrace
Dec 11, 2017
bb54fe8
reset-pass - Clean up instances of printStackTrace
Dec 11, 2017
8165fb2
providers - Clean up instances of printStackTrace
Dec 11, 2017
e6c1a66
Profile2 - Clean up instances of printStackTrace
Dec 11, 2017
914f008
Kernel - Clean up instances of printStackTrace
josecebe Dec 11, 2017
969d6c3
Presence - Clean up instances of printStackTrace
Dec 11, 2017
7ba0a9b
Postem - Clean up instances of printStackTrace
Dec 11, 2017
86344d5
Portal - Clean up instances of printStackTrace
Dec 11, 2017
6c2c842
polls - Clean up instances of printStackTrace
Dec 11, 2017
500b969
Podcasts - Clean up instances of printStackTrace
Dec 11, 2017
57834d5
Pasystem - Clean up instances of printStackTrace
Dec 11, 2017
b6039f4
oauth - Clean up instances of printStackTrace
Dec 11, 2017
40ea310
Lessonbuilder - Clean up instances of printStackTrace
josecebe Dec 11, 2017
993ad10
Login - Clean up instances of printStackTrace
josecebe Dec 11, 2017
8402e5c
Mailarchive - Clean up instances of printStackTrace
josecebe Dec 12, 2017
10f2e65
Mailsender - Clean up instances of printStackTrace
josecebe Dec 12, 2017
98ceee0
Message - Clean up instances of printStackTrace
josecebe Dec 12, 2017
c8de889
MSGCNTR - Clean up instances of printStackTrace
Dec 12, 2017
40e0f7c
Extra cases - Clean up instances of printStackTrace
Dec 12, 2017
8694da6
Extra cases - Clean up instances of System.out.println
Dec 12, 2017
f2b911f
Extra cases - Use Slf4j Annotation
Dec 12, 2017
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
Prev Previous commit
Next Next commit
Message - Clean up instances of printStackTrace
  • Loading branch information
josecebe authored and Miguel Pellicer committed Dec 12, 2017
commit 98ceee0d7492150da1b071e3f8187cca03b0bbf9
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,21 @@

package org.sakaiproject.message.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.ByteArrayOutputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.util.*;

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

import lombok.extern.slf4j.Slf4j;

import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

import org.sakaiproject.api.app.scheduler.ScheduledInvocationManager;
import org.sakaiproject.authz.api.AuthzGroupService;
import org.sakaiproject.authz.api.AuthzPermissionException;
Expand Down Expand Up @@ -52,27 +65,13 @@
import org.sakaiproject.user.api.UserDirectoryService;
import org.sakaiproject.user.api.UserNotDefinedException;
import org.sakaiproject.util.*;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.util.*;


/**
* BaseMessage is...
*/
@Slf4j
public abstract class BaseMessage implements MessageService, DoubleStorageUser
{
/** Our logger. */
private static Logger M_log = LoggerFactory.getLogger(BaseMessage.class);

/** A Storage object for persistent storage. */
protected Storage m_storage = null;

Expand All @@ -86,7 +85,7 @@ public abstract class BaseMessage implements MessageService, DoubleStorageUser

/** added to allow for scheduled notifications */
private static final String SCHED_INV_UUID = "schInvUuid";
// private static final String SCHINV_DELETE_EVENT = "schInv.delete";
//private static final String SCHINV_DELETE_EVENT = "schInv.delete";


/**
Expand Down Expand Up @@ -293,11 +292,11 @@ public void init()
m_storage = newStorage();
m_storage.open();

M_log.info("init()");
log.info("init()");
}
catch (Throwable t)
{
M_log.warn("init(): "+t, t);
log.warn("init(): "+t, t);
}

// entity producer registration in the extension services
Expand All @@ -314,7 +313,7 @@ public void destroy()
m_storage.close();
m_storage = null;

M_log.info("destroy()");
log.info("destroy()");
}

/**********************************************************************************************************************************************************************************************************************************************************
Expand Down Expand Up @@ -732,7 +731,7 @@ public MessageChannelEdit addChannel(String ref) throws IdUsedException, IdInval
if (channel != null)
channel_reference = channel.getReference();
else
M_log.info("addChannel: null channel returned from putChannel("+ref+")");
log.info("addChannel: null channel returned from putChannel("+ref+")");

Event event = m_eventTrackingService.newEvent(eventId(SECURE_CREATE), channel_reference, true);
m_eventTrackingService.post(event);
Expand Down Expand Up @@ -808,7 +807,7 @@ public void commitChannel(MessageChannelEdit edit)
}
catch (Exception e)
{
M_log.warn("commitEdit(): closed ChannelEdit", e);
log.warn("commitEdit(): closed ChannelEdit", e);
}
return;
}
Expand Down Expand Up @@ -839,7 +838,7 @@ public void cancelChannel(MessageChannelEdit edit)
}
catch (Exception e)
{
M_log.warn("cancelChannelEdit(): closed MessageChannelEdit", e);
log.warn("cancelChannelEdit(): closed MessageChannelEdit", e);
}
return;
}
Expand Down Expand Up @@ -887,7 +886,7 @@ public void removeChannel(MessageChannelEdit channel) throws PermissionException
}
catch (Exception e)
{
M_log.warn("removeChannel(): closed ChannelEdit", e);
log.warn("removeChannel(): closed ChannelEdit", e);
}
return;
}
Expand All @@ -914,7 +913,7 @@ public void removeChannel(MessageChannelEdit channel) throws PermissionException
}
catch (AuthzPermissionException e)
{
M_log.warn("removeChannel: removing realm for : " + channel.getReference() + " : " + e);
log.warn("removeChannel: removing realm for : " + channel.getReference() + " : " + e);
}
catch (GroupNotDefinedException ignore)
{
Expand Down Expand Up @@ -1095,7 +1094,7 @@ public List <Message> filterGroupAccess(List <Message> msgs, String context, Str

} catch (UserNotDefinedException e1) {
// TODO Auto-generated catch block
M_log.info("User Not Defined: " + e1.getMessage());
log.info("User Not Defined: " + e1.getMessage());
}

// boolean isViewingAs = (m_securityService.getUserEffectiveRole(context) != null);
Expand All @@ -1113,7 +1112,7 @@ public List <Message> filterGroupAccess(List <Message> msgs, String context, Str
site = m_siteService.getSite(context);
} catch (IdUnusedException e) {
// TODO Auto-generated catch block
M_log.debug("Site not found for " + context + " " + e.getMessage());
log.debug("Site not found for " + context + " " + e.getMessage());
}

if (!canSeeAllGroups(userId, site)){
Expand Down Expand Up @@ -1415,20 +1414,20 @@ else if (REF_TYPE_MESSAGE.equals(ref.getSubType()))
}

else
M_log.warn("getProperties(): unknown message ref subtype: " + ref.getSubType() + " in ref: " + ref.getReference());
log.warn("getProperties(): unknown message ref subtype: " + ref.getSubType() + " in ref: " + ref.getReference());
}
catch (PermissionException e)
{
M_log.warn("getProperties(): " + e);
log.warn("getProperties(): " + e);
}
catch (IdUnusedException e)
{
// This just means that the resource once pointed to as an attachment or something has been deleted.
// M_log.warn("getProperties(): " + e);
// log.warn("getProperties(): " + e);
}
catch (NullPointerException e)
{
M_log.warn("getProperties(): " + e);
log.warn("getProperties(): " + e);
}

return rv;
Expand Down Expand Up @@ -1457,21 +1456,21 @@ else if (REF_TYPE_MESSAGE.equals(ref.getSubType()))
rv = getMessage(ref);
}

// else try {throw new Exception();} catch (Exception e) {M_log.warn("getResource(): unknown message ref subtype: " + m_subType + " in ref: " + m_reference, e);}
// else try {throw new Exception();} catch (Exception e) {log.warn("getResource(): unknown message ref subtype: " + m_subType + " in ref: " + m_reference, e);}
else
M_log.warn("getResource(): unknown message ref subtype: " + ref.getSubType() + " in ref: " + ref.getReference());
log.warn("getResource(): unknown message ref subtype: " + ref.getSubType() + " in ref: " + ref.getReference());
}
catch (PermissionException e)
{
M_log.warn("getResource(): " + e);
log.warn("getResource(): " + e);
}
catch (IdUnusedException e)
{
M_log.warn("getResource(): " + e);
log.warn("getResource(): " + e);
}
catch (NullPointerException e)
{
M_log.warn("getResource(): " + e);
log.warn("getResource(): " + e);
}

return rv;
Expand Down Expand Up @@ -1551,7 +1550,7 @@ public Collection<String> getEntityAuthzGroups(Reference ref, String userId)
}
catch (Throwable e)
{
M_log.warn("getEntityAuthzGroups(): " + e);
log.warn("getEntityAuthzGroups(): " + e);
}

return rv;
Expand Down Expand Up @@ -1583,19 +1582,19 @@ else if (REF_TYPE_MESSAGE.equals(ref.getSubType()))
}

else
M_log.warn("getUrl(): unknown message ref subtype: " + ref.getSubType() + " in ref: " + ref.getReference());
log.warn("getUrl(): unknown message ref subtype: " + ref.getSubType() + " in ref: " + ref.getReference());
}
catch (PermissionException e)
{
M_log.warn("getUrl(): " + e);
log.warn("getUrl(): " + e);
}
catch (IdUnusedException e)
{
M_log.warn("getUrl(): " + e);
log.warn("getUrl(): " + e);
}
catch (NullPointerException e)
{
M_log.warn("getUrl(): " + e);
log.warn("getUrl(): " + e);
}

return url;
Expand Down Expand Up @@ -1654,7 +1653,7 @@ public String archive(String siteId, Document doc, Stack stack, String archivePa
}
catch (Exception any)
{
M_log.warn("archve: exception archiving messages for service: " + serviceName() + " channel: " + channelRef);
log.warn("archve: exception archiving messages for service: " + serviceName() + " channel: " + channelRef);
}

stack.pop();
Expand Down Expand Up @@ -1697,7 +1696,7 @@ public void archiveSynopticOptions(String siteId, Document doc, Element element)
}
catch (Exception e)
{
M_log.warn("archive: exception archiving synoptic options for service: " + serviceName());
log.warn("archive: exception archiving synoptic options for service: " + serviceName());
}
}

Expand Down Expand Up @@ -1891,7 +1890,7 @@ else if (element2.getTagName().equals(SYNOPTIC_TOOL))
catch (IdUnusedException e)
{
// do not add channel b/c it does not exist in tool
M_log.warn("Synoptic Tool Channel option not added- " + synChannelRef + ":" + e);
log.warn("Synoptic Tool Channel option not added- " + synChannelRef + ":" + e);
}
}
}
Expand Down Expand Up @@ -2013,7 +2012,7 @@ else if (element2.getTagName().equals(SYNOPTIC_TOOL))
}
catch (Exception any)
{
M_log.warn("mergeMessages(): exception in handling " + serviceName() + " : ", any);
log.warn("mergeMessages(): exception in handling " + serviceName() + " : ", any);
}

results.append("merging " + getLabel() + " channel " + channelRef + " (" + count + ") messages.\n");
Expand Down Expand Up @@ -2083,15 +2082,15 @@ public void transferSynopticOptions(String fromContext, String toContext)
}
catch (PermissionException pe)
{
M_log.warn("PermissionException transferring synoptic options for " + serviceName() + ':', pe);
log.warn("PermissionException transferring synoptic options for " + serviceName() + ':', pe);
}
catch (IdUnusedException e)
{
M_log.warn("Channel " + fromContext + " cannot be found. ");
log.warn("Channel " + fromContext + " cannot be found. ");
}
catch (Exception e)
{
M_log.warn("transferSynopticOptions(): exception in handling " + serviceName() + " : ", e);
log.warn("transferSynopticOptions(): exception in handling " + serviceName() + " : ", e);
}
}

Expand Down Expand Up @@ -2599,7 +2598,7 @@ public void commitMessage_order(MessageEdit edit)
}
catch (Exception e)
{
M_log.warn("commitEdit(): closed MessageEdit", e);
log.warn("commitEdit(): closed MessageEdit", e);
}
return;
}
Expand Down Expand Up @@ -2690,7 +2689,7 @@ public void commitMessage(MessageEdit edit, int priority, String invokee)
}
catch (Exception e)
{
M_log.warn("commitEdit(): closed MessageEdit", e);
log.warn("commitEdit(): closed MessageEdit", e);
}
return;
}
Expand Down Expand Up @@ -2804,7 +2803,7 @@ public void cancelMessage(MessageEdit edit)
}
catch (Exception e)
{
M_log.warn("commitEdit(): closed MessageEdit", e);
log.warn("commitEdit(): closed MessageEdit", e);
}
return;
}
Expand Down Expand Up @@ -2995,7 +2994,7 @@ public void removeMessage(String messageId) throws PermissionException
}
catch (Exception e)
{
M_log.warn("removeMessage(String): null edit ", e);
log.warn("removeMessage(String): null edit ", e);
}
return;
}
Expand All @@ -3017,7 +3016,7 @@ public void removeMessage(MessageEdit message) throws PermissionException
// check for closed edit
if (!message.isActiveEdit())
{
M_log.warn("removeMessage(): message is not in active edit, unable to remove");
log.warn("removeMessage(): message is not in active edit, unable to remove");
return;
}

Expand Down Expand Up @@ -3049,7 +3048,7 @@ public void removeMessage(MessageEdit message) throws PermissionException
}
catch (AuthzPermissionException e)
{
M_log.warn("removeMessage: removing realm for : " + message.getReference() + " : " + e);
log.warn("removeMessage: removing realm for : " + message.getReference() + " : " + e);
}

} // removeMessage
Expand Down Expand Up @@ -3298,7 +3297,7 @@ public void valueBound(SessionBindingEvent event)

public void valueUnbound(SessionBindingEvent event)
{
if (M_log.isDebugEnabled()) M_log.debug("valueUnbound()");
if (log.isDebugEnabled()) log.debug("valueUnbound()");

// catch the case where an edit was made but never resolved
if (m_active)
Expand Down Expand Up @@ -3730,7 +3729,7 @@ public void valueBound(SessionBindingEvent event)

public void valueUnbound(SessionBindingEvent event)
{
if (M_log.isDebugEnabled()) M_log.debug("valueUnbound()");
if (log.isDebugEnabled()) log.debug("valueUnbound()");

// catch the case where an edit was made but never resolved
if ((m_active) && (m_channel != null))
Expand Down Expand Up @@ -4017,7 +4016,7 @@ public void setGroupAccess(Collection groups) throws PermissionException
// there should not be a case where there's no message or a message with no channel... -ggolden
if ((m_message == null) || ((BaseMessageEdit) m_message).m_channel == null)
{
M_log.warn("setGroupAccess() called with null message: " + ((m_message == null) ? "null" : ((BaseMessageEdit) m_message).toString()) + " or channel: " + ((m_message == null) ? "" : ((BaseMessageEdit) m_message).m_channel.toString()));
log.warn("setGroupAccess() called with null message: " + ((m_message == null) ? "null" : ((BaseMessageEdit) m_message).toString()) + " or channel: " + ((m_message == null) ? "" : ((BaseMessageEdit) m_message).m_channel.toString()));
throw new PermissionException(m_sessionManager.getCurrentSessionUserId(), "access:channel", ((m_message == null) ? "" : ((BaseMessageEdit) m_message).getReference()));
}

Expand Down Expand Up @@ -4081,7 +4080,7 @@ public void clearGroupAccess() throws PermissionException
// there should not be a case where there's no message or a message with no channel... -ggolden
if ((m_message == null) || ((BaseMessageEdit) m_message).m_channel == null)
{
M_log.warn("clearGroupAccess() called with null message: " + ((m_message == null) ? "null" : ((BaseMessageEdit) m_message).toString()) + " or channel: " + ((m_message == null) ? "" : ((BaseMessageEdit) m_message).m_channel.toString()));
log.warn("clearGroupAccess() called with null message: " + ((m_message == null) ? "null" : ((BaseMessageEdit) m_message).toString()) + " or channel: " + ((m_message == null) ? "" : ((BaseMessageEdit) m_message).m_channel.toString()));
throw new PermissionException(m_sessionManager.getCurrentSessionUserId(), "access:channel", ((m_message == null) ? "" : ((BaseMessageEdit) m_message).getReference()));
}

Expand Down
Loading