GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test/fix overloaded synchronized methods · fuzz-security/java2python@7120676

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • java2python
    • config
      • default.py
    • mod/include
      • classmethod.py
  • test
    • Synchronized2.java
    • configs
      • defaults.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎java2python/config/default.py‎

Copy file name to clipboardExpand all lines: java2python/config/default.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@
9797
methodPrologueHandlers = [
9898
basic.maybeAbstractMethod,
9999
basic.maybeClassMethod,
100+
basic.overloadedClassMethods,
100101
# NB: synchronized should come after classmethod
101102
basic.maybeSynchronizedMethod,
102-
basic.overloadedClassMethods,
103103
]
104104

105105

Collapse file

‎java2python/mod/include/classmethod.py‎

Copy file name to clipboard
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class classmethod_(classmethod):
2+
""" Classmethod that provides attribute delegation.
3+
4+
"""
5+
def __getattr__(self, name):
6+
return getattr(self.__func__, name)
Collapse file

‎test/Synchronized2.java‎

Copy file name to clipboard
+36Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
class Synchronized2 {
2+
3+
public synchronized void test1() {
4+
System.out.println(1);
5+
}
6+
7+
public synchronized void test1(String s) {
8+
System.out.println(s);
9+
}
10+
11+
public static synchronized void test1(int i) {
12+
System.out.println(i);
13+
}
14+
15+
public static synchronized void test2() {
16+
System.out.println(2);
17+
}
18+
19+
public static synchronized void test2(String s) {
20+
System.out.println(s);
21+
}
22+
23+
public synchronized void test2(int i) {
24+
System.out.println(i);
25+
}
26+
27+
public static void main(String[] args) {
28+
Synchronized2 obj = new Synchronized2();
29+
obj.test1();
30+
obj.test1("test1");
31+
obj.test1(1);
32+
obj.test2();
33+
obj.test2("test2");
34+
obj.test2(2);
35+
}
36+
}
Collapse file

‎test/configs/defaults.py‎

Copy file name to clipboardExpand all lines: test/configs/defaults.py
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55

66
modulePrologueHandlers = default.modulePrologueHandlers + [
7+
'from java2python.mod.include.classmethod import classmethod_ as classmethod',
78
'from java2python.mod.include.overloading import overloaded',
89
'from abc import ABCMeta, abstractmethod',
910
'import zope.interface',

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.