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 — ensure overloaded methods are registered as synchronized · justuni/java2python@4353f40

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • java2python
    • compiler
      • template.py
    • mod
      • basic.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎java2python/compiler/template.py‎

Copy file name to clipboardExpand all lines: java2python/compiler/template.py
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ def __init__(self, config, name=None, type=None, parent=None):
119119
self.children = []
120120
self.config = config
121121
self.decorators = []
122+
self.overloaded = None
122123
self.factory = Factory(config)
123124
self.modifiers = []
124125
self.name = name
Collapse file

‎java2python/mod/basic.py‎

Copy file name to clipboardExpand all lines: java2python/mod/basic.py
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,13 @@ def overloadedClassMethods(method):
109109
cls = method.parent
110110
methods = [o for o in cls.children if o.isMethod and o.name==method.name]
111111
if len(methods) == 1:
112+
if methods[0].overloaded:
113+
yield methods[0].overloaded
112114
return
113115
for i, m in enumerate(methods[1:]):
114116
args = [p['type'] for p in m.parameters]
115117
args = ', '.join(args)
116-
m.decorators.append('@{0}.register({1})'.format(method.name, args))
118+
m.overloaded = '@{0}.register({1})'.format(method.name, args)
117119
m.name = '{0}_{1}'.format(method.name, i)
118120
# for this one only:
119121
yield '@overloaded'

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.