File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed
HMCLCore/src/main/java/org/jackhuang/hmcl/util/platform Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -113,16 +113,19 @@ public Map<String, Object> getProperties() {
113113 */
114114 public List <String > getLines (Predicate <String > lineFilter ) {
115115 lock .lock ();
116-
117- if (lineFilter == null )
118- return List .copyOf (lines );
119-
120- ArrayList <String > res = new ArrayList <>();
121- for (String line : this .lines ) {
122- if (lineFilter .test (line ))
123- res .add (line );
116+ try {
117+ if (lineFilter == null )
118+ return List .copyOf (lines );
119+
120+ ArrayList <String > res = new ArrayList <>();
121+ for (String line : this .lines ) {
122+ if (lineFilter .test (line ))
123+ res .add (line );
124+ }
125+ return Collections .unmodifiableList (res );
126+ } finally {
127+ lock .unlock ();
124128 }
125- return Collections .unmodifiableList (res );
126129 }
127130
128131 public void addLine (String line ) {
You can’t perform that action at this time.
0 commit comments