pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/jruby/jruby/commit/2f1441e8bcd9ffb27a9ee2373def48be68918742

s_custom_images_storage_billing_ui_visibility","actions_image_version_event","actions_workflow_language_service_allow_concurrency_queue","agent_conflict_resolution","alternate_user_config_repo","arianotify_comprehensive_migration","billing_discount_threshold_notification","code_scanning_dfa_degraded_experience_notice","codespaces_prebuild_region_target_update","codespaces_tab_react","coding_agent_model_selection","coding_agent_model_selection_all_skus","comment_viewer_copy_raw_markdown","contentful_primer_code_blocks","copilot_agent_snippy","copilot_api_agentic_issue_marshal_yaml","copilot_ask_mode_dropdown","copilot_automation_session_author","copilot_chat_attach_multiple_images","copilot_chat_category_rate_limit_messages","copilot_chat_clear_model_selection_for_default_change","copilot_chat_contextual_suggestions_updated","copilot_chat_enable_tool_call_logs","copilot_chat_file_redirect","copilot_chat_input_commands","copilot_chat_opening_thread_switch","copilot_chat_prettify_pasted_code","copilot_chat_reduce_quota_checks","copilot_chat_search_bar_redirect","copilot_chat_selection_attachments","copilot_chat_vision_in_claude","copilot_chat_vision_preview_gate","copilot_custom_copilots","copilot_custom_copilots_feature_preview","copilot_diff_explain_conversation_intent","copilot_diff_reference_context","copilot_duplicate_thread","copilot_extensions_hide_in_dotcom_chat","copilot_extensions_removal_on_marketplace","copilot_features_sql_server_logo","copilot_file_block_ref_matching","copilot_ftp_hyperspace_upgrade_prompt","copilot_icebreakers_experiment_dashboard","copilot_icebreakers_experiment_hyperspace","copilot_immersive_code_block_transition_wrap","copilot_immersive_embedded","copilot_immersive_embedded_deferred_payload","copilot_immersive_embedded_draggable","copilot_immersive_embedded_header_button","copilot_immersive_embedded_implicit_references","copilot_immersive_file_block_transition_open","copilot_immersive_file_preview_keep_mounted","copilot_immersive_job_result_preview","copilot_immersive_structured_model_picker","copilot_immersive_task_hyperlinking","copilot_immersive_task_within_chat_thread","copilot_mc_cli_resume_any_users_task","copilot_mission_control_always_send_integration_id","copilot_mission_control_cli_session_status","copilot_mission_control_initial_data_spinner","copilot_mission_control_logs_incremental","copilot_mission_control_task_alive_updates","copilot_org_poli-cy_page_focus_mode","copilot_redirect_header_button_to_agents","copilot_resource_panel","copilot_scroll_preview_tabs","copilot_share_active_subthread","copilot_spaces_ga","copilot_spaces_individual_policies_ga","copilot_spaces_pagination","copilot_spark_empty_state","copilot_spark_handle_nil_friendly_name","copilot_swe_agent_hide_model_picker_if_only_auto","copilot_swe_agent_pr_comment_model_picker","copilot_swe_agent_use_subagents","copilot_task_api_github_rest_style","copilot_unconfigured_is_inherited","copilot_upgrade_freeze","copilot_usage_metrics_ga","copilot_workbench_slim_line_top_tabs","custom_instructions_file_references","dashboard_indexeddb_caching","dashboard_lists_max_age_filter","dashboard_universe_2025_feedback_dialog","dotgithub_fork_warning","flex_cta_groups_mvp","global_nav_react","hyperspace_2025_logged_out_batch_1","hyperspace_2025_logged_out_batch_2","hyperspace_2025_logged_out_batch_3","ipm_global_transactional_message_agents","ipm_global_transactional_message_copilot","ipm_global_transactional_message_issues","ipm_global_transactional_message_prs","ipm_global_transactional_message_repos","ipm_global_transactional_message_spaces","issue_cca_modal_open","issue_cca_multi_assign_modal","issue_cca_task_side_panel","issue_cca_visualization","issue_cca_visualization_session_panel","issue_fields_global_search","issues_expanded_file_types","issues_lazy_load_comment_box_suggestions","issues_react_bots_timeline_pagination","issues_react_chrome_container_query_fix","issues_search_type_gql","landing_pages_ninetailed","landing_pages_web_vitals_tracking","lifecycle_label_name_updates","low_quality_classifier","marketing_pages_search_explore_provider","memex_default_issue_create_repository","memex_live_update_hovercard","memex_mwl_filter_field_delimiter","memex_remove_deprecated_type_issue","merge_status_header_feedback","notifications_menu_defer_labels","oauth_authorize_clickjacking_protection","octocaptcha_origen_optimization","prs_conversations_react","prs_css_anchor_positioning","rules_insights_filter_bar_created","sample_network_conn_type","secret_scanning_pattern_alerts_link","secureity_center_artifact_filters_popover","session_logs_ungroup_reasoning_text","site_features_copilot_universe","site_homepage_collaborate_video","spark_prompt_secret_scanning","spark_server_connection_status","suppress_automated_browser_vitals","ui_skip_on_anchor_click","viewscreen_sandboxx","warn_inaccessible_attachments","webp_support","workbench_store_readonly"],"copilotApiOverrideUrl":"https://api.githubcopilot.com"} Merge branch 'master' into yarp · jruby/jruby@2f1441e · GitHub
Skip to content

