auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void setUp() throws Exception { response = mock(HttpServletResponse.class); request = mock(HttpServletRequest.class); <START> securityService = mock(SecurityService.class); <END> authenticationPluginRegistry = mock(AuthenticationPluginRegistry.class); localizer = mock(Localizer.class); authorizationController = new AuthorizationController(localizer, authenticationPluginRegistry); }</code><technical_language>This is</technical_language>

Target:
public void setUp() throws Exception { authenticationPluginRegistry = mock(AuthenticationPluginRegistry.class); localizer = mock(Localizer.class); authorizationController = new AuthorizationController(localizer, authenticationPluginRegistry); response = new MockHttpServletResponse(); }
Source:
<code>public static void checkArgument(boolean expression, @Nullable String messageTemplate, @Nullable Object... messageArgs) { try { Preconditions.checkArgument(expression, messageTemplate, messageArgs); <START> } catch (IllegalArgumentException e) { <END> throw new BadRequestException(e.getMessage(), e); } }</code><technical_language>similarly: if (!expression) { throw new BadRequestException(String.format(messageTemplate, messageArgs)); }</technical_language>

Target:
public static void checkArgument(boolean expression, @Nullable String messageTemplate, @Nullable Object... messageArgs) { if (!expression) { throw new BadRequestException(format(messageTemplate, messageArgs)); } }
Source:
<code>private void createDatastreamForDSM(ZkClient zkClient, String cluster, String connectorType, String... datastreamNames) { for (String datastreamName : datastreamNames) { zkClient.ensurePath(KeyBuilder.datastreams(cluster)); KafkaConnection conn = new KafkaConnection(); conn.setTopicName("dummyTopic"); conn.setPartitions(1); conn.setMetadataBrokers("localhost:11111"); Datastream datastream = new Datastream(); datastream.setName(datastreamName); datastream.setConnectorType(connectorType); <START> datastream.setSource("tscp"); <END> Datastream.Target target = new Datastream.Target(); target.setKafkaConnection(conn); datastream.setTarget(target); ZookeeperBackedDatastreamStore dsStore = new ZookeeperBackedDatastreamStore(zkClient, cluster); dsStore.createDatastream(datastream.getName(), datastream); } }</code><technical_language>Open-source code internal names</technical_language>

Target:
private void createDatastreamForDSM(ZkClient zkClient, String cluster, String connectorType, String... datastreamNames) { for (String datastreamName : datastreamNames) { zkClient.ensurePath(KeyBuilder.datastreams(cluster)); KafkaConnection conn = new KafkaConnection(); conn.setTopicName("dummyTopic"); conn.setPartitions(1); conn.setMetadataBrokers("localhost:11111"); Datastream datastream = new Datastream(); datastream.setName(datastreamName); datastream.setConnectorType(connectorType); datastream.setSource("sampleSource"); Datastream.Target target = new Datastream.Target(); target.setKafkaConnection(conn); datastream.setTarget(target); ZookeeperBackedDatastreamStore dsStore = new ZookeeperBackedDatastreamStore(zkClient, cluster); dsStore.createDatastream(datastream.getName(), datastream); } }
Source:
<code>private EhcacheEntityResponse invokeLifeCycleOperation(ClientDescriptor clientDescriptor, LifecycleMessage message) throws ClusterException { switch (message.operation()) { case CONFIGURE: configure(clientDescriptor, (ConfigureStoreManager) message); break; case VALIDATE: validate(clientDescriptor, (ValidateStoreManager) message); break; case CREATE_SERVER_STORE: createServerStore(clientDescriptor, (CreateServerStore) message); break; case VALIDATE_SERVER_STORE: validateServerStore(clientDescriptor, (ValidateServerStore) message); break; case RELEASE_SERVER_STORE: releaseServerStore(clientDescriptor, (ReleaseServerStore) message); break; case DESTROY_SERVER_STORE: destroyServerStore(clientDescriptor, (DestroyServerStore) message); break; case CREATE_CLUSTERED_MAP: <START> createConcurrentMap(clientDescriptor, (CreateClusteredMap) message); <END> break; default: throw new IllegalMessageException("Unknown LifeCycle operation " + message); } return responseFactory.success(); }</code><technical_language>I wondering if this explicit operation is needed. creates IMO unnecessary message exchanges server. equivalent operation done lazily map interaction. @chrisdennis @AbfrmBlr wdyt</technical_language>

Target:
private EhcacheEntityResponse invokeLifeCycleOperation(ClientDescriptor clientDescriptor, LifecycleMessage message) throws ClusterException { switch (message.operation()) { case CONFIGURE: configure(clientDescriptor, (ConfigureStoreManager) message); break; case VALIDATE: validate(clientDescriptor, (ValidateStoreManager) message); break; case CREATE_SERVER_STORE: createServerStore(clientDescriptor, (CreateServerStore) message); break; case VALIDATE_SERVER_STORE: validateServerStore(clientDescriptor, (ValidateServerStore) message); break; case RELEASE_SERVER_STORE: releaseServerStore(clientDescriptor, (ReleaseServerStore) message); break; case DESTROY_SERVER_STORE: destroyServerStore(clientDescriptor, (DestroyServerStore) message); break; default: throw new IllegalMessageException("Unknown LifeCycle operation " + message); } return responseFactory.success(); }
Source:
<code>public static String getUrlAsString(String urlStr) { StringBuilder sb = new StringBuilder(); try { URL url = new URL(urlStr); InputStream is = url.openStream(); BufferedReader br = new BufferedReader(new InputStreamReader(is)); String line; <START> while ( (line = br.readLine()) != null) <END> sb.append(line); closeQuietly(br); closeQuietly(is); } catch (Exception e) { if (Sage.DBG) { e.printStackTrace(); } } return sb.toString(); }</code><technical_language>This end stripping newline characters, return is other end. want refactor getFileAsString method another 'getReaderAsString(java.io.Reader) (and if do that, get rid of BufferedReader wrapper a char[8192] for reads...since current logic in is sort of silly buffers 8k 4k reads...so doubling memcopies)</technical_language>

Target:
public static String getUrlAsString(String urlStr) { StringBuilder sb = new StringBuilder(); try { URL url = new URL(urlStr); return getInputStreamAsString(url.openStream()); } catch (Exception e) { if (Sage.DBG) { System.out.println("Failed to read URL to string for " + urlStr); e.printStackTrace(); } } return sb.toString(); }
Source:
<code>public static PaletteGroup getPaletteGroup(Palette palette, IContainer groupDst) { String[] groups = groupDst.getProjectRelativePath().toString().split("/"); if ((0 == groups.length) || ((1 == groups.length) && (0 == groups[0].length()))) { return palette.getRootGroup(); } <START> ArrayList<String> <END> groupList = new ArrayList<String>(); groupList.addAll(Arrays.asList(groups)); if (TypeLibraryTags.TOOL_LIBRARY_PROJECT_NAME.equals(groupList.get(0))) { groupList.remove(0); } return palette.findGroup(groupList); }</code><technical_language>replace List interface</technical_language>

Target:
public static PaletteGroup getPaletteGroup(Palette palette, IContainer groupDst) { String[] groups = groupDst.getProjectRelativePath().toString().split("/"); if ((0 == groups.length) || ((1 == groups.length) && (0 == groups[0].length()))) { return palette.getRootGroup(); } List<String> groupList = new ArrayList<>(); groupList.addAll(Arrays.asList(groups)); if (TypeLibraryTags.TOOL_LIBRARY_PROJECT_NAME.equals(groupList.get(0))) { groupList.remove(0); } return palette.findGroup(groupList); }
Source:
<code>protected void buildVmCD() { XmlRpcStruct struct; if (vm.getVmPayload() != null && vm.getVmPayload().getType() == VmDeviceType.CDROM) { VmDevice vmDevice = new VmDevice(new VmDeviceId(Guid.NewGuid(), vm.getId()), VmDeviceType.DISK.getName(), VmDeviceType.CDROM.getName(), "", 0, (vm.getVmPayload() == null) ? null : vm.getVmPayload().getSpecParams(), true, true, true, ""); struct = new XmlRpcStruct(); addCdDetails(vmDevice, struct); addDevice(struct, vmDevice, ""); } if (vm.isRunOnce() && !StringUtils.isEmpty(vm.getCdPath())) { VmDevice vmDevice = new VmDevice(new VmDeviceId(Guid.NewGuid(), vm.getId()), VmDeviceType.DISK.getName(), VmDeviceType.CDROM.getName(), "", 0, (vm.getVmPayload() == null) ? null : vm.getVmPayload().getSpecParams(), true, true, true, ""); struct = new XmlRpcStruct(); addCdDetails(vmDevice, struct); addDevice(struct, vmDevice, vm.getCdPath()); } else { List<VmDevice> vmDevices = DbFacade.getInstance() .getVmDeviceDao() .getVmDeviceByVmIdTypeAndDevice(vm.getId(), VmDeviceType.DISK.getName(), VmDeviceType.CDROM.getName()); for (VmDevice vmDevice : vmDevices) { if (!vmDevice.getIsManaged()) { continue; } <START> boolean isPayload = (VmPayload.isPayload(vmDevice.getSpecParams()) && <END> vmDevice.getDevice().equals(VmDeviceType.CDROM.getName())); struct = new XmlRpcStruct(); String cdPath = vm.getCdPath(); addCdDetails(vmDevice, struct); if (isPayload) { struct.add(VdsProperties.Index, "3"); } addAddress(vmDevice, struct); addDevice(struct, vmDevice, (cdPath == null && !isPayload) ? "" : cdPath); } } }</code><technical_language>Shahar, more correct encapsulate payload code addCdDetails</technical_language>

Target:
protected void buildVmCD() { XmlRpcStruct struct; if (vm.getVmPayload() != null && vm.getVmPayload().getType() == VmDeviceType.CDROM) { VmDevice vmDevice = new VmDevice(new VmDeviceId(Guid.NewGuid(), vm.getId()), VmDeviceType.DISK.getName(), VmDeviceType.CDROM.getName(), "", 0, (vm.getVmPayload() == null) ? null : vm.getVmPayload().getSpecParams(), true, true, true, ""); struct = new XmlRpcStruct(); addCdDetails(vmDevice, struct); addDevice(struct, vmDevice, ""); } if (vm.isRunOnce() && !StringUtils.isEmpty(vm.getCdPath())) { VmDevice vmDevice = new VmDevice(new VmDeviceId(Guid.NewGuid(), vm.getId()), VmDeviceType.DISK.getName(), VmDeviceType.CDROM.getName(), "", 0, (vm.getVmPayload() == null) ? null : vm.getVmPayload().getSpecParams(), true, true, true, ""); struct = new XmlRpcStruct(); addCdDetails(vmDevice, struct); addDevice(struct, vmDevice, vm.getCdPath()); } else { List<VmDevice> vmDevices = DbFacade.getInstance() .getVmDeviceDao() .getVmDeviceByVmIdTypeAndDevice(vm.getId(), VmDeviceType.DISK.getName(), VmDeviceType.CDROM.getName()); for (VmDevice vmDevice : vmDevices) { if (!vmDevice.getIsManaged()) { continue; } struct = new XmlRpcStruct(); String cdPath = vm.getCdPath(); addCdDetails(vmDevice, struct); addAddress(vmDevice, struct); addDevice(struct, vmDevice, cdPath == null ? "" : cdPath); } } }
Source:
<code>void shouldBeAbleHandleNOOPsDuringRunCypher() throws Exception { StubServer server = StubServer.start( "noop.script", 9001 ); URI uri = URI.create( "bolt://127.0.0.1:9001" ); <START> int x; <END> try ( Driver driver = GraphDatabase.driver( uri, INSECURE_CONFIG ) ) { try ( Session session = driver.session() ) { List<String> names = session.run( "MATCH (n) RETURN n.name" ).list( rec -> rec.get( 0 ).asString() ); assertEquals( asList( "Foo", "Bar", "Baz" ), names ); } } assertThat( server.exitStatus(), equalTo( 0 ) ); }</code><technical_language>suggestion Unused</technical_language>

Target:
void shouldBeAbleHandleNOOPsDuringRunCypher() throws Exception { StubServer server = StubServer.start( "noop.script", 9001 ); URI uri = URI.create( "bolt://127.0.0.1:9001" ); try ( Driver driver = GraphDatabase.driver( uri, INSECURE_CONFIG ) ) { try ( Session session = driver.session() ) { List<String> names = session.run( "MATCH (n) RETURN n.name" ).list( rec -> rec.get( 0 ).asString() ); assertEquals( asList( "Foo", "Bar", "Baz" ), names ); } } assertThat( server.exitStatus(), equalTo( 0 ) ); }
Source:
<code>private void logEnabledExtensions() { log.info("Start of enabled extensions list"); for (ExtensionEntry entry: loadedEntries.values()) { <START> if (entry.extension != null && entry.enabled) { <END> Map<ExtensionProperties, Object> context = entry.extension.getContext(); log.info(String.format( "Instance name: '%1$s', Extension name: '%2$s', Author '%3$s', Version '%4$s', Home: '%5$s' License: '%6$s' File: '%7$s'", emptyIfNull(context.get(ExtensionProperties.NAME)), emptyIfNull(context.get(ExtensionProperties.EXTENSION_NAME)), emptyIfNull(context.get(ExtensionProperties.AUTHOR)), emptyIfNull(context.get(ExtensionProperties.VERSION)), emptyIfNull(context.get(ExtensionProperties.HOME)), emptyIfNull(context.get(ExtensionProperties.LICENSE)), emptyIfNull(entry.file) ) ); } } log.info("End of enabled extensions list"); }</code><technical_language>enabled null</technical_language>

Target:
private void logEnabledExtensions() { log.info("Start of enabled extensions list"); for (ExtensionEntry entry: loadedEntries.values()) { if (entry.extension != null) { Map<ExtensionProperties, Object> context = entry.extension.getContext(); log.info(String.format( "Instance name: '%1$s', Extension name: '%2$s', Version: '%3$s', License: '%4$s', Home: '%5$s', Author '%6$s', File: '%7$s'", emptyIfNull(context.get(ExtensionProperties.NAME)), emptyIfNull(context.get(ExtensionProperties.EXTENSION_NAME)), emptyIfNull(context.get(ExtensionProperties.VERSION)), emptyIfNull(context.get(ExtensionProperties.LICENSE)), emptyIfNull(context.get(ExtensionProperties.HOME)), emptyIfNull(context.get(ExtensionProperties.AUTHOR)), emptyIfNull(entry.file) ) ); } } log.info("End of enabled extensions list"); }
Source:
<code><START> private static RowOrderAndPostAggregations computePostAggregations( <END> PlannerContext plannerContext, RowSignature inputRowSignature, Project project, int outputNameCounter ) { final List<String> rowOrder = new ArrayList<>(); final List<Aggregation> aggregations = new ArrayList<>(); for (final RexNode postAggregatorRexNode : project.getChildExps()) { final DruidExpression postAggregatorExpression = Expressions.toDruidExpression( plannerContext, inputRowSignature, postAggregatorRexNode ); if (postAggregatorExpression == null) { throw new CannotBuildQueryException(project, postAggregatorRexNode); } if (postAggregatorDirectColumnIsOk(inputRowSignature, postAggregatorExpression, postAggregatorRexNode)) { rowOrder.add(postAggregatorExpression.getDirectColumn()); } else { final String postAggregatorName = "p" + outputNameCounter++; final PostAggregator postAggregator = new ExpressionPostAggregator( postAggregatorName, postAggregatorExpression.getExpression(), null, plannerContext.getExprMacroTable() ); aggregations.add(Aggregation.create(postAggregator)); rowOrder.add(postAggregator.getName()); } } return new RowOrderAndPostAggregations(rowOrder, aggregations); }</code><technical_language>calling this method simply create</technical_language>

Target:
private static ProjectRowOrderAndPostAggregations computePostAggregations( PlannerContext plannerContext, RowSignature inputRowSignature, Project project, int outputNameCounter ) { final List<String> rowOrder = new ArrayList<>(); final List<PostAggregator> aggregations = new ArrayList<>(); for (final RexNode postAggregatorRexNode : project.getChildExps()) { final DruidExpression postAggregatorExpression = Expressions.toDruidExpression( plannerContext, inputRowSignature, postAggregatorRexNode ); if (postAggregatorExpression == null) { throw new CannotBuildQueryException(project, postAggregatorRexNode); } if (postAggregatorDirectColumnIsOk(inputRowSignature, postAggregatorExpression, postAggregatorRexNode)) { rowOrder.add(postAggregatorExpression.getDirectColumn()); } else { final String postAggregatorName = "p" + outputNameCounter++; final PostAggregator postAggregator = new ExpressionPostAggregator( postAggregatorName, postAggregatorExpression.getExpression(), null, plannerContext.getExprMacroTable() ); aggregations.add(postAggregator); rowOrder.add(postAggregator.getName()); } } return new ProjectRowOrderAndPostAggregations(rowOrder, aggregations); }
Source:
<code><START> public Set<ScanFilter> getScanFilters() { <END> return scanFilters; }</code><technical_language>This package visibility (for for HostProcess use)</technical_language>

Target:
List<ScanFilter> getScanFilters() { return scanFilters; }
Source:
<code><START> private String constructName(ITestNGMethod method) { <END> return method.getConstructorOrMethod().getDeclaringClass().getSimpleName() + "." + method.getMethodName(); }</code><technical_language>static is missing</technical_language>

Target:
private static String constructName(ITestNGMethod method) { return method.getConstructorOrMethod().getDeclaringClass().getSimpleName() + "." + method.getMethodName(); }
Source:
<code><START> public List<String> getFiles(GerritQueryHandler gerritQueryHandler) { <END> return change.getFiles(gerritQueryHandler); }</code><technical_language>I missed this before, this is data fail serialize, need do similar Topic. I.e. field transient add a readResolve move files Change</technical_language>

Target:
public List<String> getFiles(GerritQueryHandler gerritQueryHandler) { List<String> files = change.getFiles(gerritQueryHandler); if (files == null) { return Collections.emptyList(); } return files; }
Source:
<code>public static BufferedImage getScreenshot(HWND target) { GDI32 gdi32 = GDI32.INSTANCE; User32 user32 = User32.INSTANCE; RECT rect = new RECT(); <START> <END> user32.GetWindowRect(target, rect); Rectangle rectangle = rect.toRectangle(); HDC hdcTarget = user32.GetDC(target); HDC hdcTargetMem = gdi32.CreateCompatibleDC(hdcTarget); HBITMAP hBitmap = gdi32.CreateCompatibleBitmap(hdcTarget, rectangle.width, rectangle.height); HANDLE hdcTargetOld = gdi32.SelectObject(hdcTargetMem, hBitmap); gdi32.BitBlt(hdcTargetMem, 0, 0, rectangle.width, rectangle.height, hdcTarget, 0, 0, GDI32.SRCCOPY); gdi32.SelectObject(hdcTargetMem, hdcTargetOld); gdi32.DeleteDC(hdcTargetMem); BITMAPINFO bmi = new BITMAPINFO(); bmi.bmiHeader.biWidth = rectangle.width; bmi.bmiHeader.biHeight = -rectangle.height; bmi.bmiHeader.biPlanes = 1; bmi.bmiHeader.biBitCount = 32; bmi.bmiHeader.biCompression = WinGDI.BI_RGB; Memory buffer = new Memory(rectangle.width * rectangle.height * 4); gdi32.GetDIBits(hdcTarget, hBitmap, 0, rectangle.height, buffer, bmi, WinGDI.DIB_RGB_COLORS); BufferedImage image = new BufferedImage(rectangle.width, rectangle.height, BufferedImage.TYPE_INT_RGB); image.setRGB(0, 0, rectangle.width, rectangle.height, buffer.getIntArray(0, rectangle.width * rectangle.height), 0, rectangle.width); gdi32.DeleteObject(hBitmap); user32.ReleaseDC(target, hdcTarget); return image; }</code><technical_language>blank lines statement ? Group relevant statements</technical_language>

Target:
public static BufferedImage getScreenshot(HWND target) { RECT rect = new RECT(); User32.INSTANCE.GetWindowRect(target, rect); Rectangle rectangle = rect.toRectangle(); HDC hdcTarget = User32.INSTANCE.GetDC(target); HDC hdcTargetMem = GDI32.INSTANCE.CreateCompatibleDC(hdcTarget); HBITMAP hBitmap = GDI32.INSTANCE.CreateCompatibleBitmap(hdcTarget, rectangle.width, rectangle.height); HANDLE hdcTargetOld = GDI32.INSTANCE.SelectObject(hdcTargetMem, hBitmap); GDI32.INSTANCE.BitBlt(hdcTargetMem, 0, 0, rectangle.width, rectangle.height, hdcTarget, 0, 0, GDI32.SRCCOPY); GDI32.INSTANCE.SelectObject(hdcTargetMem, hdcTargetOld); GDI32.INSTANCE.DeleteDC(hdcTargetMem); BITMAPINFO bmi = new BITMAPINFO(); bmi.bmiHeader.biWidth = rectangle.width; bmi.bmiHeader.biHeight = -rectangle.height; bmi.bmiHeader.biPlanes = 1; bmi.bmiHeader.biBitCount = 32; bmi.bmiHeader.biCompression = WinGDI.BI_RGB; Memory buffer = new Memory(rectangle.width * rectangle.height * 4); GDI32.INSTANCE.GetDIBits(hdcTarget, hBitmap, 0, rectangle.height, buffer, bmi, WinGDI.DIB_RGB_COLORS); BufferedImage image = new BufferedImage(rectangle.width, rectangle.height, BufferedImage.TYPE_INT_RGB); image.setRGB(0, 0, rectangle.width, rectangle.height, buffer.getIntArray(0, rectangle.width * rectangle.height), 0, rectangle.width); GDI32.INSTANCE.DeleteObject(hBitmap); User32.INSTANCE.ReleaseDC(target, hdcTarget); return image; }
Source:
<code><START> private ApiInfo apiInfo() { <END> return new ApiInfoBuilder() .title("Jagger as a Service") .description("Some neat description") .license("Do we have some kind of license?") .licenseUrl("In case we have the one, there might be an URL to such") .version("1.2.6") .build(); }</code><technical_language>populate meaningful data. Version fit artifacts versions automatically Licence: <LINK_0></technical_language>

Target:
private ApiInfo apiInfo() { return new ApiInfoBuilder() .title("Jagger as a Service") .description("JaaS in a main artifact in Jagger 2. It is an always listening component.\n\n" + "It provides different information through its REST API.\n\n" + "JaaS artifact packed as an all in jar (with all dependencies inside) with embedded Tomcat.\n\n" + "JaaS based on Spring Boot, so its properties can be configured using one of Spring Boot ways" + "By default JaaS is listening on port 8080.\n" + "To change it just override property \"server.port\".") .license("GNU LESSER GENERAL PUBLIC LICENSE Version 2.1") .licenseUrl("<LINK_1>") .version(version) .build(); }
Source:
<code><START> public static Pair<Ritual, EnumFacing> getRitualFromRuins(TileMasterRitualStone tile) { <END> BlockPos pos = tile.getPos(); World world = tile.getWorld(); Ritual possibleRitual = null; EnumFacing possibleDirection = null; int highestCount = 0; for (Ritual ritual : BloodMagic.RITUAL_MANAGER.getRituals()) { for (EnumFacing direction : EnumFacing.HORIZONTALS) { List<RitualComponent> components = Lists.newArrayList(); ritual.gatherComponents(components::add); int currentCount = 0; for (RitualComponent component : components) { BlockPos newPos = pos.add(component.getOffset(direction)); if (isRuneType(world, newPos, component.getRuneType())) currentCount += 1; } if (currentCount > highestCount) { highestCount = currentCount; possibleRitual = ritual; possibleDirection = direction; } } } return Pair.of(possibleRitual, possibleDirection); }</code><technical_language>Again... this information</technical_language>

Target:
public static Pair<Ritual, EnumFacing> getRitualFromRuins(TileMasterRitualStone tile) { BlockPos pos = tile.getPos(); World world = tile.getWorld(); Ritual possibleRitual = tile.getCurrentRitual(); EnumFacing possibleDirection = tile.getDirection(); int highestCount = 0; if (possibleRitual == null || possibleDirection == null) for (Ritual ritual : BloodMagic.RITUAL_MANAGER.getRituals()) { for (EnumFacing direction : EnumFacing.HORIZONTALS) { List<RitualComponent> components = Lists.newArrayList(); ritual.gatherComponents(components::add); int currentCount = 0; for (RitualComponent component : components) { BlockPos newPos = pos.add(component.getOffset(direction)); if (isRuneType(world, newPos, component.getRuneType())) currentCount += 1; } if (currentCount > highestCount) { highestCount = currentCount; possibleRitual = ritual; possibleDirection = direction; } } } return Pair.of(possibleRitual, possibleDirection); }
Source:
<code>public HTTPResponse sendRequest(IAuthenticate auth) throws Exception { HttpClient client; if(insecure) { client = HTTPUtils.getHttpClientWithNoSSLValidation(); } else { client = new DefaultHttpClient(); } if(type == RequestType.GET) { HttpGet get = new HttpGet(url); req=get; } else { HttpPost post = new HttpPost(url); if(entity != null) post.setEntity(entity); req = post; <START> if (connectionTimeout > 0.0) { <END> HttpParams httpParams = new BasicHttpParams(); int cto = (int)(connectionTimeout * 1000.0); HttpConnectionParams.setConnectionTimeout(httpParams, cto ); post.setParams(httpParams); } } if(headers.size() > 0) { for(Entry<String, String> entry : headers.entrySet()) { req.setHeader(entry.getKey(), entry.getValue()); } } auth.sign(this); return new HTTPResponse(client.execute(req)); }</code><technical_language>Is do this once, request. Create a HttpParams re-use it</technical_language>

Target:
public HTTPResponse sendRequest(IAuthenticate auth) throws Exception { HttpClient client; if(insecure) { client = HTTPUtils.getHttpClientWithNoSSLValidation(); } else { client = new DefaultHttpClient(); } if(type == RequestType.GET) { HttpGet get = new HttpGet(url); req=get; } else { HttpPost post = new HttpPost(url); if(entity != null) { post.setEntity(entity); } req = post; if (httpParams == null) { httpParams = new BasicHttpParams(); int cto = (int)(connectionTimeout * 1000.0); HttpConnectionParams.setConnectionTimeout(httpParams, cto ); } post.setParams(httpParams); } if(headers.size() > 0) { for(Entry<String, String> entry : headers.entrySet()) { req.setHeader(entry.getKey(), entry.getValue()); } } auth.sign(this); return new HTTPResponse(client.execute(req)); }
Source:
<code>public static String addIndent(String content, int numberOfIndents) { if (numberOfIndents <= 0) { return content; } else { <START> final String lineIndent = IntStream.range(0, numberOfIndents).mapToObj(i -> "\t").reduce("", <END> String::concat); return Arrays.stream(content.split(System.lineSeparator())) .map(s -> lineIndent + s) .collect(Collectors.joining(System.lineSeparator())); } }</code><technical_language>Do need final keyword here? I adds value</technical_language>

Target:
public static String addIndent(String content, int numberOfIndents) { if (numberOfIndents <= 0) { return content; } else { String lineIndent = IntStream.range(0, numberOfIndents).mapToObj(i -> "\t").reduce("", String::concat); return Arrays.stream(content.split(System.lineSeparator())) .map(s -> lineIndent + s) .collect(Collectors.joining(System.lineSeparator())); } }
Source:
<code>public void verifyQuery(String query) { boolean flag = false; for (WebElement element:resultLinks) { if (element.getText().contains(query)){ <START> flag=true; <END> } } Assertion.assertTrue(flag, "there is no result link in the page"); }</code><technical_language>add spaces "="</technical_language>

Target:
public void verifyQuery(String query) { boolean isPresent = false; for (WebElement element:resultLinks) { if (element.getText().contains(query)){ isPresent = true; break; } } Assertion.assertTrue(isPresent, "there is no result link in the page"); }
Source:
<code>public IValidatorProblem match(Rule pattern, String input) throws WildcardException { tokenList = parseWildcard(pattern.getDescription()); String bigpattern = makeBigPattern(pattern.getDescription(), wcards); Pattern pat = Pattern.compile(bigpattern); Matcher matcher = pat.matcher(input); if (matcher.matches()) { String fileName = null; int lineNumber = -1; String message = null; Pattern lPattern = Pattern.compile(getPattern('n', wcards)); Pattern mPattern = Pattern.compile(getPattern('m', wcards)); Pattern fPattern = Pattern.compile(getPattern('f', wcards)); for (int i = 1; i <= matcher.groupCount(); i++) { if (matcher.group(i) != null) { String group = matcher.group(i); Matcher lMatch = lPattern.matcher(group); if (lMatch.find()) { <START> lineNumber = Integer.valueOf(lMatch.group()).intValue(); <END> continue; } Matcher fMatch = fPattern.matcher(group); if (fMatch.find()) { if (fileName == null) { fileName = fMatch.group(); continue; } } Matcher mMatch = mPattern.matcher(group); if (mMatch.find()) { message = mMatch.group(); continue; } } } if (message == null) { message = input; } return new ValidatorProblem(fileName, message, lineNumber, pattern .getProblemType()); } return null; }</code><technical_language>parseInt()</technical_language>

Target:
public IValidatorProblem match(Rule pattern, String input) throws WildcardException { tokenList = parseWildcard(pattern.getDescription()); String bigpattern = makeBigPattern(pattern.getDescription(), wcards); Pattern pat = Pattern.compile(bigpattern); Matcher matcher = pat.matcher(input); if (matcher.matches()) { String fileName = null; int lineNumber = -1; String message = null; Pattern lPattern = Pattern.compile(getPattern('n', wcards)); Pattern mPattern = Pattern.compile(getPattern('m', wcards)); Pattern fPattern = Pattern.compile(getPattern('f', wcards)); for (int i = 1; i <= matcher.groupCount(); i++) { if (matcher.group(i) != null) { String group = matcher.group(i); Matcher lMatch = lPattern.matcher(group); if (lMatch.find()) { lineNumber = Integer.parseInt(lMatch.group()); continue; } Matcher fMatch = fPattern.matcher(group); if (fMatch.find()) { if (fileName == null) { fileName = fMatch.group(); continue; } } Matcher mMatch = mPattern.matcher(group); if (mMatch.find()) { message = mMatch.group(); continue; } } } if (message == null) { message = input; } return new ValidatorProblem(fileName, message, lineNumber, pattern .getProblemType()); } return null; }
Source:
<code>public int hashCode() { <START> final int prime = 31; <END> int result = 1; result = prime * result + Long.valueOf(getEventId()).hashCode(); return result; }</code><technical_language>this return getEventId();</technical_language>

Target:
public int hashCode() { return Long.valueOf(eventId).hashCode(); }
Source:
<code>public final Set<String> getImports(@NotNull final Document document, @NotNull final Project project) { PsiDocumentManager psiInstance = PsiDocumentManager.getInstance(project); Set<String> imports = new HashSet<String>(); PsiFile psiFile; if (psiInstance != null && (psiInstance.getPsiFile(document)) != null) { psiFile = psiInstance.getPsiFile(document); if (psiFile != null) { PsiElement[] psiRootChildren = psiFile.getChildren(); <START> PsiElement[] importListChildren; <END> PsiElement[] importsElementList; for (PsiElement element : psiRootChildren) { if (element.getNode().getElementType().toString().equals(IMPORT_LIST)) { importListChildren = element.getChildren(); for (PsiElement importElement : importListChildren) { if (importElement.getNode().getElementType(). toString().equals(IMPORT_STATEMENT)) { importsElementList = importElement.getChildren(); if (importsElementList[2] != null) { imports.add(importsElementList[2].getNode().getText()); } } } } } } } return imports; }</code><technical_language>is need declare variables loop. declare assign place</technical_language>

Target:
public final Set<String> getImports(@NotNull final Document document, @NotNull final Project project) { PsiDocumentManager psiInstance = PsiDocumentManager.getInstance(project); Set<String> imports = new HashSet<String>(); if (psiInstance != null && (psiInstance.getPsiFile(document)) != null) { PsiFile psiFile = psiInstance.getPsiFile(document); if (psiFile != null) { PsiElement[] psiRootChildren = psiFile.getChildren(); for (PsiElement element : psiRootChildren) { if (element.getNode().getElementType().toString().equals(IMPORT_LIST)) { PsiElement[] importListChildren = element.getChildren(); for (PsiElement importElement : importListChildren) { if (importElement.getNode().getElementType(). toString().equals(IMPORT_STATEMENT)) { PsiElement[] importsElementList = importElement.getChildren(); if (importsElementList[2] != null) { imports.add(importsElementList[2].getNode().getText()); } } } } } } } return imports; }
Source:
<code>public void doMonitor(ServiceEmitter emitter) { final AtomicLong priorCount = priorRequestCount.get(); final ServiceMetricEvent.Builder builder = ServiceMetricEvent.builder(); <START> emitter.emit(builder.build("query/cache/redis/total/requests", totalRequestCount.get())); <END> emitter.emit(builder.build("query/cache/redis/delta/requests", totalRequestCount.get() - priorCount.get())); if (!priorRequestCount.compareAndSet(priorCount, totalRequestCount)) { log.error("Prior value changed while I was reporting! updating anyways"); priorRequestCount.set(totalRequestCount); } }</code><technical_language>suggest calling totalRequestCount.get() start of method</technical_language>

Target:
public void doMonitor(ServiceEmitter emitter) { final long priorCount = priorRequestCount.get(); final long totalCount = totalRequestCount.get(); final ServiceMetricEvent.Builder builder = ServiceMetricEvent.builder(); emitter.emit(builder.build("query/cache/redis/total/requests", totalCount)); emitter.emit(builder.build("query/cache/redis/delta/requests", totalCount - priorCount)); if (!priorRequestCount.compareAndSet(priorCount, totalCount)) { log.error("Prior value changed while I was reporting! updating anyways"); priorRequestCount.set(totalCount); } }
Source:
<code>public DTreeUserInteraction expand(IProgressMonitor monitor) { for (DTreeItem child : tree.getOwnedTreeItems()) { if (!child.isExpanded()) { <START> new DTreeItemUserInteraction(child, ctx).expand(monitor); <END> } } return this; }</code><technical_language>a IProgressMonitor is reusable times</technical_language>

Target:
public DTreeUserInteraction expand(IProgressMonitor monitor) { try { monitor.beginTask("Tree item expandion", tree.getOwnedTreeItems().size()); for (DTreeItem child : tree.getOwnedTreeItems()) { if (!child.isExpanded()) { new DTreeItemUserInteraction(child, ctx).expand(new SubProgressMonitor(monitor, 1)); } } } finally { monitor.done(); } return this; }
Source:
<code>public ExportRepoImageParameters() { <START> super(); <END> }</code><technical_language>I feel call super() is required, is done implicitly</technical_language>

Target:
public ExportRepoImageParameters() { }
Source:
<code>protected void onActivityResult(int requestCode, int resultCode, Intent intent) { switch (requestCode) { case CommCareHomeActivity.UPGRADE_APP: if (resultCode == RESULT_CANCELED) { <START> UpdateTask task = UpdateTask.getRunningInstance(); <END> if (task != null) { Toast.makeText(this, R.string.update_canceled, Toast.LENGTH_LONG).show(); task.cancel(true); } } else if (resultCode == RESULT_OK) { if (intent.getBooleanExtra(CommCareSetupActivity.KEY_REQUIRE_REFRESH, true)) { Toast.makeText(this, Localization.get("update.success"), Toast.LENGTH_LONG).show(); CommCareApplication._().expireUserSession(); } return; } break; case CommCareHomeActivity.MISSING_MEDIA_ACTIVITY: refresh(); if (resultCode == RESULT_CANCELED) { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(R.string.media_not_verified); builder.setMessage(R.string.skipped_verification_warning_2) .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); dialog = builder.create(); dialog.show(); } else if (resultCode == RESULT_OK) { Toast.makeText(this, R.string.media_verified, Toast.LENGTH_LONG).show(); } } }</code><technical_language>This is a bit awkward, timing wise, right? instance easily started running in a thread time here</technical_language>

Target:
protected void onActivityResult(int requestCode, int resultCode, Intent intent) { switch (requestCode) { case CommCareHomeActivity.UPGRADE_APP: if (resultCode == RESULT_CANCELED) { UpdateTask task = UpdateTask.getRunningInstance(); if (task != null) { Toast.makeText(this, R.string.update_canceled, Toast.LENGTH_LONG).show(); task.cancel(true); } } else if (resultCode == RESULT_OK) { if (intent.getBooleanExtra(CommCareSetupActivity.KEY_REQUIRE_REFRESH, true)) { Toast.makeText(this, Localization.get("update.success"), Toast.LENGTH_LONG).show(); CommCareApplication._().expireUserSession(); } return; } break; case CommCareHomeActivity.MISSING_MEDIA_ACTIVITY: refresh(); if (resultCode == RESULT_CANCELED) { String title = getString(R.string.media_not_verified); String msg = getString(R.string.skipped_verification_warning_2); AlertDialogFactory.showBasicAlertDialog(this, title, msg, null); } else if (resultCode == RESULT_OK) { Toast.makeText(this, R.string.media_verified, Toast.LENGTH_LONG).show(); } } }
Source:
<code>public void onGitStatusChanged(String endpointId, StatusChangedEventDto statusChangedEventDto) { Tree tree = projectExplorerPresenterProvider.get().getTree(); Status status = statusChangedEventDto.getStatus(); tree.getNodeStorage() .getAll() .stream() .filter( node -> node instanceof FileNode && statusChangedEventDto .getProjectName() <START> .equals(getRootProject(((ResourceNode) node).getData().asFile()).getName())) <END> .forEach( node -> { Resource resource = ((ResourceNode) node).getData(); File file = resource.asFile(); String nodeLocation = resource.getLocation().removeFirstSegments(1).toString(); VcsStatus newVcsStatus; if (status.getUntracked().contains(nodeLocation)) { newVcsStatus = UNTRACKED; } else if (status.getModified().contains(nodeLocation) || status.getChanged().contains(nodeLocation)) { newVcsStatus = MODIFIED; } else if (status.getAdded().contains(nodeLocation)) { newVcsStatus = ADDED; } else { newVcsStatus = NOT_MODIFIED; } if (file.getVcsStatus() != newVcsStatus) { file.setVcsStatus(newVcsStatus); tree.refresh(node); } }); }</code><technical_language>Cast FileNode is checked node instanceof FileNode</technical_language>

Target:
public void onGitStatusChanged(String endpointId, StatusChangedEventDto statusChangedEventDto) { Tree tree = projectExplorerPresenterProvider.get().getTree(); Status status = statusChangedEventDto.getStatus(); tree.getNodeStorage() .getAll() .stream() .filter( node -> node instanceof FileNode && statusChangedEventDto .getProjectName() .equals(getRootPath(((FileNode) node).getData().getLocation()))) .forEach( node -> { Resource resource = ((FileNode) node).getData(); File file = resource.asFile(); String nodeLocation = resource.getLocation().removeFirstSegments(1).toString(); VcsStatus newVcsStatus; if (status.getUntracked().contains(nodeLocation)) { newVcsStatus = UNTRACKED; } else if (status.getModified().contains(nodeLocation) || status.getChanged().contains(nodeLocation)) { newVcsStatus = MODIFIED; } else if (status.getAdded().contains(nodeLocation)) { newVcsStatus = ADDED; } else { newVcsStatus = NOT_MODIFIED; } if (file.getVcsStatus() != newVcsStatus) { file.setVcsStatus(newVcsStatus); tree.refresh(node); } }); }
Source:
<code>private AboutInfo promptForFeature() throws WorkbenchException { ArrayList welcomeFeatures = new ArrayList(); URL productUrl = null; IProduct product = Platform.getProduct(); if (product != null) { productUrl = ProductProperties.getWelcomePageUrl(product); welcomeFeatures.add(new AboutInfo(product)); } AboutInfo[] features = IDEWorkbenchPlugin.getDefault() .getFeatureInfos(); for (int i = 0; i < features.length; i++) { URL url = features[i].getWelcomePageURL(); <START> if (url != null && (productUrl == null || !url.toString().equals(productUrl.toString())) { <END> welcomeFeatures.add(features[i]); } } Shell shell = workbenchWindow.getShell(); if (welcomeFeatures.size() == 0) { MessageDialog.openInformation(shell, IDEWorkbenchMessages.QuickStartMessageDialog_title, IDEWorkbenchMessages.QuickStartMessageDialog_message); return null; } features = new AboutInfo[welcomeFeatures.size()]; welcomeFeatures.toArray(features); FeatureSelectionDialog d = new FeatureSelectionDialog(shell, features, product == null ? null : product.getId(), IDEWorkbenchMessages.WelcomePageSelectionDialog_title, IDEWorkbenchMessages.WelcomePageSelectionDialog_message, IIDEHelpContextIds.WELCOME_PAGE_SELECTION_DIALOG); if (d.open() != Window.OK || d.getResult().length != 1) { return null; } return (AboutInfo) d.getResult()[0]; }</code><technical_language>is closing ) brace missing. Compiler is unhappy: [ERROR] if (url != null && (productUrl == null || !url.toString().equals(productUrl.toString())) { [ERROR] ^ [ERROR] Syntax error, insert ") Statement" complete IfStatement [ERROR] -> [Help 1]</technical_language>

Target:
private AboutInfo promptForFeature() throws WorkbenchException { ArrayList welcomeFeatures = new ArrayList(); URL productUrl = null; IProduct product = Platform.getProduct(); if (product != null) { productUrl = ProductProperties.getWelcomePageUrl(product); welcomeFeatures.add(new AboutInfo(product)); } AboutInfo[] features = IDEWorkbenchPlugin.getDefault() .getFeatureInfos(); for (int i = 0; i < features.length; i++) { URL url = features[i].getWelcomePageURL(); if (url != null && (productUrl == null || !url.toString().equals(productUrl.toString()))) { welcomeFeatures.add(features[i]); } } Shell shell = workbenchWindow.getShell(); if (welcomeFeatures.size() == 0) { MessageDialog.openInformation(shell, IDEWorkbenchMessages.QuickStartMessageDialog_title, IDEWorkbenchMessages.QuickStartMessageDialog_message); return null; } features = new AboutInfo[welcomeFeatures.size()]; welcomeFeatures.toArray(features); FeatureSelectionDialog d = new FeatureSelectionDialog(shell, features, product == null ? null : product.getId(), IDEWorkbenchMessages.WelcomePageSelectionDialog_title, IDEWorkbenchMessages.WelcomePageSelectionDialog_message, IIDEHelpContextIds.WELCOME_PAGE_SELECTION_DIALOG); if (d.open() != Window.OK || d.getResult().length != 1) { return null; } return (AboutInfo) d.getResult()[0]; }
Source:
<code>public CompletableFuture<Collection<Replay>> loadLocalReplays() { String replayFileGlob = clientProperties.getReplay().getReplayFileGlob(); Path replaysDirectory = preferencesService.getReplaysDirectory(); if (Files.notExists(replaysDirectory)) { noCatch(() -> createDirectories(replaysDirectory)); } DirectoryStream<Path> directoryStream = Files.newDirectoryStream(replaysDirectory, replayFileGlob); List<CompletableFuture<Replay>> replayFutures = StreamSupport.stream(directoryStream.spliterator(), false) .sorted(Comparator.comparing(path -> noCatch(() -> Files.getLastModifiedTime((Path) path))).reversed()) .limit(MAX_REPLAYS) .map( replayFile -> { try { return loadLocalReplay(replayFile); } catch (Exception e) { return null; } }) <START> .filter(replay -> replay != null) <END> .collect(Collectors.toList()); CompletableFuture[] replayFuturesArray = replayFutures.toArray(new CompletableFuture[replayFutures.size()]); return CompletableFuture.allOf(replayFuturesArray) .thenApply(ignoredVoid -> replayFutures.stream() .map(future -> future.join()) .collect(Collectors.toList())); }</code><technical_language>Objects::requireNonNull</technical_language>

Target:
public CompletableFuture<Collection<Replay>> loadLocalReplays() throws IOException { String replayFileGlob = clientProperties.getReplay().getReplayFileGlob(); Path replaysDirectory = preferencesService.getReplaysDirectory(); if (Files.notExists(replaysDirectory)) { noCatch(() -> createDirectories(replaysDirectory)); } try (DirectoryStream<Path> directoryStream = Files.newDirectoryStream(replaysDirectory, replayFileGlob)) { List<CompletableFuture<Replay>> replayFutures = StreamSupport.stream(directoryStream.spliterator(), false) .sorted(Comparator.comparing(path -> noCatch(() -> Files.getLastModifiedTime((Path) path))).reversed()) .limit(MAX_REPLAYS) .map( replayFile -> tryLoadingLocalReplay(replayFile)) .filter(e -> !e.isCompletedExceptionally()) .collect(Collectors.toList()); CompletableFuture[] replayFuturesArray = replayFutures.toArray(new CompletableFuture[replayFutures.size()]); return CompletableFuture.allOf(replayFuturesArray) .thenApply(ignoredVoid -> replayFutures.stream() .map(future -> future.join()) .collect(Collectors.toList())); } }
Source:
<code>public void setActiveSheet(int sheetNum) { if (sheetNum >= 0 && sheetNum < numSheetsWritten) { activeSheetNum = sheetNum; } else if (sheetNum < 0) { throw new <START> OseeCoreException("Cannot <END> set active sheet less than zero"); } else { throw new OseeCoreException("Cannot set active sheet higher than the number of sheets written"); } }</code><technical_language>I this OseeArgumentException</technical_language>

Target:
public void setActiveSheet(int sheetNum) { if (sheetNum >= 0 && sheetNum < numSheetsWritten) { activeSheetNum = sheetNum; } else if (sheetNum < 0) { throw new OseeArgumentException("Cannot set active sheet less than zero"); } else { throw new OseeArgumentException("Cannot set active sheet higher than the number of sheets written"); } }
Source:
<code>public SaltUpdateEvent[] getInitEvents() { <START> return new SaltUpdateEvent[]{SaltUpdateEvent.SALT_UPDATE_EVENT}; <END> }</code><technical_language>SaltUpdateEvent needed</technical_language>

Target:
public SaltUpdateEvent[] getInitEvents() { return new SaltUpdateEvent[]{SALT_UPDATE_EVENT}; }
Source:
<code>public void afterExecute(final Runnable r, Throwable t) { super.afterExecute(r, t); if (t == null && r instanceof Future<?>) { try { Object result = ((Future<?>) r).get(); <START> } catch (java.util.concurrent.CancellationException cancellationException) { <END> t = cancellationException; } catch (java.util.concurrent.ExecutionException executionException) { t = executionException.getCause(); } catch (InterruptedException interruptedException) { Thread.currentThread().interrupt(); } } if (t != null) { Logging.error("Thread {0} raised {1}", Thread.currentThread().getName(), t); } }</code><technical_language>add import instead of fully qualified name</technical_language>

Target:
public void afterExecute(final Runnable r, Throwable t) { super.afterExecute(r, t); if (t == null && r instanceof Future<?>) { try { Object result = ((Future<?>) r).get(); } catch (CancellationException cancellationException) { t = cancellationException; } catch (ExecutionException executionException) { t = executionException.getCause(); } catch (InterruptedException interruptedException) { Thread.currentThread().interrupt(); } } if (t != null) { Logging.error("Thread {0} raised {1}", Thread.currentThread().getName(), t); } }
Source:
<code>public static void createAndWaitForStream(AmazonKinesisClient kinesisClient, String streamName, int shardCount) { if (streamExists(kinesisClient, streamName)) { String state = getStreamState(kinesisClient, streamName); switch (state) { <START> case "DELETING": <END> long waitTimeDelete = System.currentTimeMillis() + TIMEOUT; while (System.currentTimeMillis() < waitTimeDelete && streamExists(kinesisClient, streamName)) { try { LOG.debug("Deleting Stream ", streamName); TimeUnit.MILLISECONDS.sleep(SLEEP_INTERVAL); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } if (streamExists(kinesisClient, streamName)) { throw new IllegalStateException(String.format("Timed out waiting for stream to delete", streamName)); } createStream(streamName, shardCount, kinesisClient); break; case "ACTIVE": LOG.info("Stream already exists", streamName); return; case "CREATING": LOG.info("Stream is being created", streamName); break; case "UPDATING": LOG.info("Stream is being updated", streamName); return; default: throw new IllegalStateException(String.format("Illegal stream state: {}", state)); } } else { createStream(streamName, shardCount, kinesisClient); } long waitTimeCreate = System.currentTimeMillis() + TIMEOUT; while (System.currentTimeMillis() < waitTimeCreate) { try { TimeUnit.MILLISECONDS.sleep(SLEEP_INTERVAL); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } try { String streamStatus = getStreamState(kinesisClient, streamName); if ("ACTIVE".equals(streamStatus)) { LOG.info("Stream is ACTIVE", streamName); return; } } catch (ResourceNotFoundException e) { throw new IllegalStateException(String.format("Stream %s did not become active in %d", streamName, TIMEOUT), e); } } if (!getStreamState(kinesisClient, streamName).equals("ACTIVE")) { throw new IllegalStateException(String.format("Stream %s did not become active in %d", streamName, TIMEOUT)); } }</code><technical_language>hmmm, constants in Kinesis client for these</technical_language>

Target:
public static void createAndWaitForStream(AmazonKinesisClient kinesisClient, String streamName, int shardCount) { if (streamExists(kinesisClient, streamName)) { StreamStatus streamStatus = getStreamState(kinesisClient, streamName); switch (streamStatus) { case DELETING: waitForStreamState(kinesisClient, streamName, null); createStream(streamName, shardCount, kinesisClient); break; case ACTIVE: LOG.info("Stream already exists", streamName); return; case CREATING: LOG.info("Stream is being created", streamName); break; case UPDATING: LOG.info("Stream is being updated", streamName); return; default: throw new IllegalStateException(String.format("Illegal stream state: %s", streamStatus)); } } else { createStream(streamName, shardCount, kinesisClient); } waitForStreamState(kinesisClient, streamName, StreamStatus.ACTIVE); }
Source:
<code>private Callable<ChecksExecutionResult> createProcessFileCallable(File file) { <START> <END> final String fileName = file.getAbsolutePath(); return () -> { ChecksExecutionResult result; try { final SortedSet<LocalizedMessage> messages = processFile(file); fireErrors(fileName, messages); fireFileFinished(fileName); result = ChecksExecutionResult.getCompleted(file, messages); } catch (CheckstyleException ex) { result = ChecksExecutionResult.getFailed(file, ex); } return result; }; }</code><technical_language>this section a call in AbstractChecker code similar</technical_language>

Target:
private Callable<CheckerExecutionResult> createProcessFileCallable(File file) { return () -> { CheckerExecutionResult result; try { fireEventsAndProcessFile(file); result = new CheckerExecutionResult(); } catch (CheckstyleException ex) { result = new CheckerExecutionResult(ex); } return result; }; }