[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdev-java] /: Fix crash
From:       Kevin Funk <kevin () kfunk ! org>
Date:       2014-02-03 8:37:19
Message-ID: E1WAF1r-0002vi-2J () scm ! kde ! org
[Download RAW message or body]

Git commit 5c14a905a5003145ab7489c367476609d8f836b4 by Kevin Funk, on behalf of \
Matija Skala. Committed on 03/02/2014 at 08:34.
Pushed by kfunk into branch 'master'.

Fix crash

KDevelop keeps crashing on startup if java support is enabled ... and this patch \
fixes it

REVIEW: 115414

M  +1    -1    duchain/contextbuilder.cpp
M  +1    -0    parsejob.cpp
M  +1    -0    parser/parsesession.h

http://commits.kde.org/kdev-java/5c14a905a5003145ab7489c367476609d8f836b4

diff --git a/duchain/contextbuilder.cpp b/duchain/contextbuilder.cpp
index 81837ce..de0132c 100644
--- a/duchain/contextbuilder.cpp
+++ b/duchain/contextbuilder.cpp
@@ -85,7 +85,7 @@ bool ContextBuilder::hadUnresolvedIdentifiers() const
 
 KDevelop::TopDUContext* ContextBuilder::newTopContext(const \
KDevelop::RangeInRevision& range, KDevelop::ParsingEnvironmentFile* file)  {
-  KDevelop::IndexedString rangeUrl = \
KDevelop::IndexedString(range.castToSimpleRange().textRange().toSmartRange()->document()->url());
 +  KDevelop::IndexedString rangeUrl = editor()->parseSession()->m_document;
 
   if (!file) {
       file = new ParsingEnvironmentFile(rangeUrl);
diff --git a/parsejob.cpp b/parsejob.cpp
index 84780d0..da774c4 100644
--- a/parsejob.cpp
+++ b/parsejob.cpp
@@ -169,6 +169,7 @@ void ParseJob::run()
     }
 
     // 3) Form definition-use chain
+    m_session->m_document = document();
     java::EditorIntegrator editor(parseSession());
 
     //kDebug(  ) << (contentContext ? "updating" : "building") << "duchain for" << \
                parentJob()->document().str();
diff --git a/parser/parsesession.h b/parser/parsesession.h
index 2395bc7..6398ce6 100644
--- a/parser/parsesession.h
+++ b/parser/parsesession.h
@@ -53,6 +53,7 @@ public:
   void setContents( const QByteArray& contents );
 
   const char *contents() const;
+  KDevelop::IndexedString m_document;
   qint64 size() const;
   Parser::memoryPoolType *memoryPool;
   KDevPG::TokenStream *tokenStream;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic