Code Duplication    Length = 19-19 lines in 6 locations

plugins/SparqlUpdateOutput/src/main/java/br/ufrj/ppgi/greco/kettle/SparqlUpdateInsertStepDialog.java 1 location

@@ 258-276 (lines=19) @@
255
		dispose();
256
	}
257
258
	private String[] getFields(int type) {
259
260
		List<String> result = new ArrayList<String>();
261
262
		try {
263
			RowMetaInterface inRowMeta = this.transMeta.getPrevStepFields(stepname);
264
265
			List<ValueMetaInterface> fields = inRowMeta.getValueMetaList();
266
267
			for (ValueMetaInterface field : fields) {
268
				if (field.getType() == type || type == -1)
269
					result.add(field.getName());
270
			}
271
272
		} catch (KettleStepException e) {
273
			e.printStackTrace();
274
		}
275
276
		return result.toArray(new String[result.size()]);
277
	}
278
}
279

plugins/SparqlRunQuery/src/main/java/br/ufrj/ppgi/greco/kettle/SparqlRunQueryStepDialog.java 1 location

@@ 240-258 (lines=19) @@
237
		dispose();
238
	}
239
240
	private String[] getFields(int type) {
241
242
		List<String> result = new ArrayList<String>();
243
244
		try {
245
			RowMetaInterface inRowMeta = this.transMeta.getPrevStepFields(stepname);
246
247
			List<ValueMetaInterface> fields = inRowMeta.getValueMetaList();
248
249
			for (ValueMetaInterface field : fields) {
250
				if (field.getType() == type || type == -1)
251
					result.add(field.getName());
252
			}
253
254
		} catch (KettleStepException e) {
255
			e.printStackTrace();
256
		}
257
258
		return result.toArray(new String[result.size()]);
259
	}
260
261
}

plugins/DataPropertyMapping/src/main/java/br/ufrj/ppgi/greco/kettle/DataPropertyMappingStepDialog.java 1 location

@@ 196-214 (lines=19) @@
193
		return getFields(-1);
194
	}
195
196
	private String[] getFields(int type) {
197
198
		List<String> result = new ArrayList<String>();
199
200
		try {
201
			RowMetaInterface inRowMeta = this.transMeta.getPrevStepFields(stepname);
202
203
			List<ValueMetaInterface> fields = inRowMeta.getValueMetaList();
204
205
			for (ValueMetaInterface field : fields) {
206
				if (field.getType() == type || type == -1)
207
					result.add(field.getName());
208
			}
209
210
		} catch (KettleStepException e) {
211
			e.printStackTrace();
212
		}
213
214
		return result.toArray(new String[result.size()]);
215
	}
216
217
	// Adiciona listeners para widgets tratarem Enter

plugins/TurtleGenerator/src/main/java/br/ufrj/ppgi/greco/kettle/TurtleGeneratorStepDialog.java 1 location

@@ 163-181 (lines=19) @@
160
		return getFields(-1);
161
	}
162
163
	private String[] getFields(int type) {
164
165
		List<String> result = new ArrayList<String>();
166
167
		try {
168
			RowMetaInterface inRowMeta = this.transMeta.getPrevStepFields(stepname);
169
170
			List<ValueMetaInterface> fields = inRowMeta.getValueMetaList();
171
172
			for (ValueMetaInterface field : fields) {
173
				if (field.getType() == type || type == -1)
174
					result.add(field.getName());
175
			}
176
177
		} catch (KettleStepException e) {
178
			e.printStackTrace();
179
		}
180
181
		return result.toArray(new String[result.size()]);
182
	}
183
184
	// Adiciona listeners para widgets tratarem Enter

plugins/DataCube/src/main/java/br/ufrj/ppgi/greco/kettle/DataCubeStepDialog.java 1 location

@@ 152-170 (lines=19) @@
149
		return getFields(-1);
150
	}
151
152
	private String[] getFields(int type) {
153
154
		List<String> result = new ArrayList<String>();
155
156
		try {
157
			RowMetaInterface inRowMeta = this.transMeta.getPrevStepFields(stepname);
158
159
			List<ValueMetaInterface> fields = inRowMeta.getValueMetaList();
160
161
			for (ValueMetaInterface field : fields) {
162
				if (field.getType() == type || type == -1)
163
					result.add(field.getName());
164
			}
165
166
		} catch (KettleStepException e) {
167
			e.printStackTrace();
168
		}
169
170
		return result.toArray(new String[result.size()]);
171
	}
172
173

plugins/ObjectPropertyMapping/src/main/java/br/ufrj/ppgi/greco/kettle/ObjectPropertyMappingStepDialog.java 1 location

@@ 127-145 (lines=19) @@
124
		return getFields(-1);
125
	}
126
127
	private String[] getFields(int type) {
128
129
		List<String> result = new ArrayList<String>();
130
131
		try {
132
			RowMetaInterface inRowMeta = this.transMeta.getPrevStepFields(stepname);
133
134
			List<ValueMetaInterface> fields = inRowMeta.getValueMetaList();
135
136
			for (ValueMetaInterface field : fields) {
137
				if (field.getType() == type || type == -1)
138
					result.add(field.getName());
139
			}
140
141
		} catch (KettleStepException e) {
142
			e.printStackTrace();
143
		}
144
145
		return result.toArray(new String[result.size()]);
146
	}
147
148
	// Adiciona listeners para widgets tratarem Enter