@@ -833,16 +833,19 @@ class VersionApi extends AbstractApi {
833
833
* @return the ApplicationsApi instance owned by this GitLabApi instance
834
834
*/
835
835
public ApplicationsApi getApplicationsApi () {
836
-
837
- if (applicationsApi == null ) {
836
+ ApplicationsApi localRef = applicationsApi ;
837
+
838
+ if (localRef == null ) {
838
839
synchronized (this ) {
839
- if (applicationsApi == null ) {
840
- applicationsApi = new ApplicationsApi (this );
840
+ localRef = applicationsApi ;
841
+ if (localRef == null ) {
842
+ localRef = new ApplicationsApi (this );
843
+ applicationsApi = localRef ;
841
844
}
842
845
}
843
846
}
844
847
845
- return ( applicationsApi ) ;
848
+ return localRef ;
846
849
}
847
850
848
851
/**
@@ -852,16 +855,19 @@ public ApplicationsApi getApplicationsApi() {
852
855
* @return the ApplicationsApi instance owned by this GitLabApi instance
853
856
*/
854
857
public ApplicationSettingsApi getApplicationSettingsApi () {
858
+ ApplicationSettingsApi localRef = applicationSettingsApi ;
855
859
856
- if (applicationSettingsApi == null ) {
860
+ if (localRef == null ) {
857
861
synchronized (this ) {
858
- if (applicationSettingsApi == null ) {
859
- applicationSettingsApi = new ApplicationSettingsApi (this );
862
+ localRef = applicationSettingsApi ;
863
+ if (localRef == null ) {
864
+ localRef = new ApplicationSettingsApi (this );
865
+ applicationSettingsApi = localRef ;
860
866
}
861
867
}
862
868
}
863
869
864
- return ( applicationSettingsApi );
870
+ return localRef ;
865
871
}
866
872
867
873
/**
@@ -947,16 +953,18 @@ public CommitsApi getCommitsApi() {
947
953
* @return the ContainerRegistryApi instance owned by this GitLabApi instance
948
954
*/
949
955
public ContainerRegistryApi getContainerRegistryApi () {
950
-
951
- if (containerRegistryApi == null ) {
956
+ ContainerRegistryApi localInstance = containerRegistryApi ;
957
+
958
+ if (localInstance == null ) {
952
959
synchronized (this ) {
953
- if (containerRegistryApi == null ) {
954
- containerRegistryApi = new ContainerRegistryApi (this );
960
+ localInstance = containerRegistryApi ;
961
+ if (localInstance == null ) {
962
+ containerRegistryApi = localInstance = new ContainerRegistryApi (this );
955
963
}
956
964
}
957
965
}
958
-
959
- return ( containerRegistryApi ) ;
966
+
967
+ return localInstance ;
960
968
}
961
969
962
970
/**
@@ -1222,16 +1230,17 @@ public JobApi getJobApi() {
1222
1230
}
1223
1231
1224
1232
public LabelsApi getLabelsApi () {
1225
-
1226
- if (labelsApi == null ) {
1233
+ LabelsApi result = labelsApi ;
1234
+ if (result == null ) {
1227
1235
synchronized (this ) {
1228
- if (labelsApi == null ) {
1229
- labelsApi = new LabelsApi (this );
1236
+ result = labelsApi ;
1237
+ if (result == null ) {
1238
+ result = new LabelsApi (this );
1239
+ labelsApi = result ;
1230
1240
}
1231
1241
}
1232
1242
}
1233
-
1234
- return (labelsApi );
1243
+ return result ;
1235
1244
}
1236
1245
1237
1246
/**
@@ -1336,16 +1345,16 @@ public MilestonesApi getMilestonesApi() {
1336
1345
* @return the NamespaceApi instance owned by this GitLabApi instance
1337
1346
*/
1338
1347
public NamespaceApi getNamespaceApi () {
1339
-
1340
- if (namespaceApi == null ) {
1348
+ NamespaceApi result = namespaceApi ;
1349
+ if (result == null ) {
1341
1350
synchronized (this ) {
1342
- if (namespaceApi == null ) {
1343
- namespaceApi = new NamespaceApi (this );
1351
+ result = namespaceApi ;
1352
+ if (result == null ) {
1353
+ namespaceApi = result = new NamespaceApi (this );
1344
1354
}
1345
1355
}
1346
1356
}
1347
-
1348
- return (namespaceApi );
1357
+ return result ;
1349
1358
}
1350
1359
1351
1360
/**
@@ -1507,16 +1516,17 @@ public ReleasesApi getReleasesApi() {
1507
1516
* @return the RepositoryApi instance owned by this GitLabApi instance
1508
1517
*/
1509
1518
public RepositoryApi getRepositoryApi () {
1510
-
1511
- if (repositoryApi == null ) {
1519
+ RepositoryApi localRef = repositoryApi ;
1520
+ if (localRef == null ) {
1512
1521
synchronized (this ) {
1513
- if (repositoryApi == null ) {
1514
- repositoryApi = new RepositoryApi (this );
1522
+ localRef = repositoryApi ;
1523
+ if (localRef == null ) {
1524
+ localRef = new RepositoryApi (this );
1525
+ repositoryApi = localRef ;
1515
1526
}
1516
1527
}
1517
1528
}
1518
-
1519
- return (repositoryApi );
1529
+ return localRef ;
1520
1530
}
1521
1531
1522
1532
/**
@@ -1621,16 +1631,17 @@ public SearchApi getSearchApi() {
1621
1631
* @return the ServicesApi instance owned by this GitLabApi instance
1622
1632
*/
1623
1633
public ServicesApi getServicesApi () {
1624
-
1625
- if (servicesApi == null ) {
1634
+ ServicesApi result = servicesApi ;
1635
+ if (result == null ) {
1626
1636
synchronized (this ) {
1627
- if (servicesApi == null ) {
1628
- servicesApi = new ServicesApi (this );
1637
+ result = servicesApi ;
1638
+ if (result == null ) {
1639
+ result = new ServicesApi (this );
1640
+ servicesApi = result ;
1629
1641
}
1630
1642
}
1631
1643
}
1632
-
1633
- return (servicesApi );
1644
+ return result ;
1634
1645
}
1635
1646
1636
1647
/**
@@ -1714,15 +1725,17 @@ public SnippetsApi getSnippetApi() {
1714
1725
* @return the TodosApi instance owned by this GitLabApi instance
1715
1726
*/
1716
1727
public TodosApi getTodosApi () {
1717
- if (todosApi == null ) {
1728
+ TodosApi result = todosApi ;
1729
+ if (result == null ) {
1718
1730
synchronized (this ) {
1719
- if (todosApi == null ) {
1720
- todosApi = new TodosApi (this );
1731
+ result = todosApi ;
1732
+ if (result == null ) {
1733
+ result = new TodosApi (this );
1734
+ todosApi = result ;
1721
1735
}
1722
1736
}
1723
1737
}
1724
-
1725
- return todosApi ;
1738
+ return result ;
1726
1739
}
1727
1740
1728
1741
/**
0 commit comments