Skip to content

Commit

Permalink
Add missing @OverRide annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
bencomp committed Aug 4, 2024
1 parent 9fd7ff8 commit 828aad8
Show file tree
Hide file tree
Showing 48 changed files with 93 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public interface XMLExporter extends Exporter {
/**
* @return - should always be MediaType.APPLICATION_XML
*/
@Override
public default String getMediaType() {
return MediaType.APPLICATION_XML;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class ControlledVocabularyValueConverter implements Converter {
//@EJB
DatasetFieldServiceBean datasetFieldService = CDI.current().select(DatasetFieldServiceBean.class).get();

@Override
public Object getAsObject(FacesContext facesContext, UIComponent component, String submittedValue) {
if (submittedValue == null || submittedValue.equals("")) {
return "";
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/edu/harvard/iq/dataverse/DatasetFieldType.java
Original file line number Diff line number Diff line change
Expand Up @@ -470,12 +470,14 @@ public boolean isHasParent() {
return this.parentDatasetFieldType != null;
}

@Override
public int hashCode() {
int hash = 0;
hash += (this.id != null ? this.id.hashCode() : 0);
return hash;
}

@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof DatasetFieldType)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ public class DatasetFieldValueValidator implements ConstraintValidator<ValidateD
private static final Logger logger = Logger.getLogger(DatasetFieldValueValidator.class.getCanonicalName());

//private String fieldType;
@Override
public void initialize(ValidateDatasetFieldType constraintAnnotation) {
//this.fieldType = constraintAnnotation.value();
}

@Override
public boolean isValid(DatasetFieldValue value, ConstraintValidatorContext context) {
context.disableDefaultConstraintViolation(); // we do this so we can have different messages depending on the different issue

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/edu/harvard/iq/dataverse/DatasetVersionUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ private List<DatasetField> initDatasetFields(boolean createBlanks) {

//sort via display order on dataset field
Collections.sort(retList, new Comparator<DatasetField>() {
@Override
public int compare(DatasetField d1, DatasetField d2) {
int a = d1.getDatasetFieldType().getDisplayOrder();
int b = d2.getDatasetFieldType().getDisplayOrder();
Expand All @@ -382,6 +383,7 @@ public int compare(DatasetField d1, DatasetField d2) {

private List<DatasetField> sortDatasetFields(List<DatasetField> dsfList) {
Collections.sort(dsfList, new Comparator<DatasetField>() {
@Override
public int compare(DatasetField d1, DatasetField d2) {
int a = d1.getDatasetFieldType().getDisplayOrder();
int b = d2.getDatasetFieldType().getDisplayOrder();
Expand Down
1 change: 1 addition & 0 deletions src/main/java/edu/harvard/iq/dataverse/FacetConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class FacetConverter implements Converter {
//@EJB
DatasetFieldServiceBean datasetFieldService = CDI.current().select(DatasetFieldServiceBean.class).get();

@Override
public Object getAsObject(FacesContext facesContext, UIComponent component, String submittedValue) {
return datasetFieldService.find(Long.valueOf(submittedValue));
}
Expand Down
1 change: 1 addition & 0 deletions src/main/java/edu/harvard/iq/dataverse/GlobalId.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public String getProviderId() {
return managingProviderId;
}

@Override
public String toString() {
return asString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class MetadataBlockConverter implements Converter {
//@EJB
DataverseServiceBean dataverseService = CDI.current().select(DataverseServiceBean.class).get();

@Override
public Object getAsObject(FacesContext facesContext, UIComponent component, String submittedValue) {
return dataverseService.findMDB(Long.valueOf(submittedValue));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class RoleAssigneeConverter implements Converter {
//@EJB
RoleAssigneeServiceBean roleAssigneeService = CDI.current().select(RoleAssigneeServiceBean.class).get();

@Override
public Object getAsObject(FacesContext facesContext, UIComponent component, String submittedValue) {
return roleAssigneeService.getRoleAssignee(submittedValue);
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/edu/harvard/iq/dataverse/Template.java
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ private List<DatasetField> initDatasetFields() {

//sort via display order on dataset field
Collections.sort(retList, new Comparator<DatasetField>() {
@Override
public int compare(DatasetField d1, DatasetField d2) {
int a = d1.getDatasetFieldType().getDisplayOrder();
int b = d2.getDatasetFieldType().getDisplayOrder();
Expand All @@ -237,6 +238,7 @@ public int compare(DatasetField d1, DatasetField d2) {

private List<DatasetField> sortDatasetFields(List<DatasetField> dsfList) {
Collections.sort(dsfList, new Comparator<DatasetField>() {
@Override
public int compare(DatasetField d1, DatasetField d2) {
int a = d1.getDatasetFieldType().getDisplayOrder();
int b = d2.getDatasetFieldType().getDisplayOrder();
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/edu/harvard/iq/dataverse/api/Admin.java
Original file line number Diff line number Diff line change
Expand Up @@ -2024,6 +2024,7 @@ public Response submitDatasetVersionToArchive(@Context ContainerRequestContext c
}
}
new Thread(new Runnable() {
@Override
public void run() {
try {
DatasetVersion dv = commandEngine.submit(cmd);
Expand Down Expand Up @@ -2101,6 +2102,7 @@ public Response archiveAllUnarchivedDatasetVersions(@Context ContainerRequestCon
if (cmd != null) {
//Found an archiver to use
new Thread(new Runnable() {
@Override
public void run() {
int total = dsl.size();
int successes = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public WrappedAuthErrorResponse(String message) {
).type(MediaType.APPLICATION_JSON_TYPE).build();
}

@Override
public String getMessage() {
return this.message;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ protected ParsedUserResponse parseUserResponse(final String responseBody) {
}
}

@Override
public boolean isDisplayIdentifier()
{
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,7 @@ public String toString() {
return "[AuthenticatedUser identifier:" + getIdentifier() + "]";
}

@Override
public String getSortByString() {
return this.getLastName() + " " + this.getFirstName() + " " + this.getUserIdentifier();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ public boolean downloadRedirectEnabled() {
return false;
}

@Override
public boolean downloadRedirectEnabled(String auxObjectTag) {
return baseStore.downloadRedirectEnabled(auxObjectTag);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,7 @@ public boolean downloadRedirectEnabled() {
return false;
}

@Override
public boolean downloadRedirectEnabled(String auxObjectTag) {
return downloadRedirectEnabled();
}
Expand All @@ -880,6 +881,7 @@ public boolean downloadRedirectEnabled(String auxObjectTag) {
* @return redirect url
* @throws IOException.
*/
@Override
public String generateTemporaryDownloadUrl(String auxiliaryTag, String auxiliaryType, String auxiliaryFileName) throws IOException {
//Questions:
// Q. Should this work for private and public?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,12 @@ public TabularSubsetGenerator() {
* Please consult git history if you are interested in looking at that code.
*/

@Override
public void subsetFile(String infile, String outfile, List<Integer> columns, Long numCases) {
subsetFile(infile, outfile, columns, numCases, "\t");
}

@Override
public void subsetFile(String infile, String outfile, List<Integer> columns, Long numCases,
String delimiter) {
try (FileInputStream fis = new FileInputStream(new File(infile))) {
Expand All @@ -90,6 +92,7 @@ public void subsetFile(String infile, String outfile, List<Integer> columns, Lon
}


@Override
public void subsetFile(InputStream in, String outfile, List<Integer> columns, Long numCases,
String delimiter) {
try (Scanner scanner = new Scanner(in); BufferedWriter out = new BufferedWriter(new FileWriter(outfile))) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ String getDataCiteXml(DatasetVersion dv) {
public Thread startBagThread(DatasetVersion dv, PipedInputStream in, DigestInputStream digestInputStream2,
String dataciteXml, ApiToken token) throws IOException, InterruptedException {
Thread bagThread = new Thread(new Runnable() {
@Override
public void run() {
try (PipedOutputStream out = new PipedOutputStream(in)) {
// Generate bag
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ protected void postPersist(Dataset theDataset, CommandContext ctxt) {
* that a new dataset exists.
* NB: Needs dataset id so has to be postDBFlush (vs postPersist())
*/
@Override
protected void postDBFlush(Dataset theDataset, CommandContext ctxt) {
if (ctxt.settings().isTrueForKey(SettingsServiceBean.Key.SendNotificationOnDatasetCreation, false)) {
//QDR - alert curators that a dataset has been created
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public WorkflowStepResult performArchiveSubmission(DatasetVersion dv, ApiToken t
// Add datacite.xml file

Thread dcThread = new Thread(new Runnable() {
@Override
public void run() {
try (PipedOutputStream dataciteOut = new PipedOutputStream(dataciteIn)) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public WorkflowStepResult performArchiveSubmission(DatasetVersion dv, ApiToken t
// Add datacite.xml file

Thread dcThread = new Thread(new Runnable() {
@Override
public void run() {
try (PipedOutputStream dataciteOut = new PipedOutputStream(dataciteIn)) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ public class OAIServlet extends HttpServlet {
private Repository xoaiRepository;
private DataProvider dataProvider;

@Override
public void init(ServletConfig config) throws ServletException {
super.init(config);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public class IngestMessageBean implements MessageListener {
public IngestMessageBean() {
}

@Override
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public void onMessage(Message message) {
IngestMessage ingestMessage = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ public FITSFileMetadataExtractor() {
super(null);
}

@Override
public FileMetadataIngest ingest(BufferedInputStream stream) throws IOException {
dbgLog.fine("Attempting to read FITS file;");

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


@Override
public String getDescription(Locale locale) {
return "HU-IQSS-DVN-project FITS File Ingester";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public FileMetadataExtractorSpi(String vendorName, String version) {
this.version = version;
}

@Override
public abstract String getDescription(Locale locale);

protected String[] names = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public CSVFileReaderSpi() {
super("HU-IQSS-DVN-project", "0.1", formatNames, extensions, mimeType, CSVFileReaderSpi.class.getName());
}

public String getDescription(Locale locale) {
@Override
public String getDescription(Locale locale) {
return "HU-IQSS-Dataverse-project CSV";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ public DTAFileReaderSpi() {
dbgLog.fine("DTAFileReaderSpi is called");
}

@Override
public String getDescription(Locale locale) {
return "HU-IQSS-DataVerse-project Stata File Ingest plugin";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ public boolean canDecodeInput(File file) throws IOException {
return false;
}

@Override
public String getDescription(Locale locale) {
return "HU-IQSS-DataVerse-project SPSS/POR (\"portable\") File Ingest plugin";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ public RDATAFileReaderSpi() {
LOG.fine(RDATAFileReaderSpi.class.getName() + " is called");
}

public String getDescription(Locale locale) {
@Override
public String getDescription(Locale locale) {
return "HU-IQSS-DVN-project RDATA";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ private void init() throws IOException {
}
}

@Override
public TabularDataIngest read(BufferedInputStream stream, boolean storeWithVariableHeader, File dataFile) throws IOException {
dbgLog.info("SAVFileReader: read() start");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ public boolean canDecodeInput(File file) throws IOException {

/********/

@Override
public String getDescription(Locale locale) {
return "HU-IQSS-DataVerse-project SPSS/SAV File Ingest plugin";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ private SheetHandler(SharedStrings sst, DataTable dataTable, PrintWriter tempOut
columnCount = 0;
}

@Override
public void startElement(String uri, String localName, String name,
Attributes attributes) throws SAXException {
dbglog.fine("entering startElement (" + name + ")");
Expand Down Expand Up @@ -410,6 +411,7 @@ private String getColumnLetterTag(int columnCount) {
return new String(letterTag);
}

@Override
public void endElement(String uri, String localName, String name)
throws SAXException {
dbglog.fine("entering endElement (" + name + ")");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ public XLSXFileReaderSpi() {
LOG.fine(XLSXFileReaderSpi.class.getName() + " is called");
}

public String getDescription(Locale locale) {
@Override
public String getDescription(Locale locale) {
return "HU-IQSS-DVN-project Excel/XLSX";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ protected String generateYear(DvObject dvObjectIn) {
return dvObjectIn.getYearPublishedCreated();
}

@Override
public Map<String, String> getMetadataForTargetURL(DvObject dvObject) {
logger.log(Level.FINE, "getMetadataForTargetURL");
HashMap<String, String> metadata = new HashMap<>();
Expand All @@ -168,6 +169,7 @@ public boolean alreadyRegistered(DvObject dvo) throws Exception {
return alreadyRegistered(globalId, false);
}

@Override
public abstract boolean alreadyRegistered(GlobalId globalId, boolean noProviderDefault) throws Exception;

/*
Expand Down Expand Up @@ -235,6 +237,7 @@ private String generateDatasetIdentifier(Dataset dataset) {
* @param dataset
* @return {@code true} if the identifier is unique, {@code false} otherwise.
*/
@Override
public boolean isGlobalIdUnique(GlobalId globalId) {
if (!pidProviderService.isGlobalIdLocallyUnique(globalId)) {
return false; // duplication found in local database
Expand Down Expand Up @@ -313,6 +316,7 @@ protected GlobalId parsePersistentId(String protocol, String identifierString) {
return parsePersistentId(protocol, authority, identifier);
}

@Override
public GlobalId parsePersistentId(String protocol, String authority, String identifier) {
logger.fine("Parsing: " + protocol + ":" + authority + getSeparator() + identifier + " in " + getId());
if (!PidProvider.isValidGlobalId(protocol, authority, identifier)) {
Expand Down Expand Up @@ -342,6 +346,7 @@ public GlobalId parsePersistentId(String protocol, String authority, String iden
return new GlobalId(protocol, authority, identifier, getSeparator(), getUrlPrefix(), getId());
}

@Override
public String getSeparator() {
// The standard default
return SEPARATOR;
Expand Down
Loading

0 comments on commit 828aad8

Please sign in to comment.