Checks whether a schema file share an ancestor directory that also contains a schema file

@param schemaFiles - task's input that have been identified as schema file
@return - whether illegal schema files were found
163753
private static boolean illegalSchemasFound(Collection<File> schemaFiles) {
    for (final File f : schemaFiles) {
      final Path parent = Paths.get(f.getParent()).toAbsolutePath();
      List<File> matches = FluentIterable.from(schemaFiles).filter(new Predicate<File>() {
        @Override public boolean apply(@Nullable File file) {
          return file != null && file != f && Paths.get(file.getParent()).startsWith(parent);
        }
      }).toList();

      if (!matches.isEmpty()) {
        return true;
      }
    }
    return false;
  }
980135
public static boolean contains(Object src, Object... dests) {
        if (dests == null) {
            throw new NullPointerException("dest must not be null");
        }

        if (src == null) {
            return false;
        }

        for (Object dest : dests) {
            if (src == dest || src.equals(dest)) {
                return true;
            }
        }
        return false;
    }
1292320
public static List<IFileCompareResultBean> findEqualFiles(final File dirToSearch)
	{
		final List<File> allFiles = FileSearchExtensions.findFilesRecursive(dirToSearch, "*");
		final List<IFileCompareResultBean> equalFiles = new ArrayList<>();
		for (int i = 0; i < allFiles.size(); i++)
		{
			final File toCompare = allFiles.get(i);
			for (final File file : allFiles)
			{
				if (toCompare.equals(file))
				{
					continue;
				}
				final IFileCompareResultBean compareResultBean = CompareFileExtensions
					.simpleCompareFiles(toCompare, file);
				final boolean equal = CompareFileExtensions.validateEquality(compareResultBean);
				// if equal is true and the list does not contain the same
				// compareResultBean then add it.
				if (equal && !equalFiles.contains(compareResultBean))
				{
					equalFiles.add(compareResultBean);
				}
			}
		}
		return equalFiles;
	}
1238186
def isMemberOf(self, schemas):
        
        if type(schemas) not in (tuple, list, set):
            schemas = (schemas,)

        for schema in schemas:
            if schema.hasColumn(self):
                return True
        return False
1275543
private static String checkFileURIScheme(Collection<URI> uris) {
    for (URI uri : uris)
      if (uri.getScheme().compareTo(JournalType.FILE.name().toLowerCase()) != 0)
        return "The specified path is not a file."
            + "Avatar supports file non-shared storage only... ";
    return "";
  }
501868
private Boolean isActionNeeded(Collection<File> createdFiles, Collection<File> modifiedFiles) {
        boolean actionNeeded = false;

        for (File createdFile : createdFiles) {
            if (currentlyDeletedFiles.contains(createdFile)) {
                currentlyDeletedFiles.remove(createdFile);
                actionNeeded = true;
            }
        }

        if (modifiedFiles.isEmpty() == false) {
            actionNeeded = true;
        }
        return actionNeeded;
    }
1070658
function dependenciesExists(schema) {
    var deps = DependenciesMap[schema];
    var f = false;
    deps.forEach(function (d) {
        f = SavedSchemas.indexOf(d) > -1
    });
    return f;
}
431774
private Path getOrGenerateSchemaFile(Schema schema) throws IOException {

    Preconditions.checkNotNull(schema, "Avro Schema should not be null");

    String hashedSchema = Hashing.sha256().hashString(schema.toString(), StandardCharsets.UTF_8).toString();

    if (!this.schemaPaths.containsKey(hashedSchema)) {

      Path schemaFilePath = new Path(this.schemaDir, String.valueOf(System.currentTimeMillis() + ".avsc"));
      AvroUtils.writeSchemaToFile(schema, schemaFilePath, fs, true);

      this.schemaPaths.put(hashedSchema, schemaFilePath);
    }

    return this.schemaPaths.get(hashedSchema);
  }
1133191
public void setSchemaAttributes(java.util.Collection<SchemaAttributeType> schemaAttributes) {
        if (schemaAttributes == null) {
            this.schemaAttributes = null;
            return;
        }

        this.schemaAttributes = new java.util.ArrayList<SchemaAttributeType>(schemaAttributes);
    }
476431
public boolean matchJsonToSchema(JSONObject schema, JSONObject json) throws Exception {
        SchemaLoader.builder()
                 .useDefaults(true)
                 .schemaJson(schema)
                 .build()
                 .load()
                 .build()
                 .validate(json);
        return true;
    }
1126878
@Override
    public boolean contains(ArchivePath path) {
        Validate.notNull(path, "No path was specified");

        boolean found = content.containsKey(path);
        if (!found) {
            found = nestedContains(path);
        }
        return found;
    }
1218842
protected void addIncludedSchemas(Schema schema) throws WSDLException, IOException, TransformerException, TransformerFactoryConfigurationError {
        List<SchemaReference> includes = schema.getIncludes();
        for (SchemaReference schemaReference : includes) {
            String schemaLocation;
            URI locationURI = URI.create(schemaReference.getSchemaLocationURI());
            if (locationURI.isAbsolute()) {
                schemaLocation = schemaReference.getSchemaLocationURI();
            } else {
                schemaLocation = schema.getDocumentBaseURI().substring(0, schema.getDocumentBaseURI().lastIndexOf('/') + 1) + schemaReference.getSchemaLocationURI();
            }

            schemaResources.add(new FileSystemResource(schemaLocation));
        }
    }
128831
public boolean containsFile(SftpFile f) {
		return unchangedFiles.contains(f) || newFiles.contains(f)
				|| updatedFiles.contains(f) || deletedFiles.contains(f)
				|| recursedDirectories.contains(f.getAbsolutePath())
				|| failedTransfers.containsKey(f);
	}
759966
private boolean isMap(PropertyPath path) {
        if (schemaRoot != null) {
            Schema schema = this.schemaRoot.find(path);
            return schema != null && (schema.hasChild(NodeId.ANY_KEY) || schema.hasChild(NodeId.ANY));
        }
        return false;
    }
68591
private boolean hasJsonSchemaFile(ZipFile jarFile, Class<?> modelClass) throws IOException {
    String path = JsonSchemaBundleTracker.SCHEMA_CLASSPATH_PREFIX + "/" + modelClass.getName() + ".json";
    return jarFile.getEntry(path) != null;
  }
8251
public boolean duplicatesInStack(LinkedList<SchemaTableTree> distinctQueryStack) {
        Set<SchemaTable> alreadyVisited = new HashSet<>();
        for (SchemaTableTree schemaTableTree : distinctQueryStack) {
            if (!alreadyVisited.contains(schemaTableTree.getSchemaTable())) {
                alreadyVisited.add(schemaTableTree.getSchemaTable());
            } else {
                return true;
            }
        }
        return false;
    }
380630
public void setSchemas(java.util.Collection<String> schemas) {
        if (schemas == null) {
            this.schemas = null;
            return;
        }

        this.schemas = new java.util.ArrayList<String>(schemas);
    }