Skip to content
Permalink
Browse files

Correcting Kotlin parsers #45

  • Loading branch information...
tomasbjerre committed Sep 20, 2018
1 parent 2d609ff commit fb2ce3dc81491943e6eb72f2d938d6fb481629ed
@@ -18,7 +18,7 @@
public List<Violation> parseReportOutput(final String string) throws Exception {
List<Violation> violations = new ArrayList<>();
List<List<String>> partsPerLine =
getLines(string, "([^:])+?:([^:]*)[^\\d]+?(\\d+?)[^\\d]+?(\\d+?)[^:]+?:(.*)");
getLines(string, "(w|e):([^:]*)[^\\d]+?(\\d+?)[^\\d]+?(\\d+?)[^:]+?:(.*)");
for (List<String> parts : partsPerLine) {
String severity = parts.get(1).trim();
String filename = parts.get(2).trim();
@@ -18,7 +18,8 @@
public List<Violation> parseReportOutput(final String string) throws Exception {
List<Violation> violations = new ArrayList<>();
List<List<String>> partsPerLine =
getLines(string, "\\[([^\\]]+?)\\]([^:]*)[^\\d]+?(\\d+?)[^\\d]+?(\\d+?)[^\\)]+?\\)(.*)");
getLines(
string, "\\[(ERROR|WARNING)\\]([^:]*)[^\\d]+?(\\d+?)[^\\d]+?(\\d+?)[^\\)]+?\\)(.*)");
for (List<String> parts : partsPerLine) {
String severity = parts.get(1).trim();
String filename = parts.get(2).trim();
@@ -1,3 +1,27 @@
/opt/projectdir/src/debug/AndroidManifest.xml:20:5-21:31 Warning:
/opt/projectdir/src/main/AndroidManifest.xml:9:5-11:31 Warning:
/opt/projectdir/src/main/AndroidManifest.xml:24:5-50:19 Warning:
/opt/projectdir/src/main/AndroidManifest.xml:24:5-50:19 Warning:
/opt/projectdir/src/main/AndroidManifest.xml:13:5-15:31 Warning:
Found android support method: Landroid/support/v4/app/ListFragment$2;.onItemClick:(Landroid/widget/AdapterView;Landroid/view/View;IJ)V. Skipping instrumentation.
Found android support method: Landroid/support/v7/app/AlertController$AlertParams$3;.onItemClick:(Landroid/widget/AdapterView;Landroid/view/View;IJ)V. Skipping instrumentation.
Found android support method: Landroid/support/v7/app/AlertController$AlertParams$4;.onItemClick:(Landroid/widget/AdapterView;Landroid/view/View;IJ)V. Skipping instrumentation.
Found android support method: Landroid/support/v7/widget/AppCompatSpinner$DropdownPopup$1;.onItemClick:(Landroid/widget/AdapterView;Landroid/view/View;IJ)V. Skipping instrumentation.
Found android support method: Landroid/support/v7/widget/SearchView$8;.onItemClick:(Landroid/widget/AdapterView;Landroid/view/View;IJ)V. Skipping instrumentation.
Found android support method: Landroid/support/v7/preference/DropDownPreference$1;.onItemSelected:(Landroid/widget/AdapterView;Landroid/view/View;IJ)V. Skipping instrumentation.
Found android support method: Landroid/support/v7/widget/ListPopupWindow$3;.onItemSelected:(Landroid/widget/AdapterView;Landroid/view/View;IJ)V. Skipping instrumentation.
Found android support method: Landroid/support/v7/widget/SearchView$9;.onItemSelected:(Landroid/widget/AdapterView;Landroid/view/View;IJ)V. Skipping instrumentation.
Found android support method: Landroid/support/v14/preference/ListPreferenceDialogFragment$1;.onClick:(Landroid/content/DialogInterface;I)V. Skipping instrumentation.
Found android support method: Landroid/support/v7/preference/ListPreferenceDialogFragmentCompat$1;.onClick:(Landroid/content/DialogInterface;I)V. Skipping instrumentation.
Found android support method: Landroid/support/v4/view/PagerTabStrip$1;.onClick:(Landroid/view/View;)V. Skipping instrumentation.
Found android support method: Landroid/support/v4/view/PagerTabStrip$2;.onClick:(Landroid/view/View;)V. Skipping instrumentation.
Found android support method: Landroid/support/v7/app/ActionBarDrawerToggle$1;.onClick:(Landroid/view/View;)V. Skipping instrumentation.
Found android support method: Landroid/support/v7/app/AlertController$1;.onClick:(Landroid/view/View;)V. Skipping instrumentation.
Found android support method: Landroid/support/v7/preference/Preference$1;.onClick:(Landroid/view/View;)V. Skipping instrumentation.
Found android support method: Landroid/support/v7/widget/ActionBarContextView$1;.onClick:(Landroid/view/View;)V. Skipping instrumentation.
Found android support method: Landroid/support/v7/widget/SearchView$5;.onClick:(Landroid/view/View;)V. Skipping instrumentation.
Found android support method: Landroid/support/v7/widget/Toolbar$3;.onClick:(Landroid/view/View;)V. Skipping instrumentation.
Found android support method: Landroid/support/v7/widget/ToolbarWidgetWrapper$1;.onClick:(Landroid/view/View;)V. Skipping instrumentation.
w: /Users/scottkennedy/project/src/main/java/com/example/Test.kt: (13, 87): Elvis operator (?:) always returns the left operand of non-nullable type String
w: /Users/wolfs/projects/gradle/build-tool-release/buildSrc/subprojects/configuration/src/main/kotlin/org/gradle/gradlebuild/dependencies/DependenciesMetadataRulesPlugin.kt: (75, 54): Unchecked cast: Any? to List<CapabilitySpec>
w: /home/bjerre/workspace/yet-another-kotlin-vs-java-comparison/src/main/kotlin/basics/controliiiflow/p01assigniiifromiiiif/Example.kt: (17, 9): Variable 'hejsan' is never used

0 comments on commit fb2ce3d

Please sign in to comment.
You can’t perform that action at this time.