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

Added '@Override' should be used on overriding and implementing methods. (ROL-2159) #50

Merged
merged 6 commits into from
Nov 15, 2019
3 changes: 3 additions & 0 deletions app/src/main/java/org/apache/roller/RollerException.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public String getRootCauseMessage() {
* Print stack trace for exception and for root cause exception if there is one.
* @see java.lang.Throwable#printStackTrace()
*/
@Override
public void printStackTrace() {
super.printStackTrace();
if (mRootCause != null) {
Expand All @@ -113,6 +114,7 @@ public void printStackTrace() {
* Print stack trace for exception and for root cause exception if there is one.
* @param s Stream to print to.
*/
@Override
public void printStackTrace(PrintStream s) {
super.printStackTrace(s);
if (mRootCause != null) {
Expand All @@ -126,6 +128,7 @@ public void printStackTrace(PrintStream s) {
* Print stack trace for exception and for root cause exception if there is one.
* @param s Writer to write to.
*/
@Override
public void printStackTrace(PrintWriter s) {
super.printStackTrace(s);
if (null != mRootCause) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ public String getWeblogEntryURL(Weblog weblog,
/**
* Get url for a collection of entries on a given weblog.
*/
@Override
public String getWeblogCollectionURL(Weblog weblog,
String locale,
String category,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,15 @@ public void flush() throws WebloggerException {
}


@Override
public void release() {
super.release();
// tell JPA to close down
this.strategy.release();
}



@Override
public void shutdown() {
// do our own shutdown first
this.release();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public void init() throws WebloggerException {
this.init(PingQueueTask.NAME);
}

@Override
public void init(String name) throws WebloggerException {
super.init(name);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public ContinuousWorkerThread(String id, Job job, long sleep) {
*
* If we ever get interrupted then we quit.
*/
@Override
public void run() {

mLogger.info(this.id+" Started.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public void init() throws WebloggerException {
this.init(ResetHitCountsTask.NAME);
}

@Override
public void init(String name) throws WebloggerException {
super.init(name);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public WorkerThread(String id, Job job) {
*
* We just execute the job we were given if it's non-null.
*/
@Override
public void run() {

// we only run once
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public WriteToIndexOperation(IndexManagerImpl mgr) {
private static Log mLogger =
LogFactory.getFactory().getInstance(WriteToIndexOperation.class);

@Override
public void run() {
try {
manager.getReadWriteLock().writeLock().lock();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class PlanetURLStrategy extends MultiPlanetURLStrategy {
* Get URL configured for Planet.
* @param planet There's only one planet in Roller, so this is ignored.
*/
@Override
public String getPlanetURL(String planet) {
StringBuilder url = new StringBuilder();
url.append(WebloggerRuntimeConfig.getProperty("site.absoluteurl"));
Expand All @@ -45,6 +46,7 @@ public String getPlanetURL(String planet) {
* @param group Handle of planet group (or null for default group).
* @param pageNum Page number of results to return.
*/
@Override
public String getPlanetGroupURL(String planet, String group, int pageNum) {

StringBuilder url = new StringBuilder();
Expand Down Expand Up @@ -73,6 +75,7 @@ public String getPlanetGroupURL(String planet, String group, int pageNum) {
* @param group Handle of planet group (or null for default group).
* @param format Feed format to be returned (ignored, currently only RSS is supported).
*/
@Override
public String getPlanetGroupFeedURL(String planet, String group, String format) {

StringBuilder url = new StringBuilder();
Expand All @@ -95,6 +98,7 @@ public String getPlanetGroupFeedURL(String planet, String group, String format)
* @param planet There's only one planet in Roller, so this is ignored.
* @param group Handle of planet group.
*/
@Override
public String getPlanetGroupOpmlURL(String planet, String group) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public void init() throws WebloggerException {
this.init(RefreshRollerPlanetTask.NAME);
}

@Override
public void init(String name) throws WebloggerException {
super.init(name);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public PlanetConfig() {
}


@Override
public List<String> requiredGlobalPermissionActions() {
return Collections.singletonList(GlobalPermission.ADMIN);
}
Expand Down Expand Up @@ -97,7 +98,8 @@ public void myPrepare() {
}
}



@Override
public String execute() {
return INPUT;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ static PlanetGroup getGroupFromRequest(HttpServletRequest request, Planet planet
/**
* Populate page model and forward to subscription page
*/
@Override
public String execute() {
return LIST;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public void setServletRequest(HttpServletRequest request) {
/**
* Show planet groups page.
*/
@Override
public String execute() {
return LIST;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ private boolean actionImplies(String action1, String action2) {
return action1.equals(ADMIN) || (action1.equals(WEBLOG) && action2.equals(LOGIN));
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("GlobalPermission: ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ public boolean implies(Permission perm) {
return false;
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("GlobalPermission: ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public CmaRollerContext() {
/**
* Setup Spring Security features.
*/
@Override
protected void initializeSecurityFeatures(ServletContext context) {
// no need to setup Spring Security
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ public static ServletContext getServletContext() {
/**
* Responds to app-init event and triggers startup procedures.
*/
@Override
public void contextInitialized(ServletContextEvent sce) {

// First, initialize everything that requires no database
Expand Down Expand Up @@ -194,6 +195,7 @@ public void contextInitialized(ServletContextEvent sce) {
/**
* Responds to app-destroy event and triggers shutdown sequence.
*/
@Override
public void contextDestroyed(ServletContextEvent sce) {
WebloggerFactory.getWeblogger().shutdown();
// do we need a more generic mechanism for presentation layer shutdown?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,14 @@ public static RollerSession getRollerSession(HttpServletRequest request) {


/** Create session's Roller instance */
@Override
public void sessionCreated(HttpSessionEvent se) {
RollerSession rollerSession = new RollerSession();
se.getSession().setAttribute(ROLLER_SESSION, rollerSession);
}




@Override
public void sessionDestroyed(HttpSessionEvent se) {
clearSession(se);
}
Expand All @@ -144,6 +146,7 @@ public void sessionDidActivate(HttpSessionEvent se) {
* to call it when sessions are saved and then restored at some later
* point in time.
*/
@Override
public void sessionWillPassivate(HttpSessionEvent se) {
clearSession(se);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,11 @@ private boolean isInstallUrl(String uri) {
}


@Override
public void init(FilterConfig filterConfig) throws ServletException {
context = filterConfig.getServletContext();
}


@Override
public void destroy() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@ public class CharEncodingFilter implements Filter {
/**
* init
*/
@Override
public void init(FilterConfig filterConfig) throws ServletException {
}

/**
* destroy
*/
@Override
public void destroy() {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
log.info("");
}


@Override
public void destroy() {}


@Override
public void init(FilterConfig filterConfig) {}

}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public class IPBanFilter implements Filter {
private static Log log = LogFactory.getLog(IPBanFilter.class);


@Override
public void init(FilterConfig filterConfig) throws ServletException {

log.info("INIT IPBanFilter");
Expand All @@ -64,7 +65,7 @@ public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
}
}


@Override
public void destroy() {}

}
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,11 @@ private String getAbsoluteUrl(HttpServletRequest request) {
request.getRequestURI(), request.getRequestURL().toString());
}

@Override
public void init(FilterConfig filterConfig) throws ServletException {
}

@Override
public void destroy() {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterCha
chain.doFilter(request, response);
}

//@Override
@Override
public void init(FilterConfig filterConfig) throws ServletException {
}

//@Override
@Override
public void destroy() {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
}


@Override
public void init(FilterConfig filterConfig) throws ServletException {}

@Override
public void destroy() {}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
}


@Override
public void init(FilterConfig filterConfig) throws ServletException {}

public void destroy() {}
@Override
public void destroy() {}
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public void doFilter(ServletRequest request, ServletResponse response,
chain.doFilter(request, response);
}

@Override
public void init(FilterConfig filterConfig) throws ServletException {

// Construct our list of ignored urls
Expand All @@ -84,6 +85,7 @@ public void init(FilterConfig filterConfig) throws ServletException {
}
}

@Override
public void destroy() {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public RollerRememberMeServices() {
*
* If LDAP is enabled then a configurable dummy password is used in the calculation.
*/
@Override
protected String makeTokenSignature(long tokenExpiryTime, String username, String password) {

boolean usingLDAP = WebloggerConfig.getAuthMethod() == AuthMethod.LDAP;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public BigWeblogCalendarModel(WeblogPageRequest pRequest, String cat) {
}


@Override
protected void loadWeblogEntries(Date startDate, Date endDate, String catName) {
try {
WeblogEntryManager mgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
Expand All @@ -75,6 +76,7 @@ protected void loadWeblogEntries(Date startDate, Date endDate, String catName) {
}


@Override
public String getContent(Date day) {
String content = null;
try {
Expand Down Expand Up @@ -136,6 +138,7 @@ public String getContent(Date day) {
* @param alwaysURL Always return a URL, never return null
* @return URL for day, or null if no weblog entry on that day
*/
@Override
public String computeUrl(Date day, boolean nextPrevMonthURL, boolean alwaysURL) {
String url = null;
// get the 8 char YYYYMMDD datestring for day, returns null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,11 +356,13 @@ public String emit() {
return toString();
}

@Override
public int doStartTag() throws JspException {
return doStartTag( new PrintWriter( pageContext.getOut(), true) );
}



@Override
public int doEndTag() throws JspException {
return doEndTag( new PrintWriter( pageContext.getOut(), true) );
}
Expand Down
Loading