auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
boolean needsUpdate(@Nonnull Resource ensureDefinition, @Nonnull Resource oakIndex) throws IOException, RepositoryException { final Session session = ensureDefinition.getResourceResolver().adaptTo(Session.class); final ChecksumGenerator checksumGenerator = this.ensureOakIndex.getChecksumGenerator(); final CustomChecksumGeneratorOptions ensureDefinitionOptions = new CustomChecksumGeneratorOptions(); ensureDefinitionOptions.addIncludedNodeTypes(new String[]{NT_OAK_UNSTRUCTURED}); ensureDefinitionOptions.addExcludedProperties(this.ignoreProperties); ensureDefinitionOptions.addExcludedSubTrees(this.excludeSubTrees); ensureDefinitionOptions.addExcludedNodeNames(this.excludeNodeNames); final Map<String, String> srcChecksum = checksumGenerator.generateChecksums(session, ensureDefinition.getPath(), ensureDefinitionOptions); final CustomChecksumGeneratorOptions oakIndexOptions = new CustomChecksumGeneratorOptions(); oakIndexOptions.addIncludedNodeTypes(new String[]{NT_OAK_QUERY_INDEX_DEFINITION}); oakIndexOptions.addExcludedProperties(this.ignoreProperties); final Map<String, String> destChecksum = checksumGenerator.generateChecksums(session, oakIndex.getPath(), oakIndexOptions); return !StringUtils.equals(srcChecksum.get(ensureDefinition.getPath()), destChecksum.get(oakIndex.getPath())); }

Target:
boolean needsUpdate(@Nonnull Resource ensureDefinition, @Nonnull Resource oakIndex) throws IOException, RepositoryException { final Session session = ensureDefinition.getResourceResolver().adaptTo(Session.class); final ChecksumGenerator checksumGenerator = this.ensureOakIndex.getChecksumGenerator(); final CustomChecksumGeneratorOptions ensureDefinitionOptions = new CustomChecksumGeneratorOptions(); ensureDefinitionOptions.addIncludedNodeTypes(new String[]{NT_OAK_UNSTRUCTURED}); ensureDefinitionOptions.addExcludedProperties(this.ignoreProperties); ensureDefinitionOptions.addExcludedSubTrees(this.excludeSubTrees); ensureDefinitionOptions.addExcludedNodeNames(this.excludeNodeNames); final Map<String, String> srcChecksum = checksumGenerator.generateChecksums(session, ensureDefinition.getPath(), ensureDefinitionOptions); final CustomChecksumGeneratorOptions oakIndexOptions = new CustomChecksumGeneratorOptions(); oakIndexOptions.addIncludedNodeTypes(new String[]{NT_OAK_QUERY_INDEX_DEFINITION}); oakIndexOptions.addExcludedProperties(this.ignoreProperties); oakIndexOptions.addExcludedSubTrees(this.excludeSubTrees); oakIndexOptions.addExcludedNodeNames(this.excludeNodeNames); final Map<String, String> destChecksum = checksumGenerator.generateChecksums(session, oakIndex.getPath(), oakIndexOptions); return !StringUtils.equals(srcChecksum.get(ensureDefinition.getPath()), destChecksum.get(oakIndex.getPath())); }
Source:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); EventBus.getDefault().register(this); Map<String, String> values = new HashMap<>(); values.put(Analytics.Keys.TOPIC_ID, discussionThread.getTopicId()); values.put(Analytics.Keys.THREAD_ID, discussionThread.getIdentifier()); values.put(Analytics.Keys.AUTHOR, discussionThread.getAuthor()); analyticsRegistry.trackScreenView(Analytics.Screens.FORUM_VIEW_THREAD, courseData.getCourse().getId(), discussionThread.getTitle(), values); }

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); EventBus.getDefault().register(this); Map<String, String> values = new HashMap<>(); values.put(Analytics.Keys.TOPIC_ID, discussionThread.getTopicId()); values.put(Analytics.Keys.THREAD_ID, discussionThread.getIdentifier()); if (!discussionThread.isAuthorAnonymous()) { values.put(Analytics.Keys.AUTHOR, discussionThread.getAuthor()); } analyticsRegistry.trackScreenView(Analytics.Screens.FORUM_VIEW_THREAD, courseData.getCourse().getId(), discussionThread.getTitle(), values); }
Source:
public void testGetAllOfTypesWithUnrepresentedTypes() { List<VDS> result = dao .getAllOfTypes(new VDSType[] { VDSType.forValue(-1) }); assertIncorrectGetResult(result); }

Target:
public void testGetAllOfTypesWithUnrepresentedTypes() { List<VDS> result = dao .getAllOfTypes(new VDSType[] { null }); assertIncorrectGetResult(result); }
Source:
public ResponseBuilder run(JsonNode params, ResponseBuilder builder) { Object result = null; try { Map apiResult = activateApi(params); if (fieldName() != null) { result = apiResult.get(fieldName()); } else { result = apiResult; } } catch (Exception e) { log.error("Can't run api call", e); return builder.withError((Map<String, Object>) Collections.EMPTY_MAP); } if (result instanceof Map) { builder = builder.withResult((Map) result); } else if (result instanceof List) { builder = builder.withResult((List) result); } else if (result instanceof String) { builder = builder.withResult((String) result); } else { log.error("Unknown response data --> " + result, new Exception()); } return builder; }

Target:
public ResponseBuilder run(JsonNode params, ResponseBuilder builder) { Object result = null; try { Map apiResult = activateApi(params); if (fieldName() != null) { result = apiResult.get(fieldName()); } else { result = apiResult; } } catch (Exception e) { log.error("Can't run api call", e); return builder.withError((Map<String, Object>) Collections.EMPTY_MAP); } if (result instanceof Map) { builder = builder.withResult((Map) result); } else if (result instanceof List) { builder = builder.withResult((List) result); } else if (result instanceof String) { builder = builder.withResult((String) result); } else if (result != null && result.getClass().isArray()) { builder = builder.withResult((Object[]) result); } else { log.error("Unknown response data --> " + result, new Exception()); } return builder; }
Source:
private void watchDefaultStorage() { try { curator.getData().usingWatcher((CuratorWatcher) event -> { final byte[] defaultStorageId = curator.getData().forPath(ZK_TIMELINES_DEFAULT_STORAGE); if (defaultStorageId != null) { final Result<Storage> storageResult = getStorage(new String(defaultStorageId)); if (storageResult.isSuccessful()) { defaultStorage.setStorage(storageResult.getValue()); } } watchDefaultStorage(); }).forPath(ZK_TIMELINES_DEFAULT_STORAGE); } catch (final Exception e) { LOG.warn(e.getMessage(), e); } }

