Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f232a7780de6
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4a0eed602abb
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Aug 31, 2014

  1. Deprecate overloaded setProfile, prefer setProfilingMode

    The ScriptingContainer class contains two methods named `setProfile`,
    which differ only by their single argument type and do very different
    things from one another.  One of the two signatures accepts
    an argument of type `ProfilingMode`, which, in other places in the
    code, is exposed via more explicitly named accessor methods such as
    `getProfilingMode` and `setProfilingMode`.  I'm wondering if maybe
    the method in `ScriptingContainer` was simply accidentally mis-named.
    
    This commit deprecates the `setProfile(ProfilingMode)` method, and
    introduces a replacement method `setProfilingMode(ProfilingMode)`,
    which is more consistent with the rest of the code.
    cprice404 committed Aug 31, 2014
    Copy the full SHA
    05655cc View commit details

Commits on Nov 2, 2014

  1. Merge pull request #1934 from cprice404/maint/jruby-1_7/sc-set-profil…

    …ing-mode
    
    Deprecate overloaded `setProfile`, prefer `setProfilingMode`
    headius committed Nov 2, 2014
    Copy the full SHA
    4a0eed6 View commit details
Showing with 23 additions and 0 deletions.
  1. +23 −0 core/src/main/java/org/jruby/embed/ScriptingContainer.java
23 changes: 23 additions & 0 deletions core/src/main/java/org/jruby/embed/ScriptingContainer.java
Original file line number Diff line number Diff line change
@@ -761,12 +761,35 @@ public ProfilingMode getProfilingMode() {
*
* @since JRuby 1.6.6.
*
* @deprecated Use setProfilingMode instead
*
* @param mode a new profiling mode to be set.
*/
@Deprecated
public void setProfile(ProfilingMode mode) {
provider.getRubyInstanceConfig().setProfilingMode(mode);
}

/**
* Changes a ProfilingMode to a given one. The default value is Profiling.OFF.
* Call this method before you use put/get, runScriptlet, and parse methods so that
* initial configurations will work.
*
* ProfilingMode allows you to change profiling style.
*
* Profiling.OFF - default. profiling off.
* Profiling.API - activates Ruby profiler API. equivalent to --profile.api command line option
* Profiling.FLAT - synonym for --profile command line option equivalent to --profile.flat command line option
* Profiling.GRAPH - runs with instrumented (timed) profiling, graph format. equivalent to --profile.graph command line option.
*
* @since JRuby 1.7.15
*
* @param mode a new profiling mode to be set.
*/
public void setProfilingMode(ProfilingMode mode) {
provider.getRubyInstanceConfig().setProfilingMode(mode);
}

/**
* Returns a LoadServiceCreator currently used.
*