Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
7e7014ba
Kaydet (Commit)
7e7014ba
authored
Eki 14, 2015
tarafından
Noel Grandin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
use early returns to make method easier to read
Change-Id: Iabaedbd51d3832eff8e7470fd586132c38e1d039
üst
ec0c4ce0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
73 additions
and
74 deletions
+73
-74
ComponentContext.java
javaunohelper/com/sun/star/comp/helper/ComponentContext.java
+73
-74
No files found.
javaunohelper/com/sun/star/comp/helper/ComponentContext.java
Dosyayı görüntüle @
7e7014ba
...
@@ -121,94 +121,93 @@ public class ComponentContext implements XComponentContext, XComponent
...
@@ -121,94 +121,93 @@ public class ComponentContext implements XComponentContext, XComponent
public
Object
getValueByName
(
String
rName
)
public
Object
getValueByName
(
String
rName
)
{
{
Object
o
=
m_table
.
get
(
rName
);
Object
o
=
m_table
.
get
(
rName
);
if
(
o
!
=
null
)
if
(
o
=
=
null
)
{
{
if
(
o
instanceof
ComponentContextEntry
)
if
(
m_xDelegate
!=
null
)
{
{
ComponentContextEntry
entry
=
(
ComponentContextEntry
)
o
;
return
m_xDelegate
.
getValueByName
(
rName
);
if
(
entry
.
m_lateInit
!=
null
)
}
{
else
Object
xInstance
=
null
;
{
return
Any
.
VOID
;
}
}
try
if
(!(
o
instanceof
ComponentContextEntry
))
{
{
String
serviceName
=
(
String
)
entry
.
m_lateInit
;
// direct value in map
if
(
serviceName
!=
null
)
return
o
;
{
}
if
(
m_xSMgr
!=
null
)
{
xInstance
=
m_xSMgr
.
createInstanceWithContext
(
serviceName
,
this
);
}
else
{
if
(
DEBUG
)
System
.
err
.
println
(
"### no service manager instance for late init of singleton instance \""
+
rName
+
"\"!"
);
}
}
else
{
XSingleComponentFactory
xCompFac
=
UnoRuntime
.
queryInterface
(
XSingleComponentFactory
.
class
,
entry
.
m_lateInit
);
if
(
xCompFac
!=
null
)
{
xInstance
=
xCompFac
.
createInstanceWithContext
(
this
);
}
else
{
if
(
DEBUG
)
System
.
err
.
println
(
"### neither service name nor service factory given for late init of singleton instance \""
+
rName
+
"\"!"
);
}
}
}
catch
(
com
.
sun
.
star
.
uno
.
Exception
exc
)
{
if
(
DEBUG
)
System
.
err
.
println
(
"### exception occurred on late init of singleton instance \""
+
rName
+
"\": "
+
exc
.
getMessage
()
);
}
if
(
xInstance
!=
null
)
ComponentContextEntry
entry
=
(
ComponentContextEntry
)
o
;
{
if
(
entry
.
m_lateInit
==
null
)
synchronized
(
entry
)
{
{
return
entry
.
m_value
;
if
(
entry
.
m_lateInit
!=
null
)
}
{
entry
.
m_value
=
xInstance
;
Object
xInstance
=
null
;
entry
.
m_lateInit
=
null
;
try
}
{
else
// inited in the meantime
String
serviceName
=
(
String
)
entry
.
m_lateInit
;
{
if
(
serviceName
!=
null
)
// dispose fresh service instance
{
XComponent
xComp
=
UnoRuntime
.
queryInterface
(
if
(
m_xSMgr
!=
null
)
XComponent
.
class
,
xInstance
);
{
if
(
xComp
!=
null
)
xInstance
=
m_xSMgr
.
createInstanceWithContext
(
serviceName
,
this
);
{
}
xComp
.
dispose
();
else
}
{
}
if
(
DEBUG
)
}
System
.
err
.
println
(
"### no service manager instance for late init of singleton instance \""
+
rName
+
"\"!"
);
}
else
{
if
(
DEBUG
)
System
.
err
.
println
(
"### failed late init of singleton instance \""
+
rName
+
"\"!"
);
}
}
}
return
entry
.
m_value
;
}
}
else
// direct value in map
else
{
{
return
o
;
XSingleComponentFactory
xCompFac
=
UnoRuntime
.
queryInterface
(
XSingleComponentFactory
.
class
,
entry
.
m_lateInit
);
if
(
xCompFac
!=
null
)
{
xInstance
=
xCompFac
.
createInstanceWithContext
(
this
);
}
else
{
if
(
DEBUG
)
System
.
err
.
println
(
"### neither service name nor service factory given for late init of singleton instance \""
+
rName
+
"\"!"
);
}
}
}
}
}
else
if
(
m_xDelegate
!=
null
)
catch
(
com
.
sun
.
star
.
uno
.
Exception
exc
)
{
if
(
DEBUG
)
System
.
err
.
println
(
"### exception occurred on late init of singleton instance \""
+
rName
+
"\": "
+
exc
.
getMessage
()
);
}
if
(
xInstance
!=
null
)
{
{
return
m_xDelegate
.
getValueByName
(
rName
);
synchronized
(
entry
)
{
if
(
entry
.
m_lateInit
!=
null
)
{
entry
.
m_value
=
xInstance
;
entry
.
m_lateInit
=
null
;
}
else
// inited in the meantime
{
// dispose fresh service instance
XComponent
xComp
=
UnoRuntime
.
queryInterface
(
XComponent
.
class
,
xInstance
);
if
(
xComp
!=
null
)
{
xComp
.
dispose
();
}
}
}
}
}
else
else
{
{
return
Any
.
VOID
;
if
(
DEBUG
)
System
.
err
.
println
(
"### failed late init of singleton instance \""
+
rName
+
"\"!"
);
}
}
return
entry
.
m_value
;
}
}
public
XMultiComponentFactory
getServiceManager
()
public
XMultiComponentFactory
getServiceManager
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment