Skip to content

Commit 4b1ba9d

Browse files
authored
Update prettier (#709)
1 parent 4e6c464 commit 4b1ba9d

10 files changed

Lines changed: 75 additions & 156 deletions

File tree

core-patch/src/main/java/eu/neverblink/jelly/core/patch/PatchEncoder.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,11 @@ public static Params of(
6464
*/
6565
protected PatchEncoder(ProtoEncoderConverter<TNode> converter, Params params) {
6666
super(converter);
67-
this.options = params.options
68-
.clone()
69-
// Override the user's version setting with what is really supported by the encoder.
70-
.setVersion(JellyPatchConstants.PROTO_VERSION_1_0_X);
67+
this.options =
68+
params.options
69+
.clone()
70+
// Override the user's version setting with what is really supported by the encoder.
71+
.setVersion(JellyPatchConstants.PROTO_VERSION_1_0_X);
7172
this.rowBuffer = params.rowBuffer;
7273
this.allocator = params.allocator;
7374
}

core/src/main/java/eu/neverblink/jelly/core/ExperimentalApi.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,13 @@
1010
* Note: This annotation is not intended for public use and should only be used internally within the Jelly-JVM.
1111
*/
1212
@Retention(RetentionPolicy.SOURCE)
13-
@Target(
14-
{
15-
ElementType.ANNOTATION_TYPE,
16-
ElementType.CONSTRUCTOR,
17-
ElementType.FIELD,
18-
ElementType.METHOD,
19-
ElementType.PACKAGE,
20-
ElementType.TYPE,
21-
}
22-
)
13+
@Target({
14+
ElementType.ANNOTATION_TYPE,
15+
ElementType.CONSTRUCTOR,
16+
ElementType.FIELD,
17+
ElementType.METHOD,
18+
ElementType.PACKAGE,
19+
ElementType.TYPE,
20+
})
2321
@Documented
2422
public @interface ExperimentalApi {}

core/src/main/java/eu/neverblink/jelly/core/InternalApi.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,13 @@
1010
* Note: This annotation is not intended for public use and should only be used internally within the Jelly-JVM.
1111
*/
1212
@Retention(RetentionPolicy.SOURCE)
13-
@Target(
14-
{
15-
ElementType.ANNOTATION_TYPE,
16-
ElementType.CONSTRUCTOR,
17-
ElementType.FIELD,
18-
ElementType.METHOD,
19-
ElementType.PACKAGE,
20-
ElementType.TYPE,
21-
}
22-
)
13+
@Target({
14+
ElementType.ANNOTATION_TYPE,
15+
ElementType.CONSTRUCTOR,
16+
ElementType.FIELD,
17+
ElementType.METHOD,
18+
ElementType.PACKAGE,
19+
ElementType.TYPE,
20+
})
2321
@Documented
2422
public @interface InternalApi {}

core/src/main/java/eu/neverblink/jelly/core/ProtoEncoder.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,16 @@ public Params withAllocator(EncoderAllocator allocator) {
9898

9999
protected ProtoEncoder(ProtoEncoderConverter<TNode> converter, Params params) {
100100
super(converter);
101-
this.options = params.options
102-
.clone()
103-
// Override whatever the user set in the options.
104-
// If namespace declarations are enabled, we need to use Jelly 1.1.x.
105-
.setVersion(
106-
params.enableNamespaceDeclarations
107-
? JellyConstants.PROTO_VERSION_1_1_X
108-
: JellyConstants.PROTO_VERSION_1_0_X
109-
);
101+
this.options =
102+
params.options
103+
.clone()
104+
// Override whatever the user set in the options.
105+
// If namespace declarations are enabled, we need to use Jelly 1.1.x.
106+
.setVersion(
107+
params.enableNamespaceDeclarations
108+
? JellyConstants.PROTO_VERSION_1_1_X
109+
: JellyConstants.PROTO_VERSION_1_0_X
110+
);
110111
this.enableNamespaceDeclarations = params.enableNamespaceDeclarations;
111112
this.rowBuffer = params.rowBuffer;
112113
this.allocator = params.allocator;

core/src/main/java/eu/neverblink/jelly/core/internal/NameDecoderImpl.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,7 @@ public TIri decode(int prefixId, int nameId) {
132132
} catch (ArrayIndexOutOfBoundsException e) {
133133
throw new RdfProtoDeserializationError(
134134
(
135-
"Encountered an invalid name table reference (out of bounds). " +
136-
"Name ID: %d, Prefix ID: %d"
135+
"Encountered an invalid name table reference (out of bounds). " + "Name ID: %d, Prefix ID: %d"
137136
).formatted(nameId, prefixId)
138137
);
139138
}
@@ -152,8 +151,7 @@ public TIri decode(int prefixId, int nameId) {
152151
} catch (ArrayIndexOutOfBoundsException e) {
153152
throw new RdfProtoDeserializationError(
154153
(
155-
"Encountered an invalid prefix table reference (out of bounds). " +
156-
"Prefix ID: %d, Name ID: %d"
154+
"Encountered an invalid prefix table reference (out of bounds). " + "Prefix ID: %d, Name ID: %d"
157155
).formatted(prefixId, nameId)
158156
);
159157
}

core/src/main/java/eu/neverblink/jelly/core/internal/NodeEncoderImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public RdfIri makeIri(String iri) {
174174
cachedNode.encoded != null &&
175175
cachedNode.lookupSerial1 == Objects.requireNonNull(nameLookup.serials)[cachedNode.lookupPointer1] &&
176176
cachedNode.lookupSerial2 ==
177-
Objects.requireNonNull(Objects.requireNonNull(prefixLookup).serials)[cachedNode.lookupPointer2]
177+
Objects.requireNonNull(Objects.requireNonNull(prefixLookup).serials)[cachedNode.lookupPointer2]
178178
) {
179179
nameLookup.onAccess(cachedNode.lookupPointer1);
180180
prefixLookup.onAccess(cachedNode.lookupPointer2);

examples/src/main/java/eu/neverblink/jelly/examples/Rdf4jRio.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,12 @@ public void run(String[] args) throws Exception {
3737

3838
// Write the RDF graph to a Jelly file
3939
// First, create the stream's options:
40-
RdfStreamOptions options = JellyOptions.SMALL_STRICT.clone()
41-
// Setting the physical stream type is mandatory! It will always be either TRIPLES or QUADS.
42-
.setPhysicalType(PhysicalStreamType.TRIPLES)
43-
// Set other optional options
44-
.setStreamName("My weather data");
40+
RdfStreamOptions options =
41+
JellyOptions.SMALL_STRICT.clone()
42+
// Setting the physical stream type is mandatory! It will always be either TRIPLES or QUADS.
43+
.setPhysicalType(PhysicalStreamType.TRIPLES)
44+
// Set other optional options
45+
.setStreamName("My weather data");
4546
// Create the config object to pass to the writer
4647
JellyWriterSettings config = JellyWriterSettings.empty().setJellyOptions(options).setFrameSize(128);
4748

@@ -94,8 +95,9 @@ private Collection<Statement> readRdf4j(File file, RDFFormat format, Optional<Rd
9495
StatementCollector collector = new StatementCollector();
9596
parser.setRDFHandler(collector);
9697
supportedOptions.ifPresent(opt ->
97-
// If the user provided supported options, set them on the parser
98-
parser.setParserConfig(JellyParserSettings.from(opt))
98+
parser
99+
// If the user provided supported options, set them on the parser
100+
.setParserConfig(JellyParserSettings.from(opt))
99101
);
100102

101103
try (InputStream is = file.toURI().toURL().openStream()) {

jena-patch/src/main/java/eu/neverblink/jelly/convert/jena/patch/RdfPatchWriterJelly.java

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -69,23 +69,24 @@ public RdfPatchWriterJelly(Options options, JenaPatchConverterFactory converterF
6969
this.outputStream = outputStream;
7070
this.codedOutput = ProtobufUtil.createCodedOutputStream(outputStream);
7171

72-
this.patchOptions = options
73-
.patchOptions()
74-
.clone()
75-
// If no stream type is set, we default to PUNCTUATED, as it's the safest option.
76-
// It can handle patches of any size and preserves the segmentation marks.
77-
.setStreamType(
78-
options.patchOptions().getStreamType() == PatchStreamType.UNSPECIFIED
79-
? PatchStreamType.PUNCTUATED
80-
: options.patchOptions().getStreamType()
81-
)
82-
// Statement type: go for QUADS if unknown. Otherwise, if we encounter a quad later, we will
83-
// have to throw an error.
84-
.setStatementType(
85-
options.patchOptions().getStatementType() == PatchStatementType.UNSPECIFIED
86-
? PatchStatementType.QUADS
87-
: options.patchOptions().getStatementType()
88-
);
72+
this.patchOptions =
73+
options
74+
.patchOptions()
75+
.clone()
76+
// If no stream type is set, we default to PUNCTUATED, as it's the safest option.
77+
// It can handle patches of any size and preserves the segmentation marks.
78+
.setStreamType(
79+
options.patchOptions().getStreamType() == PatchStreamType.UNSPECIFIED
80+
? PatchStreamType.PUNCTUATED
81+
: options.patchOptions().getStreamType()
82+
)
83+
// Statement type: go for QUADS if unknown. Otherwise, if we encounter a quad later, we will
84+
// have to throw an error.
85+
.setStatementType(
86+
options.patchOptions().getStatementType() == PatchStatementType.UNSPECIFIED
87+
? PatchStatementType.QUADS
88+
: options.patchOptions().getStatementType()
89+
);
8990

9091
// Arena size depends on frame size (if PUNCTUATED) or is fixed at 1024 for other cases.
9192
int arenaSize = this.patchOptions.getStreamType() == PatchStreamType.PUNCTUATED ? options.frameSize + 8 : 1024;

package-lock.json

Lines changed: 12 additions & 92 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

titanium-rdf-api/src/main/java/eu/neverblink/jelly/convert/titanium/internal/TitaniumNode.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ public enum TitaniumNodeType {
2222
}
2323

2424
public static TitaniumNodeType typeOf(Object node) {
25-
if ((node instanceof String iriLike)) {
25+
if (node instanceof String iriLike) {
2626
return RdfQuadConsumer.isBlank(iriLike) ? TitaniumNodeType.BLANK : TitaniumNodeType.IRI;
2727
}
2828

29-
if ((node instanceof TitaniumLiteral literal)) {
29+
if (node instanceof TitaniumLiteral literal) {
3030
return literal.type();
3131
}
3232

0 commit comments

Comments
 (0)