This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 147688 - Sun Studio freezes when I type the "f" of "end if", when the if is directly under a subroutine
Summary: Sun Studio freezes when I type the "f" of "end if", when the if is directly u...
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: Sun All
: P2 blocker (vote)
Assignee: Alexander Simon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-19 09:20 UTC by Alexander Simon
Modified: 2008-12-09 13:37 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Simon 2008-09-19 09:20:02 UTC
This is from Esc# 1-24701700 CR# 6749526

When editing Fortran 90 code in the Sun Studio 12 IDE, Sun Studio freezes when I press the "f" key of an "end if" (the f
is not even shown) that is directly under a subroutine. Top reports that java is using 98% of the CPU. This does not
happen when the "if" is inside a do loop or inside a program.

Note: it has been reproduced with Sun Studio 10 and 12

In Sun Studio 12, if I choose

   "File" -> "New..."

and then

   "Choose File Type" -> "Fortran Files" -> "Fortran File (Free Format)"

and then entering the following source code, I can get Sun Studio to freeze as soon as I press the "f" key as per the
last line below..

Note: the vertical bars are there simply to indicate the left edge of the window, the 'f' in <<f>> in the last line is
not even shown


   |program test
   |
   |    write (*,*) 'Hello'
   |
   |    contains
   |
   |    subroutine p(c)
   |        integer :: c
   |        if (c > 0) then
   |             c = 0
   |             end i<<f>>
Comment 1 Alexander Simon 2008-09-19 09:37:45 UTC
fixed IZ#147688 & IZ#147689
http://hg.netbeans.org/main/rev/d70f5ec86b7c

unit tests for  IZ#147688 & IZ#147689
http://hg.netbeans.org/main/rev/d013e11f278f
Comment 2 Quality Engineering 2008-09-19 17:37:32 UTC
Integrated into 'main-golden', will be available in build *200809191401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/d70f5ec86b7c
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixed IZ#147688:infinite loop in indent when "c" is first important line token and IZ#147689:no indent for end program and subroutine
Comment 3 Alexander Pepin 2008-09-24 14:21:42 UTC
verified in NB6.5 build 20080924
Comment 4 Karthikeyan Rajeswaran 2008-10-01 02:24:09 UTC
The fix has been ported to release551_fixes branch.

Checking in src/org/netbeans/modules/cnd/editor/fortran/FFormatSupport.java;
/cvs/cnd/core/src/org/netbeans/modules/cnd/editor/fortran/Attic/FFormatSupport.java,v  <--  FFormatSupport.java
new revision: 1.1.2.3.6.2; previous revision: 1.1.2.3.6.1
done
Checking in src/org/netbeans/modules/cnd/editor/fortran/FFormatter.java;
/cvs/cnd/core/src/org/netbeans/modules/cnd/editor/fortran/Attic/FFormatter.java,v  <--  FFormatter.java
new revision: 1.1.2.3.6.2; previous revision: 1.1.2.3.6.1
done
Checking in src/org/netbeans/modules/cnd/editor/fortran/FSyntax.java;
/cvs/cnd/core/src/org/netbeans/modules/cnd/editor/fortran/Attic/FSyntax.java,v  <--  FSyntax.java
new revision: 1.1.2.2.6.1; previous revision: 1.1.2.2
done

The unit tests were not ported to release551_fixes, since the test infrastructure is more basic and different from trunk
for 65.
Comment 5 Karthikeyan Rajeswaran 2008-10-01 18:57:22 UTC
The fix has been ported into the release61_fixes repository.
http://hg.netbeans.org/release61_fixes/rev/0ce771bf3f24
Comment 6 Alexander Pepin 2008-10-08 14:22:52 UTC
verified in patch4
Comment 7 Karthikeyan Rajeswaran 2008-10-08 18:00:03 UTC
The fix for 147688 , 147689, 136699 and 145858 have been backported to release601_fixes branch.

