auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static Map<String, Set<String>> computeTagListFromVarList(EnvVars envVars, final String varList) { HashMap<String, Set<String>> result = new HashMap<>(); List<String> rawTagList = linesToList(varList); for (String tagLine : rawTagList) { List<String> tagList = DatadogUtilities.cstrToList(tagLine); if (tagList.isEmpty()) { continue; } for (int i = 0; i < tagList.size(); i++) { String tag = tagList.get(i).replaceAll(" ", ""); String[] expanded = envVars.expand(tag).split("="); if (expanded.length == 2) { String name = expanded[0]; String value = expanded[1]; Set<String> values = result.containsKey(name) ? result.get(name) : new HashSet<String>(); values.add(value); result.put(name, values); logger.fine(String.format("Emitted tag %s:%s", name, value)); } else if(expanded.length == 1) { String name = expanded[0]; Set<String> values = result.containsKey(name) ? result.get(name) : new HashSet<String>(); values.add(""); result.put(name, values); } else { logger.fine(String.format("Ignoring the tag %s. It is empty.", tag)); } } } return result; }

Target:
public static Map<String, Set<String>> computeTagListFromVarList(EnvVars envVars, final String varList) { HashMap<String, Set<String>> result = new HashMap<>(); List<String> rawTagList = linesToList(varList); for (String tagLine : rawTagList) { List<String> tagList = DatadogUtilities.cstrToList(tagLine); if (tagList.isEmpty()) { continue; } for (int i = 0; i < tagList.size(); i++) { String tag = tagList.get(i).replaceAll(" ", ""); String[] expanded = envVars.expand(tag).split("=", 2); if (expanded.length == 2) { String name = expanded[0]; String value = expanded[1]; Set<String> values = result.containsKey(name) ? result.get(name) : new HashSet<String>(); values.add(value); result.put(name, values); logger.fine(String.format("Emitted tag %s:%s", name, value)); } else if(expanded.length == 1) { String name = expanded[0]; Set<String> values = result.containsKey(name) ? result.get(name) : new HashSet<String>(); values.add(""); result.put(name, values); } else { logger.fine(String.format("Ignoring the tag %s. It is empty.", tag)); } } } return result; }
Source:
public Optional<QueryType> getQueryType() { if (statement instanceof Query) { return Optional.of(SELECT); } else if (statement instanceof Explain) { return Optional.of(EXPLAIN); } else if (statement instanceof ShowCatalogs || statement instanceof ShowCreate || statement instanceof ShowFunctions || statement instanceof ShowGrants || statement instanceof ShowPartitions || statement instanceof ShowSchemas || statement instanceof ShowSession || statement instanceof ShowStats || statement instanceof ShowTables) { return Optional.of(SHOW); } else if (statement instanceof CreateTableAsSelect) { return Optional.of(CREATE); } else if (statement instanceof Insert) { return Optional.of(INSERT); } else if (statement instanceof Delete) { return Optional.of(DELETE); } else if (statement instanceof ShowColumns || statement instanceof DescribeInput || statement instanceof DescribeOutput) { return Optional.of(DESCRIBE); } return Optional.empty(); }

Target:
public Optional<QueryType> getQueryType() { if (statement instanceof Query) { return Optional.of(SELECT); } else if (statement instanceof Explain) { return Optional.of(EXPLAIN); } else if (statement instanceof ShowCatalogs || statement instanceof ShowCreate || statement instanceof ShowFunctions || statement instanceof ShowGrants || statement instanceof ShowPartitions || statement instanceof ShowSchemas || statement instanceof ShowSession || statement instanceof ShowStats || statement instanceof ShowTables || statement instanceof ShowColumns || statement instanceof DescribeInput || statement instanceof DescribeOutput) { return Optional.of(DESCRIBE); } else if (statement instanceof CreateTableAsSelect || statement instanceof Insert) { return Optional.of(INSERT); } else if (statement instanceof Delete) { return Optional.of(DELETE); } return Optional.empty(); }
Source:
public Period parse(String value) { int intValue = Integer.parseInt(value); if (ChronoUnit.DAYS == this.chronoUnit) { return Period.ofDays(intValue); } else if (ChronoUnit.WEEKS == this.chronoUnit) { return Period.ofWeeks(intValue); } else if (ChronoUnit.MONTHS == this.chronoUnit) { return Period.ofMonths(intValue); } else if (ChronoUnit.YEARS == this.chronoUnit) { return Period.ofYears(intValue); } throw new IllegalArgumentException("Unknow unit '" + this.chronoUnit + "'"); }

Target:
public Period parse(String value) { return parse(value, null); }
Source:
public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException { String saml2Response = request.getParameter("SAMLResponse"); byte[] b = Saml2Utils.decode(saml2Response); String responseXml = inflateIfRequired(request, b); RelyingPartyRegistration rp = this.relyingPartyRegistrationRepository.findByRegistrationId(this.matcher.matcher(request).getVariables().get("registrationId")); String localSpEntityId = Saml2Utils.getServiceProviderEntityId(rp, request); final Saml2AuthenticationToken authentication = new Saml2AuthenticationToken( responseXml, request.getRequestURL().toString(), rp.getRemoteIdpEntityId(), localSpEntityId, rp.getCredentials() ); return getAuthenticationManager(request).authenticate(authentication); }

Target:
public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException { String saml2Response = request.getParameter("SAMLResponse"); byte[] b = Saml2Utils.decode(saml2Response); String responseXml = inflateIfRequired(request, b); RelyingPartyRegistration rp = this.relyingPartyRegistrationRepository.findByRegistrationId(this.matcher.matcher(request).getVariables().get("registrationId")); String localSpEntityId = Saml2Utils.getServiceProviderEntityId(rp, request); final Saml2AuthenticationToken authentication = new Saml2AuthenticationToken( responseXml, request.getRequestURL().toString(), rp.getRemoteIdpEntityId(), localSpEntityId, rp.getCredentials() ); return getAuthenticationManager().authenticate(authentication); }
Source:
public void testCreateAnnotation() throws IOException { DocumentModel file = session.createDocumentModel("/testDomain", "testDoc", "File"); file = session.createDocument(file); fetchInvalidations(); String xpath = "file:content"; Annotation annotation = new AnnotationImpl(); annotation.setParentId(file.getId()); annotation.setXpath(xpath); String jsonAnnotation = MarshallerHelper.objectToJson(annotation, CtxBuilder.get()); try (CloseableClientResponse response = getResponse(RequestType.POST, "id/" + file.getId() + "/@annotation", jsonAnnotation)) { assertEquals(Response.Status.CREATED.getStatusCode(), response.getStatus()); JsonNode node = mapper.readTree(response.getEntityInputStream()); assertEquals(file.getId(), node.get("parentId").textValue()); assertEquals(xpath, node.get("xpath").textValue()); } }

Target:
public void testCreateAnnotation() throws IOException { DocumentModel file = session.createDocumentModel("/testDomain", "testDoc", "File"); file = session.createDocument(file); fetchInvalidations(); String xpath = "file:content"; Annotation annotation = new AnnotationImpl(); annotation.setParentId(file.getId()); annotation.setXpath(xpath); String jsonAnnotation = MarshallerHelper.objectToJson(annotation, CtxBuilder.get()); try (CloseableClientResponse response = getResponse(RequestType.POST, "id/" + file.getId() + "/@annotation", jsonAnnotation)) { assertEquals(Response.Status.CREATED.getStatusCode(), response.getStatus()); JsonNode node = mapper.readTree(response.getEntityInputStream()); assertEquals(file.getId(), node.get(COMMENT_PARENT_ID_FIELD).textValue()); assertEquals(xpath, node.get(ANNOTATION_XPATH).textValue()); } }
Source:
public boolean isRoot() { return source instanceof RequestScope; }

Target:
public boolean isRoot() { return parentResource == null; }
Source:
public void testOptimizedFold() { for (int i = 0; i <= Unicode.MAX_RUNE; i++) { int[] orbit = Unicode.optimizedFoldOrbit(i); if (orbit != null) { int r = Unicode.simpleFold(i); int j = 0; while (r != i) { assertEquals(r, orbit[j]); j++; r = Unicode.simpleFold(r); } } else { int r = Unicode.simpleFold(i); assertEquals(r, Unicode.optimizedFoldNonOrbit(i)); assertEquals(i, Unicode.simpleFold(r)); } } }

Target:
public void testOptimizedFold() { for (int i = 0; i <= Unicode.MAX_RUNE; i++) { int[] orbit = Unicode.optimizedFoldOrbit(i); if (orbit != null) { testOptimizedFoldOrbitCase(i, orbit); } else { testOptimizedFoldNonOrbitCase(i); } } }
Source:
public void test_evaluate_invalid_return_value() { if (SwtTestUtil.isWindows) { return; } final AtomicInteger exception = new AtomicInteger(-1); browser.addProgressListener(new ProgressListener() { @Override public void changed(ProgressEvent event) @Override public void completed(ProgressEvent event) { try { browser.evaluate("return new Date()"); } catch (SWTException e) { exception.set(e.code); } } }); browser.setText("<html><body>HelloWorld</body></html>"); shell.open(); for (int i = 0; i < (loopMultipier * secondsToWaitTillFail); i++) { runLoopTimer(waitMS); if (exception.get() != -1) { if (exception.get() == SWT.ERROR_INVALID_RETURN_VALUE) { return; } else if (exception.get() == SWT.ERROR_FAILED_EVALUATE) { System.err.println("SWT Warning: test_evaluate_invalid_return_value threw wrong exception code." + " Expected ERROR_INVALID_RETURN_VALUE but got ERROR_FAILED_EVALUATE"); return; } else { System.err.println("test_evaluate_invalid_return_value - Invalid exception code : " + exception.get()); } break; } } fail(name.getMethodName() + " failed. This test tests for evaluation to return an invalid return value. An exception should have been returned, but it wasn't. Got: " + exception.get()); }

Target:
public void test_evaluate_invalid_return_value() { assumeFalse(webkit1SkipMsg(), isWebkit1); if (SwtTestUtil.isWindows) { return; } final AtomicInteger exception = new AtomicInteger(-1); browser.addProgressListener(new ProgressListener() { @Override public void changed(ProgressEvent event) @Override public void completed(ProgressEvent event) { try { browser.evaluate("return new Date()"); } catch (SWTException e) { exception.set(e.code); } } }); browser.setText("<html><body>HelloWorld</body></html>"); shell.open(); for (int i = 0; i < (loopMultipier * secondsToWaitTillFail); i++) { runLoopTimer(waitMS); if (exception.get() != -1) { if (exception.get() == SWT.ERROR_INVALID_RETURN_VALUE) { return; } else if (exception.get() == SWT.ERROR_FAILED_EVALUATE) { System.err.println("SWT Warning: test_evaluate_invalid_return_value threw wrong exception code." + " Expected ERROR_INVALID_RETURN_VALUE but got ERROR_FAILED_EVALUATE"); return; } else { fail("Invalid exception code : " + exception.get()); } break; } } fail("This test tests for evaluation to return an invalid return value. An exception should have been thrown, but none was thrown. Or test timed out"); }
Source:
DTestNodeTool(boolean withNotifications) { super(new InternalNodeProbeFactory(withNotifications)); storageProxy = InternalNodeProbe.create(withNotifications).getStorageService(); storageProxy.addNotificationListener(notifications, null, null); }

Target:
DTestNodeTool(boolean withNotifications) { super(new InternalNodeProbeFactory(withNotifications)); storageProxy = new InternalNodeProbe(withNotifications).getStorageService(); storageProxy.addNotificationListener(notifications, null, null); }
Source:
private void saveCompletedContribution(Contribution contribution, UploadResult uploadResult) throws ParseException { contribution.setFilename(uploadResult.createCanonicalFileName()); contribution.setImageUrl(uploadResult.getImageinfo().getOriginalUrl()); contribution.setState(Contribution.STATE_COMPLETED); contribution.setDateUploaded(CommonsDateUtil.getIso8601DateFormatTimestamp() .parse(uploadResult.getImageinfo().getTimestamp())); final Disposable disposable = contributionDao.delete(contribution) .flatMap(integer -> mediaClient.getMedia("File:" + uploadResult.getFilename())) .subscribe(media -> contributionDao.save(new Contribution(media))); compositeDisposable.add(disposable); }

Target:
private void saveCompletedContribution(Contribution contribution, UploadResult uploadResult) { compositeDisposable.add(mediaClient.getMedia("File:" + uploadResult.getFilename()) .map(media -> new Contribution(media, Contribution.STATE_COMPLETED)) .flatMapCompletable(newContribution -> contributionDao.saveAndDelete(contribution, newContribution)) .subscribe()); }
Source:
public List<?> find(final LdapQueryData queryData, final long resultCount) { final String domainName = queryData.getDomain(); final Domain domain = getDomainObject(domainName); if (domain == null) { log.errorFormat("Error in finding LDAP servers for domain {0} using user {1}", domainName, ldapCredentials.getUserName()); return null; } List<URI> ldapServerURIs = domain.getLdapServers(); List<URI> editableLdapServerURIs = new ArrayList<>(); editableLdapServerURIs.addAll(ldapServerURIs); if (log.isDebugEnabled()) { log.debug("Ldap server list: " + StringUtils.join(ldapServerURIs, ", ")); } List<?> response = null; for (Iterator<URI> iterator = ldapServerURIs.iterator(); iterator.hasNext();) { URI ldapURI = iterator.next(); response = findAndOrderServers(queryData, ldapURI, domainName, resultCount, editableLdapServerURIs); if (response != null) { break; } } domain.setLdapServers(editableLdapServerURIs); return response; }

Target:
public List<?> find(final LdapQueryData queryData, final long resultCount) { final String domainName = queryData.getDomain(); final Domain domain = getDomainObject(domainName); if (domain == null) { log.errorFormat("Error in finding LDAP servers for domain {0} using user {1}", domainName, ldapCredentials.getUserName()); return null; } List<URI> ldapServerURIs = domain.getLdapServers(); List<URI> editableLdapServerURIs = new ArrayList<>(ldapServerURIs); if (log.isDebugEnabled()) { log.debug("Ldap server list: " + StringUtils.join(ldapServerURIs, ", ")); } List<?> response = null; for (Iterator<URI> iterator = ldapServerURIs.iterator(); iterator.hasNext();) { URI ldapURI = iterator.next(); response = findAndOrderServers(queryData, ldapURI, domainName, resultCount, editableLdapServerURIs); if (response != null) { break; } } domain.setLdapServers(editableLdapServerURIs); return response; }
Source:
private boolean removeVm(VM vm) { RemoveVmFromPoolParameters removeVmFromPoolParameters = new RemoveVmFromPoolParameters(vm.getId()); removeVmFromPoolParameters.setTransactionScopeOption(TransactionScopeOption.Suppress); VdcReturnValueBase result = runInternalActionWithTasksContext( VdcActionType.RemoveVmFromPool, removeVmFromPoolParameters); if (!result.getSucceeded()) { return false; } result = runInternalAction( VdcActionType.RemoveVm, new RemoveVmParameters(vm.getId(), false), createRemoveVmStepContext(vm)); if (!result.getSucceeded()) { return false; } getTaskIdList().addAll(result.getInternalVdsmTaskIdList()); vmsRemoved.add(vm.getId()); return true; }

Target:
private boolean removeVm(VM vm) { RemoveVmFromPoolParameters removeVmFromPoolParameters = new RemoveVmFromPoolParameters(vm.getId()); removeVmFromPoolParameters.setTransactionScopeOption(TransactionScopeOption.Suppress); VdcReturnValueBase result = runInternalActionWithTasksContext( VdcActionType.RemoveVmFromPool, removeVmFromPoolParameters); if (!result.getSucceeded()) { return false; } result = runInternalAction( VdcActionType.RemoveVm, new RemoveVmParameters(vm.getId(), false), createRemoveVmStepContext(vm)); if (!result.getSucceeded()) { return false; } vmsRemoved.add(vm.getId()); return true; }
Source:
protected Connector[] getConnectors(Server server) { SslContextFactory sslContextFactory = new SslContextFactory(); sslContextFactory.setKeyStorePath(_keyStorePath); sslContextFactory.setKeyStorePassword(_keyStorePassword); sslContextFactory.setTrustStorePath(_trustStorePath); sslContextFactory.setTrustStorePassword(_trustStorePassword); HttpConfiguration config = new HttpConfiguration(); config.setSecureScheme(HttpScheme.HTTPS.asString()); config.addCustomizer(new SecureRequestCustomizer()); ServerConnector sslConnector = new ServerConnector(_server, new SslConnectionFactory(sslContextFactory, HttpVersion.HTTP_1_1.asString()), new HttpConnectionFactory(config)); sslConnector.setPort(_sslPort); Connector[] httpConnectors = super.getConnectors(server); Connector[] connectors = new Connector[httpConnectors.length + 1]; int i = 0; for (Connector c : httpConnectors) { connectors[i++] = c; } connectors[i++] = sslConnector; return connectors; }

