File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
dts-generator/src/main/java/com/telerik/dts Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -190,7 +190,12 @@ private int openPackage(JavaClass prevClass, JavaClass currClass) {
190
190
//method related
191
191
private void processMethod (Method m , JavaClass clazz ) {
192
192
193
- loadBaseMethods (clazz ); //loaded in "baseMethodNames" and "baseMethods"
193
+ try {
194
+ loadBaseMethods (clazz ); //loaded in "baseMethodNames" and "baseMethods"
195
+ }
196
+ catch (ClassNotFoundException e ) {
197
+ e .printStackTrace ();
198
+ }
194
199
195
200
String tabs = getTabs (this .indent + 1 );
196
201
@@ -235,13 +240,16 @@ private void cacheMethodBySignature(Method m) {
235
240
}
236
241
}
237
242
238
- private void loadBaseMethods (JavaClass clazz ) {
243
+ private void loadBaseMethods (JavaClass clazz ) throws ClassNotFoundException {
239
244
baseMethodNames = new HashSet <String >();
240
245
baseMethods = new ArrayList <Method >();
241
246
String scn = clazz .getSuperclassName ();
242
247
JavaClass currClass = ClassRepo .findClass (scn );
243
248
assert currClass != null : "javaClass=" + clazz .getClassName () + " scn=" + scn ;
244
249
250
+ if (currClass == null ) {
251
+ throw new ClassNotFoundException ("Couldn't find class: " + scn + " required by class: " + clazz .getClassName () + ". You need to provide the jar containing the missing class: " + scn );
252
+ }
245
253
//get all base methods and method names
246
254
while (true ) {
247
255
for (Method m : currClass .getMethods ()) {
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ public void write(String content, String fileName) {
30
30
try {
31
31
if (this .writeMultipleFiles ) {
32
32
this .ps = new PrintStream (new File (this .outDir .getAbsolutePath (), fileName + ".d.ts" ));
33
- ps .print ("/// <reference path=\" ./_helpers.d.ts\" />" );
33
+ ps .println ("/// <reference path=\" ./_helpers.d.ts\" />" );
34
34
this .ps .print (content );
35
35
}
36
36
else {
@@ -39,7 +39,7 @@ public void write(String content, String fileName) {
39
39
40
40
//add helpers reference to the top of the file
41
41
if (this .isFirstRun ) {
42
- ps .print ("/// <reference path=\" ./_helpers.d.ts\" />" );
42
+ ps .println ("/// <reference path=\" ./_helpers.d.ts\" />" );
43
43
this .isFirstRun = false ;
44
44
}
45
45
You can’t perform that action at this time.
0 commit comments