• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

openmrs / openmrs-core / 14177712917

31 Mar 2025 05:35PM UTC coverage: 65.083% (+0.003%) from 65.08%
14177712917

push

github

ibacher
Restore debugging when using JDKs newer than 8

With JDK 9, Java's debugging shifted so that it's possible to specify not only the port, but also the IP address that the debugger should listen on. This adapts things to fit the new syntax that reflects this, but only if we're running JDK 9 or newer.

Theoretically, it would be possible to somehow calculate this at image build time, but this is pretty limited use-case.

23407 of 35965 relevant lines covered (65.08%)

0.65 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

69.05
/api/src/main/java/org/openmrs/Field.java
1
/**
2
 * This Source Code Form is subject to the terms of the Mozilla Public License,
3
 * v. 2.0. If a copy of the MPL was not distributed with this file, You can
4
 * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
5
 * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
6
 *
7
 * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
8
 * graphic logo is a trademark of OpenMRS Inc.
9
 */
10
package org.openmrs;
11

12
import java.util.HashSet;
13
import java.util.Set;
14

15
import org.codehaus.jackson.annotate.JsonIgnore;
16
import org.hibernate.envers.Audited;
17

18
/**
19
 * Field
20
 *
21
 * @version 1.0
22
 */
23
@Audited
24
public class Field extends BaseChangeableOpenmrsMetadata {
25
        
26
        public static final long serialVersionUID = 4454L;
27
        
28
        // Fields
29
        
30
        private Integer fieldId;
31
        
32
        private FieldType fieldType;
33
        
34
        private Concept concept;
35
        
36
        private String tableName;
37
        
38
        private String attributeName;
39
        
40
        private String defaultValue;
41
        
42
        private Boolean selectMultiple = false;
1✔
43
        
44
        private Set<FieldAnswer> answers;
45
        
46
        // Constructors
47
        
48
        /** default constructor */
49
        public Field() {
1✔
50
        }
1✔
51
        
52
        /** constructor with id */
53
        public Field(Integer fieldId) {
1✔
54
                this.fieldId = fieldId;
1✔
55
        }
1✔
56
        
57
        // Property accessors
58
        
59
        /**
60
         * @return Returns the fieldId.
61
         */
62
        public Integer getFieldId() {
63
                return fieldId;
1✔
64
        }
65
        
66
        /**
67
         * @param fieldId The fieldId to set.
68
         */
69
        public void setFieldId(Integer fieldId) {
70
                this.fieldId = fieldId;
1✔
71
        }
1✔
72
        
73
        /**
74
         * @return Returns the fieldType.
75
         */
76
        public FieldType getFieldType() {
77
                return fieldType;
1✔
78
        }
79
        
80
        /**
81
         * @param fieldType The fieldType to set.
82
         */
83
        public void setFieldType(FieldType fieldType) {
84
                this.fieldType = fieldType;
1✔
85
        }
1✔
86
        
87
        /**
88
         * @return Returns the concept.
89
         */
90
        public Concept getConcept() {
91
                return concept;
1✔
92
        }
93
        
94
        /**
95
         * @param concept The concept to set.
96
         */
97
        public void setConcept(Concept concept) {
98
                this.concept = concept;
1✔
99
        }
1✔
100
        
101
        /**
102
         * @return Returns the tableName.
103
         */
104
        public String getTableName() {
105
                return tableName;
1✔
106
        }
107
        
108
        /**
109
         * @param tableName The tableName to set.
110
         */
111
        public void setTableName(String tableName) {
112
                this.tableName = tableName;
1✔
113
        }
1✔
114
        
115
        /**
116
         * @return Returns the attributeName.
117
         */
118
        public String getAttributeName() {
119
                return attributeName;
1✔
120
        }
121
        
122
        /**
123
         * @param attributeName The attributeName to set.
124
         */
125
        public void setAttributeName(String attributeName) {
126
                this.attributeName = attributeName;
1✔
127
        }
1✔
128
        
129
        /**
130
         * @return Returns the default value.
131
         */
132
        public String getDefaultValue() {
133
                return defaultValue;
1✔
134
        }
135
        
136
        /**
137
         * @param defaultValue The defaultValue to set.
138
         */
139
        public void setDefaultValue(String defaultValue) {
140
                this.defaultValue = defaultValue;
1✔
141
        }
1✔
142
        
143
        /**
144
         * @deprecated as of 2.0, use {@link #getSelectMultiple()}
145
         */
146
        @Deprecated
147
        @JsonIgnore
148
        public Boolean isSelectMultiple() {
149
                return getSelectMultiple();
×
150
        }
151
        
152
        /**
153
         * @return Returns the selectMultiple.
154
         */
155
        public Boolean getSelectMultiple() {
156
                return selectMultiple;
1✔
157
        }
158
        
159
        /**
160
         * @param selectMultiple The selectMultiple to set.
161
         */
162
        public void setSelectMultiple(Boolean selectMultiple) {
163
                this.selectMultiple = selectMultiple;
1✔
164
        }
1✔
165
        
166
        /**
167
         * @return Returns the fieldAnswers.
168
         */
169
        public Set<FieldAnswer> getAnswers() {
170
                return answers;
1✔
171
        }
172
        
173
        /**
174
         * @param fieldAnswers The fieldAnswers to set.
175
         */
176
        public void setAnswers(Set<FieldAnswer> fieldAnswers) {
177
                this.answers = fieldAnswers;
×
178
        }
×
179
        
180
        /**
181
         * Adds a field answer to the list of field answers
182
         *
183
         * @param fieldAnswer FieldAnswer to be added
184
         */
185
        public void addAnswer(FieldAnswer fieldAnswer) {
186
                if (answers == null) {
×
187
                        answers = new HashSet<>();
×
188
                }
189
                if (!answers.contains(fieldAnswer) && fieldAnswer != null) {
×
190
                        answers.add(fieldAnswer);
×
191
                }
192
        }
×
193
        
194
        /**
195
         * Removes a field answer from the list of field answers
196
         *
197
         * @param fieldAnswer FieldAnswer to be removed
198
         */
199
        public void removeAnswer(FieldAnswer fieldAnswer) {
200
                if (answers != null) {
×
201
                        answers.remove(fieldAnswer);
×
202
                }
203
        }
×
204
        
205
        /**
206
         * @since 1.5
207
         * @see org.openmrs.OpenmrsObject#getId()
208
         */
209
        @Override
210
        public Integer getId() {
211
                
212
                return getFieldId();
1✔
213
        }
214
        
215
        /**
216
         * @since 1.5
217
         * @see org.openmrs.OpenmrsObject#setId(java.lang.Integer)
218
         */
219
        @Override
220
        public void setId(Integer id) {
221
                setFieldId(id);
×
222
                
223
        }
×
224
        
225
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc