auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public List<LdapUser> getUsersInGroup(String groupName, LdapContext context) throws NamingException { final SearchControls searchControls = new SearchControls(); searchControls.setSearchScope(_ldapConfiguration.getScope()); searchControls.setReturningAttributes(_ldapConfiguration.getReturnAttributes()); String basedn = _ldapConfiguration.getBaseDn(); if (StringUtils.isBlank(basedn)) { <START> throw new IllegalArgumentException("ldap basedn is not configured"); <END> } if (StringUtils.isBlank(groupName)) { throw new IllegalArgumentException("ldap group name cannot be blank"); } NamingEnumeration<SearchResult> results = context.search(basedn, generateADGroupSearchFilter(groupName), searchControls); final List<LdapUser> users = new ArrayList<LdapUser>(); while (results.hasMoreElements()) { final SearchResult result = results.nextElement(); users.add(createUser(result)); } return users; }</code><technical_language>Basedn a required config? In case validated while configuring ldap manager time operations</technical_language>

Target:
public List<LdapUser> getUsersInGroup(String groupName, LdapContext context) throws NamingException { if (StringUtils.isBlank(groupName)) { throw new IllegalArgumentException("ldap group name cannot be blank"); } String basedn = _ldapConfiguration.getBaseDn(); if (StringUtils.isBlank(basedn)) { throw new IllegalArgumentException("ldap basedn is not configured"); } final SearchControls searchControls = new SearchControls(); searchControls.setSearchScope(_ldapConfiguration.getScope()); searchControls.setReturningAttributes(_ldapConfiguration.getReturnAttributes()); NamingEnumeration<SearchResult> results = context.search(basedn, generateADGroupSearchFilter(groupName), searchControls); final List<LdapUser> users = new ArrayList<LdapUser>(); while (results.hasMoreElements()) { final SearchResult result = results.nextElement(); users.add(createUser(result)); } return users; }
Source:
<code>CompactionDetails getCompactionDetails(BlobStore blobStore) throws StoreException { long usedCapacity = blobStore.getSizeInBytes(); long totalCapacity = blobStore.getCapacityInBytes(); CompactionDetails details = null; if (usedCapacity > (storeConfig.storeMinLogSizeToTriggerCompactionInPercent * totalCapacity / 100)) { List<String> potentialLogSegments = blobStore.getLogSegmentsOutsideJournal(); <START> if (potentialLogSegments != null && potentialLogSegments.size() > 0) { <END> details = new CompactionDetails(blobStore.getTime().milliseconds() - messageRetentionTimeInMs, potentialLogSegments); } } return details; }</code><technical_language>API BlobStore tighter. return null return 0 sized lists - either-or</technical_language>

Target:
CompactionDetails getCompactionDetails(BlobStore blobStore) throws StoreException { long usedCapacity = blobStore.getSizeInBytes(); long totalCapacity = blobStore.getCapacityInBytes(); CompactionDetails details = null; if (usedCapacity >= (storeConfig.storeMinUsedCapacityToTriggerCompactionInPercentage / 100.0) * totalCapacity) { List<String> potentialLogSegments = blobStore.getLogSegmentsNotInJournal(); if (potentialLogSegments != null) { details = new CompactionDetails(time.milliseconds() - messageRetentionTimeInMs, potentialLogSegments); } } return details; }
Source:
<code>protected void onMethodInvocationFound(MethodInvocationTree mit) { <START> if (mit.symbol().name().equals("isPresent")) { <END> handleIsPresent(mit); } else if (mit.symbol().name().equals("anyMatch")) { handleAnyMatch(mit); } }</code><technical_language>I extract mit.symbol().name() in a dedicated variable recompute in worst case scenario</technical_language>

Target:
protected void onMethodInvocationFound(MethodInvocationTree mit) { String methodName = mit.symbol().name(); if (methodName.equals("isPresent")) { handleIsPresent(mit); } else if (methodName.equals("anyMatch")) { handleAnyMatch(mit); } }
Source:
<code>public static Map<String, Set<Object>> deserializeToMap(FieldsDescriptor fieldsDescriptor, JSONObject dpou) { Map<String, Set<Object>> keyToValues = Maps.newHashMap(); for (String key : fieldsDescriptor.getFields().getFields()) { if (!dpou.has(key)) { throw new IllegalArgumentException("The given key " + key + " is not contained in the given JSON"); } Type type = fieldsDescriptor.getType(key); Set<Object> keyValues = Sets.newHashSet(); keyToValues.put(key, keyValues); Object keyValue; try { keyValue = dpou.get(key); } catch (JSONException ex) { throw new IllegalStateException("This should never happen", ex); } if (keyValue instanceof JSONArray) { JSONArray ja = (JSONArray) keyValue; for (int index = 0; index < ja.length(); index++) { Object val = getFieldFromJSON(type, ja, index); <START> keyValues.add(val); <END> } } else if (keyValue instanceof JSONObject) { throw new UnsupportedOperationException("Cannot extract objects from JSONObjects"); } else { Object val = getFieldFromJSON(fieldsDescriptor, key, dpou); keyValues.add(val); } } return keyToValues; }</code><technical_language>keyValues.add(getFieldFromJSON(type, ja, index));</technical_language>

Target:
public static Map<String, Set<Object>> deserializeToMap(FieldsDescriptor fieldsDescriptor, JSONObject dpou) { Map<String, Set<Object>> keyToValues = Maps.newHashMap(); for (String key : fieldsDescriptor.getFields().getFields()) { if (!dpou.has(key)) { throw new IllegalArgumentException("The given key " + key + " is not contained in the given JSON"); } Set<Object> keyValues; Object keyValue; try { keyValue = dpou.get(key); } catch (JSONException ex) { throw new IllegalStateException("This should never happen", ex); } if (keyValue instanceof JSONArray) { JSONArray ja = (JSONArray) keyValue; keyValues = Sets.newHashSetWithExpectedSize(ja.length()); Type type = fieldsDescriptor.getType(key); for (int index = 0; index < ja.length(); index++) { keyValues.add(getFieldFromJSON(type, ja, index)); } } else if (keyValue instanceof JSONObject) { throw new UnsupportedOperationException("Cannot extract objects from JSONObjects"); } else { keyValues = Sets.newHashSetWithExpectedSize(1); keyValues.add(getFieldFromJSON(fieldsDescriptor, key, dpou)); } keyToValues.put(key, keyValues); } return keyToValues; }
Source:
<code>public void testClient() throws Exception { for (File f : Objects.requireNonNull(SERVER_PORTS_DIR.listFiles())) { LineNumberReader reader = new LineNumberReader(new FileReader(f)); int port = Integer.parseInt(reader.readLine()); System.out.println("Validating java client to " + f.getName() + " - " + port); Transceiver client = new SocketTransceiver(new InetSocketAddress("localhost", port)); proxy = SpecificRequestor.getClient(Simple.class, client); TestProtocolSpecific proto = new TestProtocolSpecific(); proto.testHello(); proto.testEcho(); proto.testEchoBytes(); proto.testError(); System.out.println("Done! Validation java client to " + f.getName() + " - " + port); <START> reader.close(); <END> } }</code><technical_language>a try-with-resource pattern here</technical_language>

Target:
public void testClient() throws Exception { for (File f : Objects.requireNonNull(SERVER_PORTS_DIR.listFiles())) { try (LineNumberReader reader = new LineNumberReader(new FileReader(f))) { int port = Integer.parseInt(reader.readLine()); System.out.println("Validating java client to " + f.getName() + " - " + port); Transceiver client = new SocketTransceiver(new InetSocketAddress("localhost", port)); proxy = SpecificRequestor.getClient(Simple.class, client); TestProtocolSpecific proto = new TestProtocolSpecific(); proto.testHello(); proto.testEcho(); proto.testEchoBytes(); proto.testError(); System.out.println("Done! Validation java client to " + f.getName() + " - " + port); } } }
Source:
<code>Options(String[] args) throws CmdLineException { CmdLineParser parser = new CmdLineParser(this); parser.parseArgument(args); if (skipEmitRegExp != null) { skipEmitPattern = Pattern.compile(skipEmitRegExp); } depgraph = Depgraph.parseFrom(depgraphFiles); if (filterSourcesWithDepgraphs) { Set<String> merged = Sets.union(depgraph.getRoots(), depgraph.getNonroots()); arguments.retainAll(merged); } Set<String> allExterns = new LinkedHashSet<>(); allExterns.addAll(depgraph.getRootExterns()); if (!partialInput) { allExterns.addAll(depgraph.getNonrootExterns()); } allExterns.addAll(externs); externs = new ArrayList<>(allExterns); arguments.removeAll(externs); if (!strictDeps) { depgraph = depgraph.withNonrootsAsRoots(); } if (arguments.isEmpty() && externs.isEmpty()) { throw new CmdLineException(parser, "No files or externs were given"); } if (googProvidesFile != null) { try { knownGoogProvides.addAll(Files.readLines(new File(googProvidesFile), UTF_8)); } catch (IOException e) { throw new RuntimeException("Error reading goog provides file " + googProvidesFile, e); } } if (knownClassAliasesFile != null) { try { for (String line : Files.readLines(new File(knownClassAliasesFile), UTF_8)) { String[] alias = line.split(","); <START> knownClassAliases.put(alias[0], alias[1]); <END> } } catch (IOException e) { throw new RuntimeException( "Error reading known class aliases file " + knownClassAliasesFile, e); } } }</code><technical_language>add some basic checking here. If alias.length is != 2, throw some meaningful error</technical_language>

Target:
Options(String[] args) throws CmdLineException { CmdLineParser parser = new CmdLineParser(this); parser.parseArgument(args); if (skipEmitRegExp != null) { skipEmitPattern = Pattern.compile(skipEmitRegExp); } depgraph = Depgraph.parseFrom(depgraphFiles); if (filterSourcesWithDepgraphs) { Set<String> merged = Sets.union(depgraph.getRoots(), depgraph.getNonroots()); arguments.retainAll(merged); } Set<String> allExterns = new LinkedHashSet<>(); allExterns.addAll(depgraph.getRootExterns()); if (!partialInput) { allExterns.addAll(depgraph.getNonrootExterns()); } allExterns.addAll(externs); externs = new ArrayList<>(allExterns); arguments.removeAll(externs); if (!strictDeps) { depgraph = depgraph.withNonrootsAsRoots(); } if (arguments.isEmpty() && externs.isEmpty()) { throw new CmdLineException(parser, "No files or externs were given"); } if (googProvidesFile != null) { try { knownGoogProvides.addAll(Files.readLines(new File(googProvidesFile), UTF_8)); } catch (IOException e) { throw new RuntimeException("Error reading goog provides file " + googProvidesFile, e); } } if (knownClassAliasesFile != null) { try { for (String line : Files.readLines(new File(knownClassAliasesFile), UTF_8)) { String[] alias = line.split(","); if (alias.length != 2) { throw new RuntimeException( "Badly formatted mapping in known class aliases file: " + line); } knownClassAliases.put(alias[0], alias[1]); } } catch (IOException e) { throw new RuntimeException( "Error reading known class aliases file " + knownClassAliasesFile, e); } } }
Source:
<code>public void testFloats() { assertQueryUsingH2Cte("SELECT discount_real FROM lineitem_ex"); assertQueryUsingH2Cte("SELECT discount_real FROM lineitem_ex WHERE discount_real < 0.08"); assertQueryUsingH2Cte("SELECT count(*) FROM lineitem_ex WHERE tax_real > 0.1"); assertQueryUsingH2Cte("SELECT count(*) FROM lineitem_ex WHERE tax_real IS NOT NULL"); assertQueryUsingH2Cte("SELECT count(*) FROM lineitem_ex WHERE tax_real IS NULL"); <START> assertQueryUsingH2Cte("SELECT discount_real, tax_real FROM lineitem_ex"); <END> assertQueryUsingH2Cte("SELECT discount_real, tax_real FROM lineitem_ex WHERE tax_real < 0.03"); assertQueryUsingH2Cte("SELECT discount_real, tax_real FROM lineitem_ex WHERE ship_day = 1 AND ship_month = 1"); assertQueryUsingH2Cte("SELECT COUNT(*) FROM lineitem_ex WHERE discount_real IS NOT NULL AND tax_real > 0.001"); assertQueryUsingH2Cte("SELECT discount_real, tax_real FROM lineitem_ex WHERE discount_real > 0.01 AND tax_real > 0.01 AND (discount_real + tax_real) < 0.08"); }</code><technical_language>this query is necessary SELECT * lineitem_ex queries in other tests</technical_language>

Target:
public void testFloats() { assertQueryUsingH2Cte("SELECT discount_real, tax_real FROM lineitem_ex"); assertFilterProject("tax_real IS NOT NULL", "count(*)"); assertFilterProject("tax_real IS NULL", "count(*)"); assertFilterProject("tax_real > 0.1", "count(*)"); assertFilterProject("tax_real < 0.03", "discount_real, tax_real"); assertFilterProject("tax_real < 0.05 AND discount_real > 0.05", "discount_real"); assertFilterProject("tax_real = discount_real", "discount_real"); assertFilterProject("discount_real > 0.01 AND tax_real > 0.01 AND (discount_real + tax_real) < 0.08", "discount_real"); assertFilterProject("reals[1] > 0.01", "count(*)"); }
Source:
<code>static TestSource fromUri(URI uri) { Preconditions.notNull(uri, "URI must not be null"); if (CLASSPATH_SCHEME.equals(uri.getScheme())) { return ClasspathResourceSource.from(uri); } else if (METHOD_SCHEME.equals(uri.getScheme())) { return MethodSourceUtils.fromUri(uri); } <START> else { <END> return UriSource.from(uri); } }</code><technical_language>nit: please remove redundant else</technical_language>

Target:
static TestSource fromUri(URI uri) { Preconditions.notNull(uri, "URI must not be null"); if (CLASSPATH_SCHEME.equals(uri.getScheme())) { return ClasspathResourceSource.from(uri); } if (METHOD_SCHEME.equals(uri.getScheme())) { return MethodSourceSupport.from(uri); } return UriSource.from(uri); }
Source:
<code>protected GeckoDriverService createDriverService(File exe, int port, ImmutableList<String> args, ImmutableMap<String, String> environment) { try { <START> Duration timeout = (firefoxBinary == null) ? Duration.ofSeconds(45) : Duration.ofMillis(firefoxBinary.getTimeout()); <END> GeckoDriverService service = new GeckoDriverService(exe, port, args, environment, timeout); String firefoxLogFile = System.getProperty(FirefoxDriver.SystemProperty.BROWSER_LOGFILE); if (firefoxLogFile != null) { if ("/dev/stdout".equals(firefoxLogFile)) { service.sendOutputTo(System.out); } else if ("/dev/stderr".equals(firefoxLogFile)) { service.sendOutputTo(System.err); } else if ("/dev/null".equals(firefoxLogFile)) { service.sendOutputTo(ByteStreams.nullOutputStream()); } else { service.sendOutputTo(new FileOutputStream(firefoxLogFile)); } } else { if (getLogFile() != null) { service.sendOutputTo(new FileOutputStream(getLogFile())); } else { service.sendOutputTo(System.err); } } return service; } catch (IOException e) { throw new WebDriverException(e); } }</code><technical_language>change default timeout 20 45 seconds here. I realise XpiDriverService timeout binary (which is 45), preferable change behaviour here</technical_language>

Target:
protected GeckoDriverService createDriverService(File exe, int port, ImmutableList<String> args, ImmutableMap<String, String> environment) { try { GeckoDriverService service = new GeckoDriverService(exe, port, args, environment); String firefoxLogFile = System.getProperty(FirefoxDriver.SystemProperty.BROWSER_LOGFILE); if (firefoxLogFile != null) { if ("/dev/stdout".equals(firefoxLogFile)) { service.sendOutputTo(System.out); } else if ("/dev/stderr".equals(firefoxLogFile)) { service.sendOutputTo(System.err); } else if ("/dev/null".equals(firefoxLogFile)) { service.sendOutputTo(ByteStreams.nullOutputStream()); } else { service.sendOutputTo(new FileOutputStream(firefoxLogFile)); } } else { if (getLogFile() != null) { service.sendOutputTo(new FileOutputStream(getLogFile())); } else { service.sendOutputTo(System.err); } } return service; } catch (IOException e) { throw new WebDriverException(e); } }
Source:
<code>public Void processElement(ParserContext context, Element element) throws ConfigurationException { String phaseStr = element.getTextContent().trim(); Class<? extends RulePhase> phase = phaseFinder.findPhase(phaseStr); if (phase == null) { <START> String phasesListing = phaseFinder.getAvailablePhases().stream().map(clazz -> clazz.getSimpleName()).collect(Collectors.joining(System.lineSeparator())); <END> throw new IllegalArgumentException("Unrecognized phase \"" + phaseStr + "\". Available phases: \n " + phasesListing); } context.getBuilder().setPhase(phase); return null; }</code><technical_language>this changes keeping additional spaces. Is intentional</technical_language>

Target:
public Void processElement(ParserContext context, Element element) throws ConfigurationException { String phaseStr = element.getTextContent().trim(); Class<? extends RulePhase> phase = phaseFinder.findPhase(phaseStr); if (phase == null) { String phasesListing = phaseFinder.getAvailablePhases().stream().map(clazz -> clazz.getSimpleName()).collect(Collectors.joining(System.lineSeparator()+" ")); throw new IllegalArgumentException("Unrecognized phase \"" + phaseStr + "\". Available phases: \n " + phasesListing); } context.getBuilder().setPhase(phase); return null; }
Source:
<code>private ArrayList<String> readFile(MultipartFile file) throws IOException { BufferedReader br; ArrayList<String> subjectKeyList = new ArrayList<>(); String line; <START> InputStream is = file.getInputStream(); <END> br = new BufferedReader(new InputStreamReader(is)); while ((line = br.readLine()) != null && !(line.isEmpty())) { subjectKeyList.add(line); } return subjectKeyList; }</code><technical_language>Scanner instead large files loaded memory once: CSVParser csvFileParser = CSVParser.parse(new File("filePath"), csvFileFormat); for (CSVRecord csvRecord : csvFileParser) { ... // qualify csvRecord; output qualified row new file flush needed. }</technical_language>

Target:
private ArrayList<String> readFile(MultipartFile file) throws IOException { ArrayList<String> subjectKeyList = new ArrayList<>(); try(Scanner sc = new Scanner(file.getInputStream())){ String line; while (sc.hasNextLine()) { line = sc.nextLine(); subjectKeyList.add(line); } } catch (Exception e) { log.error("Exception with cause = {}", e.getCause(), e.getMessage()); } return subjectKeyList; }
Source:
<code>private void getRandomPage() { parent().getLoadStatusList().add(false); final int getLoadStatusListIndex = parent().getLoadStatusList().size() - 1; new RandomSummaryClient().request(WikipediaApp.getInstance().getWikiSite(), new RandomSummaryClient.Callback() { @Override public void onSuccess(@NonNull Call<RbPageSummary> call, @NonNull RbPageSummary pageSummary) { if (!isAdded()) { return; } setContents(pageSummary); <START> parent().getLoadStatusList().set(getLoadStatusListIndex, true); if (getPagerPosition() == parent().randomPager.getCurrentItem()) { parent().enableSaveShareButton(true); } <END> } @Override public void onError(@NonNull Call<RbPageSummary> call, @NonNull Throwable t) { if (!isAdded()) { return; } setErrorState(t); } }); }</code><technical_language>child a bit parent, parent is storing unnecessary state information children. If I suggest a cleaner approach: child store a boolean called "loadComplete" true loading finishes, a public method isLoadComplete() returns boolean. loading finishes, issues a callback function parent onChildLoaded(), parent decide do wants, based isLoadComplete() state of child</technical_language>

Target:
private void getRandomPage() { new RandomSummaryClient().request(WikipediaApp.getInstance().getWikiSite(), new RandomSummaryClient.Callback() { @Override public void onSuccess(@NonNull Call<RbPageSummary> call, @NonNull RbPageSummary pageSummary) { loadComplete = true; callback.onChildLoaded(); if (!isAdded()) { return; } setContents(pageSummary); } @Override public void onError(@NonNull Call<RbPageSummary> call, @NonNull Throwable t) { if (!isAdded()) { return; } setErrorState(t); } }); }
Source:
<code>private static String relativePathToZipCompliantName(Path path, boolean isDirectory) { log.trace("Generating zip-compliant filename from Path \"{}\", isDirectory: {}", path, isDirectory); <START> final char separator = '/'; <END> StringBuilder sb = new StringBuilder(); for (Path part : path) { sb.append(part); sb.append(separator); } if (sb.length() == 0) { log.trace("Path didn't have any name elements"); return path.toString(); } if (!isDirectory) { log.trace("Path wasn't a directory, removing trailing slash"); sb.deleteCharAt(sb.length() - 1); } return sb.toString(); }</code><technical_language>move this out of method private static final char ZIP_SEPARATOR = '/'</technical_language>

Target:
private static String relativePathToZipCompliantName(Path path, boolean isDirectory) { log.trace("Generating zip-compliant filename from Path \"{}\", isDirectory: {}", path, isDirectory); StringBuilder sb = new StringBuilder(); for (Path part : path) { sb.append(part); sb.append(ZIP_SEPARATOR); } if (!isDirectory) { log.trace("Path wasn't a directory, removing trailing slash"); sb.deleteCharAt(sb.length() - 1); } return sb.toString(); }
Source:
<code>private void prestartVms(Guid vmPoolId, int numOfVmsToPrestart) { List<VmPoolMap> vmPoolMaps = DbFacade.getInstance().getVmPoolDao() .getVmMapsInVmPoolByVmPoolIdAndStatus(vmPoolId, VMStatus.Down); int failedAttempts = 0; int prestartedVmsCounter = 0; final int maxFailedAttempts = Config.<Integer> getValue(ConfigValues.VmPoolMonitorMaxAttempts); Map<String, Integer> failureReasons = new HashMap<>(); if (vmPoolMaps != null && vmPoolMaps.size() > 0) { for (VmPoolMap map : vmPoolMaps) { if (failedAttempts < maxFailedAttempts && prestartedVmsCounter < numOfVmsToPrestart) { <START> ArrayList<String> <END> messages = new ArrayList<>(); if (prestartVm(map.getVmId(), messages)) { prestartedVmsCounter++; failedAttempts = 0; } else { failedAttempts++; collectVmPrestartFailureReasons(failureReasons, messages); } } else { logResultOfPrestartVms(prestartedVmsCounter, numOfVmsToPrestart, vmPoolId, failureReasons); break; } } } else { log.info("No Vms available for prestarting"); } }</code><technical_language>List</technical_language>

Target:
private void prestartVms(Guid vmPoolId, int numOfVmsToPrestart) { List<VmPoolMap> vmPoolMaps = DbFacade.getInstance().getVmPoolDao() .getVmMapsInVmPoolByVmPoolIdAndStatus(vmPoolId, VMStatus.Down); int failedAttempts = 0; int prestartedVmsCounter = 0; final int maxFailedAttempts = Config.<Integer> getValue(ConfigValues.VmPoolMonitorMaxAttempts); Map<String, Integer> failureReasons = new HashMap<>(); if (vmPoolMaps != null && vmPoolMaps.size() > 0) { for (VmPoolMap map : vmPoolMaps) { if (failedAttempts < maxFailedAttempts && prestartedVmsCounter < numOfVmsToPrestart) { List<String> messages = new ArrayList<>(); if (prestartVm(map.getVmId(), messages)) { prestartedVmsCounter++; failedAttempts = 0; } else { failedAttempts++; collectVmPrestartFailureReasons(failureReasons, messages); } } else { logResultOfPrestartVms(prestartedVmsCounter, numOfVmsToPrestart, vmPoolId, failureReasons); break; } } } else { log.info("No VMs available for prestarting"); } }
Source:
<code>public void run(StreamApplication app) { try { ExecutionPlan plan = getExecutionPlan(app); createStreams(plan.getIntermediateStreams()); if (plan.getJobConfigs().isEmpty()) { throw new SamzaException("No jobs to run."); } plan.getJobConfigs().forEach(jobConfig -> { log.debug("Starting job StreamProcessor with config {}", jobConfig.getName(), jobConfig); String processorId = getProcessorId(config); if (StringUtils.isEmpty(processorId)) { throw new SamzaException("processorId has to be defined when running StreamApplication locally."); } StreamProcessor processor = createStreamProcessor(processorId, jobConfig, app, new LocalStreamProcessorLifeCycleListener(processorId)); processor.start(); processors.add(processor); }); latch.await(); if (throwable.get() != null) { appStatus = ApplicationStatus.UnsuccessfulFinish; <START> throw throwable.get(); <END> } else { appStatus = ApplicationStatus.SuccessfulFinish; } } catch (Throwable t) { appStatus = ApplicationStatus.UnsuccessfulFinish; throw new SamzaException("Failed to run application", t); } finally { if (coordinationUtils != null) { coordinationUtils.reset(); } } }</code><technical_language>Wrap in a new exception throw</technical_language>

Target:
public void run(StreamApplication app) { try { ExecutionPlan plan = getExecutionPlan(app); writePlanJsonFile(plan.getPlanAsJson()); createStreams(plan.getIntermediateStreams()); if (plan.getJobConfigs().isEmpty()) { throw new SamzaException("No jobs to run."); } plan.getJobConfigs().forEach(jobConfig -> { log.debug("Starting job StreamProcessor with config {}", jobConfig.getName(), jobConfig); LocalStreamProcessorLifeCycleListener listener = new LocalStreamProcessorLifeCycleListener(); StreamProcessor processor = createStreamProcessor(jobConfig, app, listener); listener.setProcessor(processor); processors.add(processor); }); numProcessorsToStart.set(processors.size()); processors.forEach(StreamProcessor::start); } catch (Exception e) { throw new SamzaException("Failed to start application", e); } }
Source:
<code>public void testparseDeadlineStringStartEnd() { <START> String repeatable1 = "[users:john]@[R2/2019-05-27T17:00:00Z/2019-05-27T13:00:00Z]"; <END> List<Deadline> deadlines = HumanTaskHandlerHelper.parseDeadlineString(repeatable1, null, null); assertNotNull(deadlines); assertEquals(2, deadlines.size()); long diff = Math.abs(deadlines.get(1).getDate().getTime() - deadlines.get(0).getDate().getTime()); long diffHours = TimeUnit.HOURS.convert(diff, TimeUnit.MILLISECONDS); assertEquals(diffHours, 4); }</code><technical_language>this work (though decrease millis repetition of a duration duration negative), is basically invalid ISO expression (start is end)</technical_language>

Target:
public void testparseDeadlineStringStartEnd() { String repeatable1 = "[users:john]@[R2/2019-05-27T13:00:00Z/2019-05-27T17:00:00Z]"; List<Deadline> deadlines = HumanTaskHandlerHelper.parseDeadlineString(repeatable1, null, null, false); assertNotNull(deadlines); assertEquals(2, deadlines.size()); long diff = Math.abs(deadlines.get(1).getDate().getTime() - deadlines.get(0).getDate().getTime()); long diffHours = TimeUnit.HOURS.convert(diff, TimeUnit.MILLISECONDS); assertEquals(diffHours, 4); }
Source:
<code>public ScoredDocuments rerank(ScoredDocuments docs, RerankerContext context) { assert (docs.documents.length == docs.scores.length); IndexSearcher searcher = context.getIndexSearcher(); Query finalQuery = reformulateQuery(docs, context); Query filterQuery = null; TopDocs rs = null; if (this.condenseListGenerator .equals(QUERY_FILTER_RESCORER) || this.condenseListGenerator.equals(DOC_FILTER_RESCORER)) { filterQuery = this.condenseListGenerator.equals(QUERY_FILTER_RESCORER)? context.getQuery(): FilterQueryBuilder.buildSetQuery(LuceneDocumentGenerator.FIELD_ID, getFieldValues(docs, LuceneDocumentGenerator.FIELD_ID, searcher)); rs = rescoreWithTieBreaker(finalQuery,filterQuery,context,searcher); <START> }else if (this.condenseListGenerator.equals(HIT_RESCORER)){ <END> QueryRescorer rm3Rescoer = new RM3QueryRescorer(finalQuery); try { rs = rm3Rescoer.rescore(searcher,docs.topDocs,context.getSearchArgs().hits); } catch (IOException e) { e.printStackTrace(); } } return rs==null? docs:ScoredDocuments.fromTopDocs(rs, searcher); }</code><technical_language>Space else if, small typo in rm3Rescoer</technical_language>

Target:
public ScoredDocuments rerank(ScoredDocuments docs, RerankerContext context) { assert (docs.documents.length == docs.scores.length); IndexSearcher searcher = context.getIndexSearcher(); Query finalQuery = reformulateQuery(docs, context); Query filterQuery = null; TopDocs rs = null; if (this.condenseListGenerator .equals(QUERY_FILTER) || this.condenseListGenerator.equals( DOC_FILTER)) { filterQuery = this.condenseListGenerator.equals(QUERY_FILTER)? context.getQuery(): FilterQueryBuilder.buildSetQuery(LuceneDocumentGenerator.FIELD_ID, getFieldValues(docs, LuceneDocumentGenerator.FIELD_ID, searcher)); rs = rescoreWithTieBreaker(finalQuery,filterQuery,context,searcher); } else if (this.condenseListGenerator.equals(HIT_RESCORER)){ QueryRescorer rm3Rescoer = new RM3QueryRescorer(finalQuery); try { rs = rm3Rescoer.rescore(searcher,docs.topDocs,context.getSearchArgs().hits); } catch (IOException e) { e.printStackTrace(); } } return rs==null? docs:ScoredDocuments.fromTopDocs(rs, searcher); }
Source:
<code>public static void loadValue(ITimeGraphPresentationProvider presentationProvider, StateItem stateItem) { IPreferenceStore store = getStore(); String rgbKey = getRgbKey(presentationProvider, stateItem); String widthKey = getWidthKey(presentationProvider, stateItem); Map<String, Object> styleMap = stateItem.getStyleMap(); RGB defaultRgb = stateItem.getStateColor(); String defaultString = store.getDefaultString(rgbKey); <START> if(defaultString.isEmpty()) <END> { store.setDefault(rgbKey, new RGBAColor(defaultRgb.red, defaultRgb.green, defaultRgb.blue, 255).toString()); } int rgbColor = store.getInt(rgbKey); float defaultHeight = isLink(stateItem) ? 0.1f : 1.0f; float defaultWidth = (float) stateItem.getStyleMap().getOrDefault(ITimeEventStyleStrings.heightFactor(), defaultHeight); store.setDefault(widthKey, defaultWidth); float width = store.getFloat(widthKey); styleMap.put(ITimeEventStyleStrings.fillColor(), rgbColor); styleMap.put(ITimeEventStyleStrings.heightFactor(), width); }</code><technical_language>space</technical_language>

Target:
public static void loadValue(ITimeGraphPresentationProvider presentationProvider, StateItem stateItem) { IPreferenceStore store = getStore(); String rgbKey = getRgbKey(presentationProvider, stateItem); String widthKey = getWidthKey(presentationProvider, stateItem); Map<String, Object> styleMap = stateItem.getStyleMap(); RGB defaultRgb = stateItem.getStateColor(); String defaultString = store.getDefaultString(rgbKey); if (defaultString.isEmpty()) { store.setDefault(rgbKey, new RGBAColor(defaultRgb.red, defaultRgb.green, defaultRgb.blue, 255).toString()); } String rgbColor = store.getString(rgbKey); if (store.getInt(ITimeEventStyleStrings.heightFactor()) == 0) { float defaultHeight = isLink(stateItem) ? 0.1f : 1.0f; float defaultWidth = (float) stateItem.getStyleMap().getOrDefault(ITimeEventStyleStrings.heightFactor(), defaultHeight); store.setDefault(widthKey, defaultWidth); } float width = store.getFloat(widthKey); RGBAColor rgba = RGBAColor.fromString(rgbColor); if (rgba != null) { styleMap.put(ITimeEventStyleStrings.fillColor(), rgba.toInt()); styleMap.put(ITimeEventStyleStrings.heightFactor(), width); } }
Source:
<code>public Iterator<Vector2ic> iterator() { return new Iterator<Vector2ic>() { private int radius = 1; private int leg; private int x = -1; private int y; private int index; private Vector2i pos = new Vector2i(); @Override public Vector2ic next() { if (index >= maxArea) { throw new NoSuchElementException("radius has been reached"); } switch (leg) { case 0: ++x; if (x == radius) { ++leg; } break; case 1: ++y; if (y == radius) { ++leg; } break; case 2: --x; if (-x == radius) { ++leg; } break; case 3: --y; if (-y == radius) { leg = 0; ++radius; } break; } index++; int finalX = center.x() + x * scale; int finalY = center.y() + (clockwise ? y : -y) * scale; <START> pos.set(finalX, finalY); return pos; <END> } @Override public boolean hasNext() { return index < maxArea; } @Override public void remove() { throw new UnsupportedOperationException("remove"); } }; }</code><technical_language>return new Vector2i(finalX, finalY)</technical_language>

Target:
public Iterator<Vector2ic> iterator() { return new Iterator<Vector2ic>() { private int radius = 1; private int leg; private int x = -1; private int y; private int index; private final Vector2i pos = new Vector2i(); @Override public Vector2ic next() { if (index >= maxArea) { throw new NoSuchElementException("radius has been reached"); } switch (leg) { case 0: ++x; if (x == radius) { ++leg; } break; case 1: ++y; if (y == radius) { ++leg; } break; case 2: --x; if (-x == radius) { ++leg; } break; case 3: --y; if (-y == radius) { leg = 0; ++radius; } break; } index++; int finalX = center.x() + x * scale; int finalY = center.y() + (clockwise ? y : -y) * scale; pos.set(finalX, finalY); return pos; } @Override public boolean hasNext() { return index < maxArea; } @Override public void remove() { throw new UnsupportedOperationException("remove"); } }; }
Source:
<code>public Description matchVariable(VariableTree tree, VisitorState state) { <START> if (JMOCK_MOCKERY_MATCHER.matches(tree, state) && !(FIELD_A_RULE_ANNOTATION_MATHER.matches(tree, state) || CLASS_USING_JMOCK_RUNNER_MATCHER.matches(tree, state))) { <END> return describeMatch(tree); } return Description.NO_MATCH; }</code><technical_language>I restructure this as: java allOf( JMOCK_MOCKERY_MATCHER, not(anyOf(FIELD_A_RULE_ANNOTATION_MATCHER, CLASS_USING_JMOCK_RUNNER_MATCHER))) Extract composite matcher out a field, here</technical_language>

Target:
public Description matchVariable(VariableTree tree, VisitorState state) { if (BUG_PATTERN_MATCHER.matches(tree, state)) { return describeMatch(tree); } return Description.NO_MATCH; }
Source:
<code>public StreamingOutput setSolr(@PathParam("command") final String command, @Context UriInfo uriInfo) throws JsonGenerationException, JsonMappingException, IOException { if (!"select".equals(command)) { throw new WebApplicationException(); } String query = uriInfo.getRequestUri().getRawQuery(); if (null == query) { <START> throw new WebApplicationException(); <END> } return new StringStreamingOutput(searchService.select(query)); }</code><technical_language>adding a message exception query supplied</technical_language>

Target:
public StreamingOutput setSolr(@PathParam("command") final String command, @Context UriInfo uriInfo) throws JsonGenerationException, JsonMappingException, IOException { if (!"select".equals(command)) { throw new WebApplicationException(Response.status(Status.BAD_REQUEST).entity("command not supported").build()); } String query = uriInfo.getRequestUri().getRawQuery(); if (null == query) { throw new WebApplicationException(Response.status(Status.BAD_REQUEST).entity("invalid query").build()); } ResultsWrapper results; try { results = searchService.select(query); } catch (Exception e) { throw new WebApplicationException(Response.serverError().entity("search not available").build()); } return new StringStreamingOutput(results); }
Source:
<code>private String writeToString() { StringBuilder buf = new StringBuilder(); int index = 0; for (HashMap.Entry<String, ValidWriteIdList> entry : validTablesWriteIdList.entrySet()) { buf.append(entry.getValue().writeToString()); index++; if (index < validTablesWriteIdList.size()) { <START> buf.append('$'); <END> } } return buf.toString(); }</code><technical_language>I table names $</technical_language>

Target:
private String writeToString() { StringBuilder buf = new StringBuilder(txnId.toString()); int index = 0; for (HashMap.Entry<String, ValidWriteIdList> entry : tablesValidWriteIdList.entrySet()) { if (index < tablesValidWriteIdList.size()) { buf.append('$'); } buf.append(entry.getValue().writeToString()); index++; } return buf.toString(); }
Source:
<code>public static List<String> getLocalesKeys(ConfigValues configValues) { if (!configValues.equals(ConfigValues.UnsupportedLocalesFilter) && !configValues.equals(ConfigValues.UnsupportedLocalesFilterOverrides)) { throw new IllegalArgumentException("Passed in config value not related to locales"); } List<String> locales = Config.<List<String>> getValue(configValues); List<String> result = new ArrayList<String>(); if (locales != null && !locales.isEmpty()) { for (String localeKey: locales) { try { String underScoredLocaleKey = localeKey.replaceAll("-", "_"); <START> org.apache.commons.lang.LocaleUtils.toLocale(underScoredLocaleKey); <END> result.add(underScoredLocaleKey); } catch (IllegalArgumentException iae) { log.info("Invalid locale found in configuration: " + localeKey); } } } return result; }</code><technical_language>Please add import avoid fully-qualified class references. Also, simply do this: Locale parsedLocale = LocaleUtils.toLocale(underScoredLocaleKey); result.add(parsedLocale.toString());</technical_language>

Target:
public static List<String> getLocalesKeys(ConfigValues configValues) { if (!configValues.equals(ConfigValues.UnsupportedLocalesFilter) && !configValues.equals(ConfigValues.UnsupportedLocalesFilterOverrides)) { throw new IllegalArgumentException("Passed in config value not related to locales"); } List<String> locales = Config.<List<String>> getValue(configValues); List<String> result = new ArrayList<String>(); if (locales != null && !locales.isEmpty()) { for (String localeKey: locales) { try { String underScoredLocaleKey = localeKey.replaceAll("-", "_"); LocaleUtils.toLocale(underScoredLocaleKey); result.add(underScoredLocaleKey); } catch (IllegalArgumentException iae) { log.info("Invalid locale found in configuration: " + localeKey); } } } return result; }
Source:
<code>public List<PermissionSubject> getPermissionCheckSubjects() { if (permissionCheckSubject == null) { permissionCheckSubject = new ArrayList<>(); if (getParameters().getTemplateType() != VmEntityType.INSTANCE_TYPE) { Guid storagePoolId = getCluster() == null ? null : getCluster().getStoragePoolId(); permissionCheckSubject.add(new PermissionSubject(storagePoolId, VdcObjectType.StoragePool, getActionType().getActionGroup())); <START> VmStatic vmFromParams = getParameters().getMasterVm(); Set<Guid> dedicatedVmForVdsFromVm = new HashSet<>(getVm().getDedicatedVmForVdsList()); Set<Guid> dedicatedVmForVdsFromUser = new HashSet<>(vmFromParams.getDedicatedVmForVdsList()); <END> if (!dedicatedVmForVdsFromVm.equals(dedicatedVmForVdsFromUser) || !StringUtils.isEmpty(vmFromParams.getCpuPinning())) { permissionCheckSubject.add( new PermissionSubject(storagePoolId, VdcObjectType.StoragePool, ActionGroup.EDIT_ADMIN_TEMPLATE_PROPERTIES)); } } else { permissionCheckSubject.add(new PermissionSubject(Guid.SYSTEM, VdcObjectType.System, getActionType().getActionGroup())); } } return permissionCheckSubject; }</code><technical_language>please inline. create members do equals hashset? Collections.disjoint(list, other)</technical_language>

Target:
public List<PermissionSubject> getPermissionCheckSubjects() { if (permissionCheckSubject == null) { permissionCheckSubject = new ArrayList<>(); if (getParameters().getTemplateType() != VmEntityType.INSTANCE_TYPE) { Guid storagePoolId = getCluster() == null ? null : getCluster().getStoragePoolId(); permissionCheckSubject.add(new PermissionSubject(storagePoolId, VdcObjectType.StoragePool, getActionType().getActionGroup())); if (!new HashSet<>(getParameters().getMasterVm().getDedicatedVmForVdsList()) .equals(new HashSet<>(getVm().getDedicatedVmForVdsList())) || !StringUtils.isEmpty(getParameters().getMasterVm().getCpuPinning())) { permissionCheckSubject.add( new PermissionSubject(storagePoolId, VdcObjectType.StoragePool, ActionGroup.EDIT_ADMIN_TEMPLATE_PROPERTIES)); } } else { permissionCheckSubject.add(new PermissionSubject(Guid.SYSTEM, VdcObjectType.System, getActionType().getActionGroup())); } } return permissionCheckSubject; }
Source:
<code>public byte[] loadContent(String id) { File file = getFileByPath(id); if (file.exists() && !file.isFile() && !ArrayUtils.isEmpty(file.listFiles())) { try { File destination = file.listFiles()[0]; return FileUtils.readFileToByteArray(destination); } catch (IOException e) { <START> <END> } } return null; }</code><technical_language>add log</technical_language>

Target:
public byte[] loadContent(String id) { File file = getFileByPath(id); if (file.exists() && !file.isFile() && !ArrayUtils.isEmpty(file.listFiles())) { try { File destination = file.listFiles()[0]; return FileUtils.readFileToByteArray(destination); } catch (IOException e) { log.error("Unable to laod content due to {}", e.getMessage(), e); } } return null; }
Source:
<code>public void configurePipeline(PipelineConfigurer pipelineConfigurer) throws IllegalArgumentException { super.configurePipeline(pipelineConfigurer); parseConfiguration(config.encode); Schema inputSchema = pipelineConfigurer.getStageConfigurer().getInputSchema(); if (inputSchema != null) { for (Schema.Field field : inputSchema.getFields()) { if (encodeMap.containsKey(field.getName())) { if (!field.getSchema().getType().equals(Schema.Type.BYTES) && !field.getSchema().getType().equals(Schema.Type.STRING)) { throw new IllegalArgumentException( <START> String.format("Field %s is of type %s in Input Schema, currently only String and Bytes can be encoded", <END> field.getName(), field.getSchema().getType())); } } } } try { Schema outputSchema = Schema.parseJson(config.schema); pipelineConfigurer.getStageConfigurer().setOutputSchema(outputSchema); } catch (IOException e) { throw new IllegalArgumentException("Format of schema specified is invalid. Please check the format."); } }</code><technical_language>error message for consistency: "Field %s of type bytes string. is currently of type %s"</technical_language>

Target:
public void configurePipeline(PipelineConfigurer pipelineConfigurer) throws IllegalArgumentException { super.configurePipeline(pipelineConfigurer); parseConfiguration(config.encode); Schema inputSchema = pipelineConfigurer.getStageConfigurer().getInputSchema(); if (inputSchema != null) { for (Schema.Field field : inputSchema.getFields()) { if (encodeMap.containsKey(field.getName())) { if (!field.getSchema().getType().equals(Schema.Type.BYTES) && !field.getSchema().getType().equals(Schema.Type.STRING)) { throw new IllegalArgumentException( String.format("Input field %s should be of type bytes or string. It is currently of type %s", field.getName(), field.getSchema().getType().toString())); } } } } try { Schema outputSchema = Schema.parseJson(config.schema); pipelineConfigurer.getStageConfigurer().setOutputSchema(outputSchema); } catch (IOException e) { throw new IllegalArgumentException("Format of schema specified is invalid. Please check the format."); } }
Source:
<code>private void validate() { Assert.isTrue(modules != null && modules.size() > 0, "at least one definition required"); ModuleType inferredType = null; if (modules.size() == 1) { inferredType = modules.get(0).getType(); } else { ModuleType firstType = modules.get(0).getType(); ModuleType lastType = modules.get(modules.size() - 1).getType(); boolean hasInput = (!firstType.equals(ModuleType.source)); boolean hasOutput = (!lastType.equals(ModuleType.sink)); if (hasInput && hasOutput) { inferredType = ModuleType.processor; } else if (hasInput) { inferredType = ModuleType.sink; } else if (hasOutput) { inferredType = ModuleType.source; } } <START> Assert.isTrue(inferredType == this.getType(), <END> "invalid composite module: inferred type=" + inferredType + ", stated type=" + this.getType()); }</code><technical_language>explain this happen</technical_language>

Target:
private void validate() { Assert.isTrue(modules != null && modules.size() > 0, "at least one definition required"); ModuleType inferredType = null; if (modules.size() == 1) { inferredType = modules.get(0).getType(); } else { ModuleType firstType = modules.get(0).getType(); ModuleType lastType = modules.get(modules.size() - 1).getType(); boolean hasInput = firstType != ModuleType.source; boolean hasOutput = lastType != ModuleType.sink; if (hasInput && hasOutput) { inferredType = ModuleType.processor; } else if (hasInput) { inferredType = ModuleType.sink; } else if (hasOutput) { inferredType = ModuleType.source; } } Assert.isTrue(inferredType == this.getType(), "invalid composite module: inferred type=" + inferredType + ", stated type=" + this.getType()); }
Source:
<code>public void onRequestUpdated(Request request) { if (pendingRequest == null) return; if (!request.getObjectId().equals(pendingRequest.getObjectId())) return; <START> if (request.getState().equals(Request.State.PENDING)) <END> ; if (request.getState().equals(Request.State.FULFILLED)) return; else onError(new IllegalStateException("Illegal Request State: " + request.getState().toString())); }</code><technical_language>Request.State.OPEN</technical_language>

Target:
public void onRequestUpdated(Request request) { if (openRequest == null) return; if (!request.getObjectId().equals(openRequest.getObjectId())) return; if (request.getState().equals(Request.State.OPEN)) return; if (request.getState().equals(Request.State.ACTIVE)) startRequestActiveActivity(); onError(new IllegalStateException("Illegal Request State: " + request.getState().toString())); }
Source:
<code>public DockerImageName apply(final DockerImageName original) { if (original.equals(DockerImageName.parse("registry.mycompany.com/mirror/mysql:8.0.22"))) { return defaultImageNameSubstitutor.apply(DockerImageName.parse("mysql")); } else { <START> return defaultImageNameSubstitutor.apply(original); <END> } }</code><technical_language>return original? priority of 1, I thought TestSpecificImageNameSubstitutor default (0) :)</technical_language>

Target:
public DockerImageName apply(final DockerImageName original) { if (original.equals(DockerImageName.parse("registry.mycompany.com/mirror/mysql:8.0.22"))) { return DockerImageName.parse("mysql"); } else { return original; } }
Source:
<code>public Time getTime(int columnIndex, Calendar cal) throws SQLException { try { String value = getString(columnIndex); <START> SimpleDateFormat dateFormat = new SimpleDateFormat(TIMESTAMP_FORMAT); <END> java.util.Date date = dateFormat.parse(value); cal.setTime(date); Time sqlTime = new Time(cal.getTimeInMillis()); return sqlTime; } catch (Exception e) { throw new SQLException("Unable to fetch date", e); } }</code><technical_language>cache this</technical_language>

Target:
public Time getTime(int columnIndex, Calendar cal) throws SQLException { try { String value = getString(columnIndex); return DateTimeUtils.getTimeFromString(value, cal); } catch (Exception e) { throw new SQLException("Unable to fetch date", e); } }
Source:
<code>public void open() { iPythonInterpreter = getIPythonInterpreter(); if (getProperty().getProperty("zeppelin.python.useIPython", "true").equals("true") && iPythonInterpreter.checkIPythonPrerequisite()) { try { iPythonInterpreter.open(); if (InterpreterContext.get() != null) { InterpreterContext.get().out.write(("IPython is available, " + "use IPython for PythonInterpreter\n") .getBytes()); } return; } catch (Exception e) { iPythonInterpreter = null; <START> } <END> } iPythonInterpreter = null; try { if (InterpreterContext.get() != null) { InterpreterContext.get().out.write(("IPython is not available, " + "use the native PythonInterpreter\n") .getBytes()); } } catch (IOException e) { LOG.warn(e.getMessage()); } InterpreterGroup intpGroup = getInterpreterGroup(); if (intpGroup != null && intpGroup.getInterpreterHookRegistry() != null) { registerHook(HookType.POST_EXEC_DEV, "__zeppelin__._displayhook()"); } try { createGatewayServerAndStartScript(); } catch (UnknownHostException e) { throw new InterpreterException(e); } }</code><technical_language>this in L241</technical_language>

Target:
public void open() { iPythonInterpreter = getIPythonInterpreter(); if (getProperty().getProperty("zeppelin.python.useIPython", "true").equals("true") && iPythonInterpreter.checkIPythonPrerequisite()) { try { iPythonInterpreter.open(); if (InterpreterContext.get() != null) { InterpreterContext.get().out.write(("IPython is available, " + "use IPython for PythonInterpreter\n") .getBytes()); } LOG.info("Use IPythonInterpreter to replace PythonInterpreter"); return; } catch (Exception e) { iPythonInterpreter = null; } } iPythonInterpreter = null; try { if (InterpreterContext.get() != null) { InterpreterContext.get().out.write(("IPython is not available, " + "use the native PythonInterpreter\n") .getBytes()); } } catch (IOException e) { LOG.warn("Fail to write InterpreterOutput", e.getMessage()); } InterpreterGroup intpGroup = getInterpreterGroup(); if (intpGroup != null && intpGroup.getInterpreterHookRegistry() != null) { registerHook(HookType.POST_EXEC_DEV, "__zeppelin__._displayhook()"); } try { createGatewayServerAndStartScript(); } catch (UnknownHostException e) { throw new InterpreterException(e); } }