Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while (true) {
- String line = br.readLine();
- if (line == null) {
- break;
- }
- if (line.trim().contains("/*")) {
- while (true) {
- commentsCounter++;
- line = br.readLine();
- if (line.contains("*/") || line == null) {
- break;
- }
- }
- }
- if (line.trim().contains("//")) {
- commentsCounter++;
- }
- String[] words = line.split(" ");
- for (String s : words) {
- if (s.equals("private") || s.equals("public") || s.equals("protected")) {
- accessSpecifierCounter++;
- }
- if (s.equals("private")) {
- privateCounter++;
- }
- if (s.equals("public")) {
- publicCounter++;
- }
- if (s.equals("protected")) {
- protectedCounter++;
- }
- }
- lineCounter++;
- if (line.trim().length() == 0) {
- emptyLineCounter++;
- }
- }
- br.close();
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement