Skip to content

Commit

Permalink
Remove all references to CompatVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Mar 12, 2024
1 parent 1491799 commit 9fa2334
Show file tree
Hide file tree
Showing 13 changed files with 1 addition and 120 deletions.
1 change: 0 additions & 1 deletion core/pom.rb
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@
'org/jruby/anno/AnnotationBinder.java',
'org/jruby/anno/JRubyMethod.java',
'org/jruby/anno/FrameField.java',
'org/jruby/CompatVersion.java',
'org/jruby/runtime/Visibility.java',
'org/jruby/util/CodegenUtils.java',
'org/jruby/util/SafePropertyAccessor.java' ] )
Expand Down
1 change: 0 additions & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,6 @@ DO NOT MODIFY - GENERATED CODE
<include>org/jruby/anno/AnnotationBinder.java</include>
<include>org/jruby/anno/JRubyMethod.java</include>
<include>org/jruby/anno/FrameField.java</include>
<include>org/jruby/CompatVersion.java</include>
<include>org/jruby/runtime/Visibility.java</include>
<include>org/jruby/util/CodegenUtils.java</include>
<include>org/jruby/util/SafePropertyAccessor.java</include>
Expand Down
53 changes: 0 additions & 53 deletions core/src/main/java/org/jruby/CompatVersion.java

This file was deleted.

9 changes: 0 additions & 9 deletions core/src/main/java/org/jruby/RubyInstanceConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -1946,15 +1946,6 @@ public boolean getIPv4Preferred() {
return Options.PREFER_IPV4.load();
}

@Deprecated
public CompatVersion getCompatVersion() {
return CompatVersion.RUBY2_1;
}

@Deprecated
public void setCompatVersion(CompatVersion compatVersion) {
}

@Deprecated
public boolean isJitDumping() {
return jitDumping;
Expand Down
2 changes: 0 additions & 2 deletions core/src/main/java/org/jruby/RubyModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -1307,8 +1307,6 @@ public void clump(final Method[] declaredMethods) {

if (anno == null) continue;

if (anno.compat() == org.jruby.CompatVersion.RUBY1_8) continue;

// skip bridge methods, as generated by JDK8 javac for e.g. return-value overloaded methods
if (method.isBridge()) continue;

Expand Down
2 changes: 0 additions & 2 deletions core/src/main/java/org/jruby/anno/AnnotationBinder.java
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,6 @@ public void processType(TypeElement cd) {

if (anno == null) continue;

if (anno.compat() == org.jruby.CompatVersion.RUBY1_8) continue;

methodCount++;

checkForThrows(cd, method);
Expand Down
2 changes: 0 additions & 2 deletions core/src/main/java/org/jruby/anno/IndyBinder.java
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,6 @@ public void processType(TypeElement cd) {
JRubyMethod anno = method.getAnnotation(JRubyMethod.class);
if (anno == null) continue;

if (anno.compat() == org.jruby.CompatVersion.RUBY1_8) continue;

methodCount++;

AnnotationBinder.checkForThrows(cd, method);
Expand Down
3 changes: 0 additions & 3 deletions core/src/main/java/org/jruby/anno/JRubyMethod.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,6 @@
@Deprecated
boolean scope() default false;

@Deprecated
org.jruby.CompatVersion compat() default org.jruby.CompatVersion.BOTH;

@Deprecated
boolean backtrace() default false;
}
Original file line number Diff line number Diff line change
Expand Up @@ -446,10 +446,4 @@ public interface EmbedRubyInstanceConfigAdapter {
* @return version information.
*/
public String getSupportedRubyVersion();

@Deprecated
public org.jruby.CompatVersion getCompatVersion();

@Deprecated
public void setCompatVersion(org.jruby.CompatVersion version);
}
12 changes: 1 addition & 11 deletions core/src/main/java/org/jruby/embed/ScriptingContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -441,8 +441,7 @@ public void setError(Writer writer) {

/**
* Returns a compile mode currently chosen, which is one of CompileMode.JIT,
* CompileMode.FORCE, CompileMode.OFF. The default mode is CompileMode.OFF
* if CompatVersion.RUBY1_9 is chosen, otherwise, CompileMode.JIT. Also,
* CompileMode.FORCE, CompileMode.OFF. The default mode is CompileMode.JIT. Also,
* CompileMode.OFF is chosen when a security restriction is set.
*
* @since JRuby 1.5.0.
Expand Down Expand Up @@ -1939,13 +1938,4 @@ private String createUri(ClassLoader cl, String ref) {
protected void addGemPath(String uri) {
runScriptlet( "require 'rubygems';Gem::Specification.add_dir '" + uri + "' unless Gem::Specification.dirs.member?( '" + uri + "' )" );
}

@Deprecated
public org.jruby.CompatVersion getCompatVersion() {
return provider.getRubyInstanceConfig().getCompatVersion();
}

@Deprecated
public void setCompatVersion(org.jruby.CompatVersion version) {
}
}
5 changes: 0 additions & 5 deletions core/src/main/java/org/jruby/management/ConfigMBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,4 @@ public interface ConfigMBean {
public boolean isFullTraceEnabled();
public boolean isShowBytecode();
public String getExcludedMethods();

@Deprecated
default String getCompatVersion() {
return org.jruby.CompatVersion.RUBY2_1.name();
}
}
24 changes: 0 additions & 24 deletions core/src/test/java/org/jruby/embed/ScriptingContainerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2686,28 +2686,4 @@ public void testJavadocExample4() {
// }
// }

// NOTE: test makes no sense on 9K
// @Test
// public void testSystemPropertyCatcherSetCompatVersion() {
// ScriptingContainer container;
//
// System.setProperty(PropertyName.COMPATVERSION.toString(), "1.8");
// container = new ScriptingContainer(LocalContextScope.THREADSAFE);
// org.jruby.embed.util.SystemPropertyCatcher.setConfiguration(container);
// assertEquals("1.8.7", container.runScriptlet("RUBY_VERSION"));
// container.terminate();
//
// System.setProperty(PropertyName.COMPATVERSION.toString(), "RUBY2_0");
// container = new ScriptingContainer(LocalContextScope.SINGLETHREAD);
// org.jruby.embed.util.SystemPropertyCatcher.setConfiguration(container);
// assertEquals("2.0.0", container.runScriptlet("RUBY_VERSION"));
// container.terminate();
//
// System.setProperty(PropertyName.COMPATVERSION.toString(), "1.9");
// container = new ScriptingContainer(LocalContextScope.SINGLETHREAD);
// org.jruby.embed.util.SystemPropertyCatcher.setConfiguration(container);
// assertEquals("1.9.3", container.runScriptlet("RUBY_VERSION"));
// container.terminate();
// }

}
1 change: 0 additions & 1 deletion core/src/test/java/org/jruby/test/TestMethodFactories.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
package org.jruby.test;


import org.jruby.CompatVersion;
import org.jruby.Ruby;
import org.jruby.RubyMethod;
import org.jruby.RubyModule;
Expand Down

0 comments on commit 9fa2334

Please sign in to comment.