code: def validate_platform_dependencies(self):
      
      conflicts = []
  
      def is_conflicting(target, dependency):
        return self.jvm_version(dependency) > self.jvm_version(target)
  
      try:
        sort_targets(self.jvm_targets)
      except CycleException:
        self.context.log.warn('Cannot validate dependencies when cycles exist in the build graph.')
        return
  
      try:
        with self.invalidated(self.jvm_targets,
                              fingerprint_strategy=self.PlatformFingerprintStrategy(),
                              invalidate_dependents=True) as vts:
          dependency_map = self.jvm_dependency_map
          for vts_target in vts.invalid_vts:
            for target in vts_target.targets:
              if target in dependency_map:
                deps = dependency_map[target]
                invalid_dependencies = [dep for dep in deps if is_conflicting(target, dep)]
                if invalid_dependencies:
                  conflicts.append((target, invalid_dependencies))
          if conflicts:
            # NB(gmalmquist): It's important to unconditionally raise an exception, then decide later
            # whether to continue raising it or just print a warning, to make sure the targets aren't
            # marked as valid if there are invalid platform dependencies.
            error_message = self._create_full_error_message(conflicts)
            raise self.IllegalJavaTargetLevelDependency(error_message)
      except self.IllegalJavaTargetLevelDependency as e:
        if self.check == 'fatal':
          raise e
        else:
          assert self.check == 'warn'
          self.context.log.warn(error_message)
          return error_message
docs: Check all jvm targets in the context, throwing an error or warning if there are bad targets.
  
      If there are errors, this method fails slow rather than fails fast -- that is, it continues
      checking the rest of the targets before spitting error messages. This is useful, because it's
      nice to have a comprehensive list of all errors rather than just the first one we happened to
      hit.