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 236693
Collapse All | Expand All

(-)a/php.refactoring/src/org/netbeans/modules/refactoring/php/RefactoringTask.java (-3 / +7 lines)
Lines 84-95 Link Here
84
        return ui;
84
        return ui;
85
    }
85
    }
86
86
87
    @NbBundle.Messages("ERR_ScanningInProgress=Can't refactor - scanning in progress.")
87
    @NbBundle.Messages("ERR_ScanningInProgress=Can't refactor - parsing in progress.")
88
    protected void fetchRefactoringUI(Source source, UserTask userTask) {
88
    protected void fetchRefactoringUI(Source source, UserTask userTask) {
89
        Future<?> futureTask = RP.submit(new ParsingTask(source, userTask));
89
        Future<?> futureTask = RP.submit(new ParsingTask(source, userTask));
90
        boolean scanningInProgress = false;
90
        boolean scanningInProgress = false;
91
        try {
91
        try {
92
            futureTask.get(300, TimeUnit.MILLISECONDS);
92
            futureTask.get(2500, TimeUnit.MILLISECONDS);
93
        } catch (InterruptedException ex) {
93
        } catch (InterruptedException ex) {
94
            Thread.currentThread().interrupt();
94
            Thread.currentThread().interrupt();
95
        } catch (ExecutionException ex) {
95
        } catch (ExecutionException ex) {
Lines 112-117 Link Here
112
        private final Source source;
112
        private final Source source;
113
        private final UserTask userTask;
113
        private final UserTask userTask;
114
        private volatile boolean cancelled;
114
        private volatile boolean cancelled;
115
        private Future<Void> future;
115
116
116
        private ParsingTask(Source source, UserTask userTask) {
117
        private ParsingTask(Source source, UserTask userTask) {
117
            this.source = source;
118
            this.source = source;
Lines 122-128 Link Here
122
        public void run() {
123
        public void run() {
123
            try {
124
            try {
124
                if (!cancelled) {
125
                if (!cancelled) {
125
                    ParserManager.parse(Collections.singleton(source), userTask);
126
                    future = ParserManager.parseWhenScanFinished(Collections.singleton(source), userTask);
126
                }
127
                }
127
            } catch (ParseException e) {
128
            } catch (ParseException e) {
128
                LOG.log(Level.WARNING, null, e);
129
                LOG.log(Level.WARNING, null, e);
Lines 132-137 Link Here
132
        @Override
133
        @Override
133
        public boolean cancel() {
134
        public boolean cancel() {
134
            cancelled = true;
135
            cancelled = true;
136
            if (future != null) {
137
                future.cancel(true);
138
            }
135
            return true;
139
            return true;
136
        }
140
        }
137
    }
141
    }

Return to bug 236693