Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
c22230a4
Commit
c22230a4
authored
May 31, 2017
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Try making FilePool static to fix the Mockito problem on Bamboo
parent
e11b7aff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
RandomAccessDataFile.java
...pringframework/boot/loader/data/RandomAccessDataFile.java
+7
-4
No files found.
spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/data/RandomAccessDataFile.java
View file @
c22230a4
...
...
@@ -67,7 +67,7 @@ public class RandomAccessDataFile implements RandomAccessData {
throw
new
IllegalArgumentException
(
"File must exist"
);
}
this
.
file
=
file
;
this
.
filePool
=
new
FilePool
(
concurrentReads
);
this
.
filePool
=
new
FilePool
(
file
,
concurrentReads
);
this
.
offset
=
0L
;
this
.
length
=
file
.
length
();
}
...
...
@@ -229,7 +229,9 @@ public class RandomAccessDataFile implements RandomAccessData {
* Manage a pool that can be used to perform concurrent reads on the underlying
* {@link RandomAccessFile}.
*/
class
FilePool
{
static
class
FilePool
{
private
final
File
file
;
private
final
int
size
;
...
...
@@ -237,7 +239,8 @@ public class RandomAccessDataFile implements RandomAccessData {
private
final
Queue
<
RandomAccessFile
>
files
;
FilePool
(
int
size
)
{
FilePool
(
File
file
,
int
size
)
{
this
.
file
=
file
;
this
.
size
=
size
;
this
.
available
=
new
Semaphore
(
size
);
this
.
files
=
new
ConcurrentLinkedQueue
<
RandomAccessFile
>();
...
...
@@ -249,7 +252,7 @@ public class RandomAccessDataFile implements RandomAccessData {
if
(
file
!=
null
)
{
return
file
;
}
return
new
RandomAccessFile
(
RandomAccessDataFile
.
this
.
file
,
"r"
);
return
new
RandomAccessFile
(
this
.
file
,
"r"
);
}
public
void
release
(
RandomAccessFile
file
)
{
...
...
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