View | Details | Raw Unified | Return to bug 16490 | Differences between
and this patch

Collapse All | Expand All

(-)src/library/methods/R/RMethodUtils.R (-8 / +4 lines)
Lines 483-498 Link Here
483
    value <- if(missing(where))
483
    value <- if(missing(where))
484
        .getGenericFromCache(f, where,  package) ## else NULL
484
        .getGenericFromCache(f, where,  package) ## else NULL
485
    if(is.null(value)) {
485
    if(is.null(value)) {
486
        if(is.character(f) && f %in% "as.double") f <- "as.numeric"
486
        value <- .Call(C_R_getGeneric, f, FALSE, as.environment(where), package) # This call errors on f == ""
487
        if(is.character(f) && !nzchar(f)) {
487
    } else {
488
            message("Empty function name in .getGeneric")
489
            dput(sys.calls())
490
        }
491
        value <- .Call(C_R_getGeneric, f, FALSE, as.environment(where), package)
492
        ## cache public generics (usually these will have been cached already
488
        ## cache public generics (usually these will have been cached already
493
        ## and we get to this code for non-exported generics)
489
        ## and we get to this code for non-exported generics)
494
        if(!is.null(value) && !is.null(vv <- get0(f, .GlobalEnv)) &&
490
        vv <- get0(f, .GlobalEnv)
495
           identical(vv, value))
491
        if(identical(vv, value))
496
            .cacheGeneric(f, value)
492
            .cacheGeneric(f, value)
497
    }
493
    }
498
    ##     if(is.null(value) && nzchar(package) && !identical(package, "base")) {
494
    ##     if(is.null(value) && nzchar(package) && !identical(package, "base")) {
(-)src/library/methods/R/SClasses.R (-5 / +1 lines)
Lines 239-249 Link Here
239
	.getClassFromCache(Class, where, package=package, resolve.msg=resolve.msg)
239
	.getClassFromCache(Class, where, package=package, resolve.msg=resolve.msg)
240
    ## else NULL # want to force a search for the metadata in this case (Why?)
240
    ## else NULL # want to force a search for the metadata in this case (Why?)
241
    if(is.null(value)) {
241
    if(is.null(value)) {
242
	cname <-
242
	cname <- classMetaName(Class[[1L]])
243
	    classMetaName(if(length(Class) > 1L)
244
			  ## S3 class; almost certainly has no packageSlot,
245
			  ## but we'll continue anyway
246
			  Class[[1L]] else Class)
247
	## a string with a package slot strongly implies the class definition
243
	## a string with a package slot strongly implies the class definition
248
	## should be in that package.
244
	## should be in that package.
249
	if(identical(nzchar(package), TRUE)) {
245
	if(identical(nzchar(package), TRUE)) {

Return to bug 16490