auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public String rewriteURL( @Nullable RuntimeIdentity identity, @Nullable String machineName, @Nullable String serverName, String url) throws InfrastructureException { final String host = hostnameBuilder.build(serverName, machineName, identity.getWorkspaceId()); try { URI uri = UriBuilder.fromUri(url).host(host).build(); url = uri.toString(); } catch (UriBuilderException | IllegalArgumentException e) { throw new InternalInfrastructureException( format( "Rewriting of host '%s' in URL '%s' failed. Error: %s", host, url, e.getMessage())); } return url; }

Target:
public String rewriteURL( @Nullable RuntimeIdentity identity, @Nullable String machineName, @Nullable String serverName, String url) throws InfrastructureException { final String host = hostnameBuilder.build(serverName, machineName, identity.getWorkspaceId()); try { int port = wildcartPort != null ? Integer.parseInt(wildcartPort) : chePort; URI uri = UriBuilder.fromUri(url).host(host).port(port).build(); url = uri.toString(); } catch (UriBuilderException | IllegalArgumentException e) { throw new InternalInfrastructureException( format( "Rewriting of host '%s' in URL '%s' failed. Error: %s", host, url, e.getMessage())); } return url; }
Source:
public void appendString(Blackhole bh, AppenderState appenderState) throws IOException { bh.consume(appenderState.appender.append("A small string")); }

Target:
public void appendString(Blackhole bh, AppenderState appenderState) throws IOException { bh.consume(appenderState.getOrCreateAppender().append("placeholder")); }
Source:
public void handleResponse(final String methodName, final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception) { LOGGER.debug("{} for MessageType: {}", methodName, deviceMessageMetadata.getMessageType()); ResponseMessageResultType result = deviceResult; if (exception != null) { LOGGER.error("Device Response not ok. Unexpected Exception", exception); result = ResponseMessageResultType.NOT_OK; } this.webServiceResponseMessageSender.send(ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(deviceMessageMetadata.getCorrelationUid()) .withOrganisationIdentification(deviceMessageMetadata.getOrganisationIdentification()) .withDeviceIdentification(deviceMessageMetadata.getDeviceIdentification()).withResult(result) .withOsgpException(exception).withMessagePriority(deviceMessageMetadata.getMessagePriority()).build(), deviceMessageMetadata.getMessageType()); }

Target:
public void handleResponse(final String methodName, final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception) { LOGGER.debug("{} for MessageType: {}", methodName, deviceMessageMetadata.getMessageType()); ResponseMessageResultType result = deviceResult; if (exception != null) { LOGGER.error("Device Response not ok. Unexpected Exception", exception); result = ResponseMessageResultType.NOT_OK; } ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(deviceMessageMetadata.getCorrelationUid()) .withOrganisationIdentification(deviceMessageMetadata.getOrganisationIdentification()) .withDeviceIdentification(deviceMessageMetadata.getDeviceIdentification()).withResult(result) .withOsgpException(exception).withMessagePriority(deviceMessageMetadata.getMessagePriority()).build(); this.webServiceResponseMessageSender.send(responseMessage, deviceMessageMetadata.getMessageType()); }
Source:
T getNextHandle() { try { while (xmlStreamReader.hasNext()) { int event = xmlStreamReader.next(); if (event == XMLStreamReader.START_ELEMENT) { StartElementReaderImpl startElementReader = new StartElementReaderImpl(xmlStreamReader); NodeOperation nodeOperation = visitor.startElement(startElementReader); if (nodeOperation == null) { throw new IllegalStateException("No NodeOperation returned."); } switch (nodeOperation) { case DESCEND: break; case PROCESS: T handle = visitor.makeBufferedHandle(xmlStreamReader); if (handle != null) { return handle; } break; case SKIP: int count = 0; while (xmlStreamReader.hasNext()) { int next = xmlStreamReader.next(); if (next == XMLStreamReader.START_ELEMENT) { count++; } if (next == XMLStreamReader.END_ELEMENT) { if (count == 0) { break; } count--; } } break; default: throw new IllegalStateException("Unknown state"); } }else if (event == XMLStreamReader.END_ELEMENT) { visitor.endElement( xmlStreamReader.getNamespaceURI(), xmlStreamReader.getLocalName()); } } return null; } catch (XMLStreamException e) { throw new RuntimeException("Failed to traverse document", e); } }

Target:
T getNextHandle() { try { while (xmlStreamReader.hasNext()) { int event = xmlStreamReader.next(); checkForHandle: switch (event) { case XMLStreamReader.START_ELEMENT: StartElementReaderImpl startElementReader = new StartElementReaderImpl(xmlStreamReader); NodeOperation nodeOperation = visitor.startElement(startElementReader); if (nodeOperation == null) { throw new IllegalStateException("No NodeOperation returned."); } switch (nodeOperation) { case DESCEND: break checkForHandle; case PROCESS: T handle = visitor.makeBufferedHandle(new XMLBranchStreamReader(xmlStreamReader)); if (handle != null) { return handle; } break checkForHandle; case SKIP: int depth = 0; while (xmlStreamReader.hasNext()) { int next = xmlStreamReader.next(); skipCheck: switch (next) { case XMLStreamReader.START_ELEMENT: depth++; break skipCheck; case XMLStreamReader.END_ELEMENT: if (depth == 0) { break checkForHandle; } depth--; break skipCheck; default: break skipCheck; } } break checkForHandle; default: throw new IllegalStateException("Unknown state"); } case XMLStreamReader.END_ELEMENT: visitor.endElement( xmlStreamReader.getNamespaceURI(), xmlStreamReader.getLocalName()); break checkForHandle; default: break checkForHandle; } } return null; } catch (XMLStreamException e) { throw new RuntimeException("Failed to traverse document", e); } }
Source:
public ContentEvent nextEvent() { InstanceContentEvent contentEvent = null; if (isReachedEndOfStream()) { contentEvent = new InstanceContentEvent(-1, firstInstance, false, true); contentEvent.setLast(true); finished = true; } else if (hasNext()) { numInstanceSent++; contentEvent = new InstanceContentEvent(numInstanceSent, nextInstance(), true, true); if (schedule == null && delay > 0) { schedule = timer.scheduleWithFixedDelay(new DelayTimeoutHandler(this), delay, delay, TimeUnit.MILLISECONDS); } } return contentEvent; }

