Skip to content

Static variable improvements #197

@devinrsmith

Description

@devinrsmith
package com.example;

public class MyClass {

  public static final int FOO = 1;

  public static int BAR = 2;
}

jpy currently only maps final static variables for getting; we should be able to get static variables that are not final.

jpy currently does not allow setting static variables. (Easy to see there are no calls in this code base to SetStaticField Routines)

import jpy

_JMyClass = jpy.get_type("com.example.MyClass")

# works
foo = _JMyClass.FOO

# does not work
bar = _JMyClass.BAR

# does not work
_JMyClass.BAR = 42

Related to #191

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions