Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 367988

Summary: SqlFormatter: NPE with blank Strings
Product: z_Archived Reporter: Jeremie Bresson <dev>
Component: ScoutAssignee: Project Inbox <scout.core-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ivan.motsch, zimmermann
Version: unspecifiedFlags: zimmermann: juno+
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Patch for bug 367988 ivan.motsch: iplog+

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)