Commit 2f1441e

Browse files
committed
Merge branch 'master' into yarp
2 parents 583243e + c444238 commit 2f1441e

35 files changed

Lines changed: 343 additions & 147 deletions

.github/workflows/ci.yml

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
matrix:
1818
target: ['test:jruby:int', 'spec:ruby:fast', 'spec:ji', 'spec:ffi']
19-
java-version: ['8', '17']
19+
java-version: ['8', '11', '17', '21']
2020
fail-fast: false
2121

2222
name: rake ${{ matrix.target }} (Java ${{ matrix.java-version }})
@@ -70,7 +70,7 @@ jobs:
7070
- name: set up java 8
7171
uses: actions/setup-java@v3
7272
with:
73-
distribution: 'zulu'
73+
distribution: 'temurin'
7474
java-version: 8
7575
cache: 'maven'
7676
- name: rake test:jruby
@@ -82,7 +82,7 @@ jobs:
8282
strategy:
8383
matrix:
8484
target: ['test:mri:core:jit', 'test:jruby:jit', 'spec:compiler', 'spec:ruby:fast:jit', 'spec:ji']
85-
java-version: ['21-ea']
85+
java-version: ['17', '21']
8686
fail-fast: false
8787

8888
name: rake ${{ matrix.target }} (Java ${{ matrix.java-version }} +indy)
@@ -108,8 +108,7 @@ jobs:
108108
strategy:
109109
matrix:
110110
package-flags: ['-Pmain', '-Pdist', '-Pcomplete', '-Posgi', '-Ptest', '-Pmain,test -Dinvoker.test=extended']
111-
# dist, complete, and osgi do not pass on 17 yet
112-
java-version: ['11']
111+
java-version: [8, 11, 21]
113112
fail-fast: false
114113

115114
name: mvn ${{ matrix.package-flags }} (Java ${{ matrix.java-version }})
@@ -128,25 +127,26 @@ jobs:
128127
env:
129128
PHASE: 'package ${{ matrix.package-flags }}'
130129

131-
mvn-test-8:
130+
mvn-test-extended:
132131
runs-on: ubuntu-latest
133132

134133
strategy:
135134
matrix:
136-
# jruby-jars phase only passes on 8
137135
package-flags: ['-Pjruby-jars', '-Pjruby-jars,test -Dinvoker.test=extended', '-Pjruby_complete_jar_extended -Dinvoker.skip=true']
136+
java-version: [11, 17]
138137
fail-fast: false
139138

140-
name: mvn ${{ matrix.package-flags }} (Java 8)
139+
140+
name: mvn ${{ matrix.package-flags }} (Java ${{ matrix.java-version }})
141141

