Skip to content

Commit 989bebc

Browse files
author
Faisal Hameed
committed
Fixing squid:S00115 - Constant names should comply with a naming convention.
1 parent 11a910e commit 989bebc

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

common/src/main/java/net/fortytwo/sesametools/RandomValueFactory.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ public class RandomValueFactory {
2626
private static final String[] languages = {"en", "fr", "de"};
2727

2828
private enum ValueType {
29-
Uri, /*Bnode,*/ Literal
29+
URI, /*Bnode,*/ LITERAL
3030
}
3131

3232
private enum LiteralKind {
33-
Plain, WithLanguage, Typed
33+
PLAIN, WITH_LANGUAGE, TYPED
3434
}
3535

3636
private enum LiteralType {
37-
String, Int, Double
37+
STRING, INT, DOUBLE
3838
}
3939

4040
private ValueFactory valueFactory;
@@ -59,7 +59,7 @@ public Resource randomResource() {
5959
ValueType type;
6060
do {
6161
type = randomValueType();
62-
} while (ValueType.Literal == type);
62+
} while (ValueType.LITERAL == type);
6363
return (Resource) randomValue(type);
6464
}
6565

@@ -81,13 +81,13 @@ public Literal randomLiteral() {
8181
Literal l = null;
8282

8383
switch (kind) {
84-
case Plain:
84+
case PLAIN:
8585
l = valueFactory.createLiteral(randomStringLabel());
8686
break;
87-
case WithLanguage:
87+
case WITH_LANGUAGE:
8888
l = valueFactory.createLiteral(randomStringLabel(), randomLanguage());
8989
break;
90-
case Typed:
90+
case TYPED:
9191
l = randomTypedLiteral();
9292
break;
9393
}
@@ -100,13 +100,13 @@ public Literal randomTypedLiteral() {
100100
Literal l = null;
101101

102102
switch (type) {
103-
case Int:
103+
case INT:
104104
l = valueFactory.createLiteral(rand.nextInt(MAXINT));
105105
break;
106-
case Double:
106+
case DOUBLE:
107107
l = valueFactory.createLiteral(rand.nextDouble());
108108
break;
109-
case String:
109+
case STRING:
110110
l = valueFactory.createLiteral(randomStringLabel(), XMLSchema.STRING);
111111
break;
112112
}
@@ -121,13 +121,13 @@ private ValueType randomValueType() {
121121
private Value randomValue(final ValueType type) {
122122
Value v = null;
123123
switch (type) {
124-
case Uri:
124+
case URI:
125125
v = randomIRI();
126126
break;
127127
//case Bnode:
128128
// v = randomBNode();
129129
// break;
130-
case Literal:
130+
case LITERAL:
131131
v = randomLiteral();
132132
break;
133133
}

linked-data-server/src/main/java/net/fortytwo/sesametools/ldserver/WebResource.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class WebResource extends ServerResource {
4242
private static final Logger logger = Logger.getLogger(WebResource.class.getName());
4343

4444
enum WebResourceCategory {
45-
InformationResource, NonInformationResource
45+
INFORMATION_RESOURCE, NON_INFORMATION_RESOURCE
4646
}
4747

4848
protected String selfURI;
@@ -91,10 +91,10 @@ public Representation get(final Variant variant) {
9191
}
9292

9393
if (!format.isPresent()) {
94-
webResourceCategory = WebResourceCategory.NonInformationResource;
94+
webResourceCategory = WebResourceCategory.NON_INFORMATION_RESOURCE;
9595
getVariants().addAll(RDFMediaTypes.getRDFVariants());
9696
} else {
97-
webResourceCategory = WebResourceCategory.InformationResource;
97+
webResourceCategory = WebResourceCategory.INFORMATION_RESOURCE;
9898
getVariants().add(RDFMediaTypes.findVariant(format.get()));
9999

100100
hostIdentifier = this.getRequest().getResourceRef().getHostIdentifier();
@@ -108,9 +108,9 @@ public Representation get(final Variant variant) {
108108
MediaType type = variant.getMediaType();
109109

110110
switch (webResourceCategory) {
111-
case InformationResource:
111+
case INFORMATION_RESOURCE:
112112
return representInformationResource();
113-
case NonInformationResource:
113+
case NON_INFORMATION_RESOURCE:
114114
return representNonInformationResource(type);
115115
default:
116116
throw new IllegalStateException("no such resource type: " + webResourceCategory);

0 commit comments

Comments
 (0)