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
1 change: 1 addition & 0 deletions go/otel/otelstef/exphistogramvalue.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions go/otel/otelstef/histogramvalue.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ void reset() {
negativeBuckets.reset();
}
zeroThreshold = 0.0;
optionalFieldsPresent = 0;
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ void reset() {
if (bucketCounts != null) {
bucketCounts.reset();
}
optionalFieldsPresent = 0;
}


Expand Down
14 changes: 14 additions & 0 deletions stefc/generator/testdata/optional_reset_fail.stef
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// This schema was failing (for seed 1765233907441407000) because
// optional struct fields were not reset correctly by reset() method.
package com.example.gentest.optional_reset_fail

multimap MultiMap1 {
key Struct1
value int64
}

struct Struct1 root {
Field1 bytes optional
Field2 MultiMap1
Field3 Struct1 optional
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1765234703981295000
3 changes: 3 additions & 0 deletions stefc/templates/go/struct.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ func (s *{{ $.StructName }}) reset() {
{{- end -}}
{{- end -}}
{{- end -}}
{{- if .OptionalFieldCount}}
s.optionalFieldsPresent = 0
{{- end}}
}

// fixParent sets the parentModifiedFields pointer to the supplied value.
Expand Down
3 changes: 3 additions & 0 deletions stefc/templates/java/struct.java.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ public class {{ .StructName }} {

{{- end }}
{{- end }}
{{- if .OptionalFieldCount}}
optionalFieldsPresent = 0;
{{- end}}
}

{{ range .Fields }}
Expand Down
Loading