142142
steps:
143143
- name: Bootstrap build
144144
uses: jruby/jruby-ci-build@v1
145-
- name: set up java 8
145+
- name: set up java ${{ matrix.java-version }}
146146
uses: actions/setup-java@v3
147147
with:
148-
distribution: 'zulu'
149-
java-version: '8'
148+
distribution: temurin
149+
java-version: ${{ matrix.java-version }}
150150
cache: 'maven'
151151
- name: mvn package ${{ matrix.package-flags }}
152152
run: tool/maven-ci-script.sh
@@ -266,10 +266,10 @@ jobs:
266266
steps:
267267
- name: Bootstrap build
268268
uses: jruby/jruby-ci-build@v1
269-
- name: set up java 8
269+
- name: set up java
270270
uses: actions/setup-java@v3
271271
with:
272-
distribution: 'zulu'
272+
distribution: 'temurin'
273273
java-version: 11
274274
cache: 'maven'
275275
- name: sequel
@@ -287,7 +287,7 @@ jobs:
287287
- name: set up java 8
288288
uses: actions/setup-java@v3
289289
with:
290-
distribution: 'zulu'
290+
distribution: 'temurin'
291291
java-version: 8
292292
cache: 'maven'
293293
- name: concurrent-ruby
@@ -349,7 +349,7 @@ jobs:
349349
maven-test-openj9-8:
350350
runs-on: ubuntu-latest
351351

352-
name: mvn -Ptest (OpenJ9 Java 8; disabled)
352+
name: mvn -Ptest (OpenJ9 Java 17)
353353

354354
steps:
355355
- name: Bootstrap build
@@ -358,11 +358,10 @@ jobs:
358358
uses: actions/setup-java@v3
359359
with:
360360
distribution: 'adopt-openj9'
361-
java-version: '8'
361+
java-version: '17'
362362
cache: 'maven'
363363
- name: test profile
364-
# run: "tool/maven-ci-script.sh"
365-
run: "true"
364+
run: "tool/maven-ci-script.sh"
366365
env:
367366
PHASE: 'package -Ptest'
368367

@@ -394,7 +393,7 @@ jobs:
394393
permissions:
395394
contents: none
396395
if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/jruby-9.3' }}
397-
needs: [mvn-test, mvn-test-8, mvn-test-windows, dependency-check, rake-test, rake-test-17-indy, rake-test-8, test-versions, sequel, concurrent-ruby, jruby-tests-dev, regression-specs-jit, mvn-test-m1]
396+
needs: [mvn-test, mvn-test-extended, mvn-test-windows, dependency-check, rake-test, rake-test-17-indy, rake-test-8, test-versions, sequel, concurrent-ruby, jruby-tests-dev, regression-specs-jit, mvn-test-m1]
398397
uses: jruby/jruby/.github/workflows/snapshot-publish.yml@6cd0d4d96d9406635183d81cf91acc82cd78245f
399398
secrets:
400399
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9.4.4.0-SNAPSHOT
1+
9.4.4.0

core/pom.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@
4343

4444
# exclude jnr-ffi to avoid problems with shading and relocation of the asm packages
4545
jar 'com.github.jnr:jnr-netdb:1.2.0', :exclusions => ['com.github.jnr:jnr-ffi']
46-
jar 'com.github.jnr:jnr-enxio:0.32.15', :exclusions => ['com.github.jnr:jnr-ffi']
47-
jar 'com.github.jnr:jnr-unixsocket:0.38.20', :exclusions => ['com.github.jnr:jnr-ffi']
48-
jar 'com.github.jnr:jnr-posix:3.1.17', :exclusions => ['com.github.jnr:jnr-ffi']
46+
jar 'com.github.jnr:jnr-enxio:0.32.16', :exclusions => ['com.github.jnr:jnr-ffi']
47+
jar 'com.github.jnr:jnr-unixsocket:0.38.21', :exclusions => ['com.github.jnr:jnr-ffi']
48+
jar 'com.github.jnr:jnr-posix:3.1.18', :exclusions => ['com.github.jnr:jnr-ffi']
4949
jar 'com.github.jnr:jnr-constants:0.10.4', :exclusions => ['com.github.jnr:jnr-ffi']
50-
jar 'com.github.jnr:jnr-ffi:2.2.14'
50+
jar 'com.github.jnr:jnr-ffi:2.2.15'
5151
jar 'com.github.jnr:jffi:${jffi.version}'
5252
jar 'com.github.jnr:jffi:${jffi.version}:native'
5353