Target:
protected Connector[] getConnectors(Server server) { SslContextFactory sslContextFactory = new SslContextFactory(); sslContextFactory.setKeyStorePath(_keyStorePath); sslContextFactory.setKeyStorePassword(_keyStorePassword); sslContextFactory.setTrustStorePath(_trustStorePath); sslContextFactory.setTrustStorePassword(_trustStorePassword); HttpConfiguration config = new HttpConfiguration(); config.setSecureScheme(HttpScheme.HTTPS.asString()); config.addCustomizer(new SecureRequestCustomizer()); ServerConnector sslConnector = new ServerConnector(server, new SslConnectionFactory(sslContextFactory, HttpVersion.HTTP_1_1.asString()), new HttpConnectionFactory(config)); sslConnector.setPort(_sslPort); Connector[] httpConnectors = super.getConnectors(server); Connector[] connectors = Arrays.copyOf(httpConnectors, httpConnectors.length + 1); connectors[httpConnectors.length] = sslConnector; return connectors; }
Source:
public boolean equals(Object o) { if (o == null || !(o instanceof CommandConfiguration)) { return false; } CommandConfiguration other = (CommandConfiguration)o; if (this.getName() != null) { if (!this.getName().equals(other.getName())) { return false; } } else { if (other.getName() != null) { return false; } } if (this.getType() != null) { if (!this.getType().getId().equals(other.getType().getId())) { return false; } } else { if (other.getType() != null) { return false; } } if (this.toCommandLine() != null) { if (!this.toCommandLine().equals(other.toCommandLine())) { return false; } } else { if (other.toCommandLine() != null) { return false; } } return true; }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof CommandConfiguration)) { return false; } CommandConfiguration other = (CommandConfiguration)o; return Objects.equals(getName(), other.getName()) && Objects.equals(getType().getId(), other.getType().getId()) && Objects.equals(toCommandLine(), other.toCommandLine()); }
Source:
public void copyInstallResources() { try { getLocation().acquireMutex("installing "+elvis(entity,this), "installation lock at host for files and templates"); getLocation().execCommands("create install directory", ImmutableList.of("mkdir -p " + getInstallDir())); Map<String, String> installFiles = entity.getConfig(SoftwareProcess.INSTALL_FILES); if (installFiles != null && installFiles.size() > 0) { for (String source : installFiles.keySet()) { String target = installFiles.get(source); String destination = Os.isAbsolutish(target) ? target : Os.mergePathsUnix(getInstallDir(), target); copyResource(source, destination, true); } } Map<String, String> installTemplates = entity.getConfig(SoftwareProcess.INSTALL_TEMPLATES); if (installTemplates != null && installTemplates.size() > 0) { for (String source : installTemplates.keySet()) { String target = installTemplates.get(source); String destination = Os.isAbsolutish(target) ? target : Os.mergePathsUnix(getInstallDir(), target); copyTemplate(source, destination, true, MutableMap.<String, Object>of()); } } } catch (Exception e) { Exceptions.propagateIfFatal(e); } finally { getLocation().releaseMutex("installing "+elvis(entity,this)); } }

Target:
public void copyInstallResources() { getLocation().acquireMutex("installing "+elvis(entity,this), "installation lock at host for files and templates"); try { execute("mkdir -p " + getInstallDir(), "create install directory"); Map<String, String> installFiles = entity.getConfig(SoftwareProcess.INSTALL_FILES); if (installFiles != null && installFiles.size() > 0) { for (String source : installFiles.keySet()) { String target = installFiles.get(source); String destination = Os.isAbsolutish(target) ? target : Os.mergePathsUnix(getInstallDir(), target); copyResource(source, destination, true); } } Map<String, String> installTemplates = entity.getConfig(SoftwareProcess.INSTALL_TEMPLATES); if (installTemplates != null && installTemplates.size() > 0) { for (String source : installTemplates.keySet()) { String target = installTemplates.get(source); String destination = Os.isAbsolutish(target) ? target : Os.mergePathsUnix(getInstallDir(), target); copyTemplate(source, destination, true, MutableMap.<String, Object>of()); } } } catch (Exception e) { log.warn("Error copying install resources", e); throw Exceptions.propagate(e); } finally { getLocation().releaseMutex("installing "+elvis(entity,this)); } }
Source:
public void testGetValue() { Assert.assertFalse((Boolean)config.GetValue(ConfigValues.NonVmNetworkSupported, "3.0")); Assert.assertFalse(Config.<Boolean> GetValue(ConfigValues.NonVmNetworkSupported, "3.0")); Assert.assertTrue((Boolean)config.GetValue(ConfigValues.NonVmNetworkSupported, "3.1")); Assert.assertTrue(Config.<Boolean> GetValue(ConfigValues.NonVmNetworkSupported, "3.1")); Assert.assertTrue((Boolean)config.GetValue(ConfigValues.NonVmNetworkSupported, "3.2")); Assert.assertTrue(Config.<Boolean> GetValue(ConfigValues.NonVmNetworkSupported, "3.2")); }

Target:
public void testGetValue() { Assert.assertFalse(Config.<Boolean> GetValue(ConfigValues.NonVmNetworkSupported, "3.0")); Assert.assertTrue(Config.<Boolean> GetValue(ConfigValues.NonVmNetworkSupported, "3.1")); Assert.assertTrue(Config.<Boolean> GetValue(ConfigValues.NonVmNetworkSupported, "3.2")); }
Source:
private byte[] inferPriorValue(final Bytes key, final byte[] serializedChange) { final byte[] priorValue; if (index.containsKey(key)) { priorValue = internalPriorValueForBuffered(key); } else { final Change<V> change = valueSerde.deserializer().deserialize( changelogTopic, serializedChange ); priorValue = valueSerde.innerSerde().serializer().serialize( changelogTopic, change.oldValue ); } return priorValue; }

Target:
private byte[] inferPriorValue(final Bytes key, final byte[] serializedChange) { return index.containsKey(key) ? internalPriorValueForBuffered(key) : FullChangeSerde.extractOldValuePart(ByteBuffer.wrap(serializedChange)); }
Source:
public static synchronized void init(Context context) { if (BaseRealm.applicationContext == null) { if (context == null) { throw new IllegalArgumentException("Non-null context required."); } checkFilesDirAvailable(context); RealmCore.loadLibrary(context); setDefaultConfiguration(new RealmConfiguration.Builder(context).build()); ObjectServerFacade.getSyncFacadeIfPossible().init(context); BaseRealm.applicationContext = context; SharedRealm.initialize(new File(context.getFilesDir(), ".realm.temp")); } }

Target:
public static synchronized void init(Context context) { if (BaseRealm.applicationContext == null) { if (context == null) { throw new IllegalArgumentException("Non-null context required."); } checkFilesDirAvailable(context); RealmCore.loadLibrary(context); setDefaultConfiguration(new RealmConfiguration.Builder(context).build()); ObjectServerFacade.getSyncFacadeIfPossible().init(context); if (context.getApplicationContext() != null) { BaseRealm.applicationContext = context.getApplicationContext(); } else { BaseRealm.applicationContext = context; } SharedRealm.initialize(new File(context.getFilesDir(), ".realm.temp")); } }
Source:
private Logger getNewLoggingInstance( String name ) { if ( logLevelRecorder == null ) { return new MavenSimpleLogger( name ); } else { return new MavenFailLevelLogger( name, logLevelRecorder ); } }

Target:
private Logger getNewLoggingInstance( String name ) { if ( logLevelRecorder == null ) { return new MavenSimpleLogger( name ); } else { return new MavenFailOnSeverityLogger( name, logLevelRecorder ); } }
Source:
private void plugToExternalNetwork() { Provider<?> provider = providerDao.get(getNetwork().getProvidedBy().getProviderId()); String pluginType = StringUtils.defaultString( ((OpenstackNetworkProviderProperties) provider.getAdditionalProperties()).getPluginType()); String hostBindingId = hostProviderBindingDao.get(getVds().getId(), pluginType); Map<String, String> runtimeProperties = getProviderProxy().allocate(getNetwork(), vnicProfile, getParameters().getNic(), getVds(), false, hostBindingId); if (runtimeProperties != null) { getVm().getRuntimeDeviceCustomProperties().put(vmDevice.getId(), runtimeProperties); } }

Target:
private void plugToExternalNetwork() { String pluginType = ((OpenstackNetworkProviderProperties) getProvider() .getAdditionalProperties()).getPluginType(); String hostBindingId = hostProviderBindingDao.get(getVds().getId(), pluginType); Map<String, String> runtimeProperties = getProviderProxy().allocate(getNetwork(), vnicProfile, getParameters().getNic(), getVds(), false, hostBindingId); if (runtimeProperties != null) { getVm().getRuntimeDeviceCustomProperties().put(vmDevice.getId(), runtimeProperties); } }
Source:
protected void onDestroy() { super.onDestroy(); closeInteractiveShell(); tabHandler.close(); utilsHandler.close(); cloudHandler.close(); if (mCloudCursorData != null) mCloudCursorData.close(); CryptHandler cryptHandler = new CryptHandler(this); cryptHandler.close(); SshConnectionPool.getInstance().expungeAllConnections(); }

Target:
protected void onDestroy() { super.onDestroy(); closeInteractiveShell(); tabHandler.close(); utilsHandler.close(); cloudHandler.close(); CryptHandler cryptHandler = new CryptHandler(this); cryptHandler.close(); SshConnectionPool.getInstance().expungeAllConnections(); }
Source:
private void makeRequestAndVerify(String expected) throws IOException, SAXException { WebRequest req = new WebRequest(new URL(j.getURL(), "test-post")); req.setHttpMethod(HttpMethod.POST); req.setEncodingType(null); Page p = wc.getPage(req); assertEquals(expected, p.getWebResponse().getContentAsString().trim()); }

Target:
private void makeRequestAndVerify(String expected) throws IOException, SAXException { WebRequest req = new WebRequest(new URL(j.getURL(), "test-post")); req.setHttpMethod(HttpMethod.POST); req.setEncodingType(null); Page p = wc.getPage(req); assertEquals(expected, p.getWebResponse().getContentAsString()); }
Source:
public synchronized Cluster getCluster(String clusterId, String zoneId) { Cluster response = null; for (Cluster cluster : getClusters().getClustersList()) { if (cluster.getName().endsWith("/clusters/" + clusterId) && cluster.getLocation().endsWith("/locations/" + zoneId)) { if (response == null) { response = cluster; } else { throw new IllegalStateException( String.format("Got multiple clusters named %s in the %z zone.", clusterId, zoneId)); } } } return Preconditions.checkNotNull(response, "Cluster " + clusterId + " was not found"); }

Target:
public synchronized Cluster getCluster(String clusterId, String zoneId) { Cluster response = null; for (Cluster cluster : getClusters().getClustersList()) { if (cluster.getName().endsWith("/clusters/" + clusterId) && cluster.getLocation().endsWith("/locations/" + zoneId)) { if (response == null) { response = cluster; } else { throw new IllegalStateException( String.format("Got multiple clusters named %s in zone %z.", clusterId, zoneId)); } } } return Preconditions.checkNotNull(response, String.format("Cluster %s in zone %s was not found.", clusterId, zoneId)); }
Source:
public PackageId(String group, String name, Version version) { fromPath = false; if (group == null || group.equals(ETC_PACKAGES)) { group = ""; } else if (group.startsWith(ETC_PACKAGES_PREFIX)) { group = group.substring(ETC_PACKAGES_PREFIX.length()); } else if (group.startsWith("/")) { group = group.substring(1); } this.group = group; if (name == null) name = ""; this.name = name; this.version = version == null ? Version.EMPTY : version; this.str = getString(this.group, name, this.version); }

Target:
public PackageId(String group, String name, Version version) { fromPath = false; if (group.equals(ETC_PACKAGES)) { group = ""; } else if (group.startsWith(ETC_PACKAGES_PREFIX)) { group = group.substring(ETC_PACKAGES_PREFIX.length()); } else if (group.startsWith("/")) { group = group.substring(1); } this.group = group; this.name = name; this.version = version == null ? Version.EMPTY : version; this.str = getString(this.group, name, this.version); }
Source:
private void createJobToMonitor(VDSGroup cluster, GlusterAsyncTask task) { if (task.getStatus() != JobExecutionStatus.STARTED) { return; } StepEnum step = task.getType().getStep(); VdcActionType actionType; switch (step) { case REBALANCING_VOLUME: actionType = VdcActionType.StartRebalanceGlusterVolume; break; default: actionType = VdcActionType.Unknown; } VdcReturnValueBase result = getBackend().runInternalAction(VdcActionType.AddInternalJob, new AddInternalJobParameters(ExecutionMessageDirector.resolveJobMessage(actionType, getMessageMap(cluster, task)), actionType, true) ); if (!result.getSucceeded()) { throw new VdcBLLException(result.getFault().getError()); } Guid jobId = (Guid)result.getActionReturnValue(); result = getBackend().runInternalAction(VdcActionType.AddInternalStep, new AddStepParameters(jobId, ExecutionMessageDirector.resolveStepMessage(StepEnum.EXECUTING, null), StepEnum.EXECUTING)); if (!result.getSucceeded()) { throw new VdcBLLException(result.getFault().getError()); } Guid execStepId = (Guid)result.getActionReturnValue(); result = getBackend().runInternalAction(VdcActionType.AddInternalStep, new AddStepParameters(execStepId, getTaskMessage(cluster, step, task), step)); if (!result.getSucceeded()) { throw new VdcBLLException(result.getFault().getError()); } Guid asyncStepId = (Guid)result.getActionReturnValue(); Step asyncStep = getStepDao().get(asyncStepId); ExecutionHandler.updateStepExternalId(asyncStep, task.getTaskId(), ExternalSystemType.GLUSTER); }

Target:
private void createJobToMonitor(VDSGroup cluster, GlusterAsyncTask task) { if (task.getStatus() != JobExecutionStatus.STARTED) { return; } StepEnum step = task.getType().getStep(); VdcActionType actionType; switch (step) { case REBALANCING_VOLUME: actionType = VdcActionType.StartRebalanceGlusterVolume; break; default: actionType = VdcActionType.Unknown; } Guid jobId = addJob(cluster, task, actionType); Guid execStepId = addExecutingStep(jobId); Guid asyncStepId = addAsyncTaskStep(cluster, task, step, execStepId); Step asyncStep = getStepDao().get(asyncStepId); ExecutionHandler.updateStepExternalId(asyncStep, task.getTaskId(), ExternalSystemType.GLUSTER); }
Source:
public String toString() { return "skadi(" + baseUrl + ")"; }

Target:
public String toString() { return "skadi"; }
Source:
private void mountAsEnv(E env, Secret secret, String targetContainerName) throws InfrastructureException { for (PodData pd : env.getPodsData().values()) { if (!pd.getRole().equals(PodRole.DEPLOYMENT)) { continue; } for (Container c : pd.getSpec().getContainers()) { if (targetContainerName != null && !c.getName().equals(targetContainerName)) { continue; } for (Entry<String, String> entry : secret.getData().entrySet()) { final String mountEnvName = envName(secret, entry.getKey()); c.getEnv() .add( new EnvVarBuilder() .withName(mountEnvName) .withValueFrom( new EnvVarSourceBuilder() .withSecretKeyRef( new SecretKeySelectorBuilder() .withName(secret.getMetadata().getName()) .withKey(entry.getKey()) .build()) .build()) .build()); } } } }

Target:
private void mountAsEnv(E env, Secret secret, String targetContainerName) throws InfrastructureException { for (PodData podData : env.getPodsData().values()) { if (!podData.getRole().equals(PodRole.DEPLOYMENT)) { continue; } for (Container container : podData.getSpec().getContainers()) { if (targetContainerName != null && !container.getName().equals(targetContainerName)) { continue; } for (Entry<String, String> secretDataEntry : secret.getData().entrySet()) { final String mountEnvName = envName(secret, secretDataEntry.getKey()); container .getEnv() .add( new EnvVarBuilder() .withName(mountEnvName) .withValueFrom( new EnvVarSourceBuilder() .withSecretKeyRef( new SecretKeySelectorBuilder() .withName(secret.getMetadata().getName()) .withKey(secretDataEntry.getKey()) .build()) .build()) .build()); } } } }
Source:
private List<T> loadInstances(ClassLoader classloader) { ServiceLoader<T> loader = ServiceLoader.load( clazz, classloader ); Iterator<T> iterator = loader.iterator(); List<T> instances = new ArrayList<T>(); while ( iterator.hasNext() ) { try { instances.add( iterator.next() ); } catch (ServiceConfigurationError e) { LOG.error( "Error while loading Instances {}",e ); } } return instances; }

Target:
private List<T> loadInstances(ClassLoader classloader) { ServiceLoader<T> loader = ServiceLoader.load( clazz, classloader ); Iterator<T> iterator = loader.iterator(); List<T> instances = new ArrayList<T>(); while ( iterator.hasNext() ) { try { instances.add( iterator.next() ); } catch (ServiceConfigurationError e) { LOG.getServiceConfigurationErrorException( loader.getClass().getName(), e ); } } return instances; }
Source:
public PDFDocumentImpl(PDDocument document) { this.document = document; }

Target:
public PDFDocumentImpl(PDDocument document) { if (document == null) { throw new IllegalArgumentException("Document representation can not be null"); } this.document = document; }
Source:
public void pageFindByCandidateEntityShouldFindThreeApplicationForCandidateWithThreeApplication() throws ParseException { CandidateEntity candidateEntityC = this.candidateRepository.findOne(CANDIDATE_C_ID); ChannelEntity expectedChannelEntity = ChannelEntity.builder() .id(2L) .name("profession hírdetés") .build(); ChannelEntity expectedSecondChannelEntity = ChannelEntity.builder() .id(3L) .name("profession adatbázis") .build(); ChannelEntity expectedThirdChannelEntity = ChannelEntity.builder() .id(4L) .name("facebook") .build(); PositionEntity expectedPositionEntity = PositionEntity.builder() .id(1L) .name("Fejlesztő") .build(); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date expectedDate = simpleDateFormat.parse("2016-07-26 11:48:55"); Page<ApplicationEntity> pageResult = this.repository.findByCandidateEntity(candidateEntityC, DEFAULT_PAGE_REQUEST); List<ApplicationEntity> result = pageResult.getContent(); assertThat(pageResult.getTotalPages(), is(1)); assertThat(pageResult.getTotalElements(), is(3L)); assertThat(result, notNullValue()); assertThat(result.size(), is(3)); assertApplicationEntity(result.get(0), candidateEntityC, expectedChannelEntity, expectedPositionEntity, expectedDate); assertApplicationEntity(result.get(1), candidateEntityC, expectedSecondChannelEntity, expectedPositionEntity, expectedDate); assertApplicationEntity(result.get(2), candidateEntityC, expectedThirdChannelEntity, expectedPositionEntity, expectedDate); }

Target:
public void pageFindByCandidateEntityShouldFindThreeApplicationForCandidateWithThreeApplication() throws ParseException { final CandidateEntity candidateEntityC = this.candidateRepository.findOne(CANDIDATE_C_ID); final ChannelEntity expectedChannelEntity = ChannelEntity.builder() .id(2L) .name(CHANNEL_NAME_PROFESSION_ADVERTISEMENT) .deleted(false) .build(); final ChannelEntity expectedSecondChannelEntity = ChannelEntity.builder() .id(3L) .name(CHANNEL_NAME_PROFESSION_DATABASE) .deleted(false) .build(); final ChannelEntity expectedThirdChannelEntity = ChannelEntity.builder() .id(4L) .name(CHANNEL_NAME_FACEBOOK) .deleted(false) .build(); final PositionEntity expectedPositionEntity = PositionEntity.builder() .id(1L) .name(POSITION_NAME_DEVELOPER) .deleted(false) .build(); SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DATE_FORMAT_PATTERN); final Date expectedDate = simpleDateFormat.parse(DATE_SAMPLE); final Page<ApplicationEntity> pageResult = this.repository.findByCandidateEntity(candidateEntityC, DEFAULT_PAGE_REQUEST); final List<ApplicationEntity> result = pageResult.getContent(); assertThat(pageResult.getTotalPages(), is(1)); assertThat(pageResult.getTotalElements(), is(3L)); assertThat(result, notNullValue()); assertThat(result.size(), is(3)); assertApplicationEntity(result.get(0), candidateEntityC, expectedChannelEntity, expectedPositionEntity, expectedDate); assertApplicationEntity(result.get(1), candidateEntityC, expectedSecondChannelEntity, expectedPositionEntity, expectedDate); assertApplicationEntity(result.get(2), candidateEntityC, expectedThirdChannelEntity, expectedPositionEntity, expectedDate); }
Source:
private void checkCacheReload() { if (nextLoadTime > System.currentTimeMillis()) { return; } if (nextLoadTime > 0) { LOG.info("Lookup join cache has expired after minute(s), reloading", getCacheTTL().toMinutes()); } cache.clear(); try { T[] inputSplits = inputFormat.createInputSplits(1); GenericRowData reuse = new GenericRowData(producedNames.length); long count = 0; for (T split : inputSplits) { inputFormat.open(split); while (!inputFormat.reachedEnd()) { RowData row = inputFormat.nextRecord(reuse); count++; Row key = extractKey(row); List<RowData> rows = cache.computeIfAbsent(key, k -> new ArrayList<>()); rows.add(serializer.copy(row)); } inputFormat.close(); } nextLoadTime = System.currentTimeMillis() + getCacheTTL().toMillis(); LOG.info("Loaded row(s) into lookup join cache", count); } catch (IOException e) { throw new FlinkRuntimeException("Failed to load table into cache", e); } }

Target:
private void checkCacheReload() { if (nextLoadTime > System.currentTimeMillis()) { return; } if (nextLoadTime > 0) { LOG.info("Lookup join cache has expired after minute(s), reloading", getCacheTTL().toMinutes()); } else { LOG.info("Populating lookup join cache"); } cache.clear(); try { T[] inputSplits = inputFormat.createInputSplits(1); GenericRowData reuse = new GenericRowData(producedNames.length); long count = 0; for (T split : inputSplits) { inputFormat.open(split); while (!inputFormat.reachedEnd()) { RowData row = inputFormat.nextRecord(reuse); count++; Row key = extractKey(row); List<RowData> rows = cache.computeIfAbsent(key, k -> new ArrayList<>()); rows.add(serializer.copy(row)); } inputFormat.close(); } nextLoadTime = System.currentTimeMillis() + getCacheTTL().toMillis(); LOG.info("Loaded row(s) into lookup join cache", count); } catch (IOException e) { throw new FlinkRuntimeException("Failed to load table into cache", e); } }
Source:
public void waitUntilReady(long interval) throws IOException, IndicoException { String status; while (true) { status = this.client.info(this.collectionName).get("status").toString(); if (Objects.equals(status, "ready")) return; if (!Objects.equals(status, "training")) Logger.getLogger("indico").log(Level.WARNING, "Collection training has failed with status " + status); try { Thread.sleep(interval); } catch(InterruptedException ex) { Thread.currentThread().interrupt(); } } }

Target:
public void waitUntilReady(long interval) throws IOException, IndicoException { String status; while (true) { status = this.client.info(this.collectionName).get("status").toString(); if (Objects.equals(status, "ready")) return; if (!Objects.equals(status, "training")) throw new IndicoException("Collection training has failed with status " + status); try { Thread.sleep(interval); } catch(InterruptedException ex) { Thread.currentThread().interrupt(); } } }
Source:
private String getSauceLabsRestApi(String urlString) { URL url; HttpURLConnection conn = null; StringBuilder result = new StringBuilder(); int numRetriesOnFailure = 0; int sauceTimeOut = getSauceTimeout(); do { try { url = new URL(urlString); conn = (HttpURLConnection) url.openConnection(); conn.setConnectTimeout(sauceTimeOut); conn.setReadTimeout(sauceTimeOut); conn.setRequestMethod("GET"); conn.setRequestProperty("Accept", "application/json"); conn.setRequestProperty("Authorization", "Basic " + SauceConfigReader.getInstance().getAuthenticationKey()); if (conn.getResponseCode() != HttpStatus.SC_OK) { throw new IOException("Failed : HTTP error code : " + conn.getResponseCode()); } BufferedReader br = new BufferedReader(new InputStreamReader((conn.getInputStream()))); String input; while ((input = br.readLine()) != null) { result.append(input); } br.close(); } catch (IOException e) { LOGGER.log(Level.SEVERE, e.getMessage(), e); } finally { if (conn != null) { conn.disconnect(); } } } while (StringUtils.isEmpty(result.toString()) && numRetriesOnFailure++ < getSauceRetryCount()); return result.toString(); }

Target:
private String getSauceLabsRestApi(String urlString) { HttpURLConnection conn = null; StringBuilder result = new StringBuilder(); int numRetriesOnFailure = 0; int sauceTimeOut = getSauceTimeout(); do { try { URL url = new URL(urlString); conn = (HttpURLConnection) url.openConnection(); conn.setConnectTimeout(sauceTimeOut); conn.setReadTimeout(sauceTimeOut); conn.setRequestMethod("GET"); conn.setRequestProperty("Accept", "application/json"); conn.setRequestProperty("Authorization", "Basic " + SauceConfigReader.getInstance().getAuthenticationKey()); if (conn.getResponseCode() != HttpStatus.SC_OK) { throw new IOException("Failed: HTTP error code: " + conn.getResponseCode()); } BufferedReader br = new BufferedReader(new InputStreamReader((conn.getInputStream()))); String input; while ((input = br.readLine()) != null) { result.append(input); } br.close(); } catch (IOException e) { LOGGER.log(Level.SEVERE, e.getMessage(), e); } finally { if (conn != null) { conn.disconnect(); } } } while (StringUtils.isEmpty(result.toString()) && numRetriesOnFailure++ < getSauceRetryCount()); return result.toString(); }
Source:
protected boolean canDoAction() { GlusterVolumeGeoRepCreateParameters parameter = getParameters(); if(parameter == null || parameter.getSlaveHost() == null || parameter.getSlaveVolumeName() == null || parameter.getUserName() == null || parameter.getSlaveUserPassword() == null) { return false; } masterVolume = getGlusterVolume(); if (!masterVolume.isOnline()) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_IS_DOWN); addCanDoActionMessageVariable("volumeName", masterVolume.getName()); return false; } List<GlusterGeoRepSession> sessions = getGlusterGeoRepDao().getGeoRepSessions(parameter.getVolumeId()); if (sessions != null) { for (GlusterGeoRepSession session : sessions) { if (session.getMasterVolumeId() == parameter.getVolumeId() && session.getSlaveHostName() == parameter.getSlaveHost() && session.getSlaveVolumeName() == parameter.getSlaveVolumeName()) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GEOREP_SESSION_CREATED); return false; } } } return true; }

Target:
protected boolean canDoAction() { GlusterVolumeGeoRepCreateParameters parameter = getParameters(); if(parameter == null || parameter.getSlaveHost() == null || parameter.getSlaveVolumeName() == null || parameter.getUserName() == null || parameter.getSlaveUserPassword() == null) { return false; } masterVolume = getGlusterVolume(); if (!masterVolume.isOnline()) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_IS_DOWN); addCanDoActionMessageVariable("volumeName", masterVolume.getName()); return false; } List<GlusterGeoRepSession> sessions = getGlusterGeoRepDao().getGeoRepSessions(parameter.getVolumeId()); if (sessions != null) { for (GlusterGeoRepSession session : sessions) { if (session.getMasterVolumeId().equals(parameter.getVolumeId()) && session.getSlaveHostName().equals(parameter.getSlaveHost()) && session.getSlaveVolumeName().equals(parameter.getSlaveVolumeName())) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GEOREP_SESSION_CREATED); return false; } } } return true; }
Source:
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { CoreNamespaceUtils.autoregisterBeansForNamespace(parserContext, parserContext.extractSource(element)); JsrNamespaceUtils.autoregisterJsrBeansForNamespace(parserContext); String jobName = element.getAttribute(ID_ATTRIBUTE); if(PropertyParser.hasPath()) { LOG.error("Job parsing started for job name: " + jobName + " and property parser path already populated, clearing path.."); PropertyParser.clearPath(); } PropertyParser.pushPath(jobName); builder.addConstructorArgValue(jobName); String restartableAttribute = element.getAttribute(RESTARTABLE_ATTRIBUTE); if (StringUtils.hasText(restartableAttribute)) { builder.addPropertyValue("restartable", restartableAttribute); } BeanDefinition flowDef = new FlowParser(jobName, jobName).parse(element, parserContext); builder.addPropertyValue("flow", flowDef); AbstractBeanDefinition stepContextBeanDefinition = BeanDefinitionBuilder.genericBeanDefinition(StepContextFactoryBean.class) .getBeanDefinition(); stepContextBeanDefinition.setScope("step"); parserContext.getRegistry().registerBeanDefinition("stepContextFactory", stepContextBeanDefinition); new ListnerParser(JobListenerFactoryBean.class, "jobExecutionListeners").parseListeners(element, parserContext, builder); new PropertyParser(PropertyParser.JOB_ARTIFACT_PROPERTY_PREFIX + jobName, parserContext).parseProperties(element); PropertyParser.popPath(); }

Target:
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { CoreNamespaceUtils.autoregisterBeansForNamespace(parserContext, parserContext.extractSource(element)); JsrNamespaceUtils.autoregisterJsrBeansForNamespace(parserContext); String jobName = element.getAttribute(ID_ATTRIBUTE); if(PropertyParser.hasPath()) { PropertyParser.clearPath(); throw new IllegalArgumentException("Job parsing started for job name: " + jobName + " and property parser path already populated."); } PropertyParser.pushPath(jobName); builder.addConstructorArgValue(jobName); String restartableAttribute = element.getAttribute(RESTARTABLE_ATTRIBUTE); if (StringUtils.hasText(restartableAttribute)) { builder.addPropertyValue("restartable", restartableAttribute); } BeanDefinition flowDef = new FlowParser(jobName, jobName).parse(element, parserContext); builder.addPropertyValue("flow", flowDef); AbstractBeanDefinition stepContextBeanDefinition = BeanDefinitionBuilder.genericBeanDefinition(StepContextFactoryBean.class) .getBeanDefinition(); stepContextBeanDefinition.setScope("step"); parserContext.getRegistry().registerBeanDefinition("stepContextFactory", stepContextBeanDefinition); new ListnerParser(JobListenerFactoryBean.class, "jobExecutionListeners").parseListeners(element, parserContext, builder); new PropertyParser(PropertyParser.JOB_ARTIFACT_PROPERTY_PREFIX + jobName, parserContext).parseProperties(element); PropertyParser.popPath(); }
Source:
public Object toJson(AggregateCall node) { final Map<String, Object> map = jsonBuilder.map(); Map<String, Object> aggMap = new HashMap(toJson(node.getAggregation())); aggMap.put("class", node.getAggregation().getClass().getName()); map.put("agg", aggMap); map.put("type", toJson(node.getType())); map.put("distinct", node.isDistinct()); map.put("operands", node.getArgList()); map.put("name", node.getName()); return map; }

Target:
public Object toJson(AggregateCall node) { final Map<String, Object> map = jsonBuilder.map(); final Map<String, Object> aggMap = toJson(node.getAggregation()); if (node.getAggregation().getFunctionType().isUserDefined()) { aggMap.put("class", node.getAggregation().getClass().getName()); } map.put("agg", aggMap); map.put("type", toJson(node.getType())); map.put("distinct", node.isDistinct()); map.put("operands", node.getArgList()); map.put("name", node.getName()); return map; }
Source:
public void render(Context context, ImageResource value, SafeHtmlBuilder sb) { if (value != null) { sb.append(template.imageContainerWithStyleClass( styleClass.equals("") ? style : "", styleClass, SafeHtmlUtils.fromTrustedString(AbstractImagePrototype.create(value).getHTML()))); } }

Target:
public void render(Context context, ImageResource value, SafeHtmlBuilder sb) { if (value != null) { sb.append(template.imageContainerWithStyleClass( style, styleClass, SafeHtmlUtils.fromTrustedString(AbstractImagePrototype.create(value).getHTML()))); } }