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.

View | Details | Raw Unified | Return to bug 150471
Collapse All | Expand All

(-)a/javascript.editing/src/org/netbeans/modules/javascript/editing/JsFormatter.java (-2 / +2 lines)
Lines 367-373 Link Here
367
    }
367
    }
368
    
368
    
369
    @SuppressWarnings("unchecked")
369
    @SuppressWarnings("unchecked")
370
    private int getTokenBalance(TokenSequence<? extends JsTokenId> ts, BaseDocument doc, int begin, int end, boolean includeKeywords, boolean indentOnly) {
370
    private int getTokenBalance(TokenSequence<? extends JsTokenId> ts, BaseDocument doc, final int begin, int end, boolean includeKeywords, boolean indentOnly) {
371
        int balance = 0;
371
        int balance = 0;
372
372
373
        if (ts == null) {
373
        if (ts == null) {
Lines 406-412 Link Here
406
        if (embeddedJavaScript && last < end) {
406
        if (embeddedJavaScript && last < end) {
407
            // We're not done yet... find the next section...
407
            // We're not done yet... find the next section...
408
            TokenSequence<? extends JsTokenId> ets = LexUtilities.getNextJsTokenSequence(doc, last+1, end);
408
            TokenSequence<? extends JsTokenId> ets = LexUtilities.getNextJsTokenSequence(doc, last+1, end);
409
            if (ets != null) {
409
            if (ets != null && ets.offset() > begin) {
410
                return balance + getTokenBalance(ets, doc, ets.offset(), end, includeKeywords, indentOnly);
410
                return balance + getTokenBalance(ets, doc, ets.offset(), end, includeKeywords, indentOnly);
411
            }
411
            }
412
        }
412
        }

Return to bug 150471