Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialSalomon Orrego Martinez
9,137 PointsTrouble with loadCensoredWords()
hi I have an error in Prompter.java with the next method:
private void loadCensoredWords() { mCensoredWords = new HashSet<String>(); Path file = Paths.get("resources", "censored_words.txt"); List<String> words = null; try { words = Files.readAllLines(file); } catch (IOException e) { System.out.println("Couldn't load censored words"); e.printStackTrace(); } mCensoredWords.addAll(words); }
The problem is in the line that says:
words = Files.readAllLines(file);
when I try to get more information I get this: Usage of API documented as @since 1.8+ less... (Ctrl+F1) This inspection finds all usages of methods that have @since tag in their documentation. This may be useful when development is performed under newer SDK version as the target platform for production.
Should I be worried about that? how can I fix the problem?
1 Answer
Seth Kroger
56,413 PointsAs long as you're using Java 8 (the current version) or later there shouldn't be an issue. It's just pointing out a potential issue if you had to run it on an earlier version.
Salomon Orrego Martinez
9,137 PointsSalomon Orrego Martinez
9,137 PointsThanks Seth!