Checking in core/src/org/netbeans/modules/cnd/editor/fortran/FFormatSupport.java;
/cvs/cnd/core/src/org/netbeans/modules/cnd/editor/fortran/Attic/FFormatSupport.java,v  <--  FFormatSupport.java
new revision: 1.4.12.1; previous revision: 1.4
done
Checking in core/src/org/netbeans/modules/cnd/editor/fortran/FFormatter.java;
/cvs/cnd/core/src/org/netbeans/modules/cnd/editor/fortran/Attic/FFormatter.java,v  <--  FFormatter.java
new revision: 1.5.12.1; previous revision: 1.5
done
Checking in core/src/org/netbeans/modules/cnd/editor/fortran/FKit.java;
/cvs/cnd/core/src/org/netbeans/modules/cnd/editor/fortran/Attic/FKit.java,v  <--  FKit.java
new revision: 1.5.12.1; previous revision: 1.5
done
Checking in core/src/org/netbeans/modules/cnd/editor/fortran/FSyntax.java;
/cvs/cnd/core/src/org/netbeans/modules/cnd/editor/fortran/Attic/FSyntax.java,v  <--  FSyntax.java
new revision: 1.4.12.1; previous revision: 1.4
done
RCS file: /cvs/cnd/core/test/unit/src/org/netbeans/modules/cnd/editor/fortran/Attic/FortranFormatterBaseUnitTestCase.java,v
done
Checking in core/test/unit/src/org/netbeans/modules/cnd/editor/fortran/FortranFormatterBaseUnitTestCase.java;
/cvs/cnd/core/test/unit/src/org/netbeans/modules/cnd/editor/fortran/Attic/FortranFormatterBaseUnitTestCase.java,v  <-- 
FortranFormatterBaseUnitTestCase.java
new revision: 1.1.2.1; previous revision: 1.1
done
RCS file: /cvs/cnd/core/test/unit/src/org/netbeans/modules/cnd/editor/fortran/Attic/FortranFormatterUnitTest.java,v
done
Checking in core/test/unit/src/org/netbeans/modules/cnd/editor/fortran/FortranFormatterUnitTest.java;
/cvs/cnd/core/test/unit/src/org/netbeans/modules/cnd/editor/fortran/Attic/FortranFormatterUnitTest.java,v  <-- 
FortranFormatterUnitTest.java
new revision: 1.1.2.1; previous revision: 1.1
done
RCS file: /cvs/cnd/core/test/unit/src/org/netbeans/modules/cnd/editor/fortran/Attic/FortranIndentUnitTestCase.java,v
done
Checking in core/test/unit/src/org/netbeans/modules/cnd/editor/fortran/FortranIndentUnitTestCase.java;
/cvs/cnd/core/test/unit/src/org/netbeans/modules/cnd/editor/fortran/Attic/FortranIndentUnitTestCase.java,v  <-- 
FortranIndentUnitTestCase.java
new revision: 1.1.2.1; previous revision: 1.1
done
Checking in core/test/unit/src/org/netbeans/modules/cnd/test/BaseTestCase.java;
/cvs/cnd/core/test/unit/src/org/netbeans/modules/cnd/test/Attic/BaseTestCase.java,v  <--  BaseTestCase.java
new revision: 1.10.12.1; previous revision: 1.10
done
RCS file: /cvs/cnd/core/test/unit/src/org/netbeans/modules/cnd/test/Attic/FormatterBaseDocumentUnitTestCase.java,v
done
Checking in core/test/unit/src/org/netbeans/modules/cnd/test/FormatterBaseDocumentUnitTestCase.java;
/cvs/cnd/core/test/unit/src/org/netbeans/modules/cnd/test/Attic/FormatterBaseDocumentUnitTestCase.java,v  <-- 
FormatterBaseDocumentUnitTestCase.java
new revision: 1.1.2.1; previous revision: 1.1
done

The changeset http://hg.netbeans.org/release61_fixes/rev/89d1dfc6399f was made in release61_fixes branch to correct some
errors in the previous changeset http://hg.netbeans.org/release61_fixes/rev/0ce771bf3f24 .

With the above, except for the porting of unit tests for 5.5.1 fixes branch, the fix has been ported to all relevant
branches.
Comment 8 Alexander Pepin 2008-11-11 14:56:18 UTC
verified in 5.5.1 with manually installed nbms from PromoG1Patch4