Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Lost line break after label #204

@PhilippSalvisberg

Description

@PhilippSalvisberg

Input/expected result with default settings:

create or replace package body my_package is
   procedure password_check(in_password in varchar2) is
      co_digitarray  constant string(10 char)  := '0123456789';
      co_lower_bound constant simple_integer   := 1;
      co_errno       constant simple_integer   := -20501;
      co_errmsg      constant string(100 char) := 'Password must contain a digit.';
      l_isdigit      boolean                   := false;
      l_len_pw       pls_integer;
      l_len_array    pls_integer;
   begin
      l_len_pw    := length(in_password);
      l_len_array := length(co_digitarray);

      <<check_digit>>
      for i in co_lower_bound..l_len_array
      loop
         <<check_pw_char>>
         for j in co_lower_bound..l_len_pw
         loop
            if substr(in_password, j, 1) = substr(co_digitarray, i, 1) then
               l_isdigit := true;
               goto check_other_things;
            end if;
         end loop check_pw_char;
      end loop check_digit;

      <<check_other_things>>
      null;

      if not l_isdigit then
         raise_application_error(co_errno, co_errmsg);
      end if;
   end password_check;
end my_package;
/

Formatter result:

create or replace package body my_package is
   procedure password_check(in_password in varchar2) is
      co_digitarray  constant string(10 char)  := '0123456789';
      co_lower_bound constant simple_integer   := 1;
      co_errno       constant simple_integer   := -20501;
      co_errmsg      constant string(100 char) := 'Password must contain a digit.';
      l_isdigit      boolean                   := false;
      l_len_pw       pls_integer;
      l_len_array    pls_integer;
   begin
      l_len_pw    := length(in_password);
      l_len_array := length(co_digitarray);

      <<check_digit>>
      for i in co_lower_bound..l_len_array
      loop
         <<check_pw_char>>
         for j in co_lower_bound..l_len_pw
         loop
            if substr(in_password, j, 1) = substr(co_digitarray, i, 1) then
               l_isdigit := true;
               goto check_other_things;
            end if;
         end loop check_pw_char;
      end loop check_digit;

      <<check_other_things>>null;

      if not l_isdigit then
         raise_application_error(co_errno, co_errmsg);
      end if;
   end password_check;
end my_package;
/ 

The line break after the label statement ist lost. <<check_other_things>>null;. Looks like this happens for certain statements such as null statement but not for other statements like for loops or PL/SQL blocks starting with begin. A block starting with declare has the same issue.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions