Skip to content

Commit

Permalink
PIP-561 Fixed SonarQube feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
QuyenLy87 committed Nov 1, 2024
1 parent a524cec commit 6672021
Showing 1 changed file with 8 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,30 +1,16 @@
package org.ihtsdo.snomed.util.rf2.srsi;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import java.io.Writer;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.TreeSet;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.ihtsdo.snomed.util.rf2.srsi.Relationship.CHARACTERISTIC;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import static org.apache.commons.io.output.NullOutputStream.NULL_OUTPUT_STREAM;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import static org.apache.commons.io.output.NullOutputStream.INSTANCE;

/**
* Usage java -classpath /Users/Peter/code/snomed-utilities/target/snomed-utilities-1.0.10-SNAPSHOT.jar
Expand Down Expand Up @@ -462,7 +448,7 @@ private void outputFile(boolean dryRun) throws IOException {
LOGGER.info("Writing file to {} with effective time {}", (dryRun? "Dry Run Only" : outputFile), outputEffectiveTime);

try (Writer writer = new BufferedWriter(
new OutputStreamWriter(dryRun ? NULL_OUTPUT_STREAM: new FileOutputStream(outputFile), StandardCharsets.UTF_8))) {
new OutputStreamWriter(dryRun ? INSTANCE: new FileOutputStream(outputFile), StandardCharsets.UTF_8))) {
// Loop through all stated relationships and disable the replaced ones
// and output the replacements all with effective time which matches the output file

Expand Down

0 comments on commit 6672021

Please sign in to comment.