Skip to content

Commit

Permalink
Merge pull request #260 from dkpro/#254-declare-unused-methods-as-dep…
Browse files Browse the repository at this point in the history
…recated

#254 Declare unused methods as deprecated
  • Loading branch information
reckart authored Oct 31, 2023
2 parents 66d2f42 + 8fff5b9 commit e564404
Show file tree
Hide file tree
Showing 93 changed files with 582 additions and 1,135 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,9 @@ public void setTitlePattern(String pattern) {

/**
* @return A string that shows the current values of the query members.
* @deprecated To be removed without replacement.
*/
@Deprecated(since="2.0.0", forRemoval=true)
public String getQueryInfo() {
StringBuilder sb = new StringBuilder();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,9 @@ public Iterable<Page> getDiscussionArchives(int articlePageId) throws WikiApiExc
* @param title The title of the page for which the discussions should be retrieved.
* @return The page object for the discussion page.
* @throws WikiApiException If no page or redirect with this title exists or title could not be properly parsed.
* @deprecated Use {@link #getDiscussionArchives(int)} or {@link #getDiscussionArchives(Page)} instead.
*/
@Deprecated(since="2.0.0", forRemoval=true)
public Iterable<Page> getDiscussionArchives(String title) throws WikiApiException {
//Retrieve discussion archive pages with page title
return getDiscussionArchives(getPage(title));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ private Map<Integer, Set<Integer>> getCategoryArticleMap(Wikipedia pWiki, Set<In
}

/**
* Get various graph parameters like diameter, average out-degree etc of the categroy graph.
* Get various graph parameters like diameter, average out-degree etc. of the category graph.
*
* @param catGraph The category graph.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ public class CommonUtilities {
*
* @param s Must not be {@code null}.
* @return The resulting String of the contents of {@code s}.
* @deprecated To be removed without replacement.
*/
@Deprecated(since="2.0.0", forRemoval=true)
public static String getSetContents(Set<?> s) {
Object[] sortedArray = s.toArray();
Arrays.sort(sortedArray);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* @deprecated To be removed without replacement.
*/
@Deprecated(since="2.0.0", forRemoval=true)
public class DbUtilities {

private final Connection conn;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ public class GraphUtilities {

private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());

/**
* @deprecated Use {@link #getRandomPageSubset(Set, int)} instead.
*/
@Deprecated(since="2.0.0", forRemoval=true)
public static Set<Integer> getRandomPageSubset(Iterable<Page> pages, int pResultSetSize) {
Set<Integer> pageIDs = new HashSet<>();
while (pages.iterator().hasNext()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
import org.dkpro.jwpl.api.DatabaseConfiguration;
import org.dkpro.jwpl.api.hibernate.WikiHibernateUtil;

/**
* @deprecated To be removed without replacement.
*/
@Deprecated(since="2.0.0", forRemoval=true)
public class HibernateUtilities implements WikiConstants {

private final DatabaseConfiguration dbConfig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,11 @@
*/
package org.dkpro.jwpl.util;

import java.lang.invoke.MethodHandles;
import java.util.Collection;
import java.util.Iterator;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class StringUtils {

private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());

private static final StringBuilder buffer = new StringBuilder(10_000_000);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
import org.dkpro.jwpl.wikimachine.dump.version.IDumpVersionFactory;
import org.dkpro.jwpl.wikimachine.hashing.StringHashCodeDisabled;

public class SingleDumpVersionJDKStringKeyFactory implements
IDumpVersionFactory {
public class SingleDumpVersionJDKStringKeyFactory implements IDumpVersionFactory {

@Override
public IDumpVersion getDumpVersion() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
/**
* This class represents the iteration in chronological order.
*/
public class ChronoRevisionIterator
implements RevisionIteratorInterface {
public class ChronoRevisionIterator implements RevisionIteratorInterface {

/**
* Reference to the configuration parameters
Expand Down Expand Up @@ -137,8 +136,7 @@ public ChronoRevisionIterator(final RevisionAPIConfiguration config)
* @throws WikiApiException if an error occurs
*/
public ChronoRevisionIterator(final RevisionAPIConfiguration config,
final int firstArticleID, final int lastArticleID)
throws WikiApiException {
final int firstArticleID, final int lastArticleID) throws WikiApiException {

this(config);

Expand All @@ -152,8 +150,7 @@ public ChronoRevisionIterator(final RevisionAPIConfiguration config,
* @return whether the query contains results or not
* @throws SQLException if an error occurs while executing the query
*/
private boolean queryArticle()
throws SQLException {
private boolean queryArticle() throws SQLException {

Statement statement = this.connection.createStatement();

Expand Down Expand Up @@ -186,8 +183,7 @@ private void reset() {
* @return First Revision
* @throws WikiApiException if an error occurs
*/
private Revision init()
throws WikiApiException {
private Revision init() throws WikiApiException {

try {
currentArticleID = resultArticles.getInt(1);
Expand Down Expand Up @@ -347,10 +343,10 @@ public boolean hasNext() {
/**
* This method is unsupported.
*
* @throws UnsupportedOperationException
* @deprecated
* @deprecated Do not use as the method will throw an exception at runtime.
*/
@Deprecated
@Override
@Deprecated(since = "1.0")
public void remove() {
throw new UnsupportedOperationException();
}
Expand All @@ -361,8 +357,8 @@ public void remove() {
* @throws SQLException if an error occurs while closing the connection to the
* database.
*/
public void close()
throws SQLException {
@Override
public void close() throws SQLException {
if (this.connection != null) {
this.connection.close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
* The revision text is loaded upon first access (lazy loading).
* When serializing a Revision, the revisionText will be loaded first.
*/
public class Revision
implements ISizeable, Comparable<Revision>, RevisionDataInterface, Serializable {
public class Revision implements ISizeable, Comparable<Revision>, RevisionDataInterface, Serializable {

private static final long serialVersionUID = 7955292965697731279L;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class RevisionAPIConfiguration extends DatabaseConfiguration {
private String characterSet;

/**
* Memory size for the storage of revisions for the chonological iteration
* Memory size for the storage of revisions for the chronological iteration
*/
private long chronoStorageSpace;

Expand Down
Loading

0 comments on commit e564404

Please sign in to comment.