Target:
public ContentEvent nextEvent() { InstanceContentEvent contentEvent = null; if (hasReachedEndOfStream()) { contentEvent = new InstanceContentEvent(-1, firstInstance, false, true); contentEvent.setLast(true); finished = true; } else if (hasNext()) { numInstanceSent++; contentEvent = new InstanceContentEvent(numInstanceSent, nextInstance(), true, true); if (schedule == null && delay > 0) { schedule = timer.scheduleWithFixedDelay(new DelayTimeoutHandler(this), delay, delay, TimeUnit.MICROSECONDS); } } return contentEvent; }
Source:
public final CompletionStage<Void> commit(int segment, InternalDataContainer container) { if (segment < 0) { throw new IllegalArgumentException("Segment must be 0 or greater"); } if (shouldCommit()) { if (isEvicted()) { CompletionStage<Void> evict = container.evict(segment, key); setCommitted(); return evict; } else if (isRemoved()) { container.remove(segment, key); setCommitted(); } else if (value != null) { container.put(segment, key, value, metadata, internalMetadata, created, lastUsed); setCommitted(); } } return CompletableFutures.completedNull(); }

Target:
public final CompletionStage<Void> commit(int segment, InternalDataContainer container) { if (segment < 0) { throw new IllegalArgumentException("Segment must be 0 or greater"); } if (shouldCommit()) { setCommitted(); if (isEvicted()) { return container.evict(segment, key); } else if (isRemoved()) { container.remove(segment, key); } else if (value != null) { container.put(segment, key, value, metadata, internalMetadata, created, lastUsed); } } return CompletableFutures.completedNull(); }
Source:
private void doForm(List<String> parameters) { form = new FormStyleLayout(); form.setType(FormType.HORIZONTAL); Anchor link = new Anchor(); link.setText(referenceLink); link.setHref(referenceLink); link.setTarget("_blank"); form.addAttribute("Reference Link", link); for (String param : parameters) { TextBox paramField = GWT.create(TextBox.class); form.addAttribute(param, paramField); fields.add(paramField); } this.setBody(form); this.add(new ModalFooter() {{ Button installButton = new Button(Constants.INSTANCE.InstallServiceTask()) {{ addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { List<String> parameters = fields.stream().map(textbox -> textbox.getValue()).collect(Collectors.toList()); presenter.installWithParameters(serviceTaskId, target, parameters); hide(); } }); }}; installButton.setType( ButtonType.PRIMARY ); add(installButton); add(new Button(Constants.INSTANCE.Cancel()) {{ addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { hide(); } }); }}); }}); }

Target:
private void doForm(List<String> parameters) { form = new FormStyleLayout(); form.setType(FormType.HORIZONTAL); Anchor link = new Anchor(); link.setText(referenceLink); link.setHref(referenceLink); link.setTarget("_blank"); form.addAttribute("Reference Link", link); for (String param : parameters) { TextBox paramField = GWT.create(TextBox.class); form.addAttribute(param, paramField); fields.add(paramField); } this.setBody(form); Button installButton = new Button(Constants.INSTANCE.InstallServiceTask()); installButton.setType(ButtonType.PRIMARY); installButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { List<String> parameters = fields.stream().map(textbox -> textbox.getValue()).collect(Collectors.toList()); presenter.installWithParameters(serviceTaskId, target, parameters); hide(); } }); ModalFooter footer = new ModalFooter(); Button cancelButton = new Button(Constants.INSTANCE.Cancel()); cancelButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { hide(); } }); footer.add(installButton); footer.add(cancelButton); this.add(footer); }
Source:
public static boolean extractFileFromZip(String filePath, String file, String name) throws Exception { ZipInputStream inZip = new ZipInputStream( new BufferedInputStream( new FileInputStream(filePath))); byte data[] = new byte[BUFFER_SIZE]; boolean found = false; ZipEntry ze; while((ze = inZip.getNextEntry()) != null) { if(ze.getName().equals(name)) { found = true; File oldFile = new File(file); if(oldFile.exists()) { if(!oldFile.delete()) { throw new Exception("Could not delete " + file); } } FileOutputStream outFile = new FileOutputStream(file); int count; while((count = inZip.read(data)) != -1) { outFile.write(data, 0, count); } outFile.close(); inZip.closeEntry(); } } return found; }

Target:
public static boolean extractFileFromZip(String filePath, String file, String name) throws Exception { ZipInputStream inZip = new ZipInputStream( new BufferedInputStream( new FileInputStream(filePath))); byte data[] = new byte[BUFFER_SIZE]; boolean found = false; ZipEntry ze; while((ze = inZip.getNextEntry()) != null) { if(ze.getName().equals(name)) { found = true; File oldFile = new File(file); if(oldFile.exists()) { if(!oldFile.delete()) { throw new Exception("Could not delete " + file); } } FileOutputStream outFile = new FileOutputStream(file); int count = 0; while((count = inZip.read(data)) != -1) { outFile.write(data, 0, count); } outFile.close(); inZip.closeEntry(); } } return found; }
Source:
public void testArrayRefToLiteralCharArraySameLengths() throws Exception { Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); try (Connection conn = DriverManager.getConnection(getUrl(), props)) { PreparedStatement stmt = conn.prepareStatement("select ?[2] from " + "\"SYSTEM\".\"CATALOG\" limit 1"); Array array = conn.createArrayOf("CHAR", new String[] {"a","b","c"}); stmt.setArray(1, array); ResultSet rs = stmt.executeQuery(); assertTrue(rs.next()); assertEquals("b", rs.getString(1)); assertFalse(rs.next()); } }

Target:
public void testArrayRefToLiteralCharArraySameLengths() throws Exception { Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); try (Connection conn = DriverManager.getConnection(getUrl(), props)) { PreparedStatement stmt = conn.prepareStatement(TEST_QUERY); Array array = conn.createArrayOf("CHAR", new String[] {"a","b","c"}); stmt.setArray(1, array); ResultSet rs = stmt.executeQuery(); assertTrue(rs.next()); assertEquals("b", rs.getString(1)); assertFalse(rs.next()); } }
Source:
public CloseableGSSContext(String serviceName, String krb5Keytab, String krb5ccPath, String krb5ClientPrincipal, URI serviceUri) { requireNonNull(serviceName, "serviceName is null"); requireNonNull(serviceUri, "serviceUri is null"); try { loginContext = new LoginContext("", null, null, new Configuration() { @Override public AppConfigurationEntry[] getAppConfigurationEntry(String name) { ImmutableMap.Builder<String, String> optionsBuilder = ImmutableMap.builder(); optionsBuilder.put("refreshKrb5Config", "true"); optionsBuilder.put("doNotPrompt", "true"); if (log.isDebugEnabled()) { optionsBuilder.put("debug", "true"); } if (krb5Keytab != null) { optionsBuilder.put("useKeytab", "true"); optionsBuilder.put("keyTab", "keyTab"); } if (krb5ccPath != null) { optionsBuilder.put("ticketCache", krb5ccPath); optionsBuilder.put("useTicketCache", "true"); optionsBuilder.put("renewTGT", "true"); } if (krb5ClientPrincipal != null) { optionsBuilder.put("principal", krb5ClientPrincipal); } return new AppConfigurationEntry[] { new AppConfigurationEntry(Krb5LoginModule.class.getName(), REQUIRED, optionsBuilder.build()) }; } }); String servicePrincipal = KerberosUtil.getServicePrincipal(serviceName, serviceUri.getHost()); Subject subject = KerberosUtil.getClientSubject(loginContext); context = KerberosUtil.getGssContext(subject, servicePrincipal); } catch (LoginException | UnknownHostException e) { throw new AuthenticationException(e); } }

Target:
public CloseableGSSContext(String serviceName, String krb5Keytab, String krb5ccPath, String krb5ClientPrincipal, URI serviceUri) { requireNonNull(serviceName, "serviceName is null"); requireNonNull(serviceUri, "serviceUri is null"); try { loginContext = new LoginContext("", null, null, new Configuration() { @Override public AppConfigurationEntry[] getAppConfigurationEntry(String name) { ImmutableMap.Builder<String, String> optionsBuilder = ImmutableMap.builder(); optionsBuilder.put("refreshKrb5Config", "true"); optionsBuilder.put("doNotPrompt", "true"); if (log.isDebugEnabled()) { optionsBuilder.put("debug", "true"); } if (krb5Keytab != null) { optionsBuilder.put("useKeytab", "true"); optionsBuilder.put("keyTab", krb5Keytab); } if (krb5ccPath != null) { optionsBuilder.put("ticketCache", krb5ccPath); optionsBuilder.put("useTicketCache", "true"); optionsBuilder.put("renewTGT", "true"); } if (krb5ClientPrincipal != null) { optionsBuilder.put("principal", krb5ClientPrincipal); } return new AppConfigurationEntry[] { new AppConfigurationEntry(Krb5LoginModule.class.getName(), REQUIRED, optionsBuilder.build()) }; } }); String servicePrincipal = KerberosUtil.getServicePrincipal(serviceName, serviceUri.getHost()); Subject subject = KerberosUtil.getClientSubject(loginContext); context = KerberosUtil.getGssContext(subject, servicePrincipal); } catch (LoginException | UnknownHostException e) { throw new AuthenticationException(e); } }
Source:
public OpenConsoleAction(StateManager stateManager) { this.stateManager = stateManager; this.executable.bind(ActionHelper.isFieldSetForSelectedEntry(StandardField.FILE, stateManager)); }

Target:
public OpenConsoleAction(StateManager stateManager) { this.stateManager = stateManager; this.executable.bind(ActionHelper.needsDatabase(stateManager)); }
Source:
public CodecSupplier(Class<T> clazz, Metadata metadata) { this.clazz = clazz; this.metadata = metadata; ObjectMapperProvider objectMapperProvider = new ObjectMapperProvider(); objectMapperProvider.setJsonDeserializers(ImmutableMap.of(Type.class, new TypeDeserializer())); this.codecFactory = new JsonCodecFactory(objectMapperProvider); }

Target:
public CodecSupplier(Class<T> clazz, Metadata metadata) { this.clazz = requireNonNull(clazz, "clazz is null"); this.metadata = requireNonNull(metadata, "metadata is null"); ObjectMapperProvider objectMapperProvider = new ObjectMapperProvider(); objectMapperProvider.setJsonDeserializers(ImmutableMap.of(Type.class, new TypeDeserializer())); this.codecFactory = new JsonCodecFactory(objectMapperProvider); }
Source:
public String getDescriptiveText() { String defaultLocale = Locale.getDefault().getLanguage(); String descriptiveText = getDescriptiveText(defaultLocale); if (descriptiveText == null) { descriptiveText = getDescriptiveText("en"); if (descriptiveText == null) { descriptiveText = getDescriptiveText(""); if (descriptiveText == null) { descriptiveText = getDescriptiveText(null); } } } return descriptiveText; }

Target:
public String getDescriptiveText() { String defaultLocale = Locale.getDefault().getLanguage(); String descriptiveText = getDescriptiveText(defaultLocale); if (descriptiveText == null) { descriptiveText = getDescriptiveText("en"); if (descriptiveText == null) { descriptiveText = getDescriptiveText(""); } } return descriptiveText; }
Source:
public SourceFile testParameterPath(@ApiParam(value = "Workflow id", required = true) @PathParam("workflowId") Long workflowId, @QueryParam("version") String version){ Workflow workflow = workflowDAO.findById(workflowId); if (workflow.getDescriptorType().toLowerCase().equals("cwl")) { return entryVersionHelper.getSourceFile(workflowId, version, FileType.CWL_TEST_JSON); } else { return entryVersionHelper.getSourceFile(workflowId, version, FileType.WDL_TEST_JSON); } }

Target:
public SourceFile testParameterPath(@ApiParam(value = "Workflow id", required = true) @PathParam("workflowId") Long workflowId, @QueryParam("version") String version){ Workflow workflow = workflowDAO.findById(workflowId); if (workflow.getDescriptorType().toLowerCase().equals(DescriptorType.CWL.toString())) { return entryVersionHelper.getSourceFile(workflowId, version, FileType.CWL_TEST_JSON); } else { return entryVersionHelper.getSourceFile(workflowId, version, FileType.WDL_TEST_JSON); } }
Source:
public String getTupleTypeDescription(TupleTypeId tupleType) { if (tupleType.getId().equals(CoreTupleTypes.TupleMetaType)) { return "TupleMetaType"; } if (tupleType.getId().equals(CoreTupleTypes.ViewApplicability)) { return "ViewApplicability"; } if (tupleType.getId().equals(CoreTupleTypes.OseeTypeDef)) { return "OseeTypeDef"; } if (tupleType.getId().equals(CoreTupleTypes.ArtifactReferenceApplicabilityType)) { return "ArtifactReferenceApplicabilityType"; } if (tupleType.getId().equals(CoreTupleTypes.BranchView)) { return "BranchView"; } if (tupleType.getId().equals(CoreTupleTypes.VersionConfig)) { return "VersionConfig"; } if (tupleType.getId().equals(CoreTupleTypes.FixedMaintenanceData)) { return "FixedMaintenanceData"; } if (tupleType.getId().equals(CoreTupleTypes.VariableMaintenanceData)) { return "VariableMaintenanceData"; } if (tupleType.getId().equals(CoreTupleTypes.CrossRefMaintenanceData)) { return "CrossRefMaintenanceData"; } if (tupleType.getId().equals(CoreTupleTypes.ReversalMaintenanceData)) { return "ReversalMaintenanceData"; } if (tupleType.getId().equals(CoreTupleTypes.LruDataTypes)) { return "LruDataTypes"; } if (tupleType.getId().equals(CoreTupleTypes.ReversalMaintenanceData)) { return "ReversalMaintenanceData"; } if (tupleType.getId().equals(CoreTupleTypes.LruFormatData)) { return "LruFormatData"; } return "N/A"; }

Target:
public String getTupleTypeDescription(TupleTypeId tupleType) { if (tupleType.getId().equals(CoreTupleTypes.TupleMetaType.getId())) { return "TupleMetaType"; } if (tupleType.getId().equals(CoreTupleTypes.ViewApplicability.getId())) { return "ViewApplicability"; } if (tupleType.getId().equals(CoreTupleTypes.OseeTypeDef.getId())) { return "OseeTypeDef"; } if (tupleType.getId().equals(CoreTupleTypes.ArtifactReferenceApplicabilityType.getId())) { return "ArtifactReferenceApplicabilityType"; } if (tupleType.getId().equals(CoreTupleTypes.BranchView.getId())) { return "BranchView"; } if (tupleType.getId().equals(CoreTupleTypes.VersionConfig.getId())) { return "VersionConfig"; } if (tupleType.getId().equals(CoreTupleTypes.FixedMaintenanceData.getId())) { return "FixedMaintenanceData"; } if (tupleType.getId().equals(CoreTupleTypes.VariableMaintenanceData.getId())) { return "VariableMaintenanceData"; } if (tupleType.getId().equals(CoreTupleTypes.CrossRefMaintenanceData.getId())) { return "CrossRefMaintenanceData"; } if (tupleType.getId().equals(CoreTupleTypes.ReversalMaintenanceData.getId())) { return "ReversalMaintenanceData"; } if (tupleType.getId().equals(CoreTupleTypes.LruDataTypes.getId())) { return "LruDataTypes"; } if (tupleType.getId().equals(CoreTupleTypes.ReversalMaintenanceData.getId())) { return "ReversalMaintenanceData"; } if (tupleType.getId().equals(CoreTupleTypes.LruFormatData.getId())) { return "LruFormatData"; } return "N/A"; }
Source:
public void validateFullRepresentation() throws Exception { assertPropEquals("uuid", getObject().getUuid()); assertPropEquals("name", getObject().getName()); assertPropEquals("description", getObject().getDescription()); assertPropEquals("startTime", getObject().getStartTime()); assertPropEquals("started", getObject().getStarted()); assertPropEquals("taskClass", getObject().getTaskClass()); assertPropEquals("lastExecutionTime", getObject().getLastExecutionTime()); assertPropPresent("startTimePattern"); assertPropPresent("properties"); }

Target:
public void validateFullRepresentation() throws Exception { assertPropEquals("uuid", getObject().getUuid()); assertPropEquals("name", getObject().getName()); assertPropEquals("description", getObject().getDescription()); assertPropEquals("startTime", getObject().getStartTime()); assertPropEquals("started", getObject().getStarted()); assertPropEquals("taskClass", getObject().getTaskClass()); assertPropEquals("lastExecutionTime", getObject().getLastExecutionTime()); assertPropEquals("startTimePattern", getObject().getStartTimePattern()); assertPropEquals("properties", getObject().getProperties()); }
Source:
@Test public void privateFieldsFail() { class Test { @Inject private Object nope; } @Module(entryPoints = Test.class) class TestModule { @Provides Object provideObject() { return null; } } try { ObjectGraph.create(new TestModule()).inject(new Test()); } catch (IllegalStateException e) { assertThat(e.getMessage()).contains("Can't inject private field: "); } }

Target:
@Test public void privateFieldsFail() { class Test { @Inject private Object nope; } @Module(entryPoints = Test.class) class TestModule { @Provides Object provideObject() { return null; } } try { ObjectGraph.create(new TestModule()).inject(new Test()); fail(); } catch (IllegalStateException e) { assertThat(e.getMessage()).contains("Can't inject private field: "); } }
Source:
public String getAccessTokenEncryptedResponseAlg() { return id_token_encrypted_response_alg; }

Target:
public String getAccessTokenEncryptedResponseAlg() { return access_token_encrypted_response_alg; }
Source:
private void populateNamedCredential(Environment environment, String name) { if (!name.equals("") && !name.endsWith(".")) { name = name + "."; } String tenantIdKey = AZURE_CREDENTIAL_PREFIX + name + "tenantId"; String clientIdKey = AZURE_CREDENTIAL_PREFIX + name + "clientId"; String clientSecretKey = AZURE_CREDENTIAL_PREFIX + name + "clientSecret"; String tenantId = environment.getProperty(tenantIdKey); String clientId = environment.getProperty(clientIdKey); String clientSecret = environment.getProperty(clientSecretKey); if (tenantId != null && clientId != null && clientSecret != null) { TokenCredential credential = new ClientSecretCredentialBuilder() .tenantId(tenantId) .clientId(clientId) .clientSecret(clientSecret) .build(); credentials.put(name, credential); return; } String clientCertificateKey = AZURE_CREDENTIAL_PREFIX + name + "clientSecret"; String clientCertificatePath = environment.getProperty(clientCertificateKey); if (clientCertificatePath != null) { TokenCredential credential = new ClientCertificateCredentialBuilder() .tenantId(tenantId) .clientId(clientId) .pemCertificate(clientCertificatePath) .build(); credentials.put(name, credential); } }

Target:
private void populateNamedCredential(Environment environment, String name) { String standardizedName = name; if (!standardizedName.equals("") && !standardizedName.endsWith(".")) { standardizedName = standardizedName + "."; } String tenantIdKey = AZURE_CREDENTIAL_PREFIX + standardizedName + "tenantId"; String clientIdKey = AZURE_CREDENTIAL_PREFIX + standardizedName + "clientId"; String clientSecretKey = AZURE_CREDENTIAL_PREFIX + standardizedName + "clientSecret"; String tenantId = environment.getProperty(tenantIdKey); String clientId = environment.getProperty(clientIdKey); String clientSecret = environment.getProperty(clientSecretKey); if (tenantId != null && clientId != null && clientSecret != null) { TokenCredential credential = new ClientSecretCredentialBuilder() .tenantId(tenantId) .clientId(clientId) .clientSecret(clientSecret) .build(); credentials.put(name, credential); return; } String clientCertificateKey = AZURE_CREDENTIAL_PREFIX + standardizedName + "clientCertificate"; String clientCertificatePath = environment.getProperty(clientCertificateKey); if (tenantId != null && clientId != null && clientCertificatePath != null) { TokenCredential credential = new ClientCertificateCredentialBuilder() .tenantId(tenantId) .clientId(clientId) .pemCertificate(clientCertificatePath) .build(); credentials.put(name, credential); return; } if (!name.equals("")) { throw new RuntimeException("Configuration for azure.credential." + name + " is incomplete"); } }
Source:
protected void executeQueryCommand() { if (connect(getParameters().getServerName())) { String glusterServers = executeCommand(); if (StringUtils.isNotEmpty(glusterServers)) { DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder docBuilder; try { docBuilder = docBuilderFactory.newDocumentBuilder(); Document doc = docBuilder.parse(glusterServers); doc.getDocumentElement().normalize(); NodeList listOfPeers = doc.getElementsByTagName(PEER); parseHostName(listOfPeers); } catch (ParserConfigurationException e1) { log.errorFormat("There is problem in parsing xml." + e1.getMessage()); } catch (SAXException e2) { log.errorFormat("Error in parsing xml." + e2.getMessage()); } catch (IOException e3) { log.errorFormat("There is problem in reading the file." + e3.getMessage()); } serverFingerprint.put(getParameters().getServerName(), getFingerprint(getParameters().getServerName())); getQueryReturnValue().setReturnValue(getServerFingerPrintMap()); } else { log.error("Could not get the peer list form the host: " + getParameters().getServerName()); } } else { log.error("Could not connect to host: " + getParameters().getServerName()); } }

Target:
protected void executeQueryCommand() { if (connect(getParameters().getServerName())) { String glusterServers = executeCommand(); if (StringUtils.isNotEmpty(glusterServers)) { DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder docBuilder; try { File returnXml = new File(System.getProperty("java.io.tmpdir") + "/peers.xml"); FileWriter xmlFileWriter = new FileWriter(returnXml); xmlFileWriter.write(glusterServers); xmlFileWriter.close(); docBuilder = docBuilderFactory.newDocumentBuilder(); Document doc = docBuilder.parse(returnXml); doc.getDocumentElement().normalize(); NodeList listOfPeers = doc.getElementsByTagName(PEER); extractServers(listOfPeers); } catch (ParserConfigurationException e1) { log.errorFormat("There is problem in parsing xml." + e1.getMessage()); throw new RuntimeException(e1); } catch (SAXException e2) { log.errorFormat("Error in parsing xml." + e2.getMessage()); throw new RuntimeException(e2); } catch (IOException e3) { log.errorFormat("There is problem in reading the file." + e3.getMessage()); throw new RuntimeException(e3); } fingerprints.put(getParameters().getServerName(), getFingerprint(getParameters().getServerName())); getQueryReturnValue().setReturnValue(getServerFingerPrintMap()); } else { log.error("Could not get the peer list form the host: " + getParameters().getServerName()); } } else { log.error("Could not connect to host: " + getParameters().getServerName()); } }
Source:
private long getDateMidnightMs(int date) { SimpleDateFormat format = new SimpleDateFormat("yyyyMMddz"); try { return format.parse(date + "UTC").getTime(); } catch (Exception e) { throw new AssertionError("unexpected: " + date); } }

Target:
private long getDateMidnightMs(int date) { SimpleDateFormat format = new SimpleDateFormat("yyyyMMddz"); try { return format.parse(date + "UTC").getTime(); } catch (ParseException e) { throw new AssertionError("unexpected: " + date); } }
Source:
public void run() { if (logger.isFinestEnabled()) { logger.finest("Starting TcpIpAcceptor on " + registry); } try { selector = Selector.open(); for (ServerSocketRegistry.Pair entry : registry) { ServerSocketChannel serverSocketChannel = entry.getChannel(); EndpointQualifier qualifier = entry.getQualifier(); serverSocketChannel.configureBlocking(false); SelectionKey selectionKey = serverSocketChannel.register(selector, OP_ACCEPT); selectionKey.attach(qualifier); selectionKeys.add(selectionKey); } if (selectorWorkaround) { acceptLoopWithSelectorFix(); } else { acceptLoop(); } } catch (OutOfMemoryError e) { OutOfMemoryErrorDispatcher.onOutOfMemory(e); } catch (Throwable e) { logger.severe(e.getClass().getName() + ": " + e.getMessage(), e); } finally { closeSelector(); } }

Target:
public void run() { if (logger.isFinestEnabled()) { logger.finest("Starting TcpIpAcceptor on " + registry); } try { selector = Selector.open(); for (ServerSocketRegistry.Pair entry : registry) { ServerSocketChannel serverSocketChannel = entry.getChannel(); serverSocketChannel.configureBlocking(false); SelectionKey selectionKey = serverSocketChannel.register(selector, OP_ACCEPT); selectionKey.attach(entry); selectionKeys.add(selectionKey); } if (selectorWorkaround) { acceptLoopWithSelectorFix(); } else { acceptLoop(); } } catch (OutOfMemoryError e) { OutOfMemoryErrorDispatcher.onOutOfMemory(e); } catch (Throwable e) { logger.severe(e.getClass().getName() + ": " + e.getMessage(), e); } finally { closeSelector(); } }
Source:
public void stopPresenting() { taskDisplayer.detach(taskActionListener); subscriptions.clear(); subscriptions = new CompositeSubscription(); }

Target:
public void stopPresenting() { taskDisplayer.detach(taskActionListener); clearSubscriptions(); }
Source:
public <T extends Transformer> TransformerComponentBuilder<T> addTransformer(TransformerComponentBuilder<T> tjb) { if (tjb.getComponentRequirement() == null) { tjb.setComponentRequirement(_defaultRequirement); } _transformerComponentBuilders.add(tjb); onComponentAdded(); List<TransformerChangeListener> listeners = new ArrayList<>(_transformerChangeListeners); for (TransformerChangeListener listener : listeners) { listener.onAdd(tjb); } return tjb; }

Target:
public <T extends Transformer> TransformerComponentBuilder<T> addTransformer(TransformerComponentBuilder<T> tjb) { if (tjb.getComponentRequirement() == null) { tjb.setComponentRequirement(_defaultRequirement); } _transformerComponentBuilders.add(tjb); onComponentAdded(); final List<TransformerChangeListener> listeners = new ArrayList<>(_transformerChangeListeners); for (TransformerChangeListener listener : listeners) { listener.onAdd(tjb); } return tjb; }
Source:
public boolean commitPrimaryColumn(CommitData cd, Stamp commitStamp) { SyncCommitObserver sco = new SyncCommitObserver(); cd.commitObserver = sco; try { CommitStep firstStep = new GetCommitStampStepTest(commitStamp); firstStep.andThen(new WriteNotificationsStep()).andThen(new CommitPrimaryStep()); firstStep.compose(cd).thenRun(() -> cd.commitObserver.committed()) .exceptionally(throwable -> { cd.commitObserver.failed(throwable); return null; }); sco.waitForCommit(); } catch (CommitException e) { return false; } return true; }

Target:
public boolean commitPrimaryColumn(CommitData cd, Stamp commitStamp) { SyncCommitObserver sco = new SyncCommitObserver(); cd.commitObserver = sco; try { CommitStep firstStep = new GetCommitStampStepTest(commitStamp); firstStep.andThen(new WriteNotificationsStep()).andThen(new CommitPrimaryStep()) .andThen(new CommittedTestStep()); firstStep.compose(cd).exceptionally(throwable -> { cd.commitObserver.failed(throwable); return null; }); sco.waitForCommit(); } catch (CommitException e) { return false; } catch (Exception e) { throw new FluoException(e); } return true; }
Source:
public static void log(String toLog) { try { BufferedWriter buffWriter = new BufferedWriter(new FileWriter(loggingFile, true)); buffWriter.newLine(); buffWriter.write(toLog); buffWriter.close(); } catch (IOException e) { System.out.println(e); } }

Target:
public static void log(String toLog) { if (started == true) { try { BufferedWriter buffWriter = new BufferedWriter(new FileWriter(loggingFile, true)); buffWriter.newLine(); buffWriter.write(toLog); buffWriter.close(); } catch (IOException e) { System.out.println(e); } } }
Source:
public ByteBuf decrypt(ByteBuf toDecrypt, SecretKeySpec key) throws GeneralSecurityException { try { Cipher decrypter = Cipher.getInstance(GCM_CRYPTO_INSTANCE, "BC"); byte[] iv = deserializeIV(new ByteBufInputStream(toDecrypt)); decrypter.init(Cipher.DECRYPT_MODE, key, new IvParameterSpec(iv)); int outputSize = decrypter.getOutputSize(toDecrypt.readableBytes()); ByteBuf decryptedContent = ByteBufAllocator.DEFAULT.heapBuffer(outputSize); boolean toRelease = false; if (toDecrypt.nioBufferCount() != 1) { toRelease = true; ByteBuf temp = ByteBufAllocator.DEFAULT.heapBuffer(toDecrypt.readableBytes()); temp.writeBytes(toDecrypt); toDecrypt = temp; } try { ByteBuffer toDecryptBuffer = toDecrypt.nioBuffer(); ByteBuffer decryptedContentBuffer = decryptedContent.nioBuffer(0, outputSize); int n = decrypter.doFinal(toDecryptBuffer, decryptedContentBuffer); decryptedContent.writerIndex(decryptedContent.writerIndex() + n); return decryptedContent; } finally { if (toRelease) { toDecrypt.release(); } else { toDecrypt.readerIndex(toDecrypt.readerIndex() + toDecrypt.readableBytes()); } } } catch (Exception e) { throw new GeneralSecurityException("Exception thrown while decrypting data", e); } }

Target:
public ByteBuf decrypt(ByteBuf toDecrypt, SecretKeySpec key) throws GeneralSecurityException { try { Cipher decrypter = Cipher.getInstance(GCM_CRYPTO_INSTANCE, "BC"); byte[] iv = deserializeIV(new ByteBufInputStream(toDecrypt)); decrypter.init(Cipher.DECRYPT_MODE, key, new IvParameterSpec(iv)); int outputSize = decrypter.getOutputSize(toDecrypt.readableBytes()); ByteBuf decryptedContent = ByteBufAllocator.DEFAULT.heapBuffer(outputSize); boolean toRelease = false; if (toDecrypt.nioBufferCount() != 1) { toRelease = true; ByteBuf temp = ByteBufAllocator.DEFAULT.heapBuffer(toDecrypt.readableBytes()); temp.writeBytes(toDecrypt); toDecrypt = temp; } try { ByteBuffer toDecryptBuffer = toDecrypt.nioBuffer(); ByteBuffer decryptedContentBuffer = decryptedContent.nioBuffer(0, outputSize); int n = decrypter.doFinal(toDecryptBuffer, decryptedContentBuffer); decryptedContent.writerIndex(decryptedContent.writerIndex() + n); return decryptedContent; } finally { if (toRelease) { toDecrypt.release(); } else { toDecrypt.skipBytes(toDecrypt.readableBytes()); } } } catch (Exception e) { throw new GeneralSecurityException("Exception thrown while decrypting data", e); } }
Source:
public Map<String, Object> getContextMap() { Map<String, Object> context = getContext().context; if (context instanceof OgnlContext) { ((OgnlContext) context).put(TypeConverter.TYPE_CONVERTER_CONTEXT_KEY, ((OgnlContext) context).getTypeConverter()); } return context; }

Target:
public Map<String, Object> getContextMap() { return getContext().context; }
Source:
public boolean isTerrainPopulated() { return this.cubeMap.all().stream().anyMatch(c -> (c.getGeneratorStage() == GeneratorStage.LIVE)); }

Target:
public boolean isTerrainPopulated() { return this.cubeMap.all().stream().anyMatch(c -> c.getGeneratorStage().isLastStage()); }
Source:
public AgentFailuresFileListCap(File folder, FilenameFilter filter, int size) { this.folder = folder; this.size = size; if (!folder.exists() && !folder.mkdirs()) throw new Error("Failed to create "+folder); File[] sortedFiles = folder.listFiles(filter); if (sortedFiles==null) return; Arrays.sort(sortedFiles, new Comparator<File>() { public int compare(File o1, File o2) { long l = o1.lastModified() - o2.lastModified(); if (l<0) return -1; if (l>0) return 1; return 0; } }); files.addAll(Arrays.asList(sortedFiles)); }

Target:
public AgentFailuresFileListCap(File folder, FilenameFilter filter, int size) { this.folder = folder; this.size = size; if (!folder.exists() && !folder.mkdirs()) { throw new Error("Failed to create " + folder); } File[] sortedFiles = folder.listFiles(filter); if (sortedFiles==null) return; Arrays.sort(sortedFiles, new Comparator<File>() { public int compare(File o1, File o2) { long l = o1.lastModified() - o2.lastModified(); if (l<0) return -1; if (l>0) return 1; return 0; } }); files.addAll(Arrays.asList(sortedFiles)); }
Source:
private static String percentDecode(String encoded) { Preconditions.checkArgument(nonNull(encoded), "string must not be null"); Preconditions.checkArgument(ascii().matchesAllOf(encoded), "string must be ASCII"); ByteArrayOutputStream out = new ByteArrayOutputStream(encoded.length()); for (int i = 0; i < encoded.length(); i++) { char c = encoded.charAt(i); if (c == '%') { Preconditions.checkArgument(i + 2 < encoded.length(), "percent encoded value is truncated"); int high = Character.digit(encoded.charAt(i + 1), 16); int low = Character.digit(encoded.charAt(i + 2), 16); Preconditions.checkArgument(high != -1 && low != -1, "percent encoded value is not a valid hex string: ", encoded.substring(i, i + 2)); int value = (high << 4) | (low); out.write(value); i += 2; } else { out.write((int) c); } } try { return UTF_8.newDecoder() .onMalformedInput(CodingErrorAction.REPORT) .decode(ByteBuffer.wrap(out.toByteArray())) .toString(); } catch (CharacterCodingException e) { throw new IllegalArgumentException("input does not represent a proper UTF8-encoded string"); } }

Target:
private static String percentDecode(String encoded) { requireNonNull(encoded, "encoded is null"); Preconditions.checkArgument(ascii().matchesAllOf(encoded), "string must be ASCII"); ByteArrayOutputStream out = new ByteArrayOutputStream(encoded.length()); for (int i = 0; i < encoded.length(); i++) { char c = encoded.charAt(i); if (c == '%') { Preconditions.checkArgument(i + 2 < encoded.length(), "percent encoded value is truncated"); int high = Character.digit(encoded.charAt(i + 1), 16); int low = Character.digit(encoded.charAt(i + 2), 16); Preconditions.checkArgument(high != -1 && low != -1, "percent encoded value is not a valid hex string: ", encoded.substring(i, i + 2)); int value = (high << 4) | (low); out.write(value); i += 2; } else { out.write((int) c); } } try { return UTF_8.newDecoder() .onMalformedInput(CodingErrorAction.REPORT) .decode(ByteBuffer.wrap(out.toByteArray())) .toString(); } catch (CharacterCodingException e) { throw new IllegalArgumentException("input does not represent a proper UTF8-encoded string"); } }
Source:
public void edit(final HostRestartConfirmationModel object) { driver.edit(object); if (object.getForceToMaintenanceLabel() != null) { forceToMaintenance.setLabel(object.getForceToMaintenanceLabel()); } forceToMaintenance.asCheckBox().setValue(object.getForceToMaintenance().getEntity()); object.getPropertyChangedEvent().addListener((ev, sender, args) -> { if ("ForceToMaintenanceLabel".equals(args.propertyName)) { HostRestartConfirmationModel entity = (HostRestartConfirmationModel) sender; forceToMaintenance.setLabel(entity.getForceToMaintenanceLabel()); } }); }

Target:
public void edit(final HostRestartConfirmationModel object) { driver.edit(object); forceToMaintenance.asCheckBox().setValue(object.getForceToMaintenance().getEntity()); }
Source:
public Collection<EObject> getDirectEventsOn(Participant context, EObject parent) { List<EventContext> structure = computeContainmentStructure(context); LinkedHashSet<EObject> events = new LinkedHashSet<EObject>(); for (EventContext ec : structure) { if (ec.getParent().equals(parent)) { events.add(ec.getElement()); } } Set<EObject> result = new HashSet<EObject>(); for (EObject event : events) { if (event != parent) { result.add(event); } } return result; }

Target:
public Collection<EObject> getDirectEventsOn(Participant context, EObject parent) { List<EventContext> structure = computeContainmentStructure(context); LinkedHashSet<EObject> events = new LinkedHashSet<EObject>(); for (EventContext ec : structure) { if (ec.getParent().equals(parent)) { events.add(ec.getElement()); } } Set<EObject> result = new LinkedHashSet<EObject>(); for (EObject event : events) { if (event != parent) { result.add(event); } } return result; }
Source:
public OneValuedMetaProperty<T,List<R>> asFunctionalProperty() { return (OneValuedMetaProperty<T,List<R>>) null; }

Target:
public OneValuedMetaProperty<T,List<R>> asFunctionalProperty() { throw new UnsupportedOperationException(); }
Source:
public Builder addMember(MemberRef member) { this.members.add(member); return this; }

Target:
public Builder addMember(MemberRef member) { members.add(member); return this; }
Source:
public DOI(String doi) { Objects.requireNonNull(doi); String trimmedDoi = doi.trim(); if (doi.matches(HTTP_EXP) || doi.matches(SHORT_DOI_HTTP_EXP)) { try { URI url = new URI(trimmedDoi); trimmedDoi = url.getScheme() + "://" + url.getHost() + url.getPath(); } catch (URISyntaxException e) { throw new IllegalArgumentException(doi + " is not a valid HTTP DOI/Short DOI."); } } Matcher matcher = EXACT_DOI_PATT.matcher(trimmedDoi); if (matcher.find()) { this.doi = matcher.group(1); } else { Matcher shortDoiMatcher = EXACT_SHORT_DOI_PATT.matcher(trimmedDoi); if (shortDoiMatcher.find()) { this.doi = shortDoiMatcher.group(1); isShortDoi = true; checkForAmbiguousShortDOI(); } else { Matcher shortcutDoiMatcher = EXACT_SHORT_DOI_SHORTCUT.matcher(trimmedDoi); if (shortcutDoiMatcher.find()) { this.doi = "10/"+shortcutDoiMatcher.group(1); isShortDoi = true; } else { throw new IllegalArgumentException(trimmedDoi + " is not a valid DOI/Short DOI."); } } } }

Target:
public DOI(String doi) { Objects.requireNonNull(doi); String trimmedDoi = doi.trim(); if (doi.matches(HTTP_EXP) || doi.matches(SHORT_DOI_HTTP_EXP)) { try { URI url = new URI(trimmedDoi); trimmedDoi = url.getScheme() + "://" + url.getHost() + url.getPath(); } catch (URISyntaxException e) { throw new IllegalArgumentException(doi + " is not a valid HTTP DOI/Short DOI."); } } Matcher matcher = EXACT_DOI_PATT.matcher(trimmedDoi); if (matcher.find()) { this.doi = matcher.group(1); } else { Matcher shortDoiMatcher = EXACT_SHORT_DOI_PATT.matcher(trimmedDoi); if (shortDoiMatcher.find()) { this.doi = shortDoiMatcher.group(1); isShortDoi = true; } else { Matcher shortcutDoiMatcher = EXACT_SHORT_DOI_SHORTCUT.matcher(trimmedDoi); if (shortcutDoiMatcher.find()) { this.doi = "10/" + shortcutDoiMatcher.group(1); isShortDoi = true; } else { throw new IllegalArgumentException(trimmedDoi + " is not a valid DOI/Short DOI."); } } } }
Source:
public boolean isPaged() { JsonValue jsonPaged = mRepresentation.getProperties().getPropertyValue(BoxRepresentation.FIELD_PROPERTIES_PAGED); return (jsonPaged != null && TextUtils.equals(jsonPaged.asString(), Boolean.TRUE.toString())); }

Target:
public boolean isPaged() { return mRepresentation.getProperties().isPaged(); }
Source:
public void bind(Binding params, PreparedStatement statement) throws SQLException { if (stmt.positionalOnly) { boolean finished = false; for (int i = 0; !finished; ++i) { final Optional<Argument> a = params.findForPosition(i); if (a.isPresent()) { try { a.get().apply(i + 1, statement, this.context); } catch (SQLException e) { throw new UnableToExecuteStatementException( String.format("Exception while binding positional param at (0 based) position %d", i), e, context); } } else { finished = true; } } } else { int i = 0; for (String named_param : stmt.params) { if ("*".equals(named_param)) { continue; } final int index = i; Argument a = Stream.concat( JdbiStreams.toStream(params.findForName(named_param)), JdbiStreams.toStream(params.findForPosition(i))) .findFirst() .orElseThrow(() -> { String msg = String.format("Unable to execute, no named parameter matches " + "\"%s\" and no positional param for place %d (which is %d in " + "the JDBC 'start at 1' scheme) has been set.", named_param, index, index + 1); return new UnableToExecuteStatementException(msg, context); }); try { a.apply(i + 1, statement, this.context); } catch (SQLException e) { throw new UnableToCreateStatementException(String.format("Exception while binding '%s'", named_param), e, context); } i++; } } }

Target:
public void bind(Binding params, PreparedStatement statement) throws SQLException { if (stmt.positionalOnly) { boolean finished = false; for (int i = 0; !finished; ++i) { final Optional<Argument> a = params.findForPosition(i); if (a.isPresent()) { try { a.get().apply(i + 1, statement, this.context); } catch (SQLException e) { throw new UnableToExecuteStatementException( String.format("Exception while binding positional param at (0 based) position %d", i), e, context); } } else { finished = true; } } } else { int i = 0; for (String named_param : stmt.params) { if ("*".equals(named_param)) { continue; } final int index = i; Argument a = findFirstPresent( () -> params.findForName(named_param), () -> params.findForPosition(index)) .orElseThrow(() -> { String msg = String.format("Unable to execute, no named parameter matches " + "\"%s\" and no positional param for place %d (which is %d in " + "the JDBC 'start at 1' scheme) has been set.", named_param, index, index + 1); return new UnableToExecuteStatementException(msg, context); }); try { a.apply(i + 1, statement, this.context); } catch (SQLException e) { throw new UnableToCreateStatementException(String.format("Exception while binding '%s'", named_param), e, context); } i++; } } }
Source:
public StopStreamMethod(HttpWrapper httpWrapper, String baseUri) { super(httpWrapper); uri = baseUri + "/v1/calls"; }

Target:
public StopStreamMethod(HttpWrapper httpWrapper, String baseUri) { super(httpWrapper); uri = baseUri + DEFAULT_PATH; }
Source:
public static boolean waitForCopy(CloudBlob blob) throws StorageException, InterruptedException { boolean continueLoop = true; CopyStatus status = CopyStatus.PENDING; while (continueLoop) { blob.downloadAttributes(); status = blob.getCopyState().getStatus(); continueLoop = status == CopyStatus.PENDING; if (continueLoop) { Thread.sleep(500); } } return status == CopyStatus.SUCCESS; }

Target:
private static boolean waitForCopy(CloudBlob blob) throws StorageException, InterruptedException { boolean continueLoop = true; CopyStatus status = CopyStatus.PENDING; while (continueLoop) { blob.downloadAttributes(); status = blob.getCopyState().getStatus(); continueLoop = status == CopyStatus.PENDING; if (continueLoop) { Thread.sleep(500); } } return status == CopyStatus.SUCCESS; }
Source:
public int getDelay(int n) { int delay = -1; if (0 <= n && n < header.frameCount) { delay = header.frames.get(n).delay; } return delay; }

Target:
public int getDelay(int n) { int delay = -1; if ((n >= 0) && (n < header.frameCount)) { delay = header.frames.get(n).delay; } return delay; }
Source:
public FeatureSource<? extends FeatureType, ? extends Feature> handleClipParam( FeatureInfoRequestParameters params, FeatureSource<? extends FeatureType, ? extends Feature> featureSource) { Geometry clipGeom = ClipWMSGetMapCallBack.getClipGeometry(params.getGetMapRequest()); if (clipGeom == null) return featureSource; return new ClippedFeatureSource(featureSource, clipGeom); }

Target:
public FeatureSource<? extends FeatureType, ? extends Feature> handleClipParam( FeatureInfoRequestParameters params, FeatureSource<? extends FeatureType, ? extends Feature> featureSource) { Geometry clipGeom = params.getGetMapRequest().getClip(); if (clipGeom == null) return featureSource; return new ClippedFeatureSource(featureSource, clipGeom); }