@Test public void testRootPath() { final String one = Util.recursivelyFindLicense(Paths.get(System.getProperty("user.dir"))); final String two = Util.recursivelyFindLicense(Paths.get(System.getProperty("user.dir")).getParent()); Assert.assertEquals(one, two); }
static String recursivelyFindLicense(final Path path) { try (Stream stream = Files.find(path, 1, (p, attributes) -> p.endsWith("LICENSE"))) { if (stream.count() > 0) { return path.toAbsolutePath().toString(); } else { return recursivelyFindLicense(path.getParent()); } } catch (NullPointerException e) { return System.getProperty("user.dir"); } catch (IOException e) { throw new MetricException(e); } }
Util { static String recursivelyFindLicense(final Path path) { try (Stream stream = Files.find(path, 1, (p, attributes) -> p.endsWith("LICENSE"))) { if (stream.count() > 0) { return path.toAbsolutePath().toString(); } else { return recursivelyFindLicense(path.getParent()); } } catch (NullPointerException e) { return System.getProperty("user.dir"); } catch (IOException e) { throw new MetricException(e); } } }
Util { static String recursivelyFindLicense(final Path path) { try (Stream stream = Files.find(path, 1, (p, attributes) -> p.endsWith("LICENSE"))) { if (stream.count() > 0) { return path.toAbsolutePath().toString(); } else { return recursivelyFindLicense(path.getParent()); } } catch (NullPointerException e) { return System.getProperty("user.dir"); } catch (IOException e) { throw new MetricException(e); } } private  Util(); }
Util { static String recursivelyFindLicense(final Path path) { try (Stream stream = Files.find(path, 1, (p, attributes) -> p.endsWith("LICENSE"))) { if (stream.count() > 0) { return path.toAbsolutePath().toString(); } else { return recursivelyFindLicense(path.getParent()); } } catch (NullPointerException e) { return System.getProperty("user.dir"); } catch (IOException e) { throw new MetricException(e); } } private  Util(); static String fetchProjectRootPath(); static boolean checkEqualityOfIntPredicates(final IntPredicate firstPredicate,
                                                     final IntPredicate secondPredicate, final int noOfTimes); static IREdge cloneEdge(final IREdge edgeToClone,
                                 final IRVertex newSrc,
                                 final IRVertex newDst); static IREdge cloneEdge(final CommunicationPatternProperty.Value commPattern,
                                 final IREdge edgeToClone,
                                 final IRVertex newSrc,
                                 final IRVertex newDst); static IREdge createControlEdge(final IRVertex src, final IRVertex dst); static boolean isControlEdge(final IREdge edge); static boolean isUtilityVertex(final IRVertex v); static String stringifyIRVertexIds(final Collection<IRVertex> vertices); static String stringifyIREdgeIds(final Collection<IREdge> edges); static String restoreVertexId(final Integer numericId); static String restoreEdgeId(final Integer numericId); static List<Pair<Integer, ResourceSpecification>> parseResourceSpecificationString(
    final String resourceSpecificationString); static void premain(final String args, final Instrumentation inst); static long getObjectSize(final Object o); }
Util { static String recursivelyFindLicense(final Path path) { try (Stream stream = Files.find(path, 1, (p, attributes) -> p.endsWith("LICENSE"))) { if (stream.count() > 0) { return path.toAbsolutePath().toString(); } else { return recursivelyFindLicense(path.getParent()); } } catch (NullPointerException e) { return System.getProperty("user.dir"); } catch (IOException e) { throw new MetricException(e); } } private  Util(); static String fetchProjectRootPath(); static boolean checkEqualityOfIntPredicates(final IntPredicate firstPredicate,
                                                     final IntPredicate secondPredicate, final int noOfTimes); static IREdge cloneEdge(final IREdge edgeToClone,
                                 final IRVertex newSrc,
                                 final IRVertex newDst); static IREdge cloneEdge(final CommunicationPatternProperty.Value commPattern,
                                 final IREdge edgeToClone,
                                 final IRVertex newSrc,
                                 final IRVertex newDst); static IREdge createControlEdge(final IRVertex src, final IRVertex dst); static boolean isControlEdge(final IREdge edge); static boolean isUtilityVertex(final IRVertex v); static String stringifyIRVertexIds(final Collection<IRVertex> vertices); static String stringifyIREdgeIds(final Collection<IREdge> edges); static String restoreVertexId(final Integer numericId); static String restoreEdgeId(final Integer numericId); static List<Pair<Integer, ResourceSpecification>> parseResourceSpecificationString(
    final String resourceSpecificationString); static void premain(final String args, final Instrumentation inst); static long getObjectSize(final Object o);  }