Comments (3)
Here is the patch which made it work for me
From 81c3ea3a561b980670886087da8041825b7f44cb Mon Sep 17 00:00:00 2001
From: pharsfalvi <[email protected]>
Date: Sat, 25 Oct 2014 18:23:54 +0200
Subject: [PATCH] String handling errors while generating pojos
---
.../src/main/java/com/felees/hbnpojogen/SyncUtils.java | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/hbnpojogen-core/src/main/java/com/felees/hbnpojogen/SyncUtils.java b/hbnpojogen-core/src/main/java/com/felees/hbnpojogen/SyncUtils.java
index dfe7df2..34fb1e5 100755
--- a/hbnpojogen-core/src/main/java/com/felees/hbnpojogen/SyncUtils.java
+++ b/hbnpojogen-core/src/main/java/com/felees/hbnpojogen/SyncUtils.java
@@ -811,6 +811,9 @@ implements Serializable {
* @return the same string with the first character set to uppercase
*/
public static String upfirstChar(String s) {
+ if (s == null || s.length() == 0){
+ return "";
+ }
return s.substring(0, 1).toUpperCase() + s.substring(1, s.length());
}
@@ -982,8 +985,9 @@ implements Serializable {
*/
public static String removeUnderscores(String input) {
StringBuffer result = new StringBuffer();
-
- if (State.getInstance().disableUnderscoreConversion) {
+ if (input == null){
+ return "";
+ } else if (State.getInstance().disableUnderscoreConversion) {
result.append(input);
}
else {
@@ -1292,7 +1296,10 @@ implements Serializable {
* @return The table catalog
*/
public static String getTableCatalog(String dottedInput) {
- return dottedInput.substring(0, dottedInput.indexOf("."));
+ if (dottedInput.indexOf(".") >= 0){
+ return dottedInput.substring(0, dottedInput.indexOf("."));
+ }
+ return dottedInput;
}
--
2.0.1
from hbnpojogen.
Hi, thanks for the patch -- if possible can you raise a pull request? It just makes it easier to manage and track.
from hbnpojogen.
Yup, it's done. Cheers
Peter
from hbnpojogen.
Related Issues (9)
- Invalid names when system locale different than EN HOT 1
- How can i create entity only configuration? HOT 1
- PostGreSQL 10 support HOT 1
- Repositories with Spring Boot 2.0 HOT 1
- [enhancement] Create a Release package HOT 1
- little question HOT 1
- Enum generated with wrong encoding HOT 4
- Update to Maven HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hbnpojogen.