Skip to content

Commit d039b1f

Browse files
committed
Fix issues for sonar cloud scan #51
1 parent f97e5a0 commit d039b1f

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

fj-doc-base/src/main/java/org/fugerit/java/doc/base/config/DocException.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package org.fugerit.java.doc.base.config;
22

3+
import org.fugerit.java.core.lang.ex.ExConverUtils;
4+
35
public class DocException extends Exception {
46

57
public static final String DEFAULT_CODE = "DOC001";
@@ -34,23 +36,23 @@ public DocException(final String code, String message, Throwable cause) {
3436
public String getCode() {
3537
return code;
3638
}
37-
38-
public static DocException convertExMethod( String method, Exception e ) {
39-
return convertEx( "Exception during "+method, e );
40-
}
4139

4240
public static DocException convertEx( String baseMessage, Exception e ) {
4341
DocException res = null;
4442
if ( e instanceof DocException ) {
4543
res = (DocException)e;
4644
} else {
47-
res = new DocException( baseMessage+" : "+e, e );
45+
res = new DocException( ExConverUtils.defaultMessage(baseMessage, e), e );
4846
}
4947
return res;
5048
}
5149

50+
public static DocException convertExMethod( String method, Exception e ) {
51+
return convertEx( ExConverUtils.defaultMethodMessage(method), e );
52+
}
53+
5254
public static DocException convertEx( Exception e ) {
53-
return convertEx( "DocException cause is", e );
55+
return convertEx( ExConverUtils.DEFAULT_CAUSE_MESSAGE, e );
5456
}
5557

5658
/**

fj-doc-freemarker/src/main/java/org/fugerit/java/doc/freemarker/helper/FreeMarkerDocProcess.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@ public class FreeMarkerDocProcess implements Serializable {
99

1010
private FreeMarkerDocProcess() {}
1111

12-
/**
13-
* Default configuration path
14-
*/
15-
public static final String CONFIG_PATH = "cl://fj_doc_freemarker_config/fm-freemarker-doc-process-config.xml";
16-
1712
/**
1813
*
1914
*/
@@ -22,7 +17,8 @@ private FreeMarkerDocProcess() {}
2217
/*
2318
* Default implemnentation
2419
*/
25-
private static final FreemarkerDocProcessConfig INSTANCE = newInstance( CONFIG_PATH );
20+
private static final FreemarkerDocProcessConfig
21+
INSTANCE = newInstance( "cl://fj_doc_freemarker_config/fm-freemarker-doc-process-config.xml" );
2622

2723
public static FreemarkerDocProcessConfig newInstance( String configPath ) {
2824
return FreemarkerDocProcessConfigFacade.loadConfigSafe( configPath );

0 commit comments

Comments
 (0)