3737import org .eclipse .biscuit .error .LogicError ;
3838import org .eclipse .biscuit .token .builder .Check ;
3939import org .eclipse .biscuit .token .builder .Expression ;
40- import org .eclipse .biscuit .token .builder .Term ;
41- import org .eclipse .biscuit .token .builder .Utils ;
4240import org .eclipse .biscuit .token .builder .Fact ;
4341import org .eclipse .biscuit .token .builder .Rule ;
42+ import org .eclipse .biscuit .token .builder .Term ;
43+ import org .eclipse .biscuit .token .builder .Utils ;
4444import org .eclipse .biscuit .token .builder .parser .Parser ;
4545
4646/** Token verification class */
@@ -142,13 +142,11 @@ public void updateOnToken() throws Error.FailedLogic {
142142
143143 for (org .eclipse .biscuit .datalog .Fact fact : token .authority .getFacts ()) {
144144 org .eclipse .biscuit .datalog .Fact convertedFact =
145- Fact .convertFrom (fact , token .symbolTable )
146- .convert (this .symbolTable );
145+ Fact .convertFrom (fact , token .symbolTable ).convert (this .symbolTable );
147146 world .addFact (new Origin (0 ), convertedFact );
148147 }
149148 for (org .eclipse .biscuit .datalog .Rule rule : token .authority .getRules ()) {
150- Rule locRule =
151- Rule .convertFrom (rule , token .symbolTable );
149+ Rule locRule = Rule .convertFrom (rule , token .symbolTable );
152150 org .eclipse .biscuit .datalog .Rule convertedRule = locRule .convert (this .symbolTable );
153151
154152 Either <String , Rule > res = locRule .validateVariables ();
@@ -176,18 +174,15 @@ public void updateOnToken() throws Error.FailedLogic {
176174
177175 for (org .eclipse .biscuit .datalog .Fact fact : block .getFacts ()) {
178176 org .eclipse .biscuit .datalog .Fact convertedFact =
179- Fact .convertFrom (fact , blockSymbolTable )
180- .convert (this .symbolTable );
177+ Fact .convertFrom (fact , blockSymbolTable ).convert (this .symbolTable );
181178 world .addFact (new Origin (i + 1 ), convertedFact );
182179 }
183180
184181 for (org .eclipse .biscuit .datalog .Rule rule : block .getRules ()) {
185- Rule syRole =
186- Rule .convertFrom (rule , blockSymbolTable );
182+ Rule syRole = Rule .convertFrom (rule , blockSymbolTable );
187183 org .eclipse .biscuit .datalog .Rule convertedRule = syRole .convert (this .symbolTable );
188184
189- Either <String , Rule > res =
190- syRole .validateVariables ();
185+ Either <String , Rule > res = syRole .validateVariables ();
191186 if (res .isLeft ()) {
192187 throw new Error .FailedLogic (
193188 new LogicError .InvalidBlockRule (0 , this .symbolTable .formatRule (convertedRule )));
@@ -223,8 +218,7 @@ public Either<Map<Integer, List<Error>>, Authorizer> addDatalog(String s) {
223218 result = Parser .datalogComponents (s );
224219
225220 if (result .isLeft ()) {
226- Map <Integer , List <org .eclipse .biscuit .token .builder .parser .Error >> errors =
227- result .getLeft ();
221+ Map <Integer , List <org .eclipse .biscuit .token .builder .parser .Error >> errors = result .getLeft ();
228222 Map <Integer , List <Error >> errorMap = new HashMap <>();
229223 for (Map .Entry <Integer , List <org .eclipse .biscuit .token .builder .parser .Error >> entry :
230224 errors .entrySet ()) {
@@ -264,10 +258,8 @@ public Authorizer addFact(Fact fact) {
264258 }
265259
266260 public Authorizer addFact (String s ) throws Error .Parser {
267- Either <
268- org .eclipse .biscuit .token .builder .parser .Error ,
269- Tuple2 <String , Fact >>
270- res = Parser .fact (s );
261+ Either <org .eclipse .biscuit .token .builder .parser .Error , Tuple2 <String , Fact >> res =
262+ Parser .fact (s );
271263
272264 if (res .isLeft ()) {
273265 throw new Error .Parser (res .getLeft ());
@@ -288,10 +280,8 @@ public Authorizer addRule(Rule rule) {
288280 }
289281
290282 public Authorizer addRule (String s ) throws Error .Parser {
291- Either <
292- org .eclipse .biscuit .token .builder .parser .Error ,
293- Tuple2 <String , Rule >>
294- res = Parser .rule (s );
283+ Either <org .eclipse .biscuit .token .builder .parser .Error , Tuple2 <String , Rule >> res =
284+ Parser .rule (s );
295285
296286 if (res .isLeft ()) {
297287 throw new Error .Parser (res .getLeft ());
@@ -313,10 +303,8 @@ public Authorizer addCheck(Check check) {
313303 }
314304
315305 public Authorizer addCheck (String s ) throws Error .Parser {
316- Either <
317- org .eclipse .biscuit .token .builder .parser .Error ,
318- Tuple2 <String , Check >>
319- res = Parser .check (s );
306+ Either <org .eclipse .biscuit .token .builder .parser .Error , Tuple2 <String , Check >> res =
307+ Parser .check (s );
320308
321309 if (res .isLeft ()) {
322310 throw new Error .Parser (res .getLeft ());
@@ -410,16 +398,13 @@ public Authorizer addScope(Scope s) {
410398 return this ;
411399 }
412400
413- public Set <Fact > query (
414- Rule query ) throws Error {
401+ public Set <Fact > query (Rule query ) throws Error {
415402 return this .query (query , new RunLimits ());
416403 }
417404
418405 public Set <Fact > query (String s ) throws Error {
419- Either <
420- org .eclipse .biscuit .token .builder .parser .Error ,
421- Tuple2 <String , Rule >>
422- res = Parser .rule (s );
406+ Either <org .eclipse .biscuit .token .builder .parser .Error , Tuple2 <String , Rule >> res =
407+ Parser .rule (s );
423408
424409 if (res .isLeft ()) {
425410 throw new Error .Parser (res .getLeft ());
@@ -430,8 +415,7 @@ public Set<Fact> query(String s) throws Error {
430415 return query (t ._2 );
431416 }
432417
433- public Set <Fact > query (
434- Rule query , RunLimits limits ) throws Error {
418+ public Set <Fact > query (Rule query , RunLimits limits ) throws Error {
435419 world .run (limits , symbolTable );
436420
437421 org .eclipse .biscuit .datalog .Rule rule = query .convert (symbolTable );
@@ -446,20 +430,17 @@ public Set<Fact> query(
446430 Set <Fact > s = new HashSet <>();
447431
448432 for (Iterator <org .eclipse .biscuit .datalog .Fact > it = facts .stream ().iterator ();
449- it .hasNext (); ) {
433+ it .hasNext (); ) {
450434 org .eclipse .biscuit .datalog .Fact f = it .next ();
451435 s .add (Fact .convertFrom (f , symbolTable ));
452436 }
453437
454438 return s ;
455439 }
456440
457- public Set <Fact > query (String s , RunLimits limits )
458- throws Error {
459- Either <
460- org .eclipse .biscuit .token .builder .parser .Error ,
461- Tuple2 <String , Rule >>
462- res = Parser .rule (s );
441+ public Set <Fact > query (String s , RunLimits limits ) throws Error {
442+ Either <org .eclipse .biscuit .token .builder .parser .Error , Tuple2 <String , Rule >> res =
443+ Parser .rule (s );
463444
464445 if (res .isLeft ()) {
465446 throw new Error .Parser (res .getLeft ());
@@ -529,9 +510,7 @@ public Long authorize(RunLimits limits) throws Error {
529510 for (int j = 0 ; j < token .authority .getChecks ().size (); j ++) {
530511 boolean successful = false ;
531512
532- Check c =
533- Check .convertFrom (
534- token .authority .getChecks ().get (j ), token .symbolTable );
513+ Check c = Check .convertFrom (token .authority .getChecks ().get (j ), token .symbolTable );
535514 org .eclipse .biscuit .datalog .Check check = c .convert (symbolTable );
536515
537516 for (int k = 0 ; k < check .queries ().size (); k ++) {
@@ -608,9 +587,7 @@ public Long authorize(RunLimits limits) throws Error {
608587 for (int j = 0 ; j < b .getChecks ().size (); j ++) {
609588 boolean successful = false ;
610589
611- Check c =
612- Check .convertFrom (
613- b .getChecks ().get (j ), blockSymbolTable );
590+ Check c = Check .convertFrom (b .getChecks ().get (j ), blockSymbolTable );
614591 org .eclipse .biscuit .datalog .Check check = c .convert (symbolTable );
615592
616593 for (int k = 0 ; k < check .queries ().size (); k ++) {
0 commit comments