Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions generators/dotnet-oo-bindgen/src/class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,13 @@ pub(crate) fn generate(
xmldoc_print(f, &class.doc, lib)
})?;

let static_specifier = if class.is_static() { "static " } else { "" };
f.writeln(&format!("public {}class {}", static_specifier, classname))?;
let class_type = if class.is_static() {
"static"
} else {
"sealed"
};

f.writeln(&format!("public {} class {}", class_type, classname))?;
if class.destructor.is_some() {
f.write(": IDisposable")?;
}
Expand Down Expand Up @@ -141,7 +146,7 @@ fn generate_destructor(
f.newline()?;

// The IDisposable implementation
f.writeln("protected virtual void Dispose(bool disposing)")?;
f.writeln("private void Dispose(bool disposing)")?;
blocked(f, |f| {
f.writeln("if (this.disposed)")?;
f.writeln(" return;")?;
Expand Down
2 changes: 1 addition & 1 deletion generators/java-oo-bindgen/src/java/class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub(crate) fn generate(
documentation(f, |f| javadoc_print(f, &class.doc, lib))?;

// Class definition
f.writeln(&format!("public class {}", classname))?;
f.writeln(&format!("public final class {}", classname))?;
if class.destructor.is_some() {
f.write(" implements AutoCloseable")?;
}
Expand Down
2 changes: 1 addition & 1 deletion generators/java-oo-bindgen/src/java/constant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub(crate) fn generate(
documentation(f, |f| javadoc_print(f, &set.doc, lib))?;

// class definition
f.writeln(&format!("public class {}", set_name))?;
f.writeln(&format!("public final class {}", set_name))?;
blocked(f, |f| {
f.writeln("// not constructable")?;
f.writeln(&format!("private {}() {{}}", set_name))?;
Expand Down
2 changes: 1 addition & 1 deletion generators/java-oo-bindgen/src/java/structure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub(crate) fn generate(
documentation(f, |f| javadoc_print(f, &native_struct.doc(), lib))?;

// Structure definition
f.writeln(&format!("public class {}", struct_name))?;
f.writeln(&format!("public final class {}", struct_name))?;
blocked(f, |f| {
// Write Java structure elements
for el in native_struct.elements() {
Expand Down