Target:
private void watchDefaultStorage() { try { curator.getData().usingWatcher((CuratorWatcher) event -> { final byte[] defaultStorageId = curator.getData().forPath(ZK_TIMELINES_DEFAULT_STORAGE); if (defaultStorageId != null) { final Result<Storage> storageResult = getStorage(new String(defaultStorageId)); if (storageResult.isSuccessful()) { defaultStorage.setStorage(storageResult.getValue()); } } watchDefaultStorage(); }).forPath(ZK_TIMELINES_DEFAULT_STORAGE); } catch (final Exception e) { LOG.warn("Error while creating watcher for default storage updates {}", e.getMessage(), e); } }
Source:
private String extractJavaVersionFromPath(String path) { path = path.substring(0, path.length()-4); File jdkReleasePropertiesFile = new File(path, "release"); InputStream in; try { in = new FileInputStream(jdkReleasePropertiesFile); } catch (FileNotFoundException e) { throw new IllegalStateException("JVM release properties file not found at: \"" + path + "/" + "release" + "\""); } Properties jdkReleaseProperties = new Properties(); try { jdkReleaseProperties.load(in); } catch (IOException e) { throw new IllegalStateException("Failed to load properties from file"); } String result = jdkReleaseProperties.getProperty("JAVA_VERSION").replaceAll("\"", ""); return result; }

Target:
private String extractJavaVersionFromPath(String path) { List<String> commands = new ArrayList<>(); commands.add("./java"); commands.add("-version"); ProcessBuilder processBuilder = new ProcessBuilder(commands); processBuilder.redirectErrorStream(true); processBuilder.environment().put("JAVA_HOME", path); processBuilder.directory(new File(path.replace("/jre","/bin"))); String result = null; try { final Process process = processBuilder.start(); BufferedReader stdInput = new BufferedReader(new InputStreamReader(process.getInputStream())); result = stdInput.readLine(); } catch (IOException e) { throw new RuntimeException("Failed to fetch Java version from \"" + path + "\""); } Pattern p = Pattern.compile(".*\\\"(.*)\\\".*"); Matcher m = p.matcher(result); if (m.find()) { return m.group(1); } else { return null; } }
Source:
public Vector shuffle(){ return self.shuffle(); }

Target:
public Vector shuffle() { return self.shuffle(factory); }
Source:
public void echoRuntimeFail() throws TException { try { client.echoRuntimeFail(KITTY_MSG); Assert.fail(); } catch (Exception e) { Assert.assertEquals(TApplicationException.class.getName(), e.getClass().getName()); } echoPass(); }

Target:
public void echoRuntimeFail() throws TException { try { client.echoRuntimeFail(KITTY_MSG); Assert.fail("Thrift client did not throw an expected exception"); } catch (Exception e) { Assert.assertEquals(TApplicationException.class.getName(), e.getClass().getName()); } echoPass(); }
Source:
private Map<DetailAST, String> getInvalidReturnTypes(DetailAST typeToken) { Map<DetailAST, String> invalidReturnTypeMap = new HashMap<>(); final int typeCount = typeToken.getChildCount(); if (typeCount == 1) { final String returnTypeName = typeToken.getFirstChild().getText(); if (classPathMap.containsKey(returnTypeName) && !isValidLibrary(classPathMap.get(returnTypeName))) { invalidReturnTypeMap.put(typeToken, returnTypeName); } } else { invalidReturnTypeMap = getInvalidTypeFromTypeArguments(typeToken); } return invalidReturnTypeMap; }

Target:
private Map<DetailAST, String> getInvalidReturnTypes(DetailAST typeToken) { final Map<DetailAST, String> invalidReturnTypeMap = new HashMap<>(); final DetailAST identToken = typeToken.findFirstToken(TokenTypes.IDENT); if (identToken == null) { return invalidReturnTypeMap; } final String typeName = identToken.getText(); if (!isValidClassDependency(typeName)) { invalidReturnTypeMap.put(typeToken, typeName); } final DetailAST typeArgumentsToken = typeToken.findFirstToken(TokenTypes.TYPE_ARGUMENTS); if (typeArgumentsToken != null) { invalidReturnTypeMap.putAll(getInvalidTypeFromTypeArguments(typeArgumentsToken)); } return invalidReturnTypeMap; }
Source:
public void testValidateCodeWithCodeAndCoding() throws Exception { Parameters inParams = new Parameters(); inParams.addParameter().setName("url").setValue(new UriType(CS_ACMS_URL)); inParams.addParameter().setName("code").setValue(new CodeType("8452-5")); inParams.addParameter().setName("coding").setValue((new Coding().setCode("8452-1"))); try { myClient.operation().onType(CodeSystem.class).named("validate-code").withParameters(inParams).execute(); } catch (InvalidRequestException e) { assertEquals("HTTP 400 Bad Request: $validate-code can only validate (code) OR (coding) OR (codeableConcept)",e.getMessage()); } }

Target:
public void testValidateCodeWithCodeAndCoding() throws Exception { Parameters inParams = new Parameters(); inParams.addParameter().setName("url").setValue(new UriType(CS_ACMS_URL)); inParams.addParameter().setName("code").setValue(new CodeType("8452-5")); inParams.addParameter().setName("coding").setValue((new Coding().setCode("8452-1"))); try { myClient.operation().onType(CodeSystem.class).named("validate-code").withParameters(inParams).execute(); fail(); } catch (InvalidRequestException e) { assertEquals("HTTP 400 Bad Request: $validate-code can only validate (code) OR (coding) OR (codeableConcept)",e.getMessage()); } }
Source:
public MetaStreamEvent clone() { MetaStreamEvent metaStreamEvent = new MetaStreamEvent(); for (Attribute attribute: this.getOutputData()) { metaStreamEvent.addOutputData(attribute); } for (Attribute attribute: this.getOnAfterWindowData()) { metaStreamEvent.addOnAfterWindowData(attribute); } for (Attribute attribute: this.getBeforeWindowData()) { metaStreamEvent.addBeforeWindowData(attribute); } for (AbstractDefinition abstractDefinition: this.getInputDefinitions()) { metaStreamEvent.addInputDefinition(abstractDefinition); } metaStreamEvent.setInputReferenceId(this.getInputReferenceId()); metaStreamEvent.setOutputDefinition(this.getOutputStreamDefinition()); metaStreamEvent.setEventType(this.getEventType()); return metaStreamEvent; }

Target:
public MetaStreamEvent clone() { MetaStreamEvent metaStreamEvent = new MetaStreamEvent(); if (outputData != null) { for (Attribute attribute : outputData) { metaStreamEvent.addOutputData(attribute); } } if (this.onAfterWindowData != null) { metaStreamEvent.onAfterWindowData = new ArrayList<>(onAfterWindowData); } metaStreamEvent.beforeWindowData = new ArrayList<>(beforeWindowData); for (AbstractDefinition abstractDefinition: this.getInputDefinitions()) { metaStreamEvent.addInputDefinition(abstractDefinition); } metaStreamEvent.setInputReferenceId(this.getInputReferenceId()); metaStreamEvent.setOutputDefinition(this.getOutputStreamDefinition()); metaStreamEvent.setEventType(this.getEventType()); return metaStreamEvent; }
Source:
public AccumuloBulkMergeException(final Throwable cause) { super(Msg, cause); }

Target:
public AccumuloBulkMergeException(final Throwable cause) { super(MSG, cause); }
Source:
public AirGoogleMapFragment build() { if (options == null) { options = new AirGoogleMapOptions(new GoogleMapOptions()); } return AirGoogleMapFragment.newInstance(options); }

Target:
public NativeGoogleMapFragment build() { if (options == null) { options = new AirGoogleMapOptions(new GoogleMapOptions()); } return NativeGoogleMapFragment.newInstance(options); }
Source:
public void onSuccess() { int currentNumOfAttempts = numOfAttempts.get(); if (currentNumOfAttempts > 0 && currentNumOfAttempts < maxAttempts) { succeededAfterRetryCounter.increment(); Throwable throwable = Option.of(lastException.get()).getOrElse(lastRuntimeException.get()); publishRetryEvent(() -> new RetryOnSuccessEvent(getName(), currentNumOfAttempts, throwable)); } else { if (currentNumOfAttempts >= maxAttempts) { failedAfterRetryCounter.increment(); Throwable throwable = Option.of(lastException.get()).getOrElse(lastRuntimeException.get()); publishRetryEvent(() -> new RetryOnErrorEvent(name, currentNumOfAttempts, throwable != null ? throwable : new MaxRetriesExceeded("max retries is reached out for the result predicate check"))); } else { succeededWithoutRetryCounter.increment(); } } }

Target:
public void onSuccess() { onComplete(); }
Source:
public void testRetrieveKeyAndValueNull() { JdbcCodeList jdbcCodeList = new JdbcCodeList(); jdbcCodeList.setDataSource(dataSource); jdbcCodeList.setLabelColumn("valueColumn"); jdbcCodeList.setValueColumn("labelColumn"); jdbcCodeList.setQuerySql("Select code_id, code_name from codelist"); Map<String, String> mapOutput = jdbcCodeList.retrieveMap(); assertThat(mapOutput.size(), is(0)); assertNull(mapOutput.get("valueColumn")); assertNull(mapOutput.get("labelColumn")); }

Target:
public void testRetrieveKeyAndValueNull() { JdbcCodeList jdbcCodeList = new JdbcCodeList(); jdbcCodeList.setDataSource(dataSource); jdbcCodeList.setLabelColumn("valueColumn"); jdbcCodeList.setValueColumn("labelColumn"); jdbcCodeList.setQuerySql("Select code_id, code_name from codelist"); Map<String, String> mapOutput = jdbcCodeList.retrieveMap(); assertThat(mapOutput.size(), is(0)); }
Source:
public ReviewerResult call() throws Exception { ReviewerResult result = new ReviewerResult(); List<Account.Id> accounts = new ArrayList<Account.Id>(); ChangeControl ctl = changeControlFactory.validateFor(changeId); if (ctl.canRemoveReviewer(reviewerId)) { Iterable<PatchSetApproval> patchSets = db.patchSetApprovals().byChange(changeId); List<PatchSetApproval> toDelete = new ArrayList<PatchSetApproval>(); for (PatchSetApproval psa : patchSets) { if (psa.getAccountId().equals(reviewerId)) { toDelete.add(psa); } } try { db.patchSetApprovals().delete(toDelete); } catch(OrmException ex) { result.addError(new ReviewerResult.Error( ReviewerResult.Error.Type.COULD_NOT_REMOVE, "Could not remove reviewer " + reviewerId)); } } else { result.addError(new ReviewerResult.Error( ReviewerResult.Error.Type.COULD_NOT_REMOVE, "Not allowed to remove reviewer " + reviewerId)); } result.setChange(changeDetailFactory.create(changeId).call()); return result; }

Target:
public ReviewerResult call() throws Exception { ReviewerResult result = new ReviewerResult(); List<Account.Id> accounts = new ArrayList<Account.Id>(); ChangeControl ctl = changeControlFactory.validateFor(changeId); boolean permitted = true; List<PatchSetApproval> toDelete = new ArrayList<PatchSetApproval>(); for (PatchSetApproval psa : db.patchSetApprovals().byChange(changeId)) { if (psa.getAccountId().equals(reviewerId)) { if (ctl.canRemoveReviewer(psa)) { toDelete.add(psa); } else { permitted = false; break; } } } if (permitted) { try { db.patchSetApprovals().delete(toDelete); } catch (OrmException ex) { result.addError(new ReviewerResult.Error( ReviewerResult.Error.Type.COULD_NOT_REMOVE, "Could not remove reviewer " + reviewerId)); } } else { result.addError(new ReviewerResult.Error( ReviewerResult.Error.Type.COULD_NOT_REMOVE, "Not allowed to remove reviewer " + reviewerId)); } result.setChange(changeDetailFactory.create(changeId).call()); return result; }
Source:
private static boolean isCountCall(ExpressionTree testedValue) { return testedValue.is(Tree.Kind.FUNCTION_CALL) && "count".equals(((FunctionCallTree) testedValue).callee().toString()); }

Target:
private static boolean isCountCall(ExpressionTree testedValue) { return testedValue.is(Tree.Kind.FUNCTION_CALL) && "count".equalsIgnoreCase(((FunctionCallTree) testedValue).callee().toString()); }
Source:
private void registerBlockFamily(BlockFamily family) { familyByUri.put(family.getURI(), family); for (Block block : family.getBlocks()) { byte id = idByUri.get(block.getURI()); if (id == 0) { id = (byte) nextId++; idByUri.put(block.getURI(), id); } block.setId(id); blocksById.put(block.getId(), block); blocksByUri.put(block.getURI(), block); if( block.getEntityPrefab().length() > 0 ){ blocksByPrefabName.put(block.getEntityPrefab(), block); } } }

Target:
private void registerBlockFamily(BlockFamily family) { familyByUri.put(family.getURI(), family); for (Block block : family.getBlocks()) { byte id = idByUri.get(block.getURI()); if (id == 0) { id = (byte) nextId++; idByUri.put(block.getURI(), id); } block.setId(id); blocksById.put(block.getId(), block); blocksByUri.put(block.getURI(), block); if( !block.getEntityPrefab().isEmpty() ){ blocksByPrefabName.put(block.getEntityPrefab(), block); } } }
Source:
public static Candidate convertRichMemberToCandidate(RichMember richMember, UserExtSource primaryUserExtSource) { if(richMember == null) throw new InternalErrorException("RichMember can't be null when converting to Candidate."); if(primaryUserExtSource == null) throw new InternalErrorException("PrimaryUserExtSource can't be null when converting to Candidate."); List<UserExtSource> additionalUserExtSources = new ArrayList<>(); if(richMember.getUserExtSources() != null) additionalUserExtSources = new ArrayList<>(richMember.getUserExtSources()); additionalUserExtSources.remove(primaryUserExtSource); List<Attribute> allAttributes = new ArrayList<>(); if(richMember.getMemberAttributes() != null) allAttributes.addAll(richMember.getMemberAttributes()); if(richMember.getUserAttributes() != null) allAttributes.addAll(richMember.getUserAttributes()); Map<String, String> candidateAttributes = new HashMap<>(); for(Attribute attribute: allAttributes) { candidateAttributes.put(attribute.getName(), attributeValueToString(attribute)); } Candidate candidate = new Candidate(richMember.getUser(), primaryUserExtSource); candidate.setAdditionalUserExtSources(additionalUserExtSources); candidate.setAttributes(candidateAttributes); return candidate; }

Target:
public static Candidate convertRichMemberToCandidate(RichMember richMember, UserExtSource primaryUserExtSource) { if(richMember == null) throw new InternalErrorException("RichMember can't be null when converting to Candidate."); if(primaryUserExtSource == null) throw new InternalErrorException("PrimaryUserExtSource can't be null when converting to Candidate."); List<UserExtSource> additionalUserExtSources = new ArrayList<>(); if(richMember.getUserExtSources() != null) additionalUserExtSources.addAll(richMember.getUserExtSources()); additionalUserExtSources.remove(primaryUserExtSource); List<Attribute> allAttributes = new ArrayList<>(); if(richMember.getMemberAttributes() != null) allAttributes.addAll(richMember.getMemberAttributes()); if(richMember.getUserAttributes() != null) allAttributes.addAll(richMember.getUserAttributes()); Map<String, String> candidateAttributes = new HashMap<>(); for(Attribute attribute: allAttributes) { candidateAttributes.put(attribute.getName(), attributeValueToString(attribute)); } Candidate candidate = new Candidate(richMember.getUser(), primaryUserExtSource); candidate.setAdditionalUserExtSources(additionalUserExtSources); candidate.setAttributes(candidateAttributes); return candidate; }
Source:
public Boolean call() throws InterruptedException{ CallContext callContext = bulkExecCallerImpl.getCallContextQueue().poll(); continueCalling = (callContext == null)? false:bulkExecCallerImpl.processOutput(callContext); if(continueCalling) { bulkExecCallerImpl.getCallContextQueue().put(callContext); submitTask(this); } else if(getPhase() == WorkPhase.COMPLETED && bulkExecCallerImpl.getCallContextQueue().isEmpty()) { getCallerThreadPoolExecutor().shutdown(); } return true; }

Target:
public Boolean call() throws InterruptedException{ CallContext callContext = bulkExecCallerImpl.getCallContextQueue().poll(); continueCalling = (callContext == null)? false:bulkExecCallerImpl.processOutput(callContext); if(continueCalling) { bulkExecCallerImpl.getCallContextQueue().put(callContext); submitTask(this); } else if(bulkExecCallerImpl.getCallContextQueue().isEmpty() && getCallerThreadPoolExecutor().getActiveCount() == 0) { getCallerThreadPoolExecutor().shutdown(); } return true; }
Source:
public PoolListModel() { setTitle(ConstantsManager.getInstance().getConstants().poolsTitle()); setDefaultSearchString("Pools:"); setSearchString(getDefaultSearchString()); setSearchObjects(new String[] { SearchObjects.VDC_POOL_OBJ_NAME, SearchObjects.VDC_POOL_PLU_OBJ_NAME }); setAvailableInModes(ApplicationMode.VirtOnly); setNewCommand(new UICommand("New", this)); setEditCommand(new UICommand("Edit", this)); setRemoveCommand(new UICommand("Remove", this)); UpdateActionAvailability(); getSearchNextPageCommand().setIsAvailable(true); getSearchPreviousPageCommand().setIsAvailable(true); if (getCustomPropertiesKeysList() == null) { AsyncDataProvider.GetCustomPropertiesList(new AsyncQuery(this, new INewAsyncCallback() { @Override public void OnSuccess(Object target, Object returnValue) { PoolListModel model = (PoolListModel) target; if (returnValue != null) { model.setCustomPropertiesKeysList(new HashMap<Version, ArrayList<String>>()); HashMap<Version, String> dictionary = (HashMap<Version, String>) returnValue; for (Map.Entry<Version, String> keyValuePair : dictionary.entrySet()) { String[] split = keyValuePair.getValue().split("[;]", -1); if (split.length == 1 && (split[0] == null || split[0].isEmpty())) { model.getCustomPropertiesKeysList().put(keyValuePair.getKey(), null); } else { model.getCustomPropertiesKeysList().put(keyValuePair.getKey(), new ArrayList<String>()); for (String s : split) { model.getCustomPropertiesKeysList().get(keyValuePair.getKey()).add(s); } } } } } })); } }

Target:
public PoolListModel() { setTitle(ConstantsManager.getInstance().getConstants().poolsTitle()); setDefaultSearchString("Pools:"); setSearchString(getDefaultSearchString()); setSearchObjects(new String[] { SearchObjects.VDC_POOL_OBJ_NAME, SearchObjects.VDC_POOL_PLU_OBJ_NAME }); setAvailableInModes(ApplicationMode.VirtOnly); setNewCommand(new UICommand("New", this)); setEditCommand(new UICommand("Edit", this)); setRemoveCommand(new UICommand("Remove", this)); UpdateActionAvailability(); getSearchNextPageCommand().setIsAvailable(true); getSearchPreviousPageCommand().setIsAvailable(true); if (getCustomPropertiesKeysList() == null) { AsyncDataProvider.GetCustomPropertiesList(new AsyncQuery(this, new INewAsyncCallback() { @Override public void OnSuccess(Object target, Object returnValue) { PoolListModel model = (PoolListModel) target; if (returnValue != null) { model.setCustomPropertiesKeysList((HashMap<Version, ArrayList<String>>) returnValue); } } })); } }
Source:
public void deregisterMetrics() { super.deregisterMetrics(); updateNumTopics(0); updateNumAutoPausedPartitionsAwaitingDestTopic(0); updateNumAutoPausedPartitionsOnError(0); updateNumConfigPausedPartitions(0); updateNumAutoPausedPartitionsOnInFlightMessages(0); DYNAMIC_METRICS_MANAGER.unregisterMetric(_className, _key, NUM_CONFIG_PAUSED_PARTITIONS); DYNAMIC_METRICS_MANAGER.unregisterMetric(_className, _key, NUM_AUTO_PAUSED_PARTITIONS_ON_ERROR); DYNAMIC_METRICS_MANAGER.unregisterMetric(_className, _key, NUM_AUTO_PAUSED_PARTITIONS_ON_INFLIGHT_MESSAGES); DYNAMIC_METRICS_MANAGER.unregisterMetric(_className, _key, NUM_AUTO_PAUSED_PARTITIONS_WAITING_FOR_DEST_TOPIC); DYNAMIC_METRICS_MANAGER.unregisterMetric(_className, _key, NUM_TOPICS); if (_enablePollDurationMillisMetric) { DYNAMIC_METRICS_MANAGER.unregisterMetric(_className, _key, POLL_DURATION_MS); } }

Target:
public void deregisterMetrics() { super.deregisterMetrics(); updateNumTopics(0); updateNumAutoPausedPartitionsAwaitingDestTopic(0); updateNumAutoPausedPartitionsOnError(0); updateNumConfigPausedPartitions(0); updateNumAutoPausedPartitionsOnInFlightMessages(0); DYNAMIC_METRICS_MANAGER.unregisterMetric(_className, _key, NUM_CONFIG_PAUSED_PARTITIONS); DYNAMIC_METRICS_MANAGER.unregisterMetric(_className, _key, NUM_AUTO_PAUSED_PARTITIONS_ON_ERROR); DYNAMIC_METRICS_MANAGER.unregisterMetric(_className, _key, NUM_AUTO_PAUSED_PARTITIONS_ON_INFLIGHT_MESSAGES); DYNAMIC_METRICS_MANAGER.unregisterMetric(_className, _key, NUM_AUTO_PAUSED_PARTITIONS_WAITING_FOR_DEST_TOPIC); DYNAMIC_METRICS_MANAGER.unregisterMetric(_className, _key, NUM_TOPICS); if (_pollDurationMsMetric != null) { DYNAMIC_METRICS_MANAGER.unregisterMetric(_className, _key, POLL_DURATION_MS); } }
Source:
public Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream inputStream) throws IOException { Object object; try { JsonParser jsonParser = objectMapper.getJsonFactory().createJsonParser(inputStream); jsonParser.disable(JsonParser.Feature.AUTO_CLOSE_SOURCE); object = objectMapper.readValue(jsonParser, TypeFactory.type(genericType)); } catch (Exception e) { if (e instanceof EOFException) { return null; } else if (e instanceof IOException && !(e instanceof JsonProcessingException)) { throw (IOException) e; } log.debug(e, "Invalid json for Java type %s", type); throw new WebApplicationException( Response.status(Response.Status.BAD_REQUEST) .entity("Invalid json for Java type " + type) .build()); } Set<ConstraintViolation<Object>> violations = VALIDATOR.validate(object); if (!violations.isEmpty()) { throw new WebApplicationException( Response.status(Response.Status.BAD_REQUEST) .entity(messagesFor(violations)) .build()); } return object; }

Target:
public Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream inputStream) throws IOException { Object object; try { JsonParser jsonParser = objectMapper.getJsonFactory().createJsonParser(inputStream); jsonParser.disable(JsonParser.Feature.AUTO_CLOSE_SOURCE); object = objectMapper.readValue(jsonParser, TypeFactory.type(genericType)); } catch (Exception e) { if (e instanceof IOException && !(e instanceof JsonProcessingException) && !(e instanceof EOFException)) { throw (IOException) e; } log.debug(e, "Invalid json for Java type %s", type); throw new WebApplicationException( Response.status(Response.Status.BAD_REQUEST) .entity("Invalid json for Java type " + type) .build()); } Set<ConstraintViolation<Object>> violations = VALIDATOR.validate(object); if (!violations.isEmpty()) { throw new WebApplicationException( Response.status(Response.Status.BAD_REQUEST) .entity(messagesFor(violations)) .build()); } return object; }
Source:
private VdsNetworkInterface findPreviousDefaultRouteNic() { List<VdsNetworkInterface> existingNics = getExistingNics(); return existingNics.stream() .filter(nic -> DEFAULT_ROUTE_ON_IFACE_PREDICATE.test(nic)) .findFirst() .orElse(null); }

Target:
private VdsNetworkInterface findPreviousDefaultRouteNic() { List<VdsNetworkInterface> existingNics = getExistingNics(); return existingNics.stream() .filter(IsDefaultRouteOnInterfacePredicate.INSTANCE) .findFirst() .orElse(null); }
Source:
public static void main(final String[] args) { String serviceAccountEmailAddress = args[0]; String serviceAccountKey = null; try { serviceAccountKey = Files.toString(new File(args[1]), Charset.defaultCharset()); } catch (IOException e) { System.err.println("Cannot open service account private key PEM file: " + args[1] + "\n" + e.getMessage()); System.exit(1); } String command = args[2]; String projectName = null; String bucketName = null; if (command.equals("create")) { projectName = args[3]; bucketName = args[4]; } else if (command.equals("delete")) { bucketName = args[3]; if (args.length >= 5) { System.err.println("Command 'delete' require only one additional parameter (bucketName)."); System.exit(1); } } else if (command.equals("list")) { projectName = args[3]; if (args.length >= 5) { System.err.println("Command 'list' require only one additional parameters (projectName)."); System.exit(1); } } else { System.err.println("Unknown command: " + command); System.exit(1); } ManageBuckets manageBuckets = new ManageBuckets(serviceAccountEmailAddress, serviceAccountKey); if (command.equals("create")) { manageBuckets.createBucket(projectName, bucketName); } else if (command.equals("delete")) { manageBuckets.deleteBucket(bucketName); } else if (command.equals("list")) { manageBuckets.listBuckets(projectName); } else { try { manageBuckets.close(); } catch (IOException e) { e.printStackTrace(); } throw new RuntimeException("Should never happen."); } try { manageBuckets.close(); } catch (IOException e) { e.printStackTrace(); System.exit(1); } }

Target:
public static void main(final String[] args) { String serviceAccountEmailAddress = args[0]; String serviceAccountKey = null; try { serviceAccountKey = Files.toString(new File(args[1]), Charset.defaultCharset()); } catch (IOException e) { System.err.println("Cannot open service account private key PEM file: " + args[1] + "\n" + e.getMessage()); System.exit(1); } ManageBuckets manageBuckets = new ManageBuckets(serviceAccountEmailAddress, serviceAccountKey); String command = args[2]; String projectName = null; String bucketName = null; try { if (command.equals("create")) { projectName = args[3]; bucketName = args[4]; manageBuckets.createBucket(projectName, bucketName); } else if (command.equals("delete")) { bucketName = args[3]; if (args.length >= 5) { System.err.println("Warning: Command 'delete' require only one additional parameter (bucketName)."); } manageBuckets.deleteBucket(bucketName); } else if (command.equals("list")) { projectName = args[3]; if (args.length >= 5) { System.err.println("Warning: Command 'list' require only one additional parameters (projectName)."); } manageBuckets.listBuckets(projectName); } else { System.err.println("Unknown command: " + command); System.exit(1); } } catch (RuntimeException e) { System.err.format("Command %s failed: %s%n", command, e.getMessage()); System.exit(1); } try { manageBuckets.close(); } catch (IOException e) { e.printStackTrace(); System.exit(1); } }
Source:
protected synchronized void updateNameList() { if (sysNameList != null) { for (int i = 0; i < sysNameList.size(); i++) { NamedBean b = getBySystemName(sysNameList.get(i)); if (b != null) { b.removePropertyChangeListener(this); } } } sysNameList = null; sysNameList = new ArrayList<>(); getManager().getNamedBeanSet().forEach(b -> { if (b.getSystemName().startsWith(getLogixSystemPrefix())) { sysNameList.add(b.getSystemName()); b.addPropertyChangeListener(this); } }); log.debug("updateNameList: sysNameList size= {}", sysNameList.size()); }

Target:
protected synchronized void updateNameList() { if (sysNameList != null) { for (int i = 0; i < sysNameList.size(); i++) { NamedBean b = getBySystemName(sysNameList.get(i)); if (b != null) { b.removePropertyChangeListener(this); } } } sysNameList = new ArrayList<>(); getManager().getNamedBeanSet().forEach(b -> { if (b.getSystemName().startsWith(getLogixSystemPrefix())) { sysNameList.add(b.getSystemName()); b.addPropertyChangeListener(this); } }); log.debug("updateNameList: sysNameList size= {}", sysNameList.size()); }
Source:
private DefaultHttpClient getHttpClient(MetricServiceAppConfiguration passedConfig) { PoolingClientConnectionManager cm = new PoolingClientConnectionManager(); int maxTotalPoolConnections = passedConfig.getMetricServiceConfig().getMaxTotalPoolConnections(); int maxPoolConnectionsPerRoute = passedConfig.getMetricServiceConfig().getMaxPoolConnectionsPerRoute(); log.info("Setting up pool with total connections and max connections per route.", maxTotalPoolConnections, maxPoolConnectionsPerRoute); cm.setMaxTotal(maxTotalPoolConnections); cm.setDefaultMaxPerRoute(maxPoolConnectionsPerRoute); return new DefaultHttpClient(cm); }

Target:
private DefaultHttpClient getHttpClient(MetricServiceAppConfiguration passedConfig) { PoolingClientConnectionManager cm = new PoolingClientConnectionManager(); int maxTotalPoolConnections = passedConfig.getMetricServiceConfig().getMaxTotalPoolConnections(); int maxPoolConnectionsPerRoute = passedConfig.getMetricServiceConfig().getMaxPoolConnectionsPerRoute(); log.debug("Setting up pool with total connections and max connections per route.", maxTotalPoolConnections, maxPoolConnectionsPerRoute); cm.setMaxTotal(maxTotalPoolConnections); cm.setDefaultMaxPerRoute(maxPoolConnectionsPerRoute); return new DefaultHttpClient(cm); }
Source:
public long getVolume() { return BigDecimal.valueOf((4.0 / 3.0) * Math.PI) .multiply(BigDecimal.valueOf(radius.getX())) .multiply(BigDecimal.valueOf(radius.getY())) .multiply(BigDecimal.valueOf(radius.getZ())) .setScale(0, RoundingMode.FLOOR) .longValue(); }

Target:
public long getVolume() { return ELLIPSOID_BASE_MULTIPLIER .multiply(BigDecimal.valueOf(radius.getX())) .multiply(BigDecimal.valueOf(radius.getY())) .multiply(BigDecimal.valueOf(radius.getZ())) .setScale(0, RoundingMode.FLOOR) .longValue(); }
Source:
private void searchForAttributeOfGivenType_AndCheckIfTypeMatches(String attributeTypeUuid) throws Exception { SimpleObject response2 = deserialize(handle(newGetRequest(getURI(), new Parameter("attributeType", attributeTypeUuid)))); for(Object result : Util.getResultsList(response2)){ Object resultAttributeTypeUuid = PropertyUtils.getProperty(PropertyUtils.getProperty(result, "attributeType"), "uuid"); Assert.assertThat((String)resultAttributeTypeUuid, is(attributeTypeUuid)); } }

Target:
private void searchForAttributeOfGivenType_AndCheckIfTypeMatches(String attributeTypeUuid) throws Exception { SimpleObject response2 = deserialize(handle(newGetRequest(getURI(), new Parameter("attributeType", attributeTypeUuid)))); assertThat(Util.getResultsList(response2), is(not(empty()))); for (Object result : Util.getResultsList(response2)) { Object resultAttributeTypeUuid = Util.getByPath(Util.getByPath(result, "attributeType"), "uuid"); Assert.assertThat((String) resultAttributeTypeUuid, is(attributeTypeUuid)); } }
Source:
default double getDistanceL1(Point2D<?, ?> pt) { assert pt != null : "Point must not be null"; final int dx; if (pt.ix() < getMinX()) { dx = getMinX() - pt.ix(); } else if (pt.ix() > getMaxX()) { dx = pt.ix() - getMaxX(); } else { dx = 0; } final int dy; if (pt.iy() < getMinY()) { dy = getMinY() - pt.iy(); } else if (pt.iy() > getMaxY()) { dy = pt.iy() - getMaxY(); } else { dy = 0; } return dx + (double) dy; }

Target:
default double getDistanceL1(Point2D<?, ?> pt) { assert pt != null : "Point must not be null"; final int dx; if (pt.ix() < getMinX()) { dx = getMinX() - pt.ix(); } else if (pt.ix() > getMaxX()) { dx = pt.ix() - getMaxX(); } else { dx = 0; } final int dy; if (pt.iy() < getMinY()) { dy = getMinY() - pt.iy(); } else if (pt.iy() > getMaxY()) { dy = pt.iy() - getMaxY(); } else { dy = 0; } return (double) (dx + dy); }
Source:
public void getRequiredMemberGroupAndUserAttributesFromOneService() throws Exception { System.out.println(CLASS_NAME + "getRequiredMemberGroupAndUserAttributesFromOneService"); vo = setUpVo(); member = setUpMember(); group = setUpGroup(); facility = setUpFacility(); resource = setUpResource(); this.setUpMemberToResource(); service = setUpService(); attributes = setUpRequiredAttributes(); perun.getResourcesManager().assignService(sess, resource, service); List<Attribute> reqAttr = attributesManager.getRequiredAttributes(sess, member, group, true); assertNotNull("unable to get required member / member-group attributes for one service", reqAttr); assertEquals("getRequiredAtributes(sess, member, group, true) returns wrong count of attributes", 3, reqAttr.size()); }

Target:
public void getRequiredMemberGroupAndUserAttributesFromOneService() throws Exception { System.out.println(CLASS_NAME + "getRequiredMemberGroupAndUserAttributesFromOneService"); vo = setUpVo(); member = setUpMember(); group = setUpGroup(); facility = setUpFacility(); resource = setUpResource(); this.setUpMemberToResource(); service = setUpService(); attributes = setUpRequiredAttributes(); perun.getResourcesManager().assignService(sess, resource, service); List<Attribute> reqAttr = attributesManager.getRequiredAttributes(sess, member, group, true); assertNotNull("unable to get required user / member / member-group attributes for one service", reqAttr); assertEquals("getRequiredAttributes(sess, member, group, true) returns wrong count of attributes", 3, reqAttr.size()); }
Source:
private boolean sendRequest(final URL queryUrl) throws IOException, JSONException { Logger.v(TAG, "Sending discovery request to:" + queryUrl); Map<String, String> headers = new HashMap<>(); headers.put(WebRequestHandler.HEADER_ACCEPT, WebRequestHandler.HEADER_ACCEPT_JSON); if (mCorrelationId != null) { headers.put(AuthenticationConstants.AAD.CLIENT_REQUEST_ID, mCorrelationId.toString()); headers.put(AuthenticationConstants.AAD.RETURN_CLIENT_REQUEST_ID, "true"); } HttpWebResponse webResponse = null; try { ClientMetrics.INSTANCE.beginClientMetricsRecord(queryUrl, mCorrelationId, headers); try { webResponse = mWebrequestHandler.sendGet(queryUrl, headers); ClientMetrics.INSTANCE.setLastError(null); } catch (IOException e) { if (webResponse != null) { ClientMetrics.INSTANCE.setLastError(String.valueOf(webResponse.getStatusCode())); } throw e; } final Map<String, String> discoveryResponse = parseResponse(webResponse); if(discoveryResponse.containsKey(AuthenticationConstants.OAuth2.ERROR_CODES)) { String errorCodes = discoveryResponse.get(AuthenticationConstants.OAuth2.ERROR_CODES); ClientMetrics.INSTANCE.setLastError(errorCodes); } return (discoveryResponse.containsKey(TENANT_DISCOVERY_ENDPOINT)); } finally { ClientMetrics.INSTANCE.endClientMetricsRecord(ClientMetricsEndpointType.INSTANCE_DISCOVERY, mCorrelationId); } }

Target:
private boolean sendRequest(final URL queryUrl) throws IOException, JSONException { Logger.v(TAG, "Sending discovery request to:" + queryUrl); final Map<String, String> headers = new HashMap<>(); headers.put(WebRequestHandler.HEADER_ACCEPT, WebRequestHandler.HEADER_ACCEPT_JSON); if (mCorrelationId != null) { headers.put(AuthenticationConstants.AAD.CLIENT_REQUEST_ID, mCorrelationId.toString()); headers.put(AuthenticationConstants.AAD.RETURN_CLIENT_REQUEST_ID, "true"); } final HttpWebResponse webResponse; try { ClientMetrics.INSTANCE.beginClientMetricsRecord(queryUrl, mCorrelationId, headers); webResponse = mWebrequestHandler.sendGet(queryUrl, headers); ClientMetrics.INSTANCE.setLastError(null); final Map<String, String> discoveryResponse = parseResponse(webResponse); if(discoveryResponse.containsKey(AuthenticationConstants.OAuth2.ERROR_CODES)) { final String errorCodes = discoveryResponse.get(AuthenticationConstants.OAuth2.ERROR_CODES); ClientMetrics.INSTANCE.setLastError(errorCodes); } return (discoveryResponse.containsKey(TENANT_DISCOVERY_ENDPOINT)); } finally { ClientMetrics.INSTANCE.endClientMetricsRecord(ClientMetricsEndpointType.INSTANCE_DISCOVERY, mCorrelationId); } }
Source:
MapColor getColor(int x, int y) throws IllegalArgumentException; Image toImage(); Image toImage(java.awt.Color color); Builder toBuilder(MapCanvas canvas); interface Builder extends DataBuilder<MapCanvas> { Builder paintAll(MapColor color); Builder paint(int startX, int startY, int endX, int endY, MapColor mapColor); default Builder paint(final Vector2i start, final Vector2i end, final MapColor mapColor) { return this.paint( Math.min(start.getX(), end.getX()), Math.max(start.getX(), end.getX()), Math.min(start.getY(), end.getY()), Math.min(start.getY(), end.getY()), mapColor); } Builder from(MapCanvas canvas); Builder fromImage(Image image) throws IllegalArgumentException; @Override Optional<MapCanvas> build(DataView container) throws InvalidDataException; MapCanvas build(); }

Target:
MapColor getColor(int x, int y) throws IllegalArgumentException; Image toImage(); Image toImage(java.awt.Color color); Builder toBuilder(); interface Builder extends ResettableBuilder<MapCanvas, Builder> { Builder paintAll(MapColor color); Builder paint(int startX, int startY, int endX, int endY, MapColor mapColor); default Builder paint(final Vector2i start, final Vector2i end, final MapColor mapColor) { return this.paint( Math.min(start.getX(), end.getX()), Math.max(start.getX(), end.getX()), Math.min(start.getY(), end.getY()), Math.min(start.getY(), end.getY()), mapColor); } Builder from(MapCanvas canvas); Builder fromImage(Image image) throws IllegalArgumentException; Builder fromContainer(DataView container); MapCanvas build(); }
Source:
public void testParseIntEmpty() throws EvaluationException { try { PARSE_INTEGER.evaluate(s("")); fail("parse_Integer(\"\") did not throw"); } catch (EvaluationException e){ assertThat("parse_Integer(\"\") throws", true, instanceOf(Boolean.class)); } }

Target:
public void testParseIntEmpty() throws EvaluationException { PARSE_INTEGER.evaluate(s("")); }
Source:
public void cleanup(MessageContext messageContext) { LOG.debug("cleanup"); }

Target:
public void cleanup(MessageContext messageContext) { LOG.debug("cleaning up AxisToClientConnectorBridge"); }
Source:
private void evaluateExpression(final JexlVCMatchExp exp) { if (this.jContext == null){ createContext(); } try { final Boolean value = (Boolean) exp.exp.evaluate(jContext); jexl.put(exp, value == null ? false : value); } catch (final JexlException e) { jexl.put(exp,false); throw new IllegalArgumentException(String.format("Invalid JEXL expression detected for %s with message %s", exp.name, "no message" )); } }

Target:
private void evaluateExpression(final JexlVCMatchExp exp) { if (this.jContext == null) { createContext(); } try { final Boolean value = (Boolean) exp.exp.evaluate(jContext); jexl.put(exp, value == null ? false : value); } catch (final JexlException.Variable e) { jexl.put(exp,false); } catch (final JexlException e) { throw new IllegalArgumentException(String.format("Invalid JEXL expression detected for %s", exp.name), e); } }
Source:
public void stop() throws InterruptedException { synchronized (lifecycleLock) { Preconditions.checkState(started, "not started"); try { log.info("Stopping WorkerTaskMonitor."); started = false; exec.shutdownNow(); pathChildrenCache.close(); taskRunner.stop(); doneStopping.await(); } catch (InterruptedException e) { throw e; } catch (Exception e) { log.makeAlert(e, "Exception stopping WorkerTaskMonitor") .emit(); } } }

Target:
public void stop() throws InterruptedException { synchronized (lifecycleLock) { Preconditions.checkState(started, "not started"); try { started = false; exec.shutdownNow(); pathChildrenCache.close(); taskRunner.stop(); if (!doneStopping.await(STOP_WARNING_SECONDS, TimeUnit.SECONDS)) { log.warn("WorkerTaskMonitor taking longer than %s seconds to exit. Still waiting...", STOP_WARNING_SECONDS); doneStopping.await(); } log.info("Stopped WorkerTaskMonitor."); } catch (InterruptedException e) { throw e; } catch (Exception e) { log.makeAlert(e, "Exception stopping WorkerTaskMonitor") .emit(); } } }
Source:
public static ColumnIO getArrayElementColumn(ColumnIO columnIO) { while ((columnIO instanceof GroupColumnIO) && !columnIO.getType().isRepetition(REPEATED)) { columnIO = ((GroupColumnIO) columnIO).getChild(0); } if (columnIO instanceof GroupColumnIO && columnIO.getType().getOriginalType() == null && ((GroupColumnIO) columnIO).getChildrenCount() == 1) { return ((GroupColumnIO) columnIO).getChild(0); } return columnIO; }

Target:
public static ColumnIO getArrayElementColumn(ColumnIO columnIO) { while (columnIO instanceof GroupColumnIO && !columnIO.getType().isRepetition(REPEATED)) { columnIO = ((GroupColumnIO) columnIO).getChild(0); } if (columnIO instanceof GroupColumnIO && columnIO.getType().getOriginalType() == null && ((GroupColumnIO) columnIO).getChildrenCount() == 1) { return ((GroupColumnIO) columnIO).getChild(0); } return columnIO; }
Source:
public void packRefs() throws IOException { Collection<Ref> refs = repo.getAllRefs().values(); ArrayList<String> refsToBePacked = new ArrayList<String>(refs.size()); int packRefsCnt = 0; pm.beginTask(JGitText.get().packRefs, refs.size()); try { for (Ref ref : refs) { if (!ref.isSymbolic() && ref.getStorage().isLoose()) { refsToBePacked.add(ref.getName()); packRefsCnt++; } pm.update(1); } ((RefDirectory) repo.getRefDatabase()).pack(refsToBePacked .toArray(new String[packRefsCnt])); } finally { pm.endTask(); } }

Target:
public void packRefs() throws IOException { Collection<Ref> refs = repo.getAllRefs().values(); List<String> refsToBePacked = new ArrayList<String>(refs.size()); pm.beginTask(JGitText.get().packRefs, refs.size()); try { for (Ref ref : refs) { if (!ref.isSymbolic() && ref.getStorage().isLoose()) refsToBePacked.add(ref.getName()); pm.update(1); } ((RefDirectory) repo.getRefDatabase()).pack(refsToBePacked); } finally { pm.endTask(); } }
Source:
protected Void doInBackground(File... params) { synchronized (mDiskCacheLock) { mDiskLruCache = new DiskLruImageCache(mContext, "thumbnailCache", DISK_CACHE_SIZE, mCompressFormat,mCompressQuality); try { OwnCloudAccount ocAccount = new OwnCloudAccount(mAccount, mContext); mClient = OwnCloudClientManagerFactory.getDefaultSingleton(). getClientFor(ocAccount, mContext); } catch (AccountNotFoundException e) { e.printStackTrace(); } catch (AuthenticatorException e) { e.printStackTrace(); } catch (OperationCanceledException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } mDiskCacheStarting = false; mDiskCacheLock.notifyAll(); } return null; }

Target:
protected Void doInBackground(File... params) { synchronized (thumbnailDiskCacheLock) { mThumbnailCache = new DiskLruImageCache(mContext, "thumbnailCache", DISK_CACHE_SIZE, mCompressFormat, mCompressQuality); try { OwnCloudAccount ocAccount = new OwnCloudAccount(mAccount, mContext); mClient = OwnCloudClientManagerFactory.getDefaultSingleton(). getClientFor(ocAccount, mContext); } catch (AccountNotFoundException e) { e.printStackTrace(); } catch (AuthenticatorException e) { e.printStackTrace(); } catch (OperationCanceledException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } mThumbnailCacheStarting = false; thumbnailDiskCacheLock.notifyAll(); } return null; }