Skip to content

Commit

Permalink
SAK-50119 Global cleanup of Deprecated annotation (sakaiproject#12611)
Browse files Browse the repository at this point in the history
Co-authored-by: Earle Nietzel <[email protected]>
  • Loading branch information
ottenhoff and ern authored Aug 7, 2024
1 parent 885c26b commit ace27ca
Show file tree
Hide file tree
Showing 188 changed files with 747 additions and 3,005 deletions.
2 changes: 1 addition & 1 deletion admin-su/src/java/org/sakaiproject/tool/su/SuTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public String su()
// don't try to become yourself
if (sakaiSession.getUserEid().equals(validatedUserEid)) {
confirm = false;
message = msgs.getFormattedMessage("already_that_user", new Object[] {username});
message = msgs.getFormattedMessage("already_that_user", username);
fc.addMessage("su", new FacesMessage(FacesMessage.SEVERITY_ERROR, message, message));
log.warn("[SuTool] Exception: " + message);
confirm = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,18 @@ public void addJavaScriptParamsToContext(Context context) {
/**
* This class is needed to allow input and output since the User/UserEdit classes are too hard to work with
*/
@Setter
@SuppressWarnings("unused")
public static class TempUser implements User {
@Getter @Setter private String eid;
@Getter @Setter private String email;
@Getter @Setter private String firstName;
@Getter @Setter private String lastName;
@Getter @Setter private String displayName;
@Getter @Setter private String password;
@Getter @Setter private String type;
private String eid;
@Getter
private String email;
private String firstName;
private String lastName;
private String displayName;
@Getter
private String password;
private String type;

/**
* Default zero-arg constructor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ private String buildConfirmRemoveContext(SessionState state, Context context)
{
// there are sites to unenroll from, present this to the user
int siteLen = sites.size();
String siteMsg = siteLen == 1 ? rb.getString("useconrem.site") : rb.getFormattedMessage("useconrem.sites", Integer.valueOf(siteLen));
String siteMsg = siteLen == 1 ? rb.getString("useconrem.site") : rb.getFormattedMessage("useconrem.sites", Integer.toString(siteLen));
permDelWarning = rb.getFormattedMessage("useconrem.unenrol", user.getEid(), siteMsg);
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
* @version $Revision$
* @deprecated
*/
@Deprecated
public class AnnouncementService
{
public static final String MOD_DATE = org.sakaiproject.announcement.api.AnnouncementService.MOD_DATE;
Expand Down Expand Up @@ -152,18 +153,6 @@ public static org.sakaiproject.announcement.api.AnnouncementChannelEdit addAnnou
return service.addAnnouncementChannel(param0);
}

/**
* Return a list of all the defined channels.
* @return a list of MessageChannel (or extension) objects (may be empty).
*/
public static java.util.List getChannels()
{
org.sakaiproject.announcement.api.AnnouncementService service = getInstance();
if (service == null) return null;

return service.getChannels();
}

/**
* check permissions for getChannel().
* @param param0 The channel reference string.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
})
@Data
@NoArgsConstructor
@ToString(exclude = {"authors", "submissions", "groups", "properties", "attachments"})
@ToString(exclude = {"submissions", "groups", "properties", "attachments"})
@EqualsAndHashCode(of = "id")
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "id")
@JsonIgnoreProperties(ignoreUnknown = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
query = "from AssignmentAllPurposeItem m where m.assignmentId = :id")
@Data
@NoArgsConstructor
@EqualsAndHashCode(of = "id")
@EqualsAndHashCode(callSuper = false)
public class AssignmentAllPurposeItem extends AssignmentSupplementItemWithAttachment {

@Column(name = "ASSIGNMENT_ID", nullable = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public void execute(JobExecutionContext context) throws JobExecutionException {

boolean sendEmail = false;
StringBuilder email = new StringBuilder();
email.append(rb.getFormattedMessage("new.tools.body.header", new String[]{toolTitle, formatDuration(period)}));
email.append(rb.getFormattedMessage("new.tools.body.header", toolTitle, formatDuration(period)));
for(Map<String, Object> content : contents) {
String siteId = (String)content.get("SITE_ID");
try {
Expand All @@ -107,7 +107,7 @@ public void execute(JobExecutionContext context) throws JobExecutionException {
log.debug("No contents found, no email will be sent.");
return;
}
String subject = rb.getFormattedMessage("new.tools.subject", new String[]{toolTitle, formatDuration(period)});
String subject = rb.getFormattedMessage("new.tools.subject", toolTitle, formatDuration(period));
String body = email.toString();

emailService.send(from,to,subject, body, null, null, null);
Expand Down
1 change: 1 addition & 0 deletions basiclti/tsugi-util/src/java/net/oauth/OAuthMessage.java
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ public void sign(OAuthAccessor accessor) throws IOException,
* where to put the OAuth parameters, within the HTTP request
* @deprecated use HttpMessage.newRequest
*/
@Deprecated
public HttpMessage toHttpRequest(OAuthClient.ParameterStyle style) throws IOException {
return HttpMessage.newRequest(this, style.getReplacement());
}
Expand Down
31 changes: 3 additions & 28 deletions basiclti/tsugi-util/src/java/net/oauth/client/OAuthClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,23 +71,6 @@ public OAuthClient(HttpClient http)
private HttpClient http;
protected final Map<String, Object> httpParameters = new HashMap<String, Object>();

public void setHttpClient(HttpClient http) {
this.http = http;
}

public HttpClient getHttpClient() {
return http;
}

/**
* HTTP client parameters, as a map from parameter name to value.
*
* @see HttpClient for parameter names.
*/
public Map<String, Object> getHttpParameters() {
return httpParameters;
}

/**
* Get a fresh request token from the service provider.
*
Expand Down Expand Up @@ -242,14 +225,6 @@ public OAuthMessage invoke(OAuthAccessor accessor, String httpMethod,
*/
public static final String PARAMETER_STYLE = "parameterStyle";

/**
* The name of the OAuthConsumer property whose value is the Accept-Encoding
* header in HTTP requests.
* @deprecated use {@link OAuthConsumer#ACCEPT_ENCODING} instead
*/
@Deprecated
public static final String ACCEPT_ENCODING = OAuthConsumer.ACCEPT_ENCODING;

/**
* Construct a request message, send it to the service provider and get the
* response.
Expand Down Expand Up @@ -301,6 +276,7 @@ public OAuthResponseMessage access(OAuthMessage request, net.oauth.ParameterSty
*
* @deprecated use net.oauth.ParameterStyle.
*/
@Deprecated
public static enum ParameterStyle {
AUTHORIZATION_HEADER(net.oauth.ParameterStyle.AUTHORIZATION_HEADER),
BODY (net.oauth.ParameterStyle.BODY),
Expand All @@ -318,20 +294,19 @@ private ParameterStyle(net.oauth.ParameterStyle replacement) {
}

/** @deprecated */
@Deprecated
public OAuthMessage invoke(OAuthMessage request, ParameterStyle style)
throws IOException, OAuthException {
return invoke(request, style.getReplacement());
}

/** @deprecated */
@Deprecated
public OAuthResponseMessage access(OAuthMessage request, ParameterStyle style)
throws IOException {
return access(request, style.getReplacement());
}

protected static final String PUT = OAuthMessage.PUT;
protected static final String POST = OAuthMessage.POST;
protected static final String DELETE = OAuthMessage.DELETE;
protected static final String CONTENT_LENGTH = HttpMessage.CONTENT_LENGTH;

}
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ public static String adaptToCustomPropertyName(final String propertyName) {
* @param extra
* @return
*/
@Deprecated
public static Properties signProperties(Properties postProp, String url,
String method, String oauth_consumer_key, String oauth_consumer_secret,
Map<String,String> extra) {
Expand Down Expand Up @@ -290,6 +291,7 @@ public static Properties signProperties(Properties postProp, String url,
* @param extra
* @return
*/
@Deprecated
public static Properties signProperties(Properties postProp, String url,
String method, String oauth_consumer_key, String oauth_consumer_secret,
String org_id, String org_desc, String org_url, Map<String,String> extra) {
Expand Down Expand Up @@ -434,6 +436,7 @@ public static Map<String, String> signProperties(
* @param oauth_consumer_secret
* @return
*/
@Deprecated
public static boolean checkProperties(Properties postProp, String url,
String method, String oauth_consumer_key, String oauth_consumer_secret)
{
Expand Down Expand Up @@ -501,6 +504,7 @@ public static boolean checkProperties(
* @param extra
* @return the HTML ready for IFRAME src = inclusion.
*/
@Deprecated
public static String postLaunchHTML(final Properties cleanProperties,
String endpoint, String launchtext, boolean debug, Map<String,String> extra) {
Map<String, String> map = convertToMap(cleanProperties);
Expand All @@ -523,6 +527,7 @@ public static String postLaunchHTML(final Properties cleanProperties,
* @param extra
* @return the HTML ready for IFRAME src = inclusion.
*/
@Deprecated
public static String postLaunchHTML(final Properties cleanProperties,
String endpoint, String launchtext, boolean autosubmit, boolean debug, Map<String,String> extra) {
Map<String, String> map = convertToMap(cleanProperties);
Expand Down Expand Up @@ -851,6 +856,7 @@ public static String readHttpResponse(HttpURLConnection connection)
* @param descriptor
* @return
*/
@Deprecated
public static boolean parseDescriptor(Properties launch_info,
Properties postProp, String descriptor) {
// this is an ugly copy/paste of the non-@deprecated method
Expand Down Expand Up @@ -1033,6 +1039,7 @@ public static void setProperty(final Map<String, String> map,
* @param key
* @param value
*/
@Deprecated
public static void setProperty(Properties props, String key, String value) {
if (value == null) return;
if (value.trim().length() < 1) return;
Expand Down Expand Up @@ -1133,6 +1140,7 @@ public static Map<String, String> convertToMap(final Properties properties) {
* @param map
* @return
*/
@Deprecated
public static Properties convertToProperties(final Map<String, String> map) {
final Properties properties = new Properties();
if (map != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -543,14 +543,6 @@ public void setIdManager(IdManager manager)
m_idManager = manager;
}

/**
* Configuration: set the caching
*
* @param value true or false (has no effect anymore)
* @deprecated 8 April 2014 (Sakai 10) - this no longer does anything and will be removed
*/
public void setCaching(String value) {} // disabled and blank intentionally

/** Dependency: EntityManager. */
protected EntityManager m_entityManager = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
<property name="opaqueUrlDao"><ref bean="org.sakaiproject.calendar.api.OpaqueUrlDao"/></property>
<property name="containerTableName"><value>CALENDAR_CALENDAR</value></property>
<property name="resourceTableName"><value>CALENDAR_EVENT</value></property>
<property name="caching"><value>false</value></property>
<property name="locksInDb"><value>false</value></property>
<property name="autoDdl"><value>${auto.ddl}</value></property>
</bean>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@

import lombok.Data;

import lombok.EqualsAndHashCode;
import org.sakaiproject.calendar.api.CalendarEvent;
import org.sakaiproject.entity.api.Reference;
import org.sakaiproject.time.api.Time;

@EqualsAndHashCode(callSuper = true)
@Data
public class CalendarEventDetails extends CalendarEventSummary {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3227,7 +3227,7 @@ public String buildIcalExportPanelContext(VelocityPortlet portlet, Context conte

String icalInfoArr[] = {String.valueOf(ServerConfigurationService.getInt("calendar.export.next.months",12)),
String.valueOf(ServerConfigurationService.getInt("calendar.export.previous.months",6))};
String icalInfoStr = rb.getFormattedMessage("ical.info",icalInfoArr);
String icalInfoStr = rb.getFormattedMessage("ical.info", icalInfoArr);
context.put("icalInfoStr",icalInfoStr);

// Add iCal Export URL
Expand Down Expand Up @@ -3260,7 +3260,7 @@ protected void buildOpaqueUrlCleanContext(VelocityPortlet portlet, Context conte
context.put("form-cancel", BUTTON + "doCancel");
String icalInfoArr[] = {String.valueOf(ServerConfigurationService.getInt("calendar.export.next.months",12)),
String.valueOf(ServerConfigurationService.getInt("calendar.export.previous.months",6))};
String icalInfoStr = rb.getFormattedMessage("ical.info",icalInfoArr);
String icalInfoStr = rb.getFormattedMessage("ical.info", icalInfoArr);
context.put("icalInfoStr",icalInfoStr);
buildMenu(portlet, context, runData, state);
}
Expand All @@ -3277,7 +3277,7 @@ protected void buildOpaqueUrlExistingContext(VelocityPortlet portlet, Context co

String icalInfoArr[] = {String.valueOf(ServerConfigurationService.getInt("calendar.export.next.months",12)),
String.valueOf(ServerConfigurationService.getInt("calendar.export.previous.months",6))};
String icalInfoStr = rb.getFormattedMessage("ical.info",icalInfoArr);
String icalInfoStr = rb.getFormattedMessage("ical.info", icalInfoArr);
context.put("icalInfoStr",icalInfoStr);

context.put("opaqueUrl", opaqueUrl);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ public interface ChatManager extends EntitySummary {
* @return int the number of messages in the passed channel
* @deprecated use {@link #getChannelMessagesCount(ChatChannel, String, Date)}
*/
@Deprecated
public int countChannelMessages(ChatChannel channel);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public interface Citation // extends Entity
public String addCustomUrl(String label, String url, String prefixRequest);

/**
* @deprecated This should never have been added as other methods are clearer.
* @see #hasCitationProperty(String)
* @param name
* @param value
Expand Down Expand Up @@ -238,15 +237,14 @@ public interface Citation // extends Entity
public boolean hasPreferredUrl();

/**
* @deprecated This doesn't fit with the naming pattern.
* @see #hasCitationProperty(String)
* @return
*/
public boolean hasPropertyValue(String fieldId);

/**
* Read this citation from an input stream in RIS format
* @param istream
* @param ris an istream
* @throws IOException
*/
public void importFromRis(InputStream ris) throws IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@

package org.sakaiproject.citation.api;

import java.io.IOException;
import java.util.List;
import java.util.Map;

import org.osid.repository.RepositoryIterator;
import org.sakaiproject.citation.api.ActiveSearch;
import org.sakaiproject.citation.util.api.SearchCancelException;
import org.sakaiproject.citation.util.api.SearchException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
/**
* @deprecated
* */
@Deprecated
public class CitationService
{
// public static final String REF_TYPE_EXPORT_RIS = org.sakaiproject.citation.api.CitationService.REF_TYPE_EXPORT_RIS;
Expand Down
Loading

0 comments on commit ace27ca

Please sign in to comment.