Questions tagged [java-bridge-method]

30 questions
16
votes
2 answers

Two methods when implementing interface containing only one

I created interface TwoMethods. Source code: interface TwoMethods { public void method(T t); } Then I created class implementing this interface and after disassembling I saw 2 methods. Class: class A implements TwoMethods { @Override …
Pawel
  • 1,457
  • 1
  • 11
  • 22
10
votes
1 answer

Strange Default Method behavior with different Java versions

Let's say I have the following class hierarchy: interface Collection { Collection $plus(E element) } interface MutableCollection extends Collection { @Override MutableCollection $plus(E element) } interface Set
8
votes
2 answers

Reflection - Method::getGenericReturnType no generic - visbility

Description I have an odd issue in which Method::getGenericReturnType() is not able to retrieve the generic type information. Here is the minimized version: public class Test { public static void main(String[] args) { Method method =…
Zabuzard
  • 25,064
  • 8
  • 58
  • 82
7
votes
1 answer

Why does Java claim there's 2 declared methods when bounded generics are involved?

With the following definitions: public interface BaseService { T findOne(ID id); } public class BaseServiceImpl implements BaseService { @Override public T findOne(ID id) { return…
kaqqao
  • 12,984
  • 10
  • 64
  • 118
5
votes
2 answers

Writing Synthetic/Bridge method in java

I am writing an application which checks if the method is sythentic or bridge. For testing this application I have added various methods in my stub. But for none of the method this block is getting covered in the test case. Stub contains methods…
java_enthu
  • 2,279
  • 7
  • 44
  • 74
5
votes
1 answer

Why does the Java compiler add visibility bridge methods for public methods defined in package-private super types?

I am wondering why the Java compiler would add a bridge method for the foo method here: public class Outer { class SuperClass { public void foo() { } } public class SubClass extends SuperClass { } } The foo method is compiled to be…
Rafael Winterhalter
  • 42,759
  • 13
  • 108
  • 192
4
votes
1 answer

Run automtion anywhere bot even when runners are in sleep mode

I'm facing issues in running bot on a runner in RDP , the runner runs the bot when i have logged on it remotely but when i disconnect remote access , the commands like active window, screen shot, cloning etc fails. I want to run the bot without…
Abby
  • 149
  • 1
  • 8
3
votes
1 answer

How to find the declaring method of a bridge method?

Assume we have the following interface and implementations: interface Matcher{ boolean matches(T arg); } class NumberMatcher implements Matcher{ @Override public boolean matches(T arg){...} } class…
Chriss
  • 5,157
  • 7
  • 41
  • 75
3
votes
2 answers

Type Erasure tutorial on Java

I am reading the Generics trail on Oracle (Type Erasure) and I was not able to understand the following part. The code snippets are shown below: public class Node { public T data; public Node(T data) { this.data = data; } public…
MSS
  • 553
  • 2
  • 11
3
votes
0 answers

Running java jar classes with python using javabridge

I am trying to invoke some classes that are in jar file from python.I have set path and trying to run it like this : import javabridge as jv path=r'D:\myFiles\swinglibrary-1.9.5.jar' jars =…
3
votes
3 answers

Error: java.lang.AbstractMethodError when invoking a generic method implementing an interface

I am trying to use javassist to programatically create and compile a class (at runtime) that implements an interface. I get the following Error whenever I invoke an instance of that dynamic class: java.lang.AbstractMethodError:…
jespeno
  • 159
  • 1
  • 11
2
votes
1 answer

Fatal error using python-javabridge JVM in Celery thread with NLTK on Mac OS X

I am using the Python wrapper for Weka which is based on python-javabridge. I have a long task to perform and, therefore, I am using Celery to do so. The problem is I get A fatal error has been detected by the Java Runtime Environment: SIGSEGV…
Victor
  • 3,081
  • 2
  • 18
  • 20
2
votes
1 answer

Bridge methods in Java generics. Is this example correct?

Let's say I have this generic class: class Item { private T item; public void set(T item) { this.item = item; } public T get() { return item; } } If I create 2 instances like this: Item intItem = new…
Kami
  • 1,079
  • 2
  • 13
  • 28
1
vote
1 answer

Heroku fails to bundle python-javabridge (javahome not found)

I am trying to deploy my first Plotly Dash app (written in Python) to Heroku. I am having trouble with bundling up all the packages to compile the app, currently with Python-javabridge. When I try to deploy my app, even after deleting…
ISquared
  • 364
  • 4
  • 22
1
vote
1 answer

Unable to integrate java code to my react native project - error: incompatible types: ReactApplicationContext cannot be converted to Activity

I am trying to bridge java code with my react native project. My flow is this - when the user clicks on my pay button in react native, it routes to a page (which is a payment gateway) written in java and then when the user is done with the payment…
biggest_boy
  • 381
  • 4
  • 23
1
2