auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public EVCacheLatch add(EVCacheKey evcKey, final CachedData cd, Transcoder evcacheValueTranscoder, int timeToLive, Policy policy) throws Exception { if (cd == null) return null; final EVCacheClient[] clients = _pool.getEVCacheClientForWrite(); final EVCacheLatchImpl latch = new EVCacheLatchImpl(policy, clients.length - _pool.getWriteOnlyEVCacheClients().length, _appName); Boolean firstStatus = null; for (EVCacheClient client : clients) { CachedData cd1 = null; if (evcKey.getHashKey(client.isDuetClient(), client.getHashingAlgorithm()) != null) { final EVCacheValue val = new EVCacheValue(evcKey.getCanonicalKey(client.isDuetClient()), cd.getData(), cd.getFlags(), timeToLive, System.currentTimeMillis()); cd1 = evcacheValueTranscoder.encode(val); } else { cd1 = cd; } String key = evcKey.getDerivedKey(client.isDuetClient(), client.getHashingAlgorithm()); final Future<Boolean> f = client.add(key, timeToLive, cd1, latch); if (log.isDebugEnabled()) log.debug("ADD : Op Submitted : APP " + _appName + ", key " + key + "; future : " + f + "; client : " + client); boolean status = f.get().booleanValue(); if(!status) { if(firstStatus == null) { for(int i = 0; i < clients.length; i++) { latch.countDown(); } return latch; } else { return fixup(client, clients, evcKey, timeToLive, policy); } } if(firstStatus == null) firstStatus = Boolean.valueOf(status); } return latch; }

Target:
public EVCacheLatch add(EVCacheKey evcKey, final CachedData cd, Transcoder evcacheValueTranscoder, int timeToLive, Policy policy) throws Exception { if (cd == null) return null; final EVCacheClient[] clients = _pool.getEVCacheClientForWrite(); final EVCacheLatchImpl latch = new EVCacheLatchImpl(policy, clients.length - _pool.getWriteOnlyEVCacheClients().length, _appName); Boolean firstStatus = null; for (EVCacheClient client : clients) { CachedData cd1 = null; if (evcKey.getHashKey(client.isDuetClient(), client.getHashingAlgorithm(), client.shouldEncodeHashKey(), client.getMaxHashingBytes()) != null) { final EVCacheValue val = new EVCacheValue(evcKey.getCanonicalKey(client.isDuetClient()), cd.getData(), cd.getFlags(), timeToLive, System.currentTimeMillis()); cd1 = evcacheValueTranscoder.encode(val); } else { cd1 = cd; } String key = evcKey.getDerivedKey(client.isDuetClient(), client.getHashingAlgorithm(), client.shouldEncodeHashKey(), client.getMaxHashingBytes()); final Future<Boolean> f = client.add(key, timeToLive, cd1, latch); if (log.isDebugEnabled()) log.debug("ADD : Op Submitted : APP " + _appName + ", key " + key + "; future : " + f + "; client : " + client); boolean status = f.get().booleanValue(); if(!status) { if(firstStatus == null) { for(int i = 0; i < clients.length; i++) { latch.countDown(); } return latch; } else { return fixup(client, clients, evcKey, timeToLive, policy); } } if(firstStatus == null) firstStatus = Boolean.valueOf(status); } return latch; }
Source:
protected Promise<Void> makeMenuBar() { scenarioSimulationEditorPresenter.makeMenuBar(fileMenuBuilder); if (workbenchContext.getActiveWorkspaceProject().isPresent()) { final WorkspaceProject activeProject = workbenchContext.getActiveWorkspaceProject().orElseThrow(IllegalStateException::new); return projectController.canUpdateProject(activeProject).then(canUpdateProject -> { if (Boolean.TRUE.equals(canUpdateProject)) { addSave(fileMenuBuilder); addCopy(fileMenuBuilder); addRename(fileMenuBuilder); addDelete(fileMenuBuilder); } addDownloadMenuItem(fileMenuBuilder); addCommonActions(fileMenuBuilder); setSaveEnabled(canUpdateProject); return promises.resolve(); }); } return promises.resolve(); }

Target:
protected Promise<Void> makeMenuBar() { scenarioSimulationEditorPresenter.makeMenuBar(fileMenuBuilder); if (workbenchContext.getActiveWorkspaceProject().isPresent()) { final WorkspaceProject activeProject = workbenchContext.getActiveWorkspaceProject().orElseThrow(IllegalStateException::new); return projectController.canUpdateProject(activeProject).then(canUpdateProject -> { if (Boolean.TRUE.equals(canUpdateProject)) { addSave(fileMenuBuilder); addCopy(fileMenuBuilder); addRename(fileMenuBuilder); addDelete(fileMenuBuilder); } addDownloadMenuItem(fileMenuBuilder); addCommonActions(fileMenuBuilder); return promises.resolve(); }); } return promises.resolve(); }
Source:
public synchronized void processStreamControl(OperationMode operation) { switch (operation) { case RELEASE: if (isBlocked() && isMastershipAccepted() && m_gapTracker.getFirstGap() != null) { long firstUnpolledSeqNo = m_gapTracker.getFirstGap().getSecond() + 1; if (exportLog.isDebugEnabled()) { exportLog.debug("Unblock " + this + " move firstUnpolledSeqNo from " + m_firstUnpolledSeqNo + " to " + firstUnpolledSeqNo); } m_firstUnpolledSeqNo = firstUnpolledSeqNo; setStatus(StreamStatus.ACTIVE); } break; default: throw new IllegalArgumentException(operation + " is not a valid export control operation."); } }

Target:
public synchronized void processStreamControl(OperationMode operation) { switch (operation) { case RELEASE: if (m_status == StreamStatus.BLOCKED && m_mastershipAccepted.get() && m_gapTracker.getFirstGap() != null) { long firstUnpolledSeqNo = m_gapTracker.getFirstGap().getSecond() + 1; if (exportLog.isDebugEnabled()) { exportLog.debug("Release " + this + " move firstUnpolledSeqNo from " + m_firstUnpolledSeqNo + " to " + firstUnpolledSeqNo); } m_firstUnpolledSeqNo = firstUnpolledSeqNo; setStatus(StreamStatus.ACTIVE); } break; default: } }
Source:
public JSONObject getIdentitiesBySearch(@RequestBody JSONObject identitiesSearches, HttpServletResponse response) throws IOException { if (identitiesSearches.size() == 0) { throw new RestException("Must give search terms to look up identities"); } Integer requestCounter = (Integer) identitiesSearches.get("requestCounter"); JSONArray searchTerms = JSONArray.fromObject(identitiesSearches.get("identitiesSearches")); List<Set<SampleDto>> foundIdentities = new ArrayList<Set<SampleDto>>(); for (int i = 0; i < searchTerms.size(); i++) { Set<Sample> resultsForOneParent = new HashSet<Sample>(); Set<SampleDto> resultsForOneParentDtos = new HashSet<SampleDto>(); for (String term : IdentityImpl.getSetFromString(((String) searchTerms.get(i)).replaceAll(";", ","))) { Collection<Identity> selectedIdentities = sampleService.getIdentitiesByExternalNameOrAlias(term); if (!selectedIdentities.isEmpty()) { for (Identity selectedIdentity : selectedIdentities) { if (resultsForOneParent.contains(selectedIdentity)) { continue; } else { resultsForOneParentDtos.add(Dtos.asDto(selectedIdentity)); resultsForOneParent.add(selectedIdentity); } } } } foundIdentities.add(resultsForOneParentDtos); } JSONObject allIdentities = new JSONObject(); allIdentities.put("requestCounter", requestCounter); allIdentities.put("foundIdentities", foundIdentities); return allIdentities; }

Target:
public JSONObject getIdentitiesBySearch(@RequestBody JSONObject identitiesSearches, HttpServletResponse response) throws IOException { if (identitiesSearches.size() == 0) { throw new RestException("Must give search terms to look up identities"); } Integer requestCounter = (Integer) identitiesSearches.get("requestCounter"); List<Set<SampleDto>> identitiesResults = new ArrayList<>(); JSONArray searchTerms = JSONArray.fromObject(identitiesSearches.get("identitiesSearches")); for (int i = 0; i < searchTerms.size(); i++) { Set<Sample> resultsForOneParent = new HashSet<>(); Set<SampleDto> resultsForOneParentDtos = new HashSet<>(); for (String term : IdentityImpl.getSetFromString(((String) searchTerms.get(i)).replaceAll(";", ","))) { Collection<Identity> selectedIdentities = sampleService.getIdentitiesByExternalNameOrAlias(term); for (Identity selectedIdentity : selectedIdentities) { if (resultsForOneParent.contains(selectedIdentity)) { continue; } else { resultsForOneParentDtos.add(Dtos.asDto(selectedIdentity)); resultsForOneParent.add(selectedIdentity); } } } identitiesResults.add(resultsForOneParentDtos); } JSONObject allIdentities = new JSONObject(); allIdentities.put("requestCounter", requestCounter); allIdentities.put("identitiesResults", identitiesResults); return allIdentities; }
Source:
public static byte[] decrypt(Request request) throws OSException { discardEOptions(request); OSCoreCtxDB db = HashMapCtxDB.getInstance(); byte[] protectedData = collectData(request); Encrypt0Message enc = decompression(protectedData, request); CBORObject kid = enc.findAttribute(HeaderKeys.KID); if (kid == null || !kid.getType().equals(CBORType.ByteString)) { LOGGER.severe(OSExceptionHandler.MISSING_KID); throw new OSException(OSExceptionHandler.MISSING_KID); } byte[] rid = kid.GetByteString(); OSCoreCtx ctx = db.getContext(rid); if (ctx == null) { LOGGER.severe(OSExceptionHandler.CONTEXT_NOT_FOUND); throw new OSException(OSExceptionHandler.CONTEXT_NOT_FOUND); } byte[] plaintext = new byte[0]; plaintext = decryptAndDecode(enc, request, ctx, null); ctx.setCoAPCode(Code.valueOf(plaintext[0])); plaintext = Arrays.copyOfRange(plaintext, 1, plaintext.length); OptionSet optionSet = OptionJuggle.readOptionsFromOSPayload(plaintext); request.setOptions(optionSet); byte[] payload = OSSerializer.readPayload(plaintext); request.setPayload(payload); return rid; }

Target:
public static Request decrypt(Request request) throws CoapOSException { discardEOptions(request); OSCoreCtxDB db = HashMapCtxDB.getInstance(); byte[] protectedData = request.getPayload(); Encrypt0Message enc; OptionSet uOptions = request.getOptions(); try { enc = decompression(protectedData, request); } catch (OSException e) { LOGGER.error(Error.FAILED_TO_DECODE_COSE); throw new CoapOSException(Error.FAILED_TO_DECODE_COSE, ResponseCode.BAD_OPTION); } CBORObject kid = enc.findAttribute(HeaderKeys.KID); if (kid == null || !kid.getType().equals(CBORType.ByteString)) { LOGGER.error(Error.MISSING_KID); throw new CoapOSException(Error.FAILED_TO_DECODE_COSE, ResponseCode.BAD_OPTION); } byte[] rid = kid.GetByteString(); OSCoreCtx ctx = db.getContext(rid); if (ctx == null) { LOGGER.error(Error.CONTEXT_NOT_FOUND); throw new CoapOSException(Error.CONTEXT_NOT_FOUND, ResponseCode.UNAUTHORIZED); } byte[] plaintext; try { plaintext = decryptAndDecode(enc, request, ctx, null); } catch (OSException e) { LOGGER.error(Error.DECRYPTION_FAILED); throw new CoapOSException(Error.DECRYPTION_FAILED, ResponseCode.BAD_REQUEST); } DatagramReader reader = new DatagramReader(new ByteArrayInputStream(plaintext)); ctx.setCoAPCode(Code.valueOf(reader.read(CoAP.MessageFormat.CODE_BITS))); request.setOptions(EMPTY); DataParser.parseOptionsAndPayload(reader, request); OptionSet eOptions = request.getOptions(); eOptions = OptionJuggle.merge(eOptions, uOptions); request.setOptions(eOptions); request.getOptions().setOscore(rid); return OptionJuggle.setRealCodeRequest(request, ctx.getCoAPCode()); }
Source:
private String toString(String title, String text) { StringBuilder result = new StringBuilder(); result.append("Hint"); if (title != null) result.append(".titled(\"").append(title).append("\")"); if (effort != 0) result.append(".withEffort(").append(effort).append(")"); if (tags != null && !tags.isEmpty()) result.append(".withTags(").append(tags).append(")"); if (text != null) result.append("\n\t.withText(\"").append(StringUtils.abbreviate(text.trim(), MAX_LOG_TEXT_LENGTH)).append("\")"); if (links != null && !links.isEmpty()) result.append("\n\t.with(").append(links).append(")"); return result.toString(); }

Target:
private String toString(String title, String text) { StringBuilder result = new StringBuilder(); result.append("Hint"); if (title != null) result.append(".titled(\"").append(title).append("\")"); if (effort != 0) result.append(".withEffort(").append(effort).append(")"); if (tags != null && !tags.isEmpty()) result.append(".withTags(").append(tags).append(")"); if (text != null) result.append(Util.NL + "\t.withText(\"").append(StringUtils.abbreviate(text.trim(), MAX_LOG_TEXT_LENGTH)).append("\")"); if (links != null && !links.isEmpty()) result.append(Util.NL + "\t.with(").append(links).append(")"); return result.toString(); }
Source:
public void edit(HostNetworkProviderModel model) { driver.edit(model); final NeutronAgentModel neutronAgentModel = model.getNeutronAgentModel(); neutronAgentWidget.edit(neutronAgentModel); neutronAgentPanel.setVisible(neutronAgentModel.isPluginConfigurationAvailable().getEntity()); model.getNetworkProviderType().getSelectedItemChangedEvent().addListener((ev, sender, args) -> neutronAgentPanel.setVisible(model.getNetworkProviderType().getSelectedItem() == OPENSTACK_NETWORK)); }

Target:
public void edit(HostNetworkProviderModel model) { driver.edit(model); final NeutronAgentModel neutronAgentModel = model.getNeutronAgentModel(); neutronAgentWidget.edit(neutronAgentModel); neutronAgentPanel.setVisible(neutronAgentModel.isPluginConfigurationAvailable().getEntity()); IEventListener<EventArgs> providerPluginTypeListener = (ev, sender, args) -> neutronAgentPanel.setVisible( model.getNetworkProviderType().getSelectedItem() == OPENSTACK_NETWORK && isOpenstackPlugin(model.getProviderPluginType().getSelectedItem())); model.getNetworkProviderType().getSelectedItemChangedEvent().addListener(providerPluginTypeListener); model.getProviderPluginType().getSelectedItemChangedEvent().addListener(providerPluginTypeListener); }
Source:
public CloudnameException() { super(); }

Target:
public CloudnameException() { }
Source:
public KubernetesCloud(@NonNull String name, @NonNull KubernetesCloud source) { super(name); this.defaultsProviderTemplate = source.defaultsProviderTemplate; this.templates.addAll(source.templates); this.serverUrl = source.serverUrl; this.serverCertificate = source.serverCertificate; this.skipTlsVerify = source.skipTlsVerify; this.addMasterProxyEnvVars = source.addMasterProxyEnvVars; this.namespace = source.namespace; this.directConnection = source.directConnection; this.jenkinsUrl = source.jenkinsUrl; this.jenkinsTunnel = source.jenkinsTunnel; this.credentialsId = source.credentialsId; this.containerCap = source.containerCap; this.retentionTimeout = source.retentionTimeout; this.connectTimeout = source.connectTimeout; this.readTimeout = source.readTimeout; this.usageRestricted = source.usageRestricted; this.maxRequestsPerHost = source.maxRequestsPerHost; this.podRetention = source.podRetention; this.waitForPodSec = source.waitForPodSec; this.capOnlyOnAlivePods = source.capOnlyOnAlivePods; setPodLabels(source.podLabels); }

Target:
public KubernetesCloud(@NonNull String name, @NonNull KubernetesCloud source) { super(name); XStream2 xs = new XStream2(); xs.omitField(Cloud.class, "name"); xs.omitField(KubernetesCloud.class, "templates"); xs.unmarshal(XStream2.getDefaultDriver().createReader(new StringReader(xs.toXML(source))), this); this.templates.addAll(source.templates); }
Source:
public VersionTreeDialog(Active active, Collection<IAtsVersion> versions) { super("Select Version", "Select Version", new VersionContentProvider(active), new AtsObjectLabelProvider(), new AtsObjectNameSorter()); setInput(versions); }

Target:
public VersionTreeDialog(Active active, Collection<IAtsVersion> versions) { super("Select Version", "Select Version", new ArrayTreeContentProvider(), new AtsObjectLabelProvider(), new AtsObjectNameSorter()); setInput(versions); }
Source:
public void build() throws Exception { if (keyPassword == null) { throw new IllegalStateException("keyPassword has to be specified"); } if (storagePassword == null) { throw new IllegalStateException("storagePassword has to be specified"); } if (file == null) { throw new IllegalStateException("file has to be specified"); } KeyStore keyStore = KeyStore.getInstance(type); keyStore.load(null, null); KeyGenerator generator = KeyGenerator.getInstance(cryptoAlgorithm); generator.init(keySize); SecretKey adminKey = generator.generateKey(); KeyStore.ProtectionParameter keyPP = new KeyStore.PasswordProtection(keyPassword); keyStore.setEntry(KeystorePasswordStore.DEFAULT_ADMIN_KEY_ALIAS, new KeyStore.SecretKeyEntry(adminKey), keyPP); Cipher cipher = Cipher.getInstance(cryptoAlgorithm); cipher.init(Cipher.ENCRYPT_MODE, adminKey); for (Data d : data) { byte[] plainData = Normalizer.normalize(new String(d.getSecret()), Normalizer.Form.NFKC).getBytes(StandardCharsets.UTF_8); byte[] encryptedData = cipher.doFinal(plainData); KeystorePasswordStore.Entry entry = new KeystorePasswordStore.Entry(PasswordCredential.class.getName(), encryptedData); keyStore.setEntry(d.getAlias(), new KeyStore.SecretKeyEntry(new SecretKeyWrap(entry)), keyPP); } keyStore.store(new FileOutputStream(file), storagePassword); }

Target:
public void build() throws Exception { if (keyPassword == null) { throw new IllegalStateException("keyPassword has to be specified"); } if (storagePassword == null) { throw new IllegalStateException("storagePassword has to be specified"); } if (file == null) { throw new IllegalStateException("file has to be specified"); } KeyStore keyStore = KeyStore.getInstance(type); keyStore.load(null, null); KeyGenerator generator = KeyGenerator.getInstance(cryptoAlgorithm); generator.init(keySize); SecretKey adminKey = generator.generateKey(); KeyStore.ProtectionParameter keyPP = new KeyStore.PasswordProtection(keyPassword); keyStore.setEntry(KeystorePasswordStore.DEFAULT_ADMIN_KEY_ALIAS, new KeyStore.SecretKeyEntry(adminKey), keyPP); Cipher cipher = Cipher.getInstance(cryptoAlgorithm); cipher.init(Cipher.ENCRYPT_MODE, adminKey); for (Data d : data) { byte[] plainData = Normalizer.normalize(new String(d.getSecret()), Normalizer.Form.NFKC).getBytes(StandardCharsets.UTF_8); byte[] encryptedData = cipher.doFinal(plainData); KeystorePasswordStore.Entry entry = new KeystorePasswordStore.Entry(PasswordCredential.class.getName(), encryptedData); keyStore.setEntry(d.getAlias(), new KeyStore.SecretKeyEntry(new SecretKeyWrap(KeystorePasswordStore.Entry.serializeEntry(entry), ClearPassword.ALGORITHM_CLEAR)), keyPP); } keyStore.store(new FileOutputStream(file), storagePassword); }
Source:
public E getRandomValue() throws NoSuchElementException { List<E> enumConstants = getFilteredList(); if (enumConstants.isEmpty()) { throw new NoSuchElementException("No enum element available for random picking."); } int randomIndex = random.nextInt(enumConstants.size()); return enumConstants.get(randomIndex); }

Target:
public E getRandomValue() { List<E> enumConstants = getFilteredList(); int randomIndex = random.nextInt(enumConstants.size()); return enumConstants.get(randomIndex); }
Source:
public final Object include(final String filename) { final Object file = ResourceTools.resolveFile(filename, getScriptEngine().getExecutedFile(), true); if (file != null) return getScriptEngine().inject(new Script(filename, file)); else { try { final URL url = new URL(filename); return getScriptEngine().inject(url.openStream()); } catch (final MalformedURLException e) { } catch (final IOException e) { } } throw new RuntimeException("Cannot locate '" + filename + "'"); }

Target:
public final Object include(final String filename) { final Object file = ResourceTools.resolveFile(filename, getScriptEngine().getExecutedFile(), true); if (file != null) return getScriptEngine().inject(file); else { try { final URL url = new URL(filename); return getScriptEngine().inject(url.openStream()); } catch (final MalformedURLException e) { } catch (final IOException e) { } } throw new RuntimeException("Cannot locate '" + filename + "'"); }
Source:
public boolean validateSegments(List<DataSegment> latestSegments) { final List<String> thoseSegments = latestSegments .stream() .map(segment -> segment.getId().toString()) .collect(Collectors.toList()); Collections.sort(this.segments); Collections.sort(thoseSegments); return this.segments.equals(thoseSegments); }

Target:
public boolean validateSegments(List<DataSegment> latestSegments) { final List<String> thoseSegments = latestSegments .stream() .map(segment -> segment.getId().toString()) .sorted() .collect(Collectors.toList()); return this.segments.equals(thoseSegments); }
Source:
public void onReceive(Context context, Intent intent) { News news = Parcels.unwrap(intent.getParcelableExtra(Constants.NEWS)); Intent chooser = Intent.createChooser(ActionUtil.getPumpkinShareIntent(context, news), "Share"); chooser.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(chooser); }

Target:
public void onReceive(Context context, Intent intent) { News news = Parcels.unwrap(intent.getParcelableExtra(Constants.NEWS)); String label = context.getResources().getString(R.string.share); Intent shareIntent = ActionUtil.getPumpkinShareIntent(news); Intent chooser = Intent.createChooser(shareIntent, label); chooser.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(chooser); }
Source:
public static Slice ipPrefix(@SqlType(StandardTypes.IPADDRESS) Slice value, @SqlType(StandardTypes.BIGINT) long subnetSize) { byte[] ipV4Map = new byte[12]; ipV4Map[10] = (byte) 0xff; ipV4Map[11] = (byte) 0xff; if (Arrays.equals(value.getBytes(0, 12), ipV4Map)) { checkCondition(0 <= subnetSize && subnetSize <= 32, INVALID_FUNCTION_ARGUMENT, "IPv4 subnet size must be in range [0, 32]"); } else { checkCondition(0 <= subnetSize && subnetSize <= 128, INVALID_FUNCTION_ARGUMENT, "IPv6 subnet size must be in range [0, 128]"); } String addressStr; try { addressStr = InetAddresses.toAddrString(InetAddress.getByAddress(value.getBytes())); } catch (UnknownHostException e) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "Invalid IP address binary length: " + value.length(), e); } return castFromVarcharToIpPrefix(utf8Slice(addressStr + "/" + Long.toString(subnetSize))); }

Target:
public static Slice ipPrefix(@SqlType(StandardTypes.IPADDRESS) Slice value, @SqlType(StandardTypes.BIGINT) long subnetSize) { InetAddress address; try { address = InetAddress.getByAddress(value.getBytes()); } catch (UnknownHostException e) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "Invalid IP address binary: " + value.toStringUtf8(), e); } int addressLength = address.getAddress().length; if (addressLength == 4) { checkCondition(0 <= subnetSize && subnetSize <= 32, INVALID_FUNCTION_ARGUMENT, "IPv4 subnet size must be in range [0, 32]"); } else if (addressLength == 16) { checkCondition(0 <= subnetSize && subnetSize <= 128, INVALID_FUNCTION_ARGUMENT, "IPv6 subnet size must be in range [0, 128]"); } else { throw new PrestoException(GENERIC_INTERNAL_ERROR, "Invalid InetAddress length: " + addressLength); } return castFromVarcharToIpPrefix(utf8Slice(InetAddresses.toAddrString(address) + "/" + subnetSize)); }
Source:
private void init() { try { URL url = new File(schemaPath).toURI().toURL(); String sdl = Resources.toString(url, Charsets.UTF_8); GraphQLSchema graphQLSchema = buildSchema(sdl); this.graphql = GraphQL.newGraphQL(graphQLSchema).build(); } catch (Exception e) { e.printStackTrace(); } }

Target:
private void init() { try { URL url = new File(schemaPath).toURI().toURL(); String sdl = Resources.toString(url, Charsets.UTF_8); GraphQLSchema graphQLSchema = buildSchema(sdl); this.graphql = GraphQL.newGraphQL(graphQLSchema).build(); } catch (Exception e) { log.error("Unable to create the GraphQL api"); } }
Source:
public T getClient(String uri, Map<String, String> httpConfig) { T client = getOverride(uri); if (client == null) { client = createClient(getRestClient(uri, httpConfig)); } return client; }

Target:
public synchronized T getClient(String uri, Map<String, String> httpConfig) { T client = getOverride(uri); if (client == null) { client = createClient(getRestClient(uri, httpConfig)); } return client; }
Source:
public void dropView(NewVisitView view) { if (statePrimarySubscription!=null && !statePrimarySubscription.isUnsubscribed()) { statePrimarySubscription.unsubscribe(); } super.dropView(view); clearSwitchListeners(); ButterKnife.unbind(this); }

Target:
public void dropView(NewVisitView view) { super.dropView(view); clearSwitchListeners(); ButterKnife.unbind(this); }
Source:
public void doWrite(Row value, int ordinal) { if (value.getField(ordinal) == null) { ((DateDayVector) getValueVector()).setNull(getCount()); } else { ((DateDayVector) getValueVector()).setSafe( getCount(), SqlDateTimeUtils.dateToInternal(((Date) value.getField(ordinal)))); } }

Target:
public void doWrite(Row value, int ordinal) { if (value.getField(ordinal) == null) { ((DateDayVector) getValueVector()).setNull(getCount()); } else { ((DateDayVector) getValueVector()).setSafe( getCount(), PythonTypeUtils.dateToInternal(((Date) value.getField(ordinal)))); } }
Source:
public AbstractMailer(Props props) { this.azkabanName = props.getString("azkaban.name", "azkaban"); this.mailHost = props.getString("mail.host", "localhost"); this.mailUser = props.getString("mail.user", ""); this.mailPassword = props.getString("mail.password", ""); long maxAttachmentSizeInMB = props.getInt("mail.max.attachment.size.mb", 1000); attachmentMazSizeInByte = maxAttachmentSizeInMB * MB_IN_BYTES; this.mailSender = props.getString("mail.sender", ""); this.clientHostname = props.get("server.hostname"); this.clientPort = props.getInt("server.port"); this.usesSSL = props.getBoolean("server.useSSL"); if (usesSSL) { referenceURL = "https://" + clientHostname + (clientPort == 443 ? "/" : ":" + clientPort + "/"); } else { referenceURL = "http://" + clientHostname + (clientPort == 80 ? "/" : ":" + clientPort + "/"); } }

Target:
public AbstractMailer(Props props) { this.azkabanName = props.getString("azkaban.name", "azkaban"); this.mailHost = props.getString("mail.host", "localhost"); this.mailUser = props.getString("mail.user", ""); this.mailPassword = props.getString("mail.password", ""); long maxAttachmentSizeInMB = props.getInt("mail.max.attachment.size.mb", 100); attachmentMazSizeInByte = maxAttachmentSizeInMB * MB_IN_BYTES; this.mailSender = props.getString("mail.sender", ""); this.usesAuth = props.getBoolean("mail.useAuth", true); this.clientHostname = props.get("server.hostname"); this.clientPort = props.getInt("server.port"); this.usesSSL = props.getBoolean("server.useSSL"); if (usesSSL) { referenceURL = "https://" + clientHostname + (clientPort == 443 ? "/" : ":" + clientPort + "/"); } else { referenceURL = "http://" + clientHostname + (clientPort == 80 ? "/" : ":" + clientPort + "/"); } }
Source:
private void saveMetadataAsBean(DocStructInterface inStrukturelement) { this.docStruct = inStrukturelement; LinkedList<MetadatumImpl> lsMeta = new LinkedList<>(); LinkedList<MetaPerson> lsPers = new LinkedList<>(); List<? extends MetadataInterface> tempMetadata = this.metaHelper.getMetadataInclDefaultDisplay( inStrukturelement, Helper.getMetadataLanguageForCurrentUser(), false, this.process); if (tempMetadata != null) { for (MetadataInterface metadataInterface : tempMetadata) { MetadatumImpl meta = new MetadatumImpl(metadataInterface, 0, this.myPrefs, this.process); meta.getSelectedItem(); lsMeta.add(meta); } } tempMetadata = this.metaHelper.getMetadataInclDefaultDisplay(inStrukturelement, Helper.getMetadataLanguageForCurrentUser(), true, this.process); if (tempMetadata != null) { for (MetadataInterface metadataInterface : tempMetadata) { lsPers.add(new MetaPerson((PersonInterface) metadataInterface, 0, this.myPrefs, inStrukturelement)); } } this.myMetadaten = lsMeta; this.metaPersonList = lsPers; determinePagesStructure(this.docStruct); }

Target:
private void saveMetadataAsBean(DocStructInterface inStrukturelement) { this.docStruct = inStrukturelement; LinkedList<MetadatumImpl> lsMeta = new LinkedList<>(); LinkedList<MetaPerson> lsPers = new LinkedList<>(); List<? extends MetadataInterface> tempMetadata = this.metaHelper.getMetadataInclDefaultDisplay( inStrukturelement, Helper.getMetadataLanguageForCurrentUser(), false, this.process); if (tempMetadata != null) { for (MetadataInterface metadata : tempMetadata) { MetadatumImpl meta = new MetadatumImpl(metadata, 0, this.myPrefs, this.process); meta.getSelectedItem(); lsMeta.add(meta); } } tempMetadata = this.metaHelper.getMetadataInclDefaultDisplay(inStrukturelement, Helper.getMetadataLanguageForCurrentUser(), true, this.process); if (tempMetadata != null) { for (MetadataInterface metadata : tempMetadata) { lsPers.add(new MetaPerson((PersonInterface) metadata, 0, this.myPrefs, inStrukturelement)); } } this.myMetadaten = lsMeta; this.metaPersonList = lsPers; determinePagesStructure(this.docStruct); }
Source:
public void cleanupGcs() throws Exception { if (gcs == null) { return; } Storage.Objects.List req = gcs.objects().list(GCS_TEST_BUCKET); Objects objects; do { objects = req.execute(); List<StorageObject> items = objects.getItems(); if (items != null) { for (StorageObject object : items) { if (object.getName().startsWith(GCS_PREFIX)) { try { gcs.objects().delete(GCS_TEST_BUCKET, object.getName()).execute(); } catch (IOException e) { e.printStackTrace(); } } } } req.setPageToken(objects.getNextPageToken()); } while (null != objects.getNextPageToken()); }

Target:
public void cleanupGcs() throws Exception { if (gcs == null) { return; } Storage.Objects.List req = gcs.objects().list(GCS_TEST_BUCKET); Objects objects; do { objects = req.execute(); List<StorageObject> items = objects.getItems(); if (items != null) { for (StorageObject object : items) { if (object.getName().startsWith(GCS_PREFIX)) { try { gcs.objects().delete(GCS_TEST_BUCKET, object.getName()).execute(); } catch (IOException e) { logger.warn("Failed to delete test gcs bucket: {}", object.getName(), e); } } } } req.setPageToken(objects.getNextPageToken()); } while (null != objects.getNextPageToken()); }
Source:
private static <T> T createExperimentallyWithFallback( MetricsManager metricsManager, Supplier<TargetFactory.InstanceAndVersion<T>> experimentalProxySupplier, Supplier<TargetFactory.InstanceAndVersion<T>> fallbackProxySupplier, Class<T> type, AuxiliaryRemotingParameters clientParameters) { TargetFactory.InstanceAndVersion<T> fallbackProxy = fallbackProxySupplier.get(); try { return VersionSelectingClients.createVersionSelectingClient( metricsManager, fallbackProxy, experimentalProxySupplier.get(), VersionSelectingConfig.fromRemotingConfigSupplier(clientParameters.remotingClientConfig()), type); } catch (Exception e) { log.warn("Error occurred in creating an experimental proxy. Possible causes include" + " not running with SSL, which is deprecated and expected to be removed in a future release." + " Creating a legacy client.", e); return fallbackProxy.instance(); } }

Target:
private static <T> T createExperimentallyWithFallback( MetricsManager metricsManager, Supplier<TargetFactory.InstanceAndVersion<T>> experimentalProxySupplier, Supplier<TargetFactory.InstanceAndVersion<T>> fallbackProxySupplier, Class<T> type, AuxiliaryRemotingParameters clientParameters) { TargetFactory.InstanceAndVersion<T> fallbackProxy = fallbackProxySupplier.get(); try { return VersionSelectingClients.createVersionSelectingClient( metricsManager, experimentalProxySupplier.get(), fallbackProxy, VersionSelectingConfig.fromRemotingConfigSupplier(clientParameters.remotingClientConfig()), type); } catch (Exception e) { log.warn("Error occurred in creating an experimental proxy. Possible causes include" + " not running with SSL, which is deprecated and expected to be removed in a future release." + " Creating a legacy client.", e); return fallbackProxy.instance(); } }
Source:
public void initializeUI(UIBuilder builder) throws Exception { sources = inputFactory.createInputMany("sources", 's', FileResource.class); sources.setRequired(true); sources.setDescription("The folder or file where the java sources will be formatted"); profile = inputFactory.createInput("profile",'p', XMLResource.class); profile.setRequired(true); profile.setDescription("The eclipse code format file"); builder.add(sources).add(profile); }

Target:
public void initializeUI(UIBuilder builder) throws Exception { sources = inputFactory.createInputMany("sources", 's', FileResource.class); sources.setDescription("The folder or file where the java sources will be formatted"); profile = inputFactory.createInput("profile", 'p', XMLResource.class); profile.setDescription("The eclipse code format profile"); builder.add(sources).add(profile); }
Source:
public void setValues(PreparedStatement preparedStatement, Message<?> requestMessage, Object groupId, String region, boolean priorityEnabled) throws SQLException { Assert.notNull(this.serializer, "The serializer should not be null."); Assert.notNull(this.lobHandler, "The lobhandler should not be null."); String groupKey = getKey(groupId); long createdDate = System.currentTimeMillis(); String messageId = getKey(requestMessage.getHeaders().getId()); byte[] messageBytes = this.serializer.convert(requestMessage); if (logger.isDebugEnabled()) { logger.debug("Inserting message with id key=" + messageId); } preparedStatement.setString(1, messageId); preparedStatement.setString(2, groupKey); preparedStatement.setString(3, region); preparedStatement.setLong(4, createdDate); Integer priority = requestMessage.getHeaders().get(IntegrationMessageHeaderAccessor.PRIORITY, Integer.class); if (priorityEnabled && priority != null) { preparedStatement.setInt(5, priority); } else { preparedStatement.setNull(5, Types.NUMERIC); } this.lobHandler.getLobCreator().setBlobAsBytes(preparedStatement, 6, messageBytes); }

Target:
public void setValues(PreparedStatement preparedStatement, Message<?> requestMessage, Object groupId, String region, boolean priorityEnabled) throws SQLException { String groupKey = getKey(groupId); long createdDate = System.currentTimeMillis(); String messageId = getKey(requestMessage.getHeaders().getId()); byte[] messageBytes = null; if (this.serializer != null) { messageBytes = this.serializer.convert(requestMessage); } preparedStatement.setString(1, messageId); preparedStatement.setString(2, groupKey); preparedStatement.setString(3, region); preparedStatement.setLong(4, createdDate); Integer priority = requestMessage.getHeaders().get(IntegrationMessageHeaderAccessor.PRIORITY, Integer.class); if (priorityEnabled && priority != null) { preparedStatement.setInt(5, priority); } else { preparedStatement.setNull(5, Types.NUMERIC); } if (this.lobHandler != null) { this.lobHandler.getLobCreator().setBlobAsBytes(preparedStatement, 6, messageBytes); } }
Source:
private void refreshLocks() { ImmutableList<LockRefreshToken> refreshCopy = ImmutableList.copyOf(toRefresh); if (refreshCopy.isEmpty()) { return; } Set<LockRefreshToken> refreshedTokens = new HashSet<>(); for (List<LockRefreshToken> tokenBatch : Lists.partition(refreshCopy, REFRESH_BATCH_SIZE)) { refreshedTokens.addAll(delegate.refreshLockRefreshTokens(tokenBatch)); } Set<LockRefreshToken> failedTokens = null; for (LockRefreshToken token : refreshCopy) { if (!refreshedTokens.contains(token) && toRefresh.contains(token)) { log.warn("failed to refresh lock: {}", token); toRefresh.remove(token); if (failedTokens == null) { failedTokens = new HashSet<>(); } failedTokens.add(token); } } if (failedTokens != null && !failedTokens.isEmpty()) { Set<LockRefreshToken> unmodifiableFailedTokens = Collections.unmodifiableSet(failedTokens); for (FailedRefreshCallback callback : failedRefreshCallbacks) { exec.submit(() -> callback.onFailedRefresh(unmodifiableFailedTokens)); } } }

Target:
private void refreshLocks() { ImmutableList<LockRefreshToken> refreshCopy = ImmutableList.copyOf(toRefresh); if (refreshCopy.isEmpty()) { return; } Set<LockRefreshToken> refreshedTokens = new HashSet<>(); for (List<LockRefreshToken> tokenBatch : Lists.partition(refreshCopy, REFRESH_BATCH_SIZE)) { refreshedTokens.addAll(delegate.refreshLockRefreshTokens(tokenBatch)); } Set<LockRefreshToken> failedTokens = null; for (LockRefreshToken token : refreshCopy) { if (!refreshedTokens.contains(token) && toRefresh.contains(token)) { log.warn("failed to refresh lock: {}", token); toRefresh.remove(token); if (failedTokens == null) { failedTokens = new HashSet<>(); } failedTokens.add(token); } } if (failedTokens != null && !failedTokens.isEmpty()) { Set<LockRefreshToken> unmodifiableFailedTokens = Collections.unmodifiableSet(failedTokens); for (FailedRefreshCallback callback : failedRefreshCallbacks) { callbackExec.execute(() -> callback.onFailedRefresh(unmodifiableFailedTokens)); } } }
Source:
public void executeCommand(Command command, ExecutionHandlerContext context) { byte[] channelName = command.getProcessedCommand().get(1); long subscriptionCount = context.getPubSub().unsubscribe(new String(channelName), context.getClient()); ArrayList<Object> items = new ArrayList<>(); items.add("unsubscribe"); items.add(channelName); items.add(subscriptionCount); ByteBuf response = null; try { response = Coder.getArrayResponse(context.getByteBufAllocator(), items); } catch (CoderException e) { e.printStackTrace(); } command.setResponse(response); }

Target:
public void executeCommand(Command command, ExecutionHandlerContext context) { byte[] channelName = command.getProcessedCommand().get(1); long subscriptionCount = context.getPubSub().unsubscribe(new String(channelName), context.getClient()); ArrayList<Object> items = new ArrayList<>(); items.add("unsubscribe"); items.add(channelName); items.add(subscriptionCount); ByteBuf response = null; try { response = Coder.getArrayResponse(context.getByteBufAllocator(), items); } catch (CoderException e) { logger.warn("Error encoding unsubscribe response", e); } command.setResponse(response); }
Source:
private boolean hasModuleAttribute(IClasspathEntry entry) { return false && hasEnabledBooleanAttribute(IClasspathAttribute.MODULE, entry); }

Target:
private boolean hasModuleAttribute(IClasspathEntry entry) { return hasEnabledBooleanAttribute("module", entry); }
Source:
public void createsInitialDesktopFile() throws Exception { fileProvider.readAnswers.put(PATH_OWN_DESKTOP_FILE, new IOException("desktop file not existing")); registration.handleSchemes(Arrays.asList(ADT_SCHEME_INFO), Collections.emptyList()); assertEquals(PATH_OWN_DESKTOP_FILE, fileProvider.writePath); assertMimeTypeInFileIs("x-scheme-handler/adt;"); assertExecInFileIs("/home/myuser/Eclipse/Eclipse %u"); assertXdgMimeCalledFor("x-scheme-handler/adt"); }

Target:
public void createsInitialDesktopFile() throws Exception { fileProvider.readAnswers.put(PATH_OWN_DESKTOP_FILE, new IOException("desktop file not existing")); registration.handleSchemes(Arrays.asList(ADT_SCHEME_INFO), Collections.emptyList()); assertEquals(PATH_OWN_DESKTOP_FILE, fileProvider.writePath); assertAppNameInFileIs("myProduct"); assertMimeTypeInFileIs("x-scheme-handler/adt;"); assertExecInFileIs("/home/myuser/Eclipse/Eclipse %u"); assertXdgMimeCalledFor("x-scheme-handler/adt"); }
Source:
public Class<? extends ConnectorTableHandle> getTableHandleClass() { return TestingMetadata.TestingTableHandle.class; }

Target:
public Class<? extends ConnectorTableHandle> getTableHandleClass() { return TestingTableHandle.class; }
Source:
public CollectionDescription update( HttpServletRequest request, HttpServletResponse response, CollectionDescription collectionDescription ) throws IOException, ZebedeeException { Session session = Root.zebedee.getSessionsService().get(request); if (Root.zebedee.getPermissions().canEdit(session.getEmail()) == false) { throw new UnauthorizedException("You are not authorised to update collections."); } com.github.onsdigital.zebedee.model.Collection collection = Collections.getCollection(request); com.github.onsdigital.zebedee.model.Collection updatedCollection = collection.update( collection, collectionDescription, Root.zebedee, Root.getScheduler(), session); Audit.Event.COLLECTION_UPDATED .parameters() .host(request) .fromTo(collection.path.toString(), updatedCollection.path.toString()) .actionedBy(session.getEmail()) .log(); return updatedCollection.description; }

Target:
public CollectionDescription update( HttpServletRequest request, HttpServletResponse response, CollectionDescription collectionDescription ) throws IOException, ZebedeeException { Session session = Root.zebedee.getSessionsService().get(request); if (!Root.zebedee.getPermissions().canEdit(session.getEmail())) { throw new UnauthorizedException("You are not authorised to update collections."); } com.github.onsdigital.zebedee.model.Collection collection = Collections.getCollection(request); com.github.onsdigital.zebedee.model.Collection updatedCollection = collection.update( collection, collectionDescription, Root.zebedee, Root.getScheduler(), session); Audit.Event.COLLECTION_UPDATED .parameters() .host(request) .fromTo(collection.path.toString(), updatedCollection.path.toString()) .actionedBy(session.getEmail()) .log(); return updatedCollection.description; }
Source:
public static void main(String[] args) { TextAnalyticsAsyncClient client = new TextAnalyticsClientBuilder() .credential(new AzureKeyCredential(Configuration.getGlobalConfiguration().get("AZURE_TEXT_ANALYTICS_API_KEY"))) .endpoint(Configuration.getGlobalConfiguration().get("AZURE_TEXT_ANALYTICS_ENDPOINT")) .buildAsyncClient(); String document = "Microsoft employee with ssn 859-98-0987 is using our awesome API's."; client.recognizePiiEntities(document).subscribe( entityCollection -> entityCollection.forEach(entity -> System.out.printf( "Recognized personal identifiable information entity: %s, entity category: %s, entity sub-category: %s, score: %f.%n", entity.getText(), entity.getCategory(), entity.getSubcategory(), entity.getConfidenceScore())), error -> System.err.println("There was an error recognizing PII entities of the text." + error), () -> System.out.println("Entities recognized.") ); try { TimeUnit.SECONDS.sleep(5); } catch (InterruptedException ignored) { } }

Target:
public static void main(String[] args) { TextAnalyticsAsyncClient client = new TextAnalyticsClientBuilder() .credential(new AzureKeyCredential("{key}")) .endpoint("{endpoint}") .buildAsyncClient(); String document = "My SSN is 859-98-0987"; client.recognizePiiEntities(document).subscribe( entityCollection -> entityCollection.forEach(entity -> System.out.printf( "Recognized Personal Identifiable Information entity: %s, entity category: %s, entity sub-category: %s, score: %f.%n", entity.getText(), entity.getCategory(), entity.getSubcategory(), entity.getConfidenceScore())), error -> System.err.println("There was an error recognizing PII entities of the text." + error), () -> System.out.println("Entities recognized.") ); try { TimeUnit.SECONDS.sleep(5); } catch (InterruptedException ignored) { } }
Source:
T toObject(ProtobufCodec<T> codec, Provider<T> provider) { if (codec == null) { return null; } Object d = data; if (d instanceof byte[]) { this.codec = codec; if (provider == null) { d = codec.decode((byte[]) data); } else { T tmp = provider.get(); codec.mergeFrom((byte[]) data, tmp); d = tmp; } } data = d; return (T) data; }

Target:
T toObject(ProtobufCodec<T> codec, Provider<T> provider) { if (codec == null) { return null; } Object d = data; if (d instanceof byte[]) { this.codec = codec; if (provider == null) { d = codec.decode((byte[]) d); } else { T tmp = provider.get(); codec.mergeFrom((byte[]) d, tmp); d = tmp; } data = d; } return (T) d; }
Source:
public void postOnCreateSnapshot(VdcReturnValueBase returnValue, GlusterVolumeSnapshotEntity snapshot, GlusterVolumeSnapshotModel snapshotModel) { getWindow(); if (returnValue != null && returnValue.getSucceeded()) { setWindow(null); } }

Target:
public void postOnCreateSnapshot(VdcReturnValueBase returnValue, GlusterVolumeSnapshotEntity snapshot, GlusterVolumeSnapshotModel snapshotModel) { if (returnValue != null && returnValue.getSucceeded()) { setWindow(null); } }
Source:
private void validateTestExecution(TestExecutionEntity testExecution) { if (StringUtils.isEmpty(testExecution.getEnvId())) { throw new InvalidTestExecutionException( "envId must be specified"); } if (testExecution.getLoadScenarioId() == null && testExecution.getTestProjectURL() == null) { throw new InvalidTestExecutionException( "Neither a test project URL nor a load scenario name are not specified"); } if (StringUtils.isNotBlank(testExecution.getTestProjectURL())) { try { new URL(testExecution.getTestProjectURL()); } catch (MalformedURLException e) { throw new InvalidTestExecutionException( format("Test project URL '%s' is not valid URL! %s", testExecution.getTestProjectURL(), e.getMessage()), e); } } }

Target:
private void validateTestExecution(TestExecutionEntity testExecution) { if (StringUtils.isEmpty(testExecution.getEnvId())) { throw new InvalidTestExecutionException( "envId must be specified"); } if (testExecution.getLoadScenarioId() == null && testExecution.getTestProjectURL() == null) { throw new InvalidTestExecutionException( "Neither a test project URL nor a load scenario name are specified"); } if (StringUtils.isNotBlank(testExecution.getTestProjectURL())) { try { new URL(testExecution.getTestProjectURL()); } catch (MalformedURLException e) { throw new InvalidTestExecutionException( format("Test project URL '%s' is not valid URL! %s", testExecution.getTestProjectURL(), e.getMessage()), e); } } }
Source:
public void uploadFromFile3() throws IOException { BlobHttpHeaders headers = new BlobHttpHeaders() .setContentMd5("data".getBytes(StandardCharsets.UTF_8)) .setContentLanguage("en-US") .setContentType("binary"); Map<String, String> metadata = Collections.singletonMap("metadata", "value"); Map<String, String> tags = Collections.singletonMap("tag", "value"); BlobRequestConditions requestConditions = new BlobRequestConditions() .setLeaseId(leaseId) .setIfUnmodifiedSince(OffsetDateTime.now().minusDays(3)); Integer blockSize = 100 * 1024 * 1024; ParallelTransferOptions parallelTransferOptions = new ParallelTransferOptions(blockSize, null, null); try { client.uploadFromFile(filePath, parallelTransferOptions, headers, metadata, tags, AccessTier.HOT, requestConditions, timeout); System.out.println("Upload from file succeeded"); } catch (UncheckedIOException ex) { System.err.printf("Failed to upload from file %s%n", ex.getMessage()); } END: com.azure.storage.blob.BlobClient.uploadFromFile#String-ParallelTransferOptions-BlobHttpHeaders-Map-Map-AccessTier-BlobRequestConditions-Duration }

Target:
public void uploadFromFile3() throws IOException { BlobHttpHeaders headers = new BlobHttpHeaders() .setContentMd5("data".getBytes(StandardCharsets.UTF_8)) .setContentLanguage("en-US") .setContentType("binary"); Map<String, String> metadata = Collections.singletonMap("metadata", "value"); Map<String, String> tags = Collections.singletonMap("tag", "value"); BlobRequestConditions requestConditions = new BlobRequestConditions() .setLeaseId(leaseId) .setIfUnmodifiedSince(OffsetDateTime.now().minusDays(3)); Long blockSize = 100 * 1024 * 1024L; ParallelTransferOptions parallelTransferOptions = new ParallelTransferOptions().setBlockSizeLong(blockSize); try { client.uploadFromFile(filePath, new BlobUploadFromFileOptions() .setParallelTransferOptions(parallelTransferOptions).setHeaders(headers).setMetadata(metadata) .setTags(tags).setTier(AccessTier.HOT).setRequestConditions(requestConditions), timeout); System.out.println("Upload from file succeeded"); } catch (UncheckedIOException ex) { System.err.printf("Failed to upload from file %s%n", ex.getMessage()); } END: com.azure.storage.blob.BlobClient.uploadFromFile#String-BlobUploadFromFileOptions-Duration }
Source:
public static AuthUI getInstance(@NonNull FirebaseApp app) { if (ProviderAvailability.IS_TWITTER_AVAILABLE) { Log.w(TAG, "You no longer need TwitterKit to sign in with Twitter."); } AuthUI authUi; synchronized (INSTANCES) { authUi = INSTANCES.get(app); if (authUi == null) { authUi = new AuthUI(app); INSTANCES.put(app, authUi); } } return authUi; }

Target:
public static AuthUI getInstance(@NonNull FirebaseApp app) { if (ProviderAvailability.IS_TWITTER_AVAILABLE) { String releaseUrl = "<LINK_0>"; Log.w(TAG, String.format("Beginning with FirebaseUI 6.2.0 you no longer need to " + "include the TwitterKit SDK to sign in with Twitter. " + "Go to %s for more information", releaseUrl)); } AuthUI authUi; synchronized (INSTANCES) { authUi = INSTANCES.get(app); if (authUi == null) { authUi = new AuthUI(app); INSTANCES.put(app, authUi); } } return authUi; }
Source:
public ExternalImage(String id, Serializable src) { this(id, src, (List<Serializable>)null); }

Target:
public ExternalImage(String id, Serializable src) { this(id, Model.of(src), Model.ofList(Collections.<Serializable> emptyList())); }