auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Object getAdapter(Class adapter) { if (adapter == IFile.class || adapter == IResource.class) { final IFile[] file = new IFile[1]; <START> Display.getDefault().syncExec(new Runnable() { <END> public void run() { Object selectedEdition = getSelectedEdition(); if (selectedEdition instanceof DiffNode) { DiffNode diffNode = (DiffNode) selectedEdition; ITypedElement element = diffNode.getLeft(); if (element instanceof ResourceEditableRevision) { ResourceEditableRevision resourceRevision = (ResourceEditableRevision) element; file[0] = resourceRevision.getFile(); } } } }); if (file[0] != null) { return file[0]; } } return super.getAdapter(adapter); }</code><technical_language>I prefer call syncExec() getAdapter(). getAdapter() called thread problem calling thread deadlocks UI thread is busy. I propose check IF in UI thread not, call getSelectedEdition() if in UI. BTW PlatformUI.getWorkbench().getDisplay() for that</technical_language>

Target:
public Object getAdapter(Class adapter) { if ((adapter == IFile.class || adapter == IResource.class) && isUIThread()) { Object selectedEdition = getSelectedEdition(); if (selectedEdition instanceof DiffNode) { DiffNode diffNode = (DiffNode) selectedEdition; ITypedElement element = diffNode.getLeft(); if (element instanceof ResourceEditableRevision) { ResourceEditableRevision resourceRevision = (ResourceEditableRevision) element; return resourceRevision.getFile(); } } } return super.getAdapter(adapter); }
Source:
<code>public void asLocal() { assertCurlOrPowershellv3Plus(); File tmpDir = new File(System.getProperty("java.io.tmpdir")); File jar = new File(tmpDir, "slave"+createRandomName()+".jar"); String command; if (SystemUtils.IS_OS_UNIX) { String java = "java"; String jh = System.getProperty("java.home"); if (!StringUtils.isEmpty(jh)) { <START> java = new File(jh, "bin/java").getAbsolutePath(); <END> } command = String.format( "sh -c 'curl -s -o %1$s %2$sjnlpJars/slave.jar && \"%3$s\" -jar %1$s'", jar, url("../../"), java ); } else { command = String.format("powershell -command \"& { " + "try { " + "Invoke-WebRequest %2$sjnlpJars/slave.jar -OutFile %1$s " + "} catch { " + "echo 'download of slave jar failed'; " + "exit 2 "+ "} " + "java -jar %1$s "+ "}\"", jar, url("../../") ); } setLauncher(CommandSlaveLauncher.class).command(command); }</code><technical_language>Safer check File.executable</technical_language>

Target:
public void asLocal() { assertCurlOrPowershellv3Plus(); File tmpDir = new File(System.getProperty("java.io.tmpdir")); File jar = new File(tmpDir, "slave"+createRandomName()+".jar"); String command; if (SystemUtils.IS_OS_UNIX) { command = String.format( "sh -c 'curl -s -o %1$s %2$sjnlpJars/slave.jar && java -jar %1$s'", jar, url("../../") ); } else { command = String.format("powershell -command \"& { " + "try { " + "Invoke-WebRequest %2$sjnlpJars/slave.jar -OutFile %1$s " + "} catch { " + "echo 'download of slave jar failed'; " + "exit 2 "+ "} " + "java -jar %1$s "+ "}\"", jar, url("../../") ); } setLauncher(CommandSlaveLauncher.class).command(command); }
Source:
<code>public void testExecuteBatchPreparedStatementFailBulkTypes() throws Exception { try (Connection conn = DriverManager.getConnection(connectionStr)) { PreparedStatement stmt = conn.prepareStatement("insert into test (id, string_field) values (?, ?)"); stmt.setInt(1, 2); <START> stmt.setString(2, "foo"); <END> stmt.addBatch(); stmt.setInt(1, 3); stmt.setString(2, "bar"); stmt.addBatch(); stmt.setInt(1, 1); stmt.setObject(2, newHashMap()); stmt.addBatch(); try { stmt.executeBatch(); fail("BatchUpdateException not thrown"); } catch (BatchUpdateException e) { assertThat( e.getMessage(), containsString("Validation failed for string_field: cannot be cast to type string") ); assertArrayEquals( new int[]{Statement.EXECUTE_FAILED, Statement.EXECUTE_FAILED, Statement.EXECUTE_FAILED}, e.getUpdateCounts() ); } conn.createStatement().execute("refresh table test"); ResultSet resultSet = conn.createStatement().executeQuery("select count(*) from test"); assertThat(resultSet.next(), is(true)); assertThat(resultSet.getLong(1), is(1L)); } }</code><technical_language>a id column enough, cast failure done column afaik</technical_language>

Target:
public void testExecuteBatchPreparedStatementFailBulkTypes() throws Exception { try (Connection conn = DriverManager.getConnection(connectionString)) { PreparedStatement stmt = conn.prepareStatement("insert into test (id) values (?)"); stmt.setObject(1, newHashMap()); stmt.addBatch(); try { stmt.executeBatch(); fail("BatchUpdateException not thrown"); } catch (BatchUpdateException e) { assertThat( e.getMessage(), containsString("Validation failed for id: cannot be cast to type integer") ); assertArrayEquals(new int[]{Statement.EXECUTE_FAILED}, e.getUpdateCounts()); } conn.createStatement().execute("refresh table test"); ResultSet resultSet = conn.createStatement().executeQuery("select count(*) from test"); assertThat(resultSet.next(), is(true)); assertThat(resultSet.getLong(1), is(0L)); } }
Source:
<code><START> private static byte[] fromHexString(final String encoded) { <END> final byte result[] = new byte[encoded.length()/2]; final char enc[] = encoded.toCharArray(); for (int i = 0; i < enc.length; i += 2) { StringBuilder curr = new StringBuilder(2); curr.append(enc[i]).append(enc[i + 1]); result[i/2] = (byte) Integer.parseInt(curr.toString(), 16); } return result; }</code><technical_language>This algorithm is pretty inefficient, array copying stringbuilding such. Suggest do enc array StringBuilder simply String hexPair = encoded.subString(i, i+2); This is sufficiently simplified for test code. For production code want do conversions avoid of memory allocation this is spin off</technical_language>

Target:
private static byte[] fromHexString(final String encoded) { final byte result[] = new byte[encoded.length()/2]; String hexPair; for (int i = 0; i < encoded.length(); i += 2) { hexPair = encoded.substring(i, i + 2); result[i/2] = (byte) Integer.parseInt(hexPair, 16); } return result; }
Source:
<code>private void registerService(Class<?> api, Object service, boolean saveInContext) { if (api == null) { throw new NullPointerException("The service key cannot be null"); } if (!api.isInstance(service)) { throw new IllegalArgumentException( "The service does not implement the given interface"); } if (isDisposed()) { IllegalStateException ex = new IllegalStateException("An attempt was made to register service " + service + " with implementation class " + api + " on a disposed service locator"); <START> WorkbenchPlugin.log(StatusUtil.newStatus(IStatus.ERROR, ex.getMessage(), ex)); <END> } if (service instanceof INestable && activated) { ((INestable) service).activate(); } services.put(api, service); if (saveInContext) { IEclipseContext context = e4Context; if (context == null) { return; } context.set(api.getName(), service); } }</code><technical_language>return here, right? Pretend happened</technical_language>

Target:
private void registerService(Class<?> api, Object service, boolean saveInContext) { if (api == null) { throw new NullPointerException("The service key cannot be null"); } if (!api.isInstance(service)) { throw new IllegalArgumentException( "The service does not implement the given interface"); } if (isDisposed()) { IllegalStateException ex = new IllegalStateException("An attempt was made to register service " + service + " with implementation class " + api + " on a disposed service locator"); WorkbenchPlugin.log(StatusUtil.newStatus(IStatus.ERROR, ex.getMessage(), ex)); return; } if (service instanceof INestable && activated) { ((INestable) service).activate(); } services.put(api, service); if (saveInContext) { IEclipseContext context = e4Context; if (context == null) { return; } context.set(api.getName(), service); } }
Source:
<code>public void testVisitAnyRequestFirst() { VisitedResourceRequestTracker tracker = new VisitedResourceRequestTracker(nodeTracker); <START> Assert.assertTrue(tracker.visit(anyRequest)); <END> Assert.assertFalse(tracker.visit(rackRequest)); Assert.assertFalse(tracker.visit(node1Request)); Assert.assertFalse(tracker.visit(node2Request)); }</code><technical_language>assertTrue() a message is evil</technical_language>

Target:
public void testVisitAnyRequestFirst() { VisitedResourceRequestTracker tracker = new VisitedResourceRequestTracker(nodeTracker); assertTrue(FIRST_CALL_FAILURE, tracker.visit(anyRequest)); assertFalse(ANY_VISITED + RACK_FAILURE, tracker.visit(rackRequest)); assertFalse(ANY_VISITED + NODE_FAILURE, tracker.visit(node1Request)); assertFalse(ANY_VISITED + NODE_FAILURE, tracker.visit(node2Request)); }
Source:
<code>public UserExtSource updateUserExtSource(PerunSession sess, UserExtSource userExtSource) throws InternalErrorException, UserExtSourceNotExistsException, PrivilegeException { Utils.checkPerunSession(sess); if(!AuthzResolver.isAuthorized(sess, Role.REGISTRAR)) { throw new PrivilegeException(sess, "updateUserExtSource"); } <START> if (getUsersManagerBl().checkUserExtSourceExistsById(sess, userExtSource.getId())) { <END> return getUsersManagerBl().updateUserExtSource(sess, userExtSource); } else { throw new UserExtSourceNotExistsException("UserExtSource: " + userExtSource); } }</code><technical_language>Check methods throw exception instead of returning value</technical_language>

Target:
public UserExtSource updateUserExtSource(PerunSession sess, UserExtSource userExtSource) throws InternalErrorException, UserExtSourceNotExistsException, UserExtSourceExistsException, PrivilegeException { Utils.checkPerunSession(sess); if(!AuthzResolver.isAuthorized(sess, Role.REGISTRAR)) { throw new PrivilegeException(sess, "updateUserExtSource"); } getUsersManagerBl().checkUserExtSourceExistsById(sess, userExtSource.getId()); try { getUsersManagerBl().checkUserExtSourceExists(sess, userExtSource); } catch (UserExtSourceNotExistsException ex) { } return getUsersManagerBl().updateUserExtSource(sess, userExtSource); }
Source:
<code>private NodeMetrics(final StreamsMetricsImpl metrics, final String processorNodeName, final ProcessorContext context) { this.metrics = metrics; final String taskName = context.taskId().toString(); final Map<String, String> tagMap = metrics.nodeLevelTagMap(context.taskId().toString(), processorNodeName); <START> final Map<String, String> allTagMap = <END> metrics.taskLevelTagMap(context.taskId().toString(), PROCESSOR_NODE_ID_TAG, ROLLUP_VALUE); nodeProcessTimeSensor = createTaskAndNodeLatencyAndThroughputSensors( "process", metrics, taskName, processorNodeName, allTagMap, tagMap ); nodePunctuateTimeSensor = createTaskAndNodeLatencyAndThroughputSensors( "punctuate", metrics, taskName, processorNodeName, allTagMap, tagMap ); nodeCreationSensor = createTaskAndNodeLatencyAndThroughputSensors( "create", metrics, taskName, processorNodeName, allTagMap, tagMap ); nodeDestructionSensor = createTaskAndNodeLatencyAndThroughputSensors( "destroy", metrics, taskName, processorNodeName, allTagMap, tagMap ); sourceNodeForwardSensor = createTaskAndNodeLatencyAndThroughputSensors( "forward", metrics, taskName, processorNodeName, allTagMap, tagMap ); this.taskName = taskName; this.processorNodeName = processorNodeName; }</code><technical_language>This is a node-level metrics technically speaking, node-tag pointing right? In call nodeLevelTagMap(context.taskId().toString(), ROLLUP_VALUE)</technical_language>

Target:
private NodeMetrics(final StreamsMetricsImpl metrics, final String processorNodeName, final ProcessorContext context) { this.metrics = metrics; final String threadId = Thread.currentThread().getName(); final String taskName = context.taskId().toString(); final Map<String, String> tagMap = metrics.nodeLevelTagMap(threadId, context.taskId().toString(), processorNodeName); final Map<String, String> allTagMap = metrics.nodeLevelTagMap(threadId, context.taskId().toString(), ROLLUP_VALUE); nodeProcessTimeSensor = createTaskAndNodeLatencyAndThroughputSensors( "process", metrics, threadId, taskName, processorNodeName, allTagMap, tagMap ); nodePunctuateTimeSensor = createTaskAndNodeLatencyAndThroughputSensors( "punctuate", metrics, threadId, taskName, processorNodeName, allTagMap, tagMap ); nodeCreationSensor = createTaskAndNodeLatencyAndThroughputSensors( "create", metrics, threadId, taskName, processorNodeName, allTagMap, tagMap ); nodeDestructionSensor = createTaskAndNodeLatencyAndThroughputSensors( "destroy", metrics, threadId, taskName, processorNodeName, allTagMap, tagMap ); sourceNodeForwardSensor = createTaskAndNodeLatencyAndThroughputSensors( "forward", metrics, threadId, taskName, processorNodeName, allTagMap, tagMap ); this.taskName = taskName; this.processorNodeName = processorNodeName; }
Source:
<code>public String getUrl(int requestId, CheckerInfo checkerInfo) { <START> return String.format(URL_TICKER, checkerInfo.getCurrencyBaseLowerCase()); <END> }</code><technical_language>Replace URL_TICKER URL</technical_language>

Target:
public String getUrl(int requestId, CheckerInfo checkerInfo) { return String.format(URL, checkerInfo.getCurrencyBaseLowerCase()); }
Source:
<code>private void setUserPreferences() { GUIPreferences guiPreferences = GUIPreferences.getInstance(); setSize(guiPreferences.getMechSelectorSizeWidth(), guiPreferences.getMechSelectorSizeHeight()); comboUnitType.setSelectedIndex(guiPreferences.getMechSelectorUnitType()); comboWeight.setSelectedIndex(guiPreferences.getMechSelectorWeightClass()); <START> updateTypeCombo(guiPreferences.getMechSelectorRulesLevels().replaceAll("\\[", "")); <END> List<SortKey> sortList = new ArrayList<>(); try { sortList.add(new SortKey(guiPreferences.getMechSelectorSortColumn(), SortOrder.valueOf(guiPreferences.getMechSelectorSortOrder()))); } catch (Exception e) { logger.error(getClass(), "setUserPreferences", "Failed to set based on user preferences, attempting to use default", e); sortList.add(new SortKey(guiPreferences.getMechSelectorDefaultSortColumn(), SortOrder.valueOf(guiPreferences.getMechSelectorDefaultSortOrder()))); } tableUnits.getRowSorter().setSortKeys(sortList); ((DefaultRowSorter<?, ?>) tableUnits.getRowSorter()).sort(); tableUnits.invalidate(); pack(); }</code><technical_language>is this replaced right bracket is replaced</technical_language>

Target:
private void setUserPreferences() { GUIPreferences guiPreferences = GUIPreferences.getInstance(); setSize(guiPreferences.getMechSelectorSizeWidth(), guiPreferences.getMechSelectorSizeHeight()); comboUnitType.setSelectedIndex(guiPreferences.getMechSelectorUnitType()); comboWeight.setSelectedIndex(guiPreferences.getMechSelectorWeightClass()); updateTypeCombo(guiPreferences); List<SortKey> sortList = new ArrayList<>(); try { sortList.add(new SortKey(guiPreferences.getMechSelectorSortColumn(), SortOrder.valueOf(guiPreferences.getMechSelectorSortOrder()))); } catch (Exception e) { logger.error(getClass(), "setUserPreferences", "Failed to set based on user preferences, attempting to use default", e); sortList.add(new SortKey(guiPreferences.getMechSelectorDefaultSortColumn(), SortOrder.valueOf(guiPreferences.getMechSelectorDefaultSortOrder()))); } tableUnits.getRowSorter().setSortKeys(sortList); ((DefaultRowSorter<?, ?>) tableUnits.getRowSorter()).sort(); tableUnits.invalidate(); pack(); }
Source:
<code>public void afterRun() throws Exception { if (recordStore.isWanReplicationEnabled()) { CacheRecord record = recordStore.getRecord(key); if (record != null) { publishWanUpdate(key, record); <START> } else { <END> publishWanRemove(key); } } super.afterRun(); }</code><technical_language>Do need guard null well</technical_language>

Target:
public void afterRun() throws Exception { if (recordStore == null) { return; } if (recordStore.isWanReplicationEnabled()) { CacheRecord record = recordStore.getRecord(key); if (record != null) { publishWanUpdate(key, record); } else { publishWanRemove(key); } } super.afterRun(); }
Source:
<code>public void readWithWrongPayloadType() throws Exception{ KryoMessageConverter kryoMessageConverter = new KryoMessageConverter(null,true); Message message = MessageBuilder.withPayload("foo").setHeader(MessageHeaders.CONTENT_TYPE,KryoMessageConverter.KRYO_MIME_TYPE+";type=java.lang.String").build(); <START> Object result = kryoMessageConverter.fromMessage(message,String.class); <END> }</code><technical_language>unused result variable. remove I guess</technical_language>

Target:
public void readWithWrongPayloadType() throws Exception{ KryoMessageConverter kryoMessageConverter = new KryoMessageConverter(null,true); Message message = MessageBuilder.withPayload("foo").setHeader(MessageHeaders.CONTENT_TYPE,KryoMessageConverter.KRYO_MIME_TYPE+";type=java.lang.String").build(); kryoMessageConverter.fromMessage(message,String.class); }
Source:
<code>public JmsConfiguration incomingWebServiceRequestsJmsConfiguration( final JmsConfigurationFactory jmsConfigurationFactory) { <START> return jmsConfigurationFactory.initializeReceiveConfiguration("jms.incoming.ws.requests", <END> this.incomingWebServiceRequestMessageListener); }</code><technical_language>I convinced references magic Strings 'jms.incoming.requests' accross MessagingConfig classes extending AbstractMessagingConfig replaced a single shared constant. values refer a prefix in a specific .properties configuration file. If single constant changed properties files looked changed well. code is now, change prefix in a single MessagingConfig changing prefix in single accompanying .properties configuration file. other hand, if pattern common prefixes is desirable, is more obvious shared constants</technical_language>

Target:
public JmsConfiguration incomingWebServiceRequestsJmsConfiguration( final JmsConfigurationFactory jmsConfigurationFactory) { return jmsConfigurationFactory.initializeReceiveConfiguration(JmsConfigurationNames.JMS_INCOMING_WS_REQUESTS, this.incomingWebServiceRequestMessageListener); }
Source:
<code>public void returnIterator() throws IOException { final String user = "testuser1"; final RepoCommits commits = new MkRepoCommits( new MkStorage.InFile(), user, new Coordinates.Simple(user, "testrepo1") ); MatcherAssert.assertThat( commits.iterate( Collections.<String, String>emptyMap() ), <START> Matchers.notNullValue() <END> ); }</code><technical_language>wrong indentation, forgot run build qulice profile enabled</technical_language>

Target:
public void returnIterator() throws IOException { final String user = "testuser1"; MatcherAssert.assertThat( new MkRepoCommits( new MkStorage.InFile(), user, new Coordinates.Simple(user, "testrepo1") ).iterate(Collections.<String, String>emptyMap()), Matchers.notNullValue() ); }
Source:
<code>private static void createItem(PDOutlineItem item, FeatureTreeNode root, FeaturesCollection collection, Set<PDOutlineItem> items) throws FeaturesTreeNodeException { if (item != null) { items.add(item); FeatureTreeNode itemNode = FeatureTreeNode.newChildInstance( "outline", root); PBCreateNodeHelper.addNotEmptyNode("title", item.getTitle(), itemNode); <START> FeatureTreeNode color = FeatureTreeNode.newChildInstance( <END> "color", itemNode); PDColor clr = item.getTextColor(); float[] rgb = clr.getComponents(); if (rgb.length == RGB_COLORS_NUMBER) { FeatureTreeNode.newChildInstanceWithValue("red", String.valueOf(rgb[RGB_RED_COLOR_NUMBER]), color); FeatureTreeNode.newChildInstanceWithValue("green", String.valueOf(rgb[RGB_GREEN_COLOR_NUMBER]), color); FeatureTreeNode.newChildInstanceWithValue("blue", String.valueOf(rgb[RGB_BLUE_COLOR_NUMBER]), color); } else { color.addAttribute(ErrorsHelper.ERRORID, ErrorsHelper.OUTLINESCOLOR_ID); ErrorsHelper.addErrorIntoCollection(collection, ErrorsHelper.OUTLINESCOLOR_ID, ErrorsHelper.OUTLINESCOLOR_MESSAGE); } FeatureTreeNode.newChildInstanceWithValue("italic", String.valueOf(item.isItalic()), itemNode); FeatureTreeNode.newChildInstanceWithValue("bold", String.valueOf(item.isBold()), itemNode); for (PDOutlineItem child : item.children()) { if (!items.contains(item)) { createItem(child, itemNode, collection, items); } } } }</code><technical_language>return if</technical_language>

Target:
private static void createItem(PDOutlineItem item, FeatureTreeNode root, FeaturesCollection collection, Set<PDOutlineItem> items) throws FeaturesTreeNodeException { if (item != null) { items.add(item); FeatureTreeNode itemNode = FeatureTreeNode.newChildInstance( "outline", root); PBCreateNodeHelper.addNotEmptyNode("title", item.getTitle(), itemNode); if (item.getTextColor() != null) { FeatureTreeNode color = FeatureTreeNode.newChildInstance( "color", itemNode); PDColor clr = item.getTextColor(); float[] rgb = clr.getComponents(); if (rgb.length == RGB_COLORS_NUMBER) { FeatureTreeNode.newChildInstanceWithValue("red", String.valueOf(rgb[RGB_RED_COLOR_NUMBER]), color); FeatureTreeNode.newChildInstanceWithValue("green", String.valueOf(rgb[RGB_GREEN_COLOR_NUMBER]), color); FeatureTreeNode.newChildInstanceWithValue("blue", String.valueOf(rgb[RGB_BLUE_COLOR_NUMBER]), color); } else { color.addAttribute(ErrorsHelper.ERRORID, ErrorsHelper.OUTLINESCOLOR_ID); ErrorsHelper.addErrorIntoCollection(collection, ErrorsHelper.OUTLINESCOLOR_ID, ErrorsHelper.OUTLINESCOLOR_MESSAGE); } } FeatureTreeNode.newChildInstanceWithValue("italic", String.valueOf(item.isItalic()), itemNode); FeatureTreeNode.newChildInstanceWithValue("bold", String.valueOf(item.isBold()), itemNode); for (PDOutlineItem child : item.children()) { if (!items.contains(item)) { createItem(child, itemNode, collection, items); } } } }
Source:
<code>private void recoverTempFiles(String logPath) { File logPathFile = new File(logPath).getParentFile(); File[] tempFiles = logPathFile.listFiles((dir, name) -> name.endsWith(TEMP_FILE_EXTENSION)); if (tempFiles != null) { for (File tempFile : tempFiles) { String newName = tempFile.getName().substring(0, tempFile.getName().length() - TEMP_FILE_EXTENSION.length()); File newFile = new File(tempFile.getParent(), newName + LOG_FILE_EXTENSION); if (!tempFile.renameTo(newFile)) { <START> reportError("Could not rename temp file [" + tempFile + "] to [" + newFile + "]", null, ErrorManager.OPEN_FAILURE); <END> } } } }</code><technical_language>String format</technical_language>

Target:
private void recoverTempFiles(String logPath) { File logPathFile = new File(logPath).getParentFile(); File[] tempFiles = logPathFile.listFiles((dir, name) -> name.endsWith(TEMP_FILE_EXTENSION)); if (tempFiles == null) { return; } for (File tempFile : tempFiles) { String newName = tempFile.getName().substring(0, tempFile.getName().length() - TEMP_FILE_EXTENSION.length()); File newFile = new File(tempFile.getParent(), newName + LOG_FILE_EXTENSION); if (!tempFile.renameTo(newFile)) { reportError(format("Could not rename temp file [%s] to [%s]", tempFile, newFile), null, ErrorManager.OPEN_FAILURE); } } }
Source:
<code>private void generateIBClassesFile(File installDir) throws IOException { List<String> customClasses = config.getCustomIBClasses(); if (!customClasses.isEmpty()) { <START> FileWriter fw = new FileWriter(new File(installDir, "ib.classes")); <END> String array = StringUtils.toString(customClasses.toArray(new String[customClasses.size()]), ","); fw.write(array); fw.close(); } }</code><technical_language>Again, try-with-resources</technical_language>

Target:
private void generateIBClassesFile(File installDir) throws IOException { List<String> customClasses = config.getCustomIBClasses(); if (!customClasses.isEmpty()) { try (FileWriter fw = new FileWriter(new File(installDir, "ib.classes"))) { String array = StringUtils.toString(customClasses.toArray(new String[customClasses.size()]), ","); fw.write(array); } } }
Source:
<code>protected void processEventChunk(ComplexEventChunk complexEventChunk, Processor nextProcessor, StreamEventCloner streamEventCloner, ComplexEventPopulater complexEventPopulater) { while (complexEventChunk.hasNext()) { ComplexEvent complexEvent = complexEventChunk.next(); Object[] outputData; switch (attributeExpressionLength) { case 0: outputData = process((Object) null); complexEventPopulater.populateComplexEvent(complexEvent, outputData); break; case 1: outputData = process(attributeExpressionExecutors[0].execute(complexEvent)); complexEventPopulater.populateComplexEvent(complexEvent, outputData); break; default: Object[] inputData = new Object[attributeExpressionLength]; for (int i = 0; i < attributeExpressionLength; i++) { inputData[i] = attributeExpressionExecutors[i].execute(complexEvent); } outputData = process(inputData); complexEventPopulater.populateComplexEvent(complexEvent, outputData); <START> break; <END> } } nextProcessor.process(complexEventChunk); }</code><technical_language>Damith, need add a break for default case bottom. specific reason for add a break for default</technical_language>

Target:
protected void processEventChunk(ComplexEventChunk complexEventChunk, Processor nextProcessor, StreamEventCloner streamEventCloner, ComplexEventPopulater complexEventPopulater) { while (complexEventChunk.hasNext()) { ComplexEvent complexEvent = complexEventChunk.next(); Object[] outputData; switch (attributeExpressionLength) { case 0: outputData = process((Object) null); complexEventPopulater.populateComplexEvent(complexEvent, outputData); break; case 1: outputData = process(attributeExpressionExecutors[0].execute(complexEvent)); complexEventPopulater.populateComplexEvent(complexEvent, outputData); break; default: Object[] inputData = new Object[attributeExpressionLength]; for (int i = 0; i < attributeExpressionLength; i++) { inputData[i] = attributeExpressionExecutors[i].execute(complexEvent); } outputData = process(inputData); complexEventPopulater.populateComplexEvent(complexEvent, outputData); } } nextProcessor.process(complexEventChunk); }
Source:
<code>private boolean isSnapshotUsed(VM vm) { <START> if (vm.isRunning() || vm.getStatus() == VMStatus.Paused) { <END> Set<Guid> volumeChain = imagesHandler.getVolumeChain(vm.getId(), vm.getRunOnVds(), getDiskImage()); if (volumeChain == null) { log.warn("Could not retrieve chain, skipping deletion"); return true; } if (volumeChain.contains(getDiskImage().getImageId())) { log.warn("Image '{}' appears to be in use by VM '{}', skipping deletion", getDiskImage().getImageId(), vm.getId()); return true; } } return false; }</code><technical_language>if status helpers a bit weird...but still, isRunningOrPaused work. !Down? sense check state all..</technical_language>

Target:
private boolean isSnapshotUsed(VM vm) { if (vm.isRunningOrPaused() && vm.getStatus() != VMStatus.WaitForLaunch) { Set<Guid> volumeChain = imagesHandler.getVolumeChain(vm.getId(), vm.getRunOnVds(), getDiskImage()); if (volumeChain == null) { log.warn("Could not retrieve chain, skipping deletion"); return true; } if (volumeChain.contains(getDiskImage().getImageId())) { log.warn("Image '{}' appears to be in use by VM '{}', skipping deletion", getDiskImage().getImageId(), vm.getId()); return true; } } return false; }
Source:
<code>private <P> Flowable<P> publish(IntSet segments, Function<ResultSet, Flowable<P>> function) { return Flowable.using(() -> { Connection connection = connectionFactory.getConnection(); connection.setAutoCommit(false); String sql; if (segments != null) { sql = tableManager.getLoadNonExpiredRowsSqlForSegments(segments.size()); } else { sql = tableManager.getLoadNonExpiredAllRowsSql(); } if (trace) { log.tracef("Running sql %s", sql); } return new KeyValuePair<>(connection, connection.prepareStatement(sql)); }, kvp -> { PreparedStatement ps = kvp.getValue(); int offset = 1; ps.setLong(offset, timeService.wallClockTime()); if (segments != null) { for (PrimitiveIterator.OfInt segIter = segments.iterator(); segIter.hasNext(); ) { ps.setInt(++offset, segIter.nextInt()); } } ps.setFetchSize(tableManager.getFetchSize()); ResultSet rs = ps.executeQuery(); return function.apply(rs).doOnComplete(() -> JdbcUtil.safeClose(rs)); }, kvp -> { JdbcUtil.safeClose(kvp.getValue()); Connection connection = kvp.getKey(); <START> connection.rollback(); <END> connectionFactory.releaseConnection(connection); }); }</code><technical_language>need catch this exception, ensure return connection pool. log similarly JdbcUtil#safeClose does</technical_language>

Target:
private <P> Flowable<P> publish(IntSet segments, Function<ResultSet, Flowable<P>> function) { return Flowable.using(() -> { String sql; if (segments != null) { sql = tableManager.getLoadNonExpiredRowsSqlForSegments(segments.size()); } else { sql = tableManager.getLoadNonExpiredAllRowsSql(); } if (trace) { log.tracef("Running sql %s", sql); } return new FlowableConnection(connectionFactory, sql); }, fc -> { PreparedStatement ps = fc.statement; int offset = 1; ps.setLong(offset, timeService.wallClockTime()); if (segments != null) { for (PrimitiveIterator.OfInt segIter = segments.iterator(); segIter.hasNext(); ) { ps.setInt(++offset, segIter.nextInt()); } } ps.setFetchSize(tableManager.getFetchSize()); ResultSet rs = ps.executeQuery(); return function.apply(rs).doOnComplete(() -> JdbcUtil.safeClose(rs)); }, FlowableConnection::close); }
Source:
<code>public Interval getSourceInterval() { if ( stop==null ) { if ( start!=null ) { return Interval.of(start.getTokenIndex(), start.getTokenIndex()-1); } else { <START> return Interval.of(0, -1); <END> } } return Interval.of(start.getTokenIndex(), stop.getTokenIndex()); }</code><technical_language>exclamation: This Interval.INVALID idea source interval is. Edit: this case is handled condition for beginning of method</technical_language>

Target:
public Interval getSourceInterval() { if ( start == null ) { return Interval.INVALID; } if ( stop==null || stop.getTokenIndex()<start.getTokenIndex() ) { return Interval.of(start.getTokenIndex(), start.getTokenIndex()-1); } return Interval.of(start.getTokenIndex(), stop.getTokenIndex()); }
Source:
<code>public boolean equals(Object o) { if (this == o) return true; <START> if (o == null || getClass() != o.getClass()) return false; <END> LegalInformationComplete that = (LegalInformationComplete) o; return content != null ? content.equals(that.content) : that.content == null; }</code><technical_language>if(!(o instanceof LegalInformationComplete)) is better, break equals contract in case of inheritance</technical_language>

Target:
public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof LegalInformationComplete)) return false; LegalInformationComplete that = (LegalInformationComplete) o; return content != null ? content.equals(that.content) : that.content == null; }
Source:
<code>public boolean isGround() { if (isGround == null) { <START> if (variableSet == null || !variableSet.isEmpty()) { <END> new IsGroundFieldInitializer().visitNode(this); } else { isGround = true; } } return isGround; }</code><technical_language>if (variableSet == null) {</technical_language>

Target:
public boolean isGround() { if (isGround == null) { if (variableSet == null) { new IsGroundFieldInitializer().visitNode(this); } else { isGround = variableSet.isEmpty(); } } return isGround; }
Source:
<code>public void newStreamWithData() throws Exception { HTTP2Client http2Client = new HTTP2Client(); http2Client.start(); SocketAddress serverAddress = new InetSocketAddress("localhost", 8080); CompletableFuture<Session> sessionCF = http2Client.connect(serverAddress, new Session.Listener.Adapter()); Session session = sessionCF.get(); <START> HttpFields.Mutable requestHeaders = HttpFields.build() <END> .put(HttpHeader.CONTENT_TYPE, "application/json"); MetaData.Request request = new MetaData.Request("POST", HttpURI.from("http://localhost:8080/path"), HttpVersion.HTTP_2, requestHeaders); HeadersFrame headersFrame = new HeadersFrame(request, null, false); CompletableFuture<Stream> streamCF = session.newStream(headersFrame, new Stream.Listener.Adapter()); Stream stream = streamCF.get(); String content1 = "{\"greet\": \"hello world\"}"; ByteBuffer buffer1 = StandardCharsets.UTF_8.encode(content1); String content2 = "{\"user\": \"jetty\"}"; ByteBuffer buffer2 = StandardCharsets.UTF_8.encode(content2); CompletableFuture<Stream> dataCF1 = stream.data(new DataFrame(stream.getId(), buffer1, false)); dataCF1.thenCompose(s -> s.data(new DataFrame(s.getId(), buffer2, true))); }</code><technical_language>Remove .Mutable</technical_language>

Target:
public void newStreamWithData() throws Exception { HTTP2Client http2Client = new HTTP2Client(); http2Client.start(); SocketAddress serverAddress = new InetSocketAddress("localhost", 8080); CompletableFuture<Session> sessionCF = http2Client.connect(serverAddress, new Session.Listener.Adapter()); Session session = sessionCF.get(); HttpFields requestHeaders = HttpFields.build() .put(HttpHeader.CONTENT_TYPE, "application/json"); MetaData.Request request = new MetaData.Request("POST", HttpURI.from("http://localhost:8080/path"), HttpVersion.HTTP_2, requestHeaders); HeadersFrame headersFrame = new HeadersFrame(request, null, false); CompletableFuture<Stream> streamCF = session.newStream(headersFrame, new Stream.Listener.Adapter()); Stream stream = streamCF.get(); String content1 = "{\"greet\": \"hello world\"}"; ByteBuffer buffer1 = StandardCharsets.UTF_8.encode(content1); String content2 = "{\"user\": \"jetty\"}"; ByteBuffer buffer2 = StandardCharsets.UTF_8.encode(content2); CompletableFuture<Stream> dataCF1 = stream.data(new DataFrame(stream.getId(), buffer1, false)); dataCF1.thenCompose(s -> s.data(new DataFrame(s.getId(), buffer2, true))); }
Source:
<code>private JobResult executeSchedulingTest(int numSlots) throws Exception { final Configuration configuration = new Configuration(); configuration.setString(RestOptions.BIND_PORT, "0"); configuration.setLong(JobManagerOptions.SLOT_REQUEST_TIMEOUT, 5000L); final MiniClusterConfiguration miniClusterConfiguration = new MiniClusterConfiguration.Builder() .setConfiguration(configuration) .setNumTaskManagers(1) .setNumSlotsPerTaskManager(numSlots) .build(); try (MiniCluster miniCluster = new MiniCluster(miniClusterConfiguration)) { <START> miniCluster.start(); <END> final MiniClusterClient miniClusterClient = new MiniClusterClient(configuration, miniCluster); final JobGraph jobGraph = createJobGraph(100); final JobID jobID = miniClusterClient.submitJob(jobGraph).get(); final CompletableFuture<JobResult> resultFuture = miniClusterClient.requestJobResult(jobID); final JobResult jobResult = resultFuture.get(); return jobResult; } }</code><technical_language>test need wait for 5s? 1s less</technical_language>

Target:
private JobResult executeSchedulingTest(int numSlots) throws Exception { final Configuration configuration = new Configuration(); configuration.setString(RestOptions.BIND_PORT, "0"); configuration.setLong(JobManagerOptions.SLOT_REQUEST_TIMEOUT, 5000L); configuration.setString(JobManagerOptions.SCHEDULING_STRATEGY, "region"); final MiniClusterConfiguration miniClusterConfiguration = new MiniClusterConfiguration.Builder() .setConfiguration(configuration) .setNumTaskManagers(1) .setNumSlotsPerTaskManager(numSlots) .build(); try (MiniCluster miniCluster = new MiniCluster(miniClusterConfiguration)) { miniCluster.start(); final MiniClusterClient miniClusterClient = new MiniClusterClient(configuration, miniCluster); final JobGraph jobGraph = createJobGraph(10); final JobID jobID = miniClusterClient.submitJob(jobGraph).get(); final CompletableFuture<JobResult> resultFuture = miniClusterClient.requestJobResult(jobID); final JobResult jobResult = resultFuture.get(); return jobResult; } }
Source:
<code>public void obtainNewAccessToken() throws InterruptedException, ExecutionException, TimeoutException { <START> new NetworkCallTask().execute(); <END> }</code><technical_language>creating ad-hoc instance of NetworkCallTask, is possibility for a TaskPool (Implemented commons-pool, etc) control instantiating aforesaid objects</technical_language>

Target:
public void obtainNewAccessToken() { new NetworkCallTask().execute(); }
Source:
<code>public ConsistentHash getReadConsistentHash() { switch (phase) { <START> case CONFLICT_RESOLUTION: <END> assert pendingCH != null; assert unionCH != null; return currentCH; case NO_REBALANCE: assert pendingCH == null; assert unionCH == null; return currentCH; case READ_OLD_WRITE_ALL: assert pendingCH != null; assert unionCH != null; return currentCH; case READ_ALL_WRITE_ALL: assert pendingCH != null; return unionCH; case READ_NEW_WRITE_ALL: assert unionCH != null; return pendingCH; } return currentCH; }</code><technical_language>move label READ_OLD_WRITE_ALL, properties</technical_language>

Target:
public ConsistentHash getReadConsistentHash() { switch (phase) { case NO_REBALANCE: assert pendingCH == null; assert unionCH == null; return currentCH; case CONFLICT_RESOLUTION: case READ_OLD_WRITE_ALL: assert pendingCH != null; assert unionCH != null; return currentCH; case READ_ALL_WRITE_ALL: assert pendingCH != null; return unionCH; case READ_NEW_WRITE_ALL: assert unionCH != null; return pendingCH; } return currentCH; }
Source:
<code>public ProjectDetailEvent( Project projectSelected ) { <START> this.projectSelected = projectSelected; <END> }</code><technical_language>a null check</technical_language>

Target:
public ProjectDetailEvent( Project projectSelected ) { checkNotNull( "projectSelected", projectSelected ); this.projectSelected = projectSelected; }
Source:
<code><START> public String getPrimaryBroadcastAddress() { <END> String primaryIp = getPrimaryIpv4HostAddress(); String broadcastAddress = null; if (primaryIp != null) { try { byte[] addr = InetAddress.getByName(primaryIp).getAddress(); Short prefix = getAllInterfaceAddresses().stream() .filter(a -> a.getAddress().getHostAddress().equals(primaryIp)).map(a -> a.getPrefix()) .findFirst().get().shortValue(); byte[] netmask = InetAddress.getByName(networkPrefixLengthToNetmask(prefix)).getAddress(); byte[] broadcast = new byte[] { (byte) (~netmask[0] | addr[0]), (byte) (~netmask[1] | addr[1]), (byte) (~netmask[2] | addr[2]), (byte) (~netmask[3] | addr[3]) }; broadcastAddress = InetAddress.getByAddress(broadcast).getHostAddress(); } catch (UnknownHostException ex) { LOGGER.error("Invalid IP address parameter: {}", ex.getMessage(), ex); } } if (broadcastAddress == null) { broadcastAddress = getFirstIpv4BroadcastAddress(); LOGGER.warn( "Could not find broadcast address of configured IP, using broadcast address of first interface instead", broadcastAddress); } return broadcastAddress; }</code><technical_language>please some test cases for this method in <LINK_0> ? byte magic is tricky debug easy break, I good some test cases for that</technical_language>

Target:
private String getPrimaryBroadcastAddress() { String primaryIp = getPrimaryIpv4HostAddress(); String broadcastAddress = null; if (primaryIp != null) { try { Short prefix = getAllInterfaceAddresses().stream() .filter(a -> a.getAddress().getHostAddress().equals(primaryIp)).map(a -> a.getPrefix()) .findFirst().get().shortValue(); broadcastAddress = getIpv4NetBroadcastAddress(primaryIp, prefix); } catch (IllegalArgumentException ex) { LOGGER.error("Invalid IP address parameter: {}", ex.getMessage(), ex); } } if (broadcastAddress == null) { broadcastAddress = getFirstIpv4BroadcastAddress(); LOGGER.warn( "Could not find broadcast address of primary IP, using broadcast address of first interface instead", broadcastAddress); } return broadcastAddress; }
Source:
<code>public void handleSynchronizeTimeresponse(final String deviceIdentification, final String organisationIdentification, final String correlationUid, final String messageType, final ResponseMessageResultType deviceResult, final OsgpException exception) { LOGGER.info("handleSynchronizeReadsresponse for MessageType: {}", messageType); ResponseMessageResultType result = ResponseMessageResultType.OK; <START> if (exception != null) { <END> LOGGER.error("Device Response not ok. Unexpected Exception", exception); result = ResponseMessageResultType.NOT_OK; } this.webServiceResponseMessageSender.send(new ResponseMessage(correlationUid, organisationIdentification, deviceIdentification, result, exception, null), messageType); }</code><technical_language>ResponseMessageResultType result = deviceResult;</technical_language>

Target:
public void handleSynchronizeTimeresponse(final String deviceIdentification, final String organisationIdentification, final String correlationUid, final String messageType, final ResponseMessageResultType deviceResult, final OsgpException exception) { LOGGER.info("handleSynchronizeReadsresponse for MessageType: {}", messageType); ResponseMessageResultType result = deviceResult; if (exception != null) { LOGGER.error("Device Response not ok. Unexpected Exception", exception); result = ResponseMessageResultType.NOT_OK; } this.webServiceResponseMessageSender.send(new ResponseMessage(correlationUid, organisationIdentification, deviceIdentification, result, exception, null), messageType); }
Source:
<code>public ODocument onInstall(OrienteerWebApplication app, ODatabaseDocument db) { onUpdate(app, db, 0, getVersion()); <START> OSchemaHelper helper = OSchemaHelper.bind(db); <END> helper.oClass(WIDGET_OCLASS_NAME, OWidgetsModule.OCLASS_WIDGET) .oProperty(OPROPERTY_PIVOT_CUSTOM_SQL, OType.STRING, 200).assignVisualization("textarea"); return null; }</code><technical_language>here? Please try understand onInstall onUpdate doing. If wrote: a duplication</technical_language>

Target:
public ODocument onInstall(OrienteerWebApplication app, ODatabaseDocument db) { onUpdate(app, db, 0, getVersion()); return null; }
Source:
<code>public int prepare(Xid xid) throws XAException { if (trace) { log.tracef("XaResource.prepare(%s)", xid); } <START> if (currentXid == null) { <END> throw new XAException(XAException.XAER_NOTA); } else if (!currentXid.equals(xid)) { throw new XAException(XAException.XAER_INVAL); } return internalPrepare(false); }</code><technical_language>refactor currentXid xid check a private method</technical_language>

Target:
public int prepare(Xid xid) throws XAException { if (trace) { log.tracef("XaResource.prepare(%s)", xid); } assertStartInvoked(); assertSameXid(xid, XAException.XAER_INVAL); return internalPrepare(false); }
Source:
<code>HeadContext(DefaultChannelPipeline pipeline) { <START> super(pipeline, pipeline.channel.eventLoop(), HEAD_NAME, HeadContext.class); <END> unsafe = pipeline.channel().unsafe(); setAddComplete(); }</code><technical_language>this pipeline.executor</technical_language>

Target:
HeadContext(DefaultChannelPipeline pipeline) { super(pipeline, HEAD_NAME, HeadContext.class); unsafe = pipeline.channel().unsafe(); setAddComplete(); }
Source:
<code>public boolean start() throws Exception { ThrottledStepInfo info = new ThrottledStepInfo(getCategory()); ThrottledStepInfo parentInfo = getContext().get(ThrottledStepInfo.class); if (parentInfo != null) { Computer computer = getContext().get(Computer.class); <START> if (computer != null && computer.getNode() != null) { <END> parentInfo.setNode(computer.getNode().getNodeName()); } info.setParentInfo(parentInfo); } Run<?, ?> r = getContext().get(Run.class); TaskListener listener = getContext().get(TaskListener.class); ThrottleJobProperty.DescriptorImpl descriptor = Jenkins.getActiveInstance().getDescriptorByType(ThrottleJobProperty.DescriptorImpl.class); descriptor.addThrottledPipelineForCategory(r.getExternalizableId(), getCategory(), listener); body = getContext().newBodyInvoker() .withContext(info) .withCallback(BodyExecutionCallback.wrap(getContext())) .start(); return false; }</code><technical_language>Return Node getRequiredContext skip null check getNode conversion</technical_language>

Target:
public boolean start() throws Exception { Run<?, ?> r = getContext().get(Run.class); TaskListener listener = getContext().get(TaskListener.class); FlowNode flowNode = getContext().get(FlowNode.class); ThrottleJobProperty.DescriptorImpl descriptor = ThrottleJobProperty.fetchDescriptor(); String runId = null; String flowNodeId = null; if (r != null && flowNode != null) { runId = r.getExternalizableId(); flowNodeId = flowNode.getId(); for (String category : validateCategories(descriptor, listener)) { descriptor.addThrottledPipelineForCategory(runId, flowNodeId, category, listener); } } getContext().newBodyInvoker() .withCallback(new Callback(runId, flowNodeId, getCategories())) .start(); return false; }
Source:
<code>public void setUp() throws Exception { WebAppContext context; context = new WebAppContext("/Users/aled/repos/apache-asf/incubator-brooklyn/usage/rest-client/src/test/webapp", "/"); <START> context.setExtraClasspath("/Users/aled/repos/apache-asf/incubator-brooklyn/usage/rest-client/target/test-rest-server/"); <END> context.setAttribute(BrooklynServiceAttributes.BROOKLYN_MANAGEMENT_CONTEXT, getManagementContext()); Server server = BrooklynRestApiLauncher.launcher() .managementContext(manager) .customContext(context) .start(); api = new BrooklynApi("http://localhost:" + server.getConnectors()[0].getPort() + "/"); }</code><technical_language>revert this I think:)</technical_language>

Target:
public void setUp() throws Exception { WebAppContext context; context = new WebAppContext("src/test/webapp", "/"); context.setExtraClasspath("./target/test-rest-server/"); context.setAttribute(BrooklynServiceAttributes.BROOKLYN_MANAGEMENT_CONTEXT, getManagementContext()); Server server = BrooklynRestApiLauncher.launcher() .managementContext(manager) .customContext(context) .start(); api = new BrooklynApi("http://localhost:" + server.getConnectors()[0].getPort() + "/"); }
Source:
<code>public ArrayList<Kill> getKillsFor(UUID pid) { ArrayList<Kill> personalKills = kills.get(pid); if(personalKills == null) { <START> return new ArrayList<Kill>(); <END> } Collections.sort(personalKills, new Comparator<Kill>() { @Override public int compare(final Kill u1, final Kill u2) { return u1.getDate().compareTo(u2.getDate()); } }); return personalKills; }</code><technical_language>suggestion return Collections.emptyList();</technical_language>

Target:
public List<Kill> getKillsFor(UUID pid) { List<Kill> personalKills = kills.get(pid); if(personalKills == null) { return Collections.emptyList(); } Collections.sort(personalKills, new Comparator<Kill>() { @Override public int compare(final Kill u1, final Kill u2) { return u1.getDate().compareTo(u2.getDate()); } }); return personalKills; }
Source:
<code>private List<DiskImage> getDisksList() { if (selectedActiveDisks == null) { <START> selectedActiveDisks = <END> ImagesHandler.filterDiskBasedOnImages(DbFacade.getInstance() .getDiskDao() .getAllForVm(getVmId())); } return selectedActiveDisks; }</code><technical_language>I suggest adding getDiskDAO(), getSnapshotsDAO()</technical_language>

Target:
private List<DiskImage> getDisksList() { if (selectedActiveDisks == null) { selectedActiveDisks = ImagesHandler.filterDiskBasedOnImages(getDbFacade().getDiskDao() .getAllForVm(getVmId())); } return selectedActiveDisks; }
Source:
<code>public void start() { try { Hosts.HostAndPort hostAndPort = config.getHosts().getFirst(); <START> RedisURI.Builder builder = new RedisURI.Builder().redis( hostAndPort.getHost(), hostAndPort.getPort() ); <END> builder.withSsl( config.isSsl() ); if ( config.getPassword() != null ) { builder.withPassword( config.getPassword() ); } builder.withTimeout( config.getTimeout(), TimeUnit.MILLISECONDS ); redisClient = new RedisClient( builder.build() ); log.connectingToRedis( config.getHosts().toString(), config.getTimeout() ); connection = redisClient.connect( new ByteArrayCodec() ); } catch (RuntimeException e) { throw log.unableToInitializeRedis( e ); } }</code><technical_language>redis() accessed static method</technical_language>

Target:
public void start() { try { Hosts.HostAndPort hostAndPort = config.getHosts().getFirst(); RedisURI.Builder builder = redis( hostAndPort.getHost(), hostAndPort.getPort() ); builder.withSsl( config.isSsl() ); builder.withDatabase( config.getDatabaseNumber() ); if ( config.getPassword() != null ) { builder.withPassword( config.getPassword() ); } builder.withTimeout( config.getTimeout(), TimeUnit.MILLISECONDS ); redisClient = new RedisClient( builder.build() ); log.connectingToRedis( config.getHosts().toString(), config.getTimeout() ); connection = redisClient.connect( new ByteArrayCodec() ); } catch (RuntimeException e) { throw log.unableToInitializeRedis( e ); } }