class RubyCritic::SourceLocator

def deduplicate_symlinks(path_list)

def deduplicate_symlinks(path_list)
  # sort the symlinks to the end so files are preferred
  path_list.sort_by! { |path| File.symlink?(path.cleanpath) ? 'z' : 'a' }
  if defined?(JRUBY_VERSION)
    require 'java'
    path_list.uniq! do |path|
      java.io.File.new(path.realpath.to_s).canonical_path
    end
  else
    path_list.uniq!(&:realpath)
  end
end