auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Object visitValuesCommand(InvocationContext ctx, ValuesCommand command) throws Throwable { Object values = super.visitValuesCommand(ctx, command); if (enabled && passivationEnabled && values instanceof Collection<?>) { Set<InternalCacheEntry> set = loader.loadAll(); Collection<Object> valueCollection = (Collection<Object>)values; List<Object> valueList = new ArrayList<Object>(set.size() + valueCollection.size()); valueList.addAll(valueCollection); for (InternalCacheEntry ice : set) { valueList.add(ice.getValue()); } return Collections.unmodifiableList(valueList); } else { return values; } }

Target:
public Object visitValuesCommand(InvocationContext ctx, ValuesCommand command) throws Throwable { Object values = super.visitValuesCommand(ctx, command); if (enabled && !shouldSkipCacheLoader(command)) { Set<InternalCacheEntry> set = loader.loadAll(); Collection<Object> valueCollection = (Collection<Object>)values; List<Object> valueList = new ArrayList<Object>(set.size() + valueCollection.size()); valueList.addAll(valueCollection); for (InternalCacheEntry ice : set) { valueList.add(ice.getValue()); } return Collections.unmodifiableList(valueList); } return values; }
Source:
public synchronized List<Definition> getDefinitions() { List<Definition> defs = fDefs; if (defs == null) { ImmutableList.Builder<Definition> builder = new ImmutableList.Builder<>(); for (int i = 0; i < fLength; i++) { IntegerDeclaration charDecl = IntegerDeclaration.UINT_8_DECL; String fieldName = getFieldName() + '[' + i + ']'; byte fieldValue = fContent[i]; builder.add(new IntegerDefinition(charDecl, getDefinitionScope(), fieldName, fieldValue)); } @SuppressWarnings("null") @NonNull List<Definition> ret = builder.build(); fDefs = ret; return ret; } return defs; }

Target:
public synchronized List<Definition> getDefinitions() { List<Definition> defs = fDefs; if (defs == null) { ImmutableList.Builder<Definition> builder = new ImmutableList.Builder<>(); for (int i = 0; i < fContent.length; i++) { IntegerDeclaration charDecl = IntegerDeclaration.UINT_8_DECL; String fieldName = getFieldName() + '[' + i + ']'; byte fieldValue = fContent[i]; builder.add(new IntegerDefinition(charDecl, getDefinitionScope(), fieldName, fieldValue)); } @SuppressWarnings("null") @NonNull List<Definition> ret = builder.build(); fDefs = ret; return ret; } return defs; }
Source:
public static Map<String, String> buildUserMetadata(byte[] userMetadata) throws RestServiceException { Map<String, String> toReturn = new HashMap<String, String>(); boolean oldStyle = false; try { if (userMetadata.length > 0) { try { CrcInputStream crcstream = new CrcInputStream(new ByteArrayInputStream(userMetadata)); DataInputStream streamData = new DataInputStream(crcstream); short version = streamData.readShort(); switch (version) { case UserMetadata_Version_V1: ByteBuffer userMetadataBuffer = deserializeUserMetadata(crcstream); if (userMetadataBuffer.hasRemaining()) { int size = userMetadataBuffer.getInt(); int counter = 0; while (counter++ < size) { String key = Utils.deserializeAsciiEncodedString(userMetadataBuffer); String value = Utils.deserializeAsciiEncodedString(userMetadataBuffer); toReturn.put(key, value); } } break; default: logger.trace("Failed to parse version in new format. Returning as old format"); oldStyle = true; } } catch (IOException e) { logger.trace("IOException on parsing user metadata. Returning as old format"); oldStyle = true; } catch (RuntimeException e) { logger.trace("Runtime Exception on parsing user metadata. Returning as old format"); oldStyle = true; } } if (oldStyle) { toReturn = getOldStyleUserMetadataAsHashMap(userMetadata); } } catch (UnsupportedEncodingException e) { throw new IllegalStateException(e); } return toReturn; }

Target:
public static Map<String, String> buildUserMetadata(byte[] userMetadata) throws RestServiceException { Map<String, String> toReturn = new HashMap<String, String>(); boolean oldStyle = false; if (userMetadata.length > 0) { try { ByteBuffer userMetadataBuffer = ByteBuffer.wrap(userMetadata); short version = userMetadataBuffer.getShort(); switch (version) { case UserMetadata_Version_V1: int sizeToRead = userMetadataBuffer.getInt(); if (sizeToRead != (userMetadataBuffer.remaining() - 8)) { logger.trace("Size didn't match. Returning as old format"); oldStyle = true; } else { int entryCount = userMetadataBuffer.getInt(); int counter = 0; while (counter++ < entryCount) { String key = Utils.deserializeString(userMetadataBuffer, StandardCharsets.US_ASCII); String value = Utils.deserializeString(userMetadataBuffer, StandardCharsets.US_ASCII); toReturn.put(key, value); } long actualCRC = userMetadataBuffer.getLong(); Crc32 crc32 = new Crc32(); crc32.update(userMetadata, 0, userMetadata.length - Crc_Size); long expectedCRC = crc32.getValue(); if (actualCRC != expectedCRC) { logger.trace("corrupt data while parsing user metadata Expected CRC " + expectedCRC + " Actual CRC " + actualCRC); oldStyle = true; } } break; default: logger.trace("Failed to parse version in new format. Returning as old format"); oldStyle = true; } } catch (RuntimeException e) { logger.trace("Runtime Exception on parsing user metadata. Returning as old format"); oldStyle = true; } } if (oldStyle) { toReturn = getOldStyleUserMetadataAsHashMap(userMetadata); } return toReturn; }
Source:
public void testValidatePropertyWithNestedPathAndNullPropertyInTheWay() { Validator validator = getValidator(); X someX = new X(); Set<ConstraintViolation<X>> constraintViolationsX = validator.validateProperty( someX, "list[0].foo" ); assertNumberOfViolations( constraintViolationsX, 1 ); assertCorrectPropertyPaths( constraintViolationsX, "list[0].foo" ); }

Target:
public void testValidatePropertyWithNestedPathAndNullPropertyInTheWay() { Validator validator = getValidator(); X someX = new X(); validator.validateProperty( someX, "list[0].foo" ); }
Source:
public int getNumSplits(InputFormat inputFormat, @Nullable SplitHintSpec splitHintSpec) { final Iterator<File> fileIterator = getFileIterator(); int num = 0; while (fileIterator.hasNext()) { fileIterator.next(); num++; } return num; }

Target:
public int getNumSplits(InputFormat inputFormat, @Nullable SplitHintSpec splitHintSpec) { return Iterators.size(getFileIterator()); }
Source:
public int getEtag() { return etag; }

Target:
public long getEtag() { return etag; }
Source:
private void addAddress(List<DiscoveryNode> discoveredNodes, Endpoint endpoint) { if (Boolean.TRUE.equals(resolveNotReadyAddresses) || endpoint.isReady()) { Address address = createAddress(endpoint.getPrivateAddress()); Address publicAddress = createAddress(endpoint.getPublicAddress()); discoveredNodes .add(new SimpleDiscoveryNode(address, publicAddress, endpoint.getAdditionalProperties())); if (logger.isFinestEnabled()) { logger.finest("Found node service with address: " + address); } } }

Target:
private void addAddress(List<DiscoveryNode> discoveredNodes, Endpoint endpoint) { if (Boolean.TRUE.equals(resolveNotReadyAddresses) || endpoint.isReady()) { Address privateAddress = createAddress(endpoint.getPrivateAddress()); Address publicAddress = createAddress(endpoint.getPublicAddress()); discoveredNodes .add(new SimpleDiscoveryNode(privateAddress, publicAddress, endpoint.getAdditionalProperties())); if (logger.isFinestEnabled()) { logger.finest(String.format("Found node service with addresses (private, public): %s, %s ", privateAddress, publicAddress)); } } }
Source:
public RefSpec setDestination(final String destination) { final RefSpec r = new RefSpec(this); r.dstName = destination; if (isWildcard(r.dstName) && r.srcName == null) throw new IllegalStateException(JGitText.get().destinationIsNotAWildcard); if (isWildcard(r.srcName) != isWildcard(r.dstName)) throw new IllegalStateException(JGitText.get().sourceDestinationMustMatch); return r; }

Target:
public RefSpec setDestination(final String destination) { final RefSpec r = new RefSpec(this); r.dstName = destination; if (isWildcard(r.dstName) && r.srcName == null) throw new IllegalStateException(JGitText.get().sourceIsNotAWildcard); if (isWildcard(r.srcName) != isWildcard(r.dstName)) throw new IllegalStateException(JGitText.get().sourceDestinationMustMatch); return r; }
Source:
public VaultRawSecret getRawSecret(final String value) { String entryId = this.getVaultEntryKey(value); if (entryId != null) { if (this.provider == null) { throw new IllegalStateException("Required VaultProvider not found - check vault configuration"); } return this.provider.obtainSecret(entryId); } else { ByteBuffer buffer = value != null ? ByteBuffer.wrap(value.getBytes(StandardCharsets.UTF_8)) : null; return DefaultVaultRawSecret.forBuffer(Optional.ofNullable(buffer)); } }

Target:
public VaultRawSecret getRawSecret(final String value) { String entryId = this.getVaultEntryKey(value); if (entryId != null) { return this.provider.obtainSecret(entryId); } else { ByteBuffer buffer = value != null ? ByteBuffer.wrap(value.getBytes(StandardCharsets.UTF_8)) : null; return DefaultVaultRawSecret.forBuffer(Optional.ofNullable(buffer)); } }
Source:
public Map<String, Collection<String>> headers() { headers.forEach((key, value) -> value.removeIf(e -> e == null)); headers.entrySet().removeIf(e -> e.getValue() == null || e.getValue().isEmpty()); return Collections.unmodifiableMap(headers); }

Target:
public Map<String, Collection<String>> headers() { return Collections.unmodifiableMap( headers.entrySet().stream().filter(h -> h.getValue() != null && !h.getValue().isEmpty()) .collect(toMap( Entry::getKey, Entry::getValue, (e1, e2) -> { throw new IllegalStateException("headers should not have duplicated keys"); }, LinkedHashMap::new))); }
Source:
private void initLabelsToNetworks() { for (Network network : clusterNetworks) { if (network != null) { labelToNetworks.computeIfAbsent(network.getLabel(), k -> new ArrayList<>()).add(network); } } }

Target:
private void initLabelsToNetworks() { for (Network network : clusterNetworks) { labelToNetworks.computeIfAbsent(network.getLabel(), k -> new ArrayList<>()).add(network); } }
Source:
private void reactOnSelection(ISelection selection) { if (selection instanceof StructuredSelection) { System.out.println(">>> selection: " + selection.toString()); StructuredSelection ssel = (StructuredSelection) selection; if (ssel.size() != 1) return; if (ssel.getFirstElement() instanceof IResource) showResource((IResource) ssel.getFirstElement()); if (ssel.getFirstElement() instanceof IAdaptable) { IResource adapted = (IResource) ((IAdaptable) ssel .getFirstElement()).getAdapter(IResource.class); if (adapted != null) showResource(adapted); } else if (ssel.getFirstElement() instanceof RepositoryTreeNode) { RepositoryTreeNode repoNode = (RepositoryTreeNode) ssel .getFirstElement(); reload(repoNode.getRepository()); } } }

Target:
private void reactOnSelection(ISelection selection) { if (selection instanceof StructuredSelection) { StructuredSelection ssel = (StructuredSelection) selection; if (ssel.size() != 1) return; if (ssel.getFirstElement() instanceof IResource) showResource((IResource) ssel.getFirstElement()); if (ssel.getFirstElement() instanceof IAdaptable) { IResource adapted = (IResource) ((IAdaptable) ssel .getFirstElement()).getAdapter(IResource.class); if (adapted != null) showResource(adapted); } else if (ssel.getFirstElement() instanceof RepositoryTreeNode) { RepositoryTreeNode repoNode = (RepositoryTreeNode) ssel .getFirstElement(); reload(repoNode.getRepository()); } } }
Source:
public IStatus schedule() { final ITmfTrace trace = getTrace(); if (trace == null) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, String.format("No trace specified for analysis %s", getName())); } execute(trace); return Status.OK_STATUS; }

Target:
public IStatus schedule() { synchronized (syncObj) { final ITmfTrace trace = getTrace(); if (trace == null) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, String.format("No trace specified for analysis %s", getName())); } execute(trace); } return Status.OK_STATUS; }
Source:
public void shouldMakeTransactionToFail() throws Throwable { try ( Transaction ignore = db.beginTx() ) { db.createNode( Label.label( "Person" ) ); } Result result = db.execute( "CALL org.neo4j.procedure.failure" ); exception.expect( TransactionFailureException.class ); result.next(); }

Target:
public void shouldMakeTransactionToFail() throws Throwable { try ( Transaction ignore = db.beginTx() ) { db.createNode( Label.label( "Person" ) ); } Result result = db.execute( "CALL org.neo4j.procedure.failingPersonCount" ); exception.expect( TransactionFailureException.class ); result.next(); }
Source:
@Override public boolean cancel() { acceptException(new IgniteFutureCancelledCheckedException("Snapshot operation has been cancelled by external process " + "[snpName=" + snpName + ']')); try { closeAsync().get(); } catch (InterruptedException | ExecutionException e) { U.error(log, "SnapshotFutureTask cancellation failed", e); return false; } return true; }

Target:
@Override public boolean cancel() { acceptException(new IgniteFutureCancelledCheckedException("Snapshot operation has been cancelled " + "by external process [snpName=" + snpName + ']')); try { closeAsync().get(); } catch (InterruptedException | ExecutionException e) { U.error(log, "SnapshotFutureTask cancellation failed", e); return false; } return true; }
Source:
public ListenableFuture<Boolean> issueSpeculativeRequest() { return lh.bk.getMainWorkerPool().submitOrdered(lh.getId(), new Callable<Boolean>() { @Override public Boolean call() throws Exception { if (!isComplete() && null != maybeSendSpeculativeRead(heardFromHostsBitSet)) { if (LOG.isInfoEnabled()) { LOG.info("Send speculative read for {}. Hosts sent are {}, " + " Hosts heard are {}, ensemble is {}.", this, sentToHosts, heardFromHostsBitSet, ensemble); } return true; } return false; } }); }

Target:
public ListenableFuture<Boolean> issueSpeculativeRequest() { return lh.bk.getMainWorkerPool().submitOrdered(lh.getId(), new Callable<Boolean>() { @Override public Boolean call() throws Exception { if (!isComplete() && null != maybeSendSpeculativeRead(heardFromHostsBitSet)) { if (LOG.isDebugEnabled()) { LOG.debug("Send speculative read for {}. Hosts sent are {}, " + " Hosts heard are {}, ensemble is {}.", this, sentToHosts, heardFromHostsBitSet, ensemble); } return true; } return false; } }); }
Source:
protected String doInBackground(Void... arg0) { Map<String, String> request_params = new HashMap<String, String>(); request_params.put("grant_type", "password"); request_params.put("username", username); request_params.put("password", password); APIUtilities apiUtilities = new APIUtilities(); apiUtilities.setEndPoint(tokenEndPoint); apiUtilities.setHttpMethod("POST"); apiUtilities.setRequestParamsMap(request_params); Map<String, String> headers = new HashMap<String, String>(); String authorizationString = "Basic " + new String( Base64.encodeBase64((clientID + ":" + clientSecret).getBytes())); headers.put("Authorization", authorizationString); headers.put("Content-Type", "application/x-www-form-urlencoded"); Map<String, String> response_params = ServerApiAccess.postDataAPI(apiUtilities, headers); response = response_params.get("response"); responseCode = response_params.get("status"); return response; }

Target:
protected String doInBackground(Void... arg0) { Map<String, String> request_params = new HashMap<String, String>(); request_params.put(Constants.GRANT_TYPE, Constants.GRANT_TYPE_PASSWORD); request_params.put(USERNAME_LABEL, info.getUsername()); request_params.put(PASSWORD_LABEL, info.getPassword()); EndPointInfo apiUtilities = new EndPointInfo(); apiUtilities.setEndPoint(info.getTokenEndPoint()); apiUtilities.setHttpMethod(HTTP_METHODS.POST); apiUtilities.setRequestParamsMap(request_params); byte[] credentials = Base64.encodeBase64((info.getClientID() + COLON + info.getClientSecret()).getBytes()); String encodedCredentials = new String(credentials); Map<String, String> headers = new HashMap<String, String>(); String authorizationString = Constants.AUTHORIZATION_MODE + encodedCredentials; headers.put(Constants.AUTHORIZATION_HEADER, authorizationString); headers.put(Constants.CONTENT_TYPE_HEADER, Constants.DEFAULT_CONTENT_TYPE); Map<String, String> responseParams = null; try { responseParams = ServerUtilities.postDataAPI(apiUtilities, headers); response = responseParams.get(Constants.SERVER_RESPONSE_BODY); responseCode = responseParams.get(Constants.SERVER_RESPONSE_STATUS); } catch (IDPTokenManagerException e) { Log.e(TAG, "Failed to contact server." + e); } return response; }
Source:
protected void onCreate(Bundle savedInstanceState) { if (Utils.isLollipopOrLater()) { getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS); } super.onCreate(savedInstanceState); setContentView(R.layout.activity_generic_media); navigationDrawerFragment = (NavigationDrawerFragment)getSupportFragmentManager() .findFragmentById(R.id.navigation_drawer); navigationDrawerFragment.setUp(R.id.navigation_drawer, (DrawerLayout) findViewById(R.id.drawer_layout)); if (savedInstanceState == null) { MovieListFragment movieListFragment = new MovieListFragment(); if (Utils.isLollipopOrLater()) { Fade fade = new Fade(); fade.setDuration(50); movieListFragment.setExitTransition(fade); movieListFragment.setReenterTransition(TransitionInflater .from(this) .inflateTransition(android.R.transition.fade)); movieListFragment.setSharedElementReturnTransition(TransitionInflater.from( this).inflateTransition(R.transition.change_image)); } getSupportFragmentManager() .beginTransaction() .add(R.id.fragment_container, movieListFragment) .commit(); } else { selectedMovieId = savedInstanceState.getInt(MOVIEID, -1); selectedMovieTitle = savedInstanceState.getString(MOVIETITLE, null); } setupActionBar(selectedMovieTitle); }

Target:
protected void onCreate(Bundle savedInstanceState) { if (Utils.isLollipopOrLater()) { getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS); } super.onCreate(savedInstanceState); setContentView(R.layout.activity_generic_media); navigationDrawerFragment = (NavigationDrawerFragment)getSupportFragmentManager() .findFragmentById(R.id.navigation_drawer); navigationDrawerFragment.setUp(R.id.navigation_drawer, (DrawerLayout) findViewById(R.id.drawer_layout)); if (savedInstanceState == null) { MovieListFragment movieListFragment = new MovieListFragment(); if (Utils.isLollipopOrLater()) { Transition fade = TransitionInflater .from(this) .inflateTransition(android.R.transition.fade); movieListFragment.setExitTransition(fade); movieListFragment.setReenterTransition(fade); movieListFragment.setSharedElementReturnTransition(TransitionInflater.from( this).inflateTransition(R.transition.change_image)); } getSupportFragmentManager() .beginTransaction() .add(R.id.fragment_container, movieListFragment) .commit(); } else { selectedMovieId = savedInstanceState.getInt(MOVIEID, -1); selectedMovieTitle = savedInstanceState.getString(MOVIETITLE, null); } setupActionBar(selectedMovieTitle); }
Source:
public Map<Node, Integer> cluster() { final int[] cluster = IntStream.range(0, nodes.size()).toArray(); IntStream.range(0, neighbors.size()).forEach(i -> neighbors.get(i).stream().forEach(j -> joinNodes(cluster, j, i))); return nodes.stream().collect(Collectors.toMap(n -> n, n -> findRepNode(cluster, cluster[nodes.indexOf(n)]))); }

Target:
public Map<Node, Integer> cluster() { final int[] cluster = IntStream.range(0, nodes.size()).toArray(); IntStream.range(0, neighbors.size()).forEach(i -> neighbors.get(i).stream().forEach(j -> joinNodes(cluster, j, i))); return nodes.stream().collect(Collectors.toMap(n -> n, n -> findRepNode(cluster, nodes.indexOf(n)))); }
Source:
public boolean testSourceType(CommandSource source) { return dispatcher.testSourceType(source); }

Target:
public boolean testSourceType(CommandSource source) { return this.dispatcher.testSourceType(source); }
Source:
public String generateSas(StorageSharedKeyCredential storageSharedKeyCredentials, Context context) { StorageImplUtils.assertNotNull("storageSharedKeyCredentials", storageSharedKeyCredentials); ensureState(); final String canonicalName = getCanonicalName(storageSharedKeyCredentials.getAccountName()); final String stringToSign = stringToSign(canonicalName); if (context != null && Boolean.TRUE.equals(context.getData("Log-String-To-Sign").orElse(false))) { logger.info("The string to sign computed by the SDK is: {}{}", stringToSign, System.getProperty("line.separator")); logger.warning("Please remember to disable 'Log-String-To-Sign' before going to production as this " + "string can potentially contain PII."); } final String signature = storageSharedKeyCredentials.computeHmac256(stringToSign); return encode(null , signature); }

Target:
public String generateSas(StorageSharedKeyCredential storageSharedKeyCredentials, Context context) { StorageImplUtils.assertNotNull("storageSharedKeyCredentials", storageSharedKeyCredentials); ensureState(); final String canonicalName = getCanonicalName(storageSharedKeyCredentials.getAccountName()); final String stringToSign = stringToSign(canonicalName); StorageImplUtils.logStringToSign(logger, stringToSign, context); final String signature = storageSharedKeyCredentials.computeHmac256(stringToSign); return encode(null , signature); }
Source:
public View display(Context context, int position, View v, FuzzyScore fuzzyScore) { if (v == null) v = inflateFromId(context, R.layout.item_search); TextView appName = v.findViewById(R.id.item_search_text); ImageView image = v.findViewById(R.id.item_search_icon); String text; int pos; int len; if (searchPojo.direct) { text = String.format(context.getString(R.string.ui_item_visit), this.pojo.getName()); pos = text.indexOf(this.pojo.getName()); len = this.pojo.getName().length(); image.setImageResource(R.drawable.ic_public); } else { text = String.format(context.getString(R.string.ui_item_search), this.pojo.getName(), searchPojo.query); pos = text.indexOf(searchPojo.query); len = searchPojo.query.length(); image.setImageResource(search); } appName.setText(text); image.setColorFilter(getThemeFillColor(context), PorterDuff.Mode.SRC_IN); return v; }

Target:
public View display(Context context, int position, View v, FuzzyScore fuzzyScore) { if (v == null) v = inflateFromId(context, R.layout.item_search); TextView searchText = v.findViewById(R.id.item_search_text); ImageView image = v.findViewById(R.id.item_search_icon); String text; int pos; int len; if (searchPojo.direct) { text = String.format(context.getString(R.string.ui_item_visit), this.pojo.getName()); pos = text.indexOf(this.pojo.getName()); len = this.pojo.getName().length(); image.setImageResource(R.drawable.ic_public); } else { text = String.format(context.getString(R.string.ui_item_search), this.pojo.getName(), searchPojo.query); pos = text.indexOf(searchPojo.query); len = searchPojo.query.length(); image.setImageResource(search); } displayHighlighted(text, Collections.singletonList(new Pair<Integer, Integer>(pos, pos + len)), searchText, context); image.setColorFilter(getThemeFillColor(context), PorterDuff.Mode.SRC_IN); return v; }
Source:
public AbstractFetchCommand(final boolean isUid, @Nonnull final String msgNumbers, @Nonnull final FetchMacro macro) { this(isUid, msgNumbers, macro, null); }

Target:
protected AbstractFetchCommand(final boolean isUid, @Nonnull final String msgNumbers, @Nonnull final FetchMacro macro) { this(isUid, msgNumbers, macro, null, false); }
Source:
public void setFillGradient(LinearGradient.LinearGradientJSO grad) { throwException(); }

Target:
public void setFillGradient(LinearGradient.LinearGradientJSO grad) { setFillColor(null); }
Source:
public List<Condition> searchConditionsByPatient(String patientUuid) { return null; }

Target:
public List<Condition> searchConditionsByPatient(String patientUuid) { throw new NotImplementedException(); }
Source:
public void init() throws Exception { context = new AutomationContext("AS", "appServerInstance0002", ContextXpathConstants.SUPER_TENANT, ContextXpathConstants.ADMIN); authenticatorClient = new AuthenticatorClient(context.getContextUrls().getBackEndUrl()); authenticatorClient = new AuthenticatorClient(context.getContextUrls().getBackEndUrl()); String mySQLPath = " AutomationContext context = new AutomationContext(); mySQL_DB_URL = context.getConfigurationValue(mySQLPath); }

Target:
public void init() throws XPathExpressionException, AxisFault { context = new AutomationContext(ASIntegrationConstants.AS_PRODUCT_GROUP, ASIntegrationConstants.AS_INSTANCE_0002, ContextXpathConstants.SUPER_TENANT, ContextXpathConstants.SUPER_ADMIN); authenticatorClient = new AuthenticatorClient(context.getContextUrls().getBackEndUrl()); dataSourceBean = CarbonCommandToolsUtil.getDataSourceInformation("MySQL"); }
Source:
public ModelAndView deleteMrrtReportTemplate(HttpServletRequest request, @RequestParam("templateId") MrrtReportTemplate mrrtReportTemplate) { mrrtReportTemplateService.purgeMrrtReportTemplate(mrrtReportTemplate); request.getSession() .setAttribute(WebConstants.OPENMRS_MSG_ATTR, "radiology.MrrtReportTemplate.deleted"); return new ModelAndView(RADIOLOGY_REPORT_TEMPLATES_TAB_VIEW); }

Target:
public ModelAndView deleteMrrtReportTemplate(HttpServletRequest request, @RequestParam("templateId") MrrtReportTemplate mrrtReportTemplate) { try { mrrtReportTemplateService.purgeMrrtReportTemplate(mrrtReportTemplate); request.getSession() .setAttribute(WebConstants.OPENMRS_MSG_ATTR, "radiology.MrrtReportTemplate.deleted"); } catch (APIException ex) { request.getSession() .setAttribute(WebConstants.OPENMRS_ERROR_ATTR, "Failed to delete template file" + " => " + ex.getMessage()); } return new ModelAndView(RADIOLOGY_REPORT_TEMPLATES_TAB_VIEW); }
Source:
public int getApplicabilityRating(PresentationType presentationType, IArtifact artifact) throws OseeCoreException { Artifact aArtifact = artifact.getFullArtifact(); if (aArtifact.isAttributeTypeValid(CoreAttributeTypes.HTMLContent)) { if (presentationType.matches(PresentationType.DIFF)) { return PRESENTATION_SUBTYPE_MATCH; } } return NO_MATCH; }

Target:
public int getApplicabilityRating(PresentationType presentationType, IArtifact artifact) throws OseeCoreException { Artifact aArtifact = artifact.getFullArtifact(); int toReturn = NO_MATCH; if (aArtifact.isAttributeTypeValid(CoreAttributeTypes.HTMLContent)) { if (presentationType.matches(PresentationType.DIFF)) { toReturn = PRESENTATION_SUBTYPE_MATCH; } } return toReturn; }
Source:
public void scheduleAtFixedRate(final Runnable command, long initialDelay, long period, TimeUnit unit) { lock.lock(); try { Configuration newConfiguration = new Configuration(command, initialDelay, period, unit); if (!newConfiguration.equals(currentConfiguration)) { log.debug("Schedule new task {}", newConfiguration); currentConfiguration = newConfiguration; if (lastStartedLoopProcess != null) { lastStartedLoopProcess.cancel(false); } lastStartedLoopProcess = loopExecutor.scheduleAtFixedRate(new Runnable() { @Override public void run() { taskExecutor.submit(command); } }, initialDelay, period, unit); } } finally { lock.unlock(); } }

Target:
public synchronized void scheduleAtFixedRate(final Runnable command, long initialDelay, long period, TimeUnit unit) { Configuration newConfiguration = new Configuration(command, initialDelay, period, unit); if (!newConfiguration.equals(currentConfiguration)) { log.debug("Schedule new task {}", newConfiguration); currentConfiguration = newConfiguration; if (lastStartedLoopProcess != null) { lastStartedLoopProcess.cancel(false); } lastStartedLoopProcess = loopExecutor.scheduleAtFixedRate(new Runnable() { @Override public void run() { taskExecutor.submit(command); } }, initialDelay, period, unit); } }
Source:
private Integer updateReference(Object key, Integer updateCount) { Integer currentCounter = counterMap.get(key); currentCounter = updateCount + ((currentCounter == null) ? 0 : currentCounter); counterMap.put(key, currentCounter); return currentCounter; }

Target:
private Integer updateReference(Object key, Integer updateCount) { Integer currentCount = updateCount + MoreObjects.firstNonNull(counterMap.get(key), 0); if (currentCount <= 0) { counterMap.remove(key); } else { counterMap.put(key, currentCount); } return currentCount; }
Source:
private void useFlyClickJump(final User user) { try { final Location otarget = LocationUtil.getTarget(user.getBase()); class DelayedClickJumpTask implements Runnable { @Override public void run() { Location loc = user.getLocation(); loc.setX(otarget.getX()); loc.setZ(otarget.getZ()); while (LocationUtil.isBlockDamaging(loc.getWorld(), loc.getBlockX(), loc.getBlockY() - 1, loc.getBlockZ())) { loc.setY(loc.getY() + 1d); } PaperLib.teleportAsync(user.getBase(), loc); } } ess.scheduleSyncDelayedTask(new DelayedClickJumpTask()); } catch (Exception ex) { if (ess.getSettings().isDebug()) { LOGGER.log(Level.WARNING, ex.getMessage(), ex); } } }

Target:
private void useFlyClickJump(final User user) { try { final Location otarget = LocationUtil.getTarget(user.getBase()); class DelayedClickJumpTask implements Runnable { @Override public void run() { Location loc = user.getLocation(); loc.setX(otarget.getX()); loc.setZ(otarget.getZ()); while (LocationUtil.isBlockDamaging(loc.getWorld(), loc.getBlockX(), loc.getBlockY() - 1, loc.getBlockZ())) { loc.setY(loc.getY() + 1d); } PaperLib.teleportAsync(user.getBase(), loc, TeleportCause.PLUGIN); } } ess.scheduleSyncDelayedTask(new DelayedClickJumpTask()); } catch (Exception ex) { if (ess.getSettings().isDebug()) { LOGGER.log(Level.WARNING, ex.getMessage(), ex); } } }
Source:
public IDefaultLaunchArguments getDefaultLaunchArguments() { String[] as5Types = new String[]{ IJBossToolingConstants.AS_50, IJBossToolingConstants.AS_51, IJBossToolingConstants.EAP_50, IJBossToolingConstants.SERVER_AS_50, IJBossToolingConstants.SERVER_AS_51, IJBossToolingConstants.SERVER_EAP_50, }; boolean isAS5 = false; String serverType = (server == null ? null : server.getServerType() == null ? null : server.getServerType().getId()); String rtType = (runtime == null ? null : runtime.getRuntimeType() == null ? null : runtime.getRuntimeType().getId()); for( int i = 0; i < as5Types.length; i++ ) { if( as5Types[i].equals(serverType) || as5Types[i].equals(rtType)) { isAS5 = true; break; } } if( isAS5 ) { ServerBean sb = new ServerBeanLoader(runtime.getLocation().toFile()).getServerBean(); if( sb.getBeanType().getId().equals("EAP_STD")) { sb = new ServerBeanLoader(runtime.getLocation().toFile().getParentFile()).getServerBean(); if( sb != null && "SOA-P".equals(sb.getBeanType().getId()) && sb.getVersion().equals("5.3")) { if( server != null) return new JBossSoa53DefaultLaunchArguments(server); return new JBossSoa53DefaultLaunchArguments(runtime); } } if( server != null) return new JBoss5xDefaultLaunchArguments(server); return new JBoss5xDefaultLaunchArguments(runtime); } if( server != null) return new JBossDefaultLaunchArguments(server); return new JBossDefaultLaunchArguments(runtime); }

Target:
public IDefaultLaunchArguments getDefaultLaunchArguments() { String[] as5Types = new String[]{ IJBossToolingConstants.AS_50, IJBossToolingConstants.AS_51, IJBossToolingConstants.EAP_50, IJBossToolingConstants.SERVER_AS_50, IJBossToolingConstants.SERVER_AS_51, IJBossToolingConstants.SERVER_EAP_50, }; boolean isAS5 = false; String serverType = (server == null ? null : server.getServerType() == null ? null : server.getServerType().getId()); String rtType = (runtime == null ? null : runtime.getRuntimeType() == null ? null : runtime.getRuntimeType().getId()); for( int i = 0; i < as5Types.length; i++ ) { if( as5Types[i].equals(serverType) || as5Types[i].equals(rtType)) { isAS5 = true; break; } } if( isAS5 ) { ServerBean sb = new ServerBeanLoader(runtime.getLocation().toFile()).getServerBean(); if( sb.getBeanType().getId().equals(JBossServerType.EAP_STD.getId())) { sb = new ServerBeanLoader(runtime.getLocation().toFile().getParentFile()).getServerBean(); if( sb != null && JBossServerType.SOAP.getId().equals(sb.getBeanType().getId()) && sb.getVersion().startsWith("5.")) { if( server != null) return new JBossSoa5xDefaultLaunchArguments(server); return new JBossSoa5xDefaultLaunchArguments(runtime); } } if( server != null) return new JBoss5xDefaultLaunchArguments(server); return new JBoss5xDefaultLaunchArguments(runtime); } if( server != null) return new JBossDefaultLaunchArguments(server); return new JBossDefaultLaunchArguments(runtime); }
Source:
public static void main(String[] args) throws InterruptedException { SpringApplication.run(CounterSinkApplication.class, args); }

Target:
public static void main(String[] args) { SpringApplication.run(CounterSinkApplication.class, args); }
Source:
private DefaultSolverManager(String solverConfigResource, ClassLoader classLoader, SolverFactory<Solution_> solverFactory, ThreadFactory threadFactory) { if (solverFactory != null) { this.solverFactory = solverFactory; } else if (classLoader != null) { this.solverFactory = SolverFactory.createFromXmlResource(solverConfigResource, classLoader); } else { this.solverFactory = SolverFactory.createFromXmlResource(solverConfigResource); } int numAvailableProcessors = Runtime.getRuntime().availableProcessors(); int activeThreadCount = Math.max(numAvailableProcessors - 2, 1); logger.info("Number of available processors: {}. Active thread count: {}.", numAvailableProcessors, activeThreadCount); if (threadFactory != null) { this.solverFactory.getSolverConfig().setThreadFactoryClass(threadFactory.getClass()); solverExecutorService = Executors.newFixedThreadPool(activeThreadCount, threadFactory); eventHandlerExecutorService = Executors.newSingleThreadExecutor(threadFactory); } else { solverExecutorService = Executors.newFixedThreadPool(numAvailableProcessors - 1); eventHandlerExecutorService = Executors.newSingleThreadExecutor(); } }

Target:
private DefaultSolverManager(String solverConfigResource, ClassLoader classLoader, SolverFactory<Solution_> solverFactory, ThreadFactory threadFactory) { if (solverFactory != null) { this.solverFactory = solverFactory; } else if (classLoader != null) { this.solverFactory = SolverFactory.createFromXmlResource(solverConfigResource, classLoader); } else { this.solverFactory = SolverFactory.createFromXmlResource(solverConfigResource); } int numAvailableProcessors = Runtime.getRuntime().availableProcessors(); int activeThreadCount = Math.max(numAvailableProcessors - 2, 1); logger.info("Number of available processors: {}. Active thread count: {}.", numAvailableProcessors, activeThreadCount); if (threadFactory != null) { this.solverFactory.getSolverConfig().setThreadFactoryClass(threadFactory.getClass()); solverExecutorService = Executors.newFixedThreadPool(activeThreadCount, threadFactory); eventHandlerExecutorService = Executors.newSingleThreadExecutor(threadFactory); } else { solverExecutorService = Executors.newFixedThreadPool(activeThreadCount); eventHandlerExecutorService = Executors.newSingleThreadExecutor(); } }
Source:
public void addItemToListPropertyTest() throws IOException, OperationException { assertNotNull(doc); assertNotNull(doc.getPropertyValue("ds:fields")); assertEquals(((Collection) doc.getPropertyValue("ds:fields")).size(), 0); String fieldsDataAsJSon = readPropertiesFromFile("creationFields.json"); OperationContext ctx = new OperationContext(coreSession); ctx.setInput(doc); OperationChain chain = new OperationChain("testAddItemToPropertyChain"); chain.add(AddItemToListProperty.ID).set("xpath", "ds:fields").set("ComplexJsonProperties", fieldsDataAsJSon); DocumentModel resultDoc = (DocumentModel) service.run(ctx, chain); java.util.ArrayList<?> dbFields = (java.util.ArrayList<?>) resultDoc.getPropertyValue("ds:fields"); assertEquals(5, dbFields.size()); }

Target:
public void addItemToListPropertyTest() throws IOException, OperationException { assertNotNull(doc); assertNotNull(doc.getPropertyValue("ds:fields")); assertEquals(((Collection) doc.getPropertyValue("ds:fields")).size(), 0); String fieldsDataAsJson = readPropertiesFromFile("creationFields.json"); OperationContext ctx = new OperationContext(coreSession); ctx.setInput(doc); OperationChain chain = new OperationChain("testAddItemToPropertyChain"); chain.add(AddItemToListProperty.ID).set("xpath", "ds:fields").set("complexJsonProperties", fieldsDataAsJson); DocumentModel resultDoc = (DocumentModel) service.run(ctx, chain); List<?> dbFields = (List<?>) resultDoc.getPropertyValue("ds:fields"); assertEquals(5, dbFields.size()); }
Source:
private void testSpecialPage(AdsBaseObject ads) { ads.setPageType("special"); specialPageExpectedDataProvider(); ads.verifyAds(SPECIAL_PAGE_EXPECTED_LINE_ITEMS, SPECIAL_PAGE_EXPECTED_AD_UNITS); }

Target:
private void testSpecialPage(AdsBaseObject ads) { ads.setPageType("special"); ads.verifyAds(getSpecialPageExpectedLineItems(), getSpecialPageExpectedAdUnits()); }
Source:
public void executeQuery(String query) throws NullPointerException, DataAccessException { if (LOG.isLoggable(GaeLevel.DEBUG)) { LOG.log(GaeLevel.DEBUG, "executing query: " + query); } if (query == null) throw new NullPointerException("query cannot be null"); if (query.length() == 0) throw new IllegalArgumentException("query cannot be empty"); affectedRowCount = -1; statement = null; insertedId = -1; connect(); try { if (statement == null) { statement = connection.createStatement(); } if (statement.execute(query, Statement.RETURN_GENERATED_KEYS)) { queryResult = statement.getResultSet(); } else { queryResult = statement.getGeneratedKeys(); } } catch (MySQLIntegrityConstraintViolationException ex) { LOG.log(GaeLevel.SEVERE, "Error executing query - duplicate entry key", ex); throw new DuplicateKeyException(); } catch (SQLException ex) { LOG.log(GaeLevel.SEVERE, "Error executing query", ex); throw new DataAccessException(); } return; }

Target:
public void executeQuery(String query) throws NullPointerException, DataAccessException { if (LOG.isLoggable(GaeLevel.DEBUG)) { LOG.log(GaeLevel.DEBUG, "executing query: " + query); } if (query == null) throw new NullPointerException("query cannot be null"); if (query.length() == 0) throw new IllegalArgumentException("query cannot be empty"); affectedRowCount = -1; statement = null; insertedId = -1; connect(); try { if (statement == null) { statement = connection.createStatement(); } if (statement.execute(query, Statement.RETURN_GENERATED_KEYS)) { queryResult = statement.getResultSet(); } else { queryResult = statement.getGeneratedKeys(); } } catch (SQLException ex) { LOG.log(GaeLevel.SEVERE, "Error executing query", ex); throw new DataAccessException(ex); } return; }
Source:
public Map<String, Fingerprint> loadFingerprints(final Path fingerprintFile, final String specificSample) { SequenceUtil.assertSequenceDictionariesEqual(this.haplotypes.getHeader().getSequenceDictionary(), VCFFileReader.getSequenceDictionary(fingerprintFile)); final VCFFileReader reader = new VCFFileReader(fingerprintFile, false); Map<String, Fingerprint> fingerprints; if (reader.isQueryable()) { fingerprints = loadFingerprintsFromQueriableReader(reader, specificSample, fingerprintFile); } else { log.warn("Couldn't find index for file " + fingerprintFile + " going to read through it all."); fingerprints = loadFingerprintsFromVariantContexts(reader, specificSample, fingerprintFile); } for (final String sample : reader.getFileHeader().getGenotypeSamples()) { fingerprints.computeIfAbsent(sample, s -> new Fingerprint(s, fingerprintFile, null)); } return fingerprints; }

Target:
public Map<String, Fingerprint> loadFingerprints(final Path fingerprintFile, final String specificSample) { SequenceUtil.assertSequenceDictionariesEqual(this.haplotypes.getHeader().getSequenceDictionary(), VCFFileReader.getSequenceDictionary(fingerprintFile)); final VCFFileReader reader = new VCFFileReader(fingerprintFile, false); final Map<String, Fingerprint> fingerprints; if (reader.isQueryable()) { fingerprints = loadFingerprintsFromQueriableReader(reader, specificSample, fingerprintFile); } else { log.warn("Couldn't find index for file " + fingerprintFile + " going to read through it all."); fingerprints = loadFingerprintsFromVariantContexts(reader, specificSample, fingerprintFile); } for (final String sample : reader.getFileHeader().getGenotypeSamples()) { fingerprints.computeIfAbsent(sample, s -> new Fingerprint(s, fingerprintFile, null)); } return fingerprints; }
Source:
public void extractedManaged(OperationContext context, ModelNode operation) { String name = PathAddress.pathAddress(operation.get(ModelDescriptionConstants.OP_ADDR)).getLastElement().getValue(); ModelNode deployment = context.readResourceFromRoot(PathAddress.pathAddress(PathElement.pathElement(DEPLOYMENT, name))).getModel(); if (deployment.hasDefined(CONTENT_RESOURCE_ALL.getName())) { ModelNode content = deployment.get(CONTENT_RESOURCE_ALL.getName()).asList().get(0); context.getResult().set(!isUnmanagedContent(content)); } }

Target:
public void extractedManaged(OperationContext context, ModelNode operation) { String name = context.getCurrentAddressValue(); ModelNode deployment = context.readResourceFromRoot(PathAddress.pathAddress(PathElement.pathElement(DEPLOYMENT, name))).getModel(); if (deployment.hasDefined(CONTENT_RESOURCE_ALL.getName())) { ModelNode content = deployment.get(CONTENT_RESOURCE_ALL.getName()).asList().get(0); context.getResult().set(!isUnmanagedContent(content)); } }
Source:
public void setUrlResourceReaderRootDirs(String... rootResourceDirs) throws IOException { Configuration configuration = configAdmin.getConfiguration(PID, null); Dictionary<String, Object> properties = new DictionaryMap<>(); Set<String> rootResourceDirectories = ImmutableSet.<String>builder().add(rootResourceDirs).build(); properties.put("rootResourceDirectories", rootResourceDirectories); configuration.update(properties); for (int i = 0; i < 5; i++) { Configuration updatedConfig = configAdmin.getConfiguration(PID, null); if (updatedConfig .getProperties() .get("rootResourceDirectories") .equals(rootResourceDirectories)) { break; } else { try { TimeUnit.SECONDS.sleep(5); } catch (InterruptedException e) { } } } LOGGER.info("URLResourceReader props after update: {}", configuration.getProperties()); }

Target:
public void setUrlResourceReaderRootDirs(String... rootResourceDirs) throws IOException { Configuration configuration = configAdmin.getConfiguration(PID, null); Dictionary<String, Object> properties = new DictionaryMap<>(); Set<String> rootResourceDirectories = ImmutableSet.<String>builder().add(rootResourceDirs).build(); properties.put("rootResourceDirectories", rootResourceDirectories); configuration.update(properties); for (int i = 0; i < 5; i++) { Configuration updatedConfig = configAdmin.getConfiguration(PID, null); if (updatedConfig .getProperties() .get("rootResourceDirectories") .equals(rootResourceDirectories)) { break; } boolean interrupted = false; try { TimeUnit.SECONDS.sleep(5); } catch (InterruptedException e) { interrupted = true; } finally { if (interrupted) { Thread.currentThread().interrupt(); } } } LOGGER.info("URLResourceReader props after update: {}", configuration.getProperties()); }
Source:
private static ByteString binaryOperator( ByteString b0, long b1, BinaryOperator<Byte> bitOp) { byte[] bytes0 = b0.getBytes(); final byte[] result = new byte[bytes0.length]; for (int i = 0; i < bytes0.length; i++) { result[i] = bitOp.apply((byte) (b1 >> 8 * (bytes0.length - i - 1)), bytes0[i]); } return new ByteString(result); }

Target:
private static ByteString binaryOperator( ByteString b0, long b1, BinaryOperator<Byte> bitOp) { final byte[] bytes0 = b0.getBytes(); for (int i = 0; i < bytes0.length; i++) { bytes0[i] = bitOp.apply((byte) (b1 >> 8 * (bytes0.length - i - 1)), bytes0[i]); } return new ByteString(bytes0); }
Source:
private synchronized ListenableFuture<?> updateSystemMemory(long delta) { long userMemory = memoryPool.getQueryUserMemoryReservation(queryId); if (delta >= 0) { if (queryMemoryContext.getSystemMemory() + userMemory + delta > maxTotalMemory) { throw exceededLocalTotalMemoryLimit(succinctBytes(maxTotalMemory)); } return systemMemoryPool.reserve(queryId, delta); } systemMemoryPool.free(queryId, -delta); return NOT_BLOCKED; }

Target:
private synchronized ListenableFuture<?> updateSystemMemory(long delta) { long totalMemory = memoryPool.getQueryMemoryReservation(queryId); if (delta >= 0) { if (totalMemory + delta > maxTotalMemory) { throw exceededLocalTotalMemoryLimit(succinctBytes(maxTotalMemory)); } return memoryPool.reserve(queryId, delta); } memoryPool.free(queryId, -delta); return NOT_BLOCKED; }
Source:
public List<EntityDto> listEntitiesByBundle(String bundleSymbolicName) { if (StringUtils.isBlank(bundleSymbolicName)) { throw new MdsException("Bundle symbolic name cannot be empty or null"); } List<EntityDto> entityDtos = new ArrayList<>(); for (Entity entity : allEntities.retrieveAll("bundleSymbolicName", bundleSymbolicName)) { if (entity.isActualEntity()) { entityDtos.add(entity.toDto()); } } return entityDtos; }

Target:
public List<EntityDto> listEntitiesByBundle(String bundleSymbolicName) { if (StringUtils.isBlank(bundleSymbolicName)) { throw new MdsException("Bundle symbolic name cannot be empty or null"); } List<EntityDto> entityDtos = new ArrayList<>(); for (Entity entity : allEntities.retrieveBySymbolicName(bundleSymbolicName)) { entityDtos.add(entity.toDto()); } return entityDtos; }
Source:
public static Map<String, List<User>> getPlayerLists(final IEssentials ess, final User sender, final boolean showHidden) { Server server = ess.getServer(); final Map<String, List<User>> playerList = new HashMap<>(); for (User onlineUser : ess.getOnlineUsers()) { if ((sender == null && !showHidden && onlineUser.isHidden()) || (sender != null && !showHidden && !sender.getBase().canSee(onlineUser.getBase()))) { continue; } final String group = FormatUtil.stripFormat(FormatUtil.stripEssentialsFormat(onlineUser.getGroup().toLowerCase())); List<User> list = playerList.computeIfAbsent(group, k -> new ArrayList<>()); list.add(onlineUser); } return playerList; }

Target:
public static Map<String, List<User>> getPlayerLists(final IEssentials ess, final User sender, final boolean showHidden) { final Map<String, List<User>> playerList = new HashMap<>(); for (User onlineUser : ess.getOnlineUsers()) { if ((sender == null && !showHidden && onlineUser.isHidden()) || (sender != null && !showHidden && !sender.getBase().canSee(onlineUser.getBase()))) { continue; } final String group = FormatUtil.stripFormat(FormatUtil.stripEssentialsFormat(onlineUser.getGroup().toLowerCase())); List<User> list = playerList.computeIfAbsent(group, k -> new ArrayList<>()); list.add(onlineUser); } return playerList; }
Source:
public void endElement(String uri, String name, String qName) { if (qName.equals("ETag")) { this.currentETag = currentOrNull(currentText); } else if (qName.equals("LastModified")) { try { this.currentLastModified = dateParser .iso8601DateParse(currentOrNull(currentText)); } catch (IllegalArgumentException orig) { try { this.currentLastModified = dateParser .iso8601SecondsDateParse(currentOrNull(currentText)); } catch (IllegalArgumentException ie) { throw orig; } } } else if (qName.equals("CopyObjectResult")) { metadata = new CopyObjectResult(currentLastModified, currentETag); } currentText = new StringBuilder(); }

Target:
public void endElement(String uri, String name, String qName) { if (qName.equals("ETag")) { this.currentETag = currentOrNull(currentText); } else if (qName.equals("LastModified")) { this.currentLastModified = dateParser .iso8601DateParseWithOptionalTZ(currentOrNull(currentText)); } else if (qName.equals("CopyObjectResult")) { metadata = new CopyObjectResult(currentLastModified, currentETag); } currentText = new StringBuilder(); }