Skip to content

Commit 2fd5929

Browse files
committed
getDescriptorNames() replicates the redundant code.
1 parent cd1a7d9 commit 2fd5929

File tree

1 file changed

+4
-17
lines changed
  • descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/molecular

1 file changed

+4
-17
lines changed

descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/molecular/BCUTDescriptor.java

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ public DescriptorValue calculate(IAtomContainer container) {
311311
int counter;
312312
IAtomContainer molecule;
313313
try {
314-
molecule = (IAtomContainer) container.clone();
314+
molecule = container.clone();
315315
} catch (CloneNotSupportedException e) {
316316
logger.debug("Error during clone");
317317
return getDummyDescriptorValue(new CDKException("Error occurred during clone " + e));
@@ -421,9 +421,6 @@ public DescriptorValue calculate(IAtomContainer container) {
421421
eigenDecomposition = new EigenvalueDecomposition(matrix);
422422
double[] eval3 = eigenDecomposition.getRealEigenvalues();
423423

424-
String[] names;
425-
String[] suffix = {"w", "c", "p"};
426-
427424
// return only the n highest & lowest eigenvalues
428425
int lnlow, lnhigh, enlow, enhigh;
429426
if (nlow > nheavy) {
@@ -471,19 +468,9 @@ public DescriptorValue calculate(IAtomContainer container) {
471468
for (int i = 0; i < enhigh; i++)
472469
retval.add(Double.NaN);
473470

474-
names = new String[3 * nhigh + 3 * nlow];
475-
counter = 0;
476-
for (String aSuffix : suffix) {
477-
for (int i = 0; i < nhigh; i++) {
478-
names[counter++] = "BCUT" + aSuffix + "-" + (i + 1) + "l";
479-
}
480-
for (int i = 0; i < nlow; i++) {
481-
names[counter++] = "BCUT" + aSuffix + "-" + (i + 1) + "h";
482-
}
483-
}
484-
485-
return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), retval,
486-
getDescriptorNames());
471+
return new DescriptorValue(getSpecification(), getParameterNames(),
472+
getParameters(), retval,
473+
getDescriptorNames());
487474
}
488475

489476
/**

0 commit comments

Comments
 (0)