@@ -113,27 +113,22 @@ public static void write(PrintWriter out, String packageName) {
113
113
+ " var imports = new ArrayList<String>();\n "
114
114
+ "\n "
115
115
+ " while (importMatcher.find()) {\n "
116
- + " imports.add(usesMatcher .group(1));\n "
116
+ + " imports.add(importMatcher .group(1));\n "
117
117
+ " }\n "
118
118
+ "\n "
119
119
+ " while (providesMatcher.find()) {\n "
120
- + " String providedInterface = providesMatcher.group(1);\n "
120
+ + " String providedInterface = resolveImport(imports, providesMatcher.group(1) );\n "
121
121
+ " String implementationClasses = providesMatcher.group(2);\n "
122
122
+ "\n "
123
- + " if (!providedInterface.contains(\" .\" )) {\n "
124
- + " implementationClasses = resolveImport(imports, providedInterface);\n "
125
- + " }\n "
126
123
+ " List<String> implementations =\n "
127
124
+ " Arrays.stream(implementationClasses.split(SPLIT_PATTERN))\n "
128
- + " .map(s -> s.contains( \" . \" ) ? s : resolveImport(imports, providedInterface ))\n "
125
+ + " .map(s -> resolveImport(imports, s ))\n "
129
126
+ " .collect(toList());\n "
130
127
+ " provides.add(new Provides(providedInterface, implementations));\n "
131
128
+ " }\n "
132
129
+ " while (usesMatcher.find()) {\n "
133
- + " String usedInterface = usesMatcher.group(1);\n "
134
- + " if (!usedInterface.contains(\" .\" )) {\n "
135
- + " usedInterface = resolveImport(imports, usedInterface);\n "
136
- + " }\n "
130
+ + " String usedInterface = resolveImport(imports, usesMatcher.group(1));\n "
131
+ + "\n "
137
132
+ " uses.add(new Uses(usedInterface));\n "
138
133
+ " }\n "
139
134
+ " }\n "
@@ -142,7 +137,7 @@ public static void write(PrintWriter out, String packageName) {
142
137
+ " return imports.stream()\n "
143
138
+ " .filter(s -> s.contains(providedInterface))\n "
144
139
+ " .findFirst()\n "
145
- + " .orElse(providedInterface);\n "
140
+ + " .orElse(providedInterface).replaceAll( \" \\ \\ s \" , \" \" ) ;\n "
146
141
+ " }\n "
147
142
+ "\n "
148
143
+ " /**\n "
0 commit comments