isConsSigSupported reports whether the generators can handle a given constructor signature.
(t types.Type)
| 353 | // isConsSigSupported reports whether the generators can handle a given |
| 354 | // constructor signature. |
| 355 | func (g *JavaGen) isConsSigSupported(t types.Type) bool { |
| 356 | if !g.isSigSupported(t) { |
| 357 | return false |
| 358 | } |
| 359 | // Skip constructors taking a single int32 argument |
| 360 | // since they clash with the proxy constructors that |
| 361 | // take a refnum. |
| 362 | params := t.(*types.Signature).Params() |
| 363 | if params.Len() != 1 { |
| 364 | return true |
| 365 | } |
| 366 | if t, ok := params.At(0).Type().(*types.Basic); ok { |
| 367 | switch t.Kind() { |
| 368 | case types.Int32, types.Uint32: |
| 369 | return false |
| 370 | } |
| 371 | } |
| 372 | return true |
| 373 | } |
| 374 | |
| 375 | // javaTypeName returns the class name of a given Go type name. If |
| 376 | // the type name clashes with the package class name, an underscore is |
no test coverage detected