Skip to content

Commit 14876c6

Browse files
committed
Check to see if initialized
1 parent 15a62cf commit 14876c6

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

.gitignore

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
.gradle/
1+
*.class
2+
*.jar
23
.classpath
34
.project
45
.settings/
5-
*.class
6-
*.jar
6+
.gradle/
77
bin/
88
build/
99
target/
10-

LICENSE

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
22-
21+
SOFTWARE.

src/main/java/lambda2sql/Lambda2Sql.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package lambda2sql;
22

3+
import static java.lang.System.getProperty;
34
import static java.nio.file.Files.createTempDirectory;
5+
import static java.util.Objects.requireNonNull;
46

57
import java.io.IOException;
68
import java.util.function.Predicate;
@@ -36,6 +38,7 @@ public static void init() {
3638
* Supported operators: >,>=,<,<=,=,!=,&&,||,!
3739
*/
3840
public static <T> String toSql(Predicate<T> predicate) {
41+
requireNonNull(getProperty(DUMP_CLASSES_PROP), "Call init() before creating the predicate.");
3942
LambdaExpression<Predicate<T>> lambdaExpression = LambdaExpression.parse(predicate);
4043
return lambdaExpression.accept(new ToSqlVisitor()).toString();
4144
}

0 commit comments

Comments
 (0)