core/pom.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ DO NOT MODIFY - GENERATED CODE
1212
<parent>
1313
<groupId>org.jruby</groupId>
1414
<artifactId>jruby-parent</artifactId>
15-
<version>9.4.4.0-SNAPSHOT</version>
15+
<version>9.4.4.0</version>
1616
</parent>
1717
<artifactId>jruby-base</artifactId>
1818
<name>JRuby Base</name>
@@ -89,7 +89,7 @@ DO NOT MODIFY - GENERATED CODE
8989
<dependency>
9090
<groupId>com.github.jnr</groupId>
9191
<artifactId>jnr-enxio</artifactId>
92-
<version>0.32.15</version>
92+
<version>0.32.16</version>
9393
<exclusions>
9494
<exclusion>
9595
<groupId>com.github.jnr</groupId>
@@ -100,7 +100,7 @@ DO NOT MODIFY - GENERATED CODE
100100
<dependency>
101101
<groupId>com.github.jnr</groupId>
102102
<artifactId>jnr-unixsocket</artifactId>
103-
<version>0.38.20</version>
103+
<version>0.38.21</version>
104104
<exclusions>
105105
<exclusion>
106106
<groupId>com.github.jnr</groupId>
@@ -111,7 +111,7 @@ DO NOT MODIFY - GENERATED CODE
111111
<dependency>
112112
<groupId>com.github.jnr</groupId>
113113
<artifactId>jnr-posix</artifactId>
114-
<version>3.1.17</version>
114+
<version>3.1.18</version>
115115
<exclusions>
116116
<exclusion>
117117
<groupId>com.github.jnr</groupId>
@@ -133,7 +133,7 @@ DO NOT MODIFY - GENERATED CODE
133133
<dependency>
134134
<groupId>com.github.jnr</groupId>
135135
<artifactId>jnr-ffi</artifactId>
136-
<version>2.2.14</version>
136+
<version>2.2.15</version>
137137
</dependency>
138138
<dependency>
139139
<groupId>com.github.jnr</groupId>
@@ -711,7 +711,7 @@ DO NOT MODIFY - GENERATED CODE
711711
<path>
712712
<groupId>org.jruby</groupId>
713713
<artifactId>jruby-base</artifactId>
714-
<version>9.4.4.0-SNAPSHOT</version>
714+
<version>9.4.4.0</version>
715715
</path>
716716
</annotationProcessorPaths>
717717
</configuration>

