Skip to content

Commit e1e1aad

Browse files
committed
Removed all deprecated code and options
1 parent 8ae0ef5 commit e1e1aad

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+69
-2753
lines changed

apache-rat-core/src/main/java/org/apache/rat/OptionCollection.java

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -71,26 +71,6 @@ private OptionCollection() {
7171
/** The Help option */
7272
public static final Option HELP = new Option("?", "help", false, "Print help for the RAT command line interface and exit.");
7373

74-
/** A mapping of {@code argName(value)} values to a description of those values. */
75-
@Deprecated
76-
private static final Map<String, Supplier<String>> ARGUMENT_TYPES;
77-
static {
78-
ARGUMENT_TYPES = new TreeMap<>();
79-
for (ArgumentType argType : ArgumentType.values()) {
80-
ARGUMENT_TYPES.put(argType.getDisplayName(), argType.description);
81-
}
82-
}
83-
84-
/**
85-
* Gets the mapping of {@code argName(value)} values to a description of those values.
86-
* @return the mapping of {@code argName(value)} values to a description of those values.
87-
* @deprecated use {@link ArgumentType}
88-
*/
89-
@Deprecated
90-
public static Map<String, Supplier<String>> getArgumentTypes() {
91-
return Collections.unmodifiableMap(ARGUMENT_TYPES);
92-
}
93-
9474
/**
9575
* Join a collection of objects together as a comma separated list of their string values.
9676
* @param args the objects to join together.

apache-rat-core/src/main/java/org/apache/rat/analysis/IHeaderMatcher.java

Lines changed: 0 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -91,85 +91,5 @@ interface Builder {
9191
default Description getDescription() {
9292
return DescriptionBuilder.buildMap(this.getClass());
9393
}
94-
95-
/**
96-
* @return an instance of the standard TextBuilder.
97-
* @see TextBuilder
98-
* @deprecated Use new TextBuilder()
99-
*/
100-
@Deprecated // since 0.17
101-
static TextBuilder text() {
102-
return new TextBuilder();
103-
}
104-
105-
/**
106-
* @return an instance of the standard AnyBuilder.
107-
* @see AnyBuilder
108-
* @deprecated Use new AnyBuilder()
109-
*/
110-
@Deprecated // since 0.17
111-
static AnyBuilder any() {
112-
return new AnyBuilder();
113-
}
114-
115-
/**
116-
* @return an instance of the standard AllBuilder.
117-
* @see AllBuilder
118-
* @deprecated Use new AllBuilder()
119-
*/
120-
@Deprecated // since 0.17
121-
static AllBuilder all() {
122-
return new AllBuilder();
123-
}
124-
125-
/**
126-
* @return an instance of the standard CopyrightBuilder.
127-
* @see CopyrightBuilder
128-
* @deprecated Use new CopyrightBuilder()
129-
*/
130-
@Deprecated // since 0.17
131-
static CopyrightBuilder copyright() {
132-
return new CopyrightBuilder();
133-
}
134-
135-
/**
136-
* @return an instance of the standard SpdxBuilder.
137-
* @see SpdxBuilder
138-
* @deprecated Use new SpdxBuilder()
139-
*/
140-
@Deprecated // since 0.17
141-
static SpdxBuilder spdx() {
142-
return new SpdxBuilder();
143-
}
144-
145-
/**
146-
* @return an instance of the standard MatcherRefBuilder.
147-
* @see MatcherRefBuilder
148-
* @deprecated Use new MatcherRefBuilder()
149-
*/
150-
@Deprecated // since 0.17
151-
static MatcherRefBuilder matcherRef() {
152-
return new MatcherRefBuilder();
153-
}
154-
155-
/**
156-
* @return an instance of the standard NotBuilder.
157-
* @see NotBuilder
158-
* @deprecated Use new NotBuilder()
159-
*/
160-
@Deprecated // since 0.17
161-
static NotBuilder not() {
162-
return new NotBuilder();
163-
}
164-
165-
/**
166-
* @return an instance of the standard RegexBuilder.
167-
* @see RegexBuilder
168-
* @deprecated Use new RegexBuilder()
169-
*/
170-
@Deprecated // since 0.17
171-
static RegexBuilder regex() {
172-
return new RegexBuilder();
173-
}
17494
}
17595
}

apache-rat-core/src/main/java/org/apache/rat/analysis/TikaProcessor.java

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -129,31 +129,31 @@ public static InputStream markSupportedInputStream(final InputStream stream) {
129129
* @throws RatDocumentAnalysisException on error.
130130
*/
131131
public static String process(final Document document) throws RatDocumentAnalysisException {
132-
try (InputStream stream = markSupportedInputStream(document.inputStream())) {
133-
Metadata metadata = new Metadata();
134-
metadata.set(TikaCoreProperties.RESOURCE_NAME_KEY, document.getName().getShortName());
135-
String result = TIKA.detect(stream, metadata);
136-
String[] parts = result.split("/");
137-
MediaType mediaType = new MediaType(parts[0], parts[1]);
138-
document.getMetaData().setMediaType(mediaType);
139-
if (!document.isIgnored()) {
140-
document.getMetaData()
141-
.setDocumentType(fromMediaType(mediaType));
142-
}
143-
if (Document.Type.STANDARD == document.getMetaData().getDocumentType()) {
144-
try {
145-
document.getMetaData().setCharset(detectCharset(stream, document.getName()));
146-
if (NoteGuesser.isNote(document)) {
147-
document.getMetaData().setDocumentType(Document.Type.NOTICE);
132+
try (InputStream stream = markSupportedInputStream(document.inputStream())) {
133+
Metadata metadata = new Metadata();
134+
metadata.set(TikaCoreProperties.RESOURCE_NAME_KEY, document.getName().getShortName());
135+
String result = TIKA.detect(stream, metadata);
136+
String[] parts = result.split("/");
137+
MediaType mediaType = new MediaType(parts[0], parts[1]);
138+
document.getMetaData().setMediaType(mediaType);
139+
if (!document.isIgnored()) {
140+
document.getMetaData()
141+
.setDocumentType(fromMediaType(mediaType));
142+
}
143+
if (Document.Type.STANDARD == document.getMetaData().getDocumentType()) {
144+
try {
145+
document.getMetaData().setCharset(detectCharset(stream, document.getName()));
146+
if (NoteGuesser.isNote(document)) {
147+
document.getMetaData().setDocumentType(Document.Type.NOTICE);
148+
}
149+
} catch (UnsupportedCharsetException e) {
150+
document.getMetaData().setDocumentType(Document.Type.UNKNOWN);
148151
}
149-
} catch (UnsupportedCharsetException e) {
150-
document.getMetaData().setDocumentType(Document.Type.UNKNOWN);
151152
}
153+
return result;
154+
} catch (IOException e) {
155+
throw new RatDocumentAnalysisException(e);
152156
}
153-
return result;
154-
} catch (IOException e) {
155-
throw new RatDocumentAnalysisException(e);
156-
}
157157
}
158158

159159
/**

apache-rat-core/src/main/java/org/apache/rat/analysis/license/BaseLicense.java

Lines changed: 0 additions & 66 deletions
This file was deleted.

apache-rat-core/src/main/java/org/apache/rat/analysis/license/DeprecatedConfig.java

Lines changed: 0 additions & 39 deletions
This file was deleted.

apache-rat-core/src/main/java/org/apache/rat/analysis/license/FullTextMatchingLicense.java

Lines changed: 0 additions & 62 deletions
This file was deleted.

0 commit comments

Comments
 (0)