Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 367988 - SqlFormatter: NPE with blank Strings
Summary: SqlFormatter: NPE with blank Strings
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Scout (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-05 16:43 EST by Jeremie Bresson CLA
Modified: 2021-08-19 11:15 EDT (History)
2 users (show)

See Also:
zimmermann: juno+


Attachments
Patch for bug 367988 (1.86 KB, patch)
2012-01-05 16:45 EST, Jeremie Bresson CLA
ivan.motsch: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremie Bresson CLA 2012-01-05 16:43:26 EST
Build Identifier: 

The SQL Formatter (in Scout commons) throws a NullPointerException with blank String as input.

Here example cases (as Unit Test):

  @Test
  public void testBlankString() throws Exception {
    Assert.assertEquals("", SqlFormatter.wellform(""));
    Assert.assertEquals("", SqlFormatter.wellform(" "));
    Assert.assertEquals("", SqlFormatter.wellform("     "));
    Assert.assertEquals("", SqlFormatter.wellform("\t"));
  }


Reproducible: Always
Comment 1 Jeremie Bresson CLA 2012-01-05 16:45:26 EST
Created attachment 209106 [details]
Patch for bug 367988

Patch proposition for bug 367988.

Makes the Unit-Test testBlankString() as proposed in the description OK.
Comment 2 Ivan Motsch CLA 2012-01-09 09:01:38 EST
Thanks a lot, Jeremie. Applied your patch and added your test to the existing SqlFormatterTest class.
Comment 3 Matthias Zimmermann CLA 2012-07-09 06:49:13 EDT
ticket closed.
deliverd as part of eclipse scout 3.8.0 (juno release train)