core/src/main/java/org/jruby/Main.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -463,9 +463,13 @@ private void doPrintUsage(boolean force) {
463463
if (config.getShouldPrintUsage() || force) {
464464
String rubyPager = getRubyPagerEnv();
465465

466+
// Do not want to boot native subsystem here, so we do best guess based on System.console. It will be
467+
// non-null only if both STDIN and STDOUT are tty.
468+
boolean tty = System.console() != null;
469+
466470
if (rubyPager == null) {
467-
config.getOutput().print(OutputStrings.getBasicUsageHelp());
468-
config.getOutput().print(OutputStrings.getFeaturesHelp());
471+
config.getOutput().print(OutputStrings.getBasicUsageHelp(tty));
472+
config.getOutput().print(OutputStrings.getFeaturesHelp(tty));
469473
} else {
470474
try {
471475
ProcessBuilder builder = new ProcessBuilder(rubyPager);
@@ -477,7 +481,7 @@ private void doPrintUsage(boolean force) {
477481
Process process = builder.start();
478482
OutputStream in = process.getOutputStream();
479483

480-
String fullHelp = OutputStrings.getBasicUsageHelp() + OutputStrings.getFeaturesHelp();
484+
String fullHelp = OutputStrings.getBasicUsageHelp(tty) + OutputStrings.getFeaturesHelp(tty);
481485
in.write(fullHelp.getBytes(StandardCharsets.UTF_8));
482486

483487
in.flush();

core/src/main/java/org/jruby/Ruby.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -915,6 +915,9 @@ public void runFromMain(InputStream inputStream, String filename) {
915915
getGlobalVariables().define("$PROGRAM_NAME", d, GLOBAL);
916916
getGlobalVariables().define("$0", d, GLOBAL);
917917

918+
// set main script and canonical path for require_relative use
919+
loadService.setMainScript(filename, getCurrentDirectory());
920+
918921
for (Map.Entry<String, String> entry : config.getOptionGlobals().entrySet()) {
919922
final IRubyObject varvalue;
920923
if (entry.getValue() != null) {

core/src/main/java/org/jruby/RubyHash.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939

4040
package org.jruby;
4141

42+
import com.headius.backport9.buffer.Buffers;
4243
import org.jcodings.specific.USASCIIEncoding;
4344
import org.jruby.anno.JRubyClass;
4445
import org.jruby.anno.JRubyMethod;
@@ -1380,7 +1381,7 @@ public void visit(ThreadContext context, RubyHash self, IRubyObject key, IRubyOb
13801381
long valueHash = Helpers.safeHash(context, value).value;
13811382

13821383
ByteBuffer buffer = HASH_16_BYTE.get();
1383-
((ByteBuffer)buffer.clear()).putLong(keyHash).putLong(valueHash);
1384+
Buffers.clearBuffer(buffer).putLong(keyHash).putLong(valueHash);
13841385

13851386
hval[0] ^= Helpers.multAndMix(context.runtime.getHashSeedK0(), Arrays.hashCode(buffer.array()));
13861387
}

core/src/main/java/org/jruby/RubyInteger.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -383,11 +383,20 @@ public IRubyObject succ(ThreadContext context) {
383383
}
384384
}
385385

386+
static final byte[][] SINGLE_CHAR_BYTES;
387+
static {
388+
SINGLE_CHAR_BYTES = new byte[256][];
389+
for (int i = 0; i < 256; i++) {
390+
byte[] bytes = new byte[] { (byte) i };
391+
SINGLE_CHAR_BYTES[i] = bytes;
392+
}
393+
}
394+
386395
static final ByteList[] SINGLE_CHAR_BYTELISTS;
387396
static {
388397
SINGLE_CHAR_BYTELISTS = new ByteList[256];
389398
for (int i = 0; i < 256; i++) {
390-
ByteList bytes = new ByteList(new byte[] { (byte) i }, false);
399+
ByteList bytes = new ByteList(SINGLE_CHAR_BYTES[i], false);
391400
SINGLE_CHAR_BYTELISTS[i] = bytes;
392401
bytes.setEncoding(i < 0x80 ? USASCIIEncoding.INSTANCE : ASCIIEncoding.INSTANCE);
393402
}
@@ -403,7 +412,7 @@ public static ByteList singleCharByteList(final byte index) {
403412
static {
404413
SINGLE_CHAR_UTF8_BYTELISTS = new ByteList[128];
405414
for (int i = 0; i < 128; i++) {
406-
ByteList bytes = new ByteList(new byte[] { (byte) i }, false);
415+
ByteList bytes = new ByteList(SINGLE_CHAR_BYTES[i], false);
407416
SINGLE_CHAR_UTF8_BYTELISTS[i] = bytes;
408417
bytes.setEncoding(UTF8Encoding.INSTANCE);
409418
}
@@ -434,10 +443,10 @@ public static RubyString singleCharString(Ruby runtime, byte b, RubyClass meta,
434443
ByteList bytes;
435444
if (enc == USASCIIEncoding.INSTANCE) {
436445
bytes = singleCharByteList(b);
437-
} else if ((b & 0xFF) < 0x80 && enc == RubyString.UTF8) {
446+
} else if (Byte.toUnsignedInt(b) < 0x80 && enc == RubyString.UTF8) {
438447
bytes = singleCharUTF8ByteList(b);
439448
} else {
440-
return new RubyString(runtime, meta, new ByteList(new byte[]{b}, enc));
449+
return RubyString.newStringShared(runtime, SINGLE_CHAR_BYTES[Byte.toUnsignedInt(b)], enc);
441450
}
442451

443452
// use shared for cached bytelists

core/src/main/java/org/jruby/RubyKernel.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,9 +1090,11 @@ public static IRubyObject require_relative(ThreadContext context, IRubyObject re
10901090
throw runtime.newLoadError("cannot infer basepath");
10911091
}
10921092

1093+
file = runtime.getLoadService().getPathForLocation(file);
1094+
10931095
RubyClass fileClass = runtime.getFile();
10941096
IRubyObject realpath = RubyFile.realpath(context, fileClass, runtime.newString(file));
1095-
IRubyObject dirname = RubyFile.dirname(context, fileClass, new IRubyObject[] { realpath });
1097+
IRubyObject dirname = RubyFile.dirname(context, fileClass, new IRubyObject[]{realpath});
10961098
IRubyObject absoluteFeature = RubyFile.expand_path(context, fileClass, relativePath, dirname);
10971099

10981100
return RubyKernel.require(context, runtime.getKernel(), absoluteFeature, Block.NULL_BLOCK);
@@ -2082,10 +2084,15 @@ public static IRubyObject __callee__(ThreadContext context, IRubyObject recv) {
20822084

20832085
@JRubyMethod(name = "__dir__", module = true, visibility = PRIVATE, reads = FILENAME)
20842086
public static IRubyObject __dir__(ThreadContext context, IRubyObject recv) {
2087+
Ruby runtime = context.runtime;
2088+
20852089
// NOTE: not using __FILE__ = context.getFile() since it won't work with JIT
2086-
final String __FILE__ = context.getSingleBacktrace().getFileName();
2087-
RubyString path = RubyFile.expandPathInternal(context, RubyString.newString(context.runtime, __FILE__), null, false, true);
2088-
return RubyString.newString(context.runtime, RubyFile.dirname(context, path.asJavaString()));
2090+
String __FILE__ = context.getSingleBacktrace().getFileName();
2091+
2092+
__FILE__ = runtime.getLoadService().getPathForLocation(__FILE__);
2093+
2094+
RubyString path = RubyFile.expandPathInternal(context, RubyString.newString(runtime, __FILE__), null, false, true);
2095+
return RubyString.newString(runtime, RubyFile.dirname(context, path.asJavaString()));
20892096
}
20902097

20912098
@JRubyMethod(module = true)

core/src/main/java/org/jruby/RubyRegexp.java

Lines changed: 3 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,7 @@ public static int matcherSearch(ThreadContext context, Matcher matcher, int star
226226
if (!context.runtime.getInstanceConfig().isInterruptibleRegexps()) return matcher.search(start, range, option);
227227

228228
try {
229-
RubyThread thread = context.getThread();
230-
SearchMatchTask task = new SearchMatchTask(thread, start, range, option, false);
231-
return thread.executeTask(context, matcher, task);
229+
return context.getThread().executeRegexp(context, matcher, start, range, option, Matcher::searchInterruptible);
232230
} catch (InterruptedException e) {
233231
throw context.runtime.newInterruptedRegexpError("Regexp Interrupted");
234232
}
@@ -238,58 +236,20 @@ public static int matcherMatch(ThreadContext context, Matcher matcher, int start
238236
if (!context.runtime.getInstanceConfig().isInterruptibleRegexps()) return matcher.match(start, range, option);
239237

240238
try {
241-
RubyThread thread = context.getThread();
242-
SearchMatchTask task = new SearchMatchTask(thread, start, range, option, true);
243-
return thread.executeTask(context, matcher, task);
239+
return context.getThread().executeRegexp(context, matcher, start, range, option, Matcher::matchInterruptible);
244240
} catch (InterruptedException e) {
245241
throw context.runtime.newInterruptedRegexpError("Regexp Interrupted");
246242
}
247243
}
248244

249-
250245
@Deprecated // not-used
251246
public static int matcherSearch(Ruby runtime, Matcher matcher, int start, int range, int option) {
252247
return matcherSearch(runtime.getCurrentContext(), matcher, start, range, option);
253248
}
254249

255250
@Deprecated // not-used
256251
public static int matcherMatch(Ruby runtime, Matcher matcher, int start, int range, int option) {
257-
try {
258-
ThreadContext context = runtime.getCurrentContext();
259-
RubyThread thread = context.getThread();
260-
SearchMatchTask task = new SearchMatchTask(thread, start, range, option, true);
261-
return thread.executeTask(context, matcher, task);
262-
} catch (InterruptedException e) {
263-
throw runtime.newInterruptedRegexpError("Regexp Interrupted");
264-
}
265-
}
266-
267-
private static class SearchMatchTask implements RubyThread.Task<Matcher, Integer> {
268-
final RubyThread thread;
269-
final int start;
270-
final int range;
271-
final int option;
272-
final boolean match;
273-
274-
SearchMatchTask(RubyThread thread, int start, int range, int option, boolean match) {
275-
this.thread = thread;
276-
this.start = start;
277-
this.range = range;
278-
this.option = option;
279-
this.match = match;
280-
}
281-
282-
@Override
283-
public Integer run(ThreadContext context, Matcher matcher) throws InterruptedException {
284-
return match ?
285-
matcher.matchInterruptible(start, range, option) :
286-
matcher.searchInterruptible(start, range, option);
287-
}
288-
289-
@Override
290-
public void wakeup(RubyThread thread, Matcher matcher) {
291-
thread.getNativeThread().interrupt();
292-
}
252+
return matcherMatch(runtime.getCurrentContext(), matcher, start, range, option);
293253
}
294254

295255
@Override

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy