auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static FieldSchema singleFieldToFieldSchema(String fieldName, Field field) throws FrontendException { switch (field.getType()) { case TType.LIST: if (PigUtil.Pig9orNewer && field.getListElemField().getType()==TType.STRUCT) { Schema internalSchema=singleFieldToTupleSchema(fieldName, field.getListElemField()); return new FieldSchema(fieldName, new Schema(new FieldSchema("t",internalSchema,DataType.TUPLE)), DataType.BAG); } else { Schema internalSchema=singleFieldToTupleSchema(fieldName + "_tuple", field.getListElemField()); return new FieldSchema(fieldName, internalSchema, DataType.BAG); } case TType.SET: if (PigUtil.Pig9orNewer && field.getSetElemField().getType()==TType.STRUCT) { Schema internalSchema=singleFieldToTupleSchema(fieldName, field.getSetElemField()); return new FieldSchema(fieldName, new Schema(new FieldSchema("t",internalSchema,DataType.TUPLE)), DataType.BAG); } else { Schema internalSchema=singleFieldToTupleSchema(fieldName + "_tuple", field.getSetElemField()); return new FieldSchema(fieldName, internalSchema, DataType.BAG); } case TType.MAP: if (field.getMapKeyField().getType() != TType.STRING && field.getMapKeyField().getType() != TType.ENUM) { LOG.warn("Using a map with non-string key for field " + field.getName() + ". while converting to PIG Tuple, toString() is used for the key." + " It could result in incorrect maps."); } return new FieldSchema(fieldName, null, DataType.MAP); default: return new FieldSchema(fieldName, null, getPigDataType(field)); } }

Target:
private static FieldSchema singleFieldToFieldSchema(String fieldName, Field field) throws FrontendException { switch (field.getType()) { case TType.LIST: return new FieldSchema(fieldName, singleFieldToTupleSchema(fieldName + "_tuple", field.getListElemField()), DataType.BAG); case TType.SET: return new FieldSchema(fieldName, singleFieldToTupleSchema(fieldName + "_tuple", field.getSetElemField()), DataType.BAG); case TType.MAP: if (field.getMapKeyField().getType() != TType.STRING && field.getMapKeyField().getType() != TType.ENUM) { LOG.warn("Using a map with non-string key for field " + field.getName() + ". while converting to PIG Tuple, toString() is used for the key." + " It could result in incorrect maps."); } return new FieldSchema(fieldName, null, DataType.MAP); default: return new FieldSchema(fieldName, null, getPigDataType(field)); } }
Source:
public boolean equals(Object that) { if (true) { return (Object) this; } if (true) { return (Object) equals(); } return false; }

Target:
public boolean equals(Object that) { ((Object) this).hashCode(); double d = (double) hashCode(); return false; }
Source:
private void cancelDownloadsForAccount(Account account){ ConcurrentMap downloadsAccount = mPendingDownloads.get(account); Iterator<String> it = downloadsAccount.keySet().iterator(); Log_OC.d(TAG, "Number of pending downloads= " + downloadsAccount.size()); while (it.hasNext()) { String key = it.next(); Log_OC.d(TAG, "download CANCELLED " + key); if (key.startsWith(account.name)) { DownloadFileOperation download; synchronized (mPendingDownloads) { download = mPendingDownloads.get(key); if (download != null) { String remotePath = download.getRemotePath(); if (mPendingDownloads.contains(account, remotePath)) { mPendingDownloads.remove(account, remotePath); } } } } } }

Target:
private void cancelDownloadsForAccount(Account account) { mPendingDownloads.remove(account); }
Source:
private List<LookupBean> getLookupsListFromLookupConfig() { List<LookupBean> lookupBeanList = new ArrayList<>(); if (lookupConfig.getEnableLookupSyncOnStartup()) { String tier = lookupListeningAnnouncerConfig.getLookupTier(); lookupBeanList = getLookupListFromCoordinator(tier); if (lookupBeanList == null) { LOG.info("Coordinator is unavailable. Loading saved snapshot instead"); lookupBeanList = getLookupListFromSnapshot(); } } else { lookupBeanList = getLookupListFromSnapshot(); } return lookupBeanList; }

Target:
private List<LookupBean> getLookupsListFromLookupConfig() { List<LookupBean> lookupBeanList; if (lookupConfig.getEnableLookupSyncOnStartup()) { String tier = lookupListeningAnnouncerConfig.getLookupTier(); lookupBeanList = getLookupListFromCoordinator(tier); if (lookupBeanList == null) { LOG.info("Coordinator is unavailable. Loading saved snapshot instead"); lookupBeanList = getLookupListFromSnapshot(); } } else { lookupBeanList = getLookupListFromSnapshot(); } return lookupBeanList; }
Source:
public FilterCursorWrapper(Cursor cursor,String filter,int column1, int column2) { super(cursor); this.mFilter = filter.toLowerCase(); this.mColumn = new int[] {column1, column2}; if (this.mFilter != "") { mCount = super.getCount(); this.mIndex = new int[this.mCount]; for (int i = 0; i < this.mCount; i++) { super.moveToPosition(i); if (this.getString(this.mColumn[0]).toLowerCase().contains(this.mFilter) || this.getString(this.mColumn[1]).toLowerCase().contains(this.mFilter)) this.mIndex[this.mPosition++] = i; } this.mCount = this.mPosition; this.mPosition = 0; super.moveToFirst(); } else { this.mCount = super.getCount(); this.mIndex = new int[this.mCount]; for (int i = 0; i < this.mCount; i++) { this.mIndex[i] = i; } } }

Target:
public FilterCursorWrapper(Cursor cursor,String filter,int column1, int column2) { super(cursor); this.mFilter = filter.toLowerCase(); this.mColumn = new int[] {column1, column2}; if (this.mFilter.isEmpty()) { mCount = super.getCount(); this.mIndex = new int[this.mCount]; for (int i = 0; i < this.mCount; i++) { super.moveToPosition(i); if (this.getString(this.mColumn[0]).toLowerCase().contains(this.mFilter) || this.getString(this.mColumn[1]).toLowerCase().contains(this.mFilter)) this.mIndex[this.mPosition++] = i; } this.mCount = this.mPosition; this.mPosition = 0; super.moveToFirst(); } else { this.mCount = super.getCount(); this.mIndex = new int[this.mCount]; for (int i = 0; i < this.mCount; i++) { this.mIndex[i] = i; } } }
Source:
private Optional<List<String>> validateNotifySettingsRequest(JsonNode payload){ Optional<List<String>> checkList = requestValidator.checkIfExistsOrEmpty(payload, FIELD_OPERATION, FIELD_OPERATION_PATH); if(checkList.isPresent()){ return checkList; } String op = payload.get(FIELD_OPERATION).asText(); if (!VALID_ATTRIBUTE_UPDATE_OPERATIONS.get(FIELD_OPERATION).contains(op)) { return Optional.of(asList(format("Operation [%s] is invalid for path [%s]", op, FIELD_OPERATION))); } JsonNode valueNode = payload.get(FIELD_VALUES); checkList = requestValidator.checkIfExistsOrEmpty(valueNode, FIELD_NOTIFY_API_TOKEN, FIELD_NOTIFY_TEMPLATE_ID); return checkList; }

Target:
private Optional<List<String>> validateNotifySettingsRequest(JsonNode payload){ String op = payload.get(FIELD_OPERATION).asText(); if (!VALID_ATTRIBUTE_UPDATE_OPERATIONS.get(FIELD_OPERATION).contains(op)) { return Optional.of(asList(format("Operation [%s] is not valid for path [%s]", op, FIELD_OPERATION))); } if(op.equals("remove")) { return Optional.empty(); } JsonNode valueNode = payload.get(FIELD_VALUES); if(null == valueNode) { return Optional.of(asList(format("Field [%s] is required", FIELD_VALUES))); } return requestValidator.checkIfExistsOrEmpty(valueNode, FIELD_NOTIFY_API_TOKEN, FIELD_NOTIFY_TEMPLATE_ID); }
Source:
protected void verifyAccesibleForSpecificUser() { InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, account.googleId); FeedbackSessionAttributes session = logic.getFeedbackSession(feedbackSessionName, courseId); new GateKeeper().verifyAccessible(instructor, session, false, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION_COMMENT_IN_SECTIONS); }

Target:
protected void verifyAccesibleForSpecificUser() { InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, account.googleId); FeedbackSessionAttributes session = logic.getFeedbackSession(feedbackSessionName, courseId); new GateKeeper().verifyAccessible(instructor, session, false, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION); }
Source:
public CompositeItemWriterBuilder delegates(List<ItemWriter<? super T>> delegates) { Assert.notNull(delegates, "A list of delegates is required."); Assert.notEmpty(delegates, "The delegates list must have one or more delegates."); this.delegates = delegates; return this; }

Target:
public CompositeItemWriterBuilder delegates(List<ItemWriter<? super T>> delegates) { this.delegates = delegates; return this; }
Source:
public Iterator<Bucket> iterator() { return new Iterator<Bucket>() { private int currentIndex; @Override public boolean hasNext() { return currentIndex < indices.length; } @Override public Bucket next() { if (!hasNext()) { throw new NoSuchElementException(); } final Bucket bucket = new Bucket( indices[currentIndex] * (max - min) / bucketCount, (indices[currentIndex] + 1) * (max - min) / bucketCount, weights[currentIndex], counts[currentIndex]); ++currentIndex; return bucket; } @Override public void remove() { throw new UnsupportedOperationException(); } }; }

Target:
public Iterator<BucketWeight> iterator() { return new Iterator<BucketWeight>() { private int currentIndex; @Override public boolean hasNext() { return currentIndex < indices.length; } @Override public BucketWeight next() { if (!hasNext()) { throw new NoSuchElementException(); } final BucketWeight bucket = new BucketWeight( getLeftValueForIndex(bucketCount, min, max, indices[currentIndex]), getRightValueForIndex(bucketCount, min, max, indices[currentIndex]), weights[currentIndex], counts[currentIndex]); ++currentIndex; return bucket; } @Override public void remove() { throw new UnsupportedOperationException(); } }; }
Source:
private boolean canRemoveVmPool(Guid vmPoolId) { return getVmPoolDao().getVmPoolsMapByVmPoolId(vmPoolId).size() == 0; }

Target:
private boolean canRemoveVmPool(Guid vmPoolId) { return getVmPoolDao().getVmPoolsMapByVmPoolId(vmPoolId).isEmpty(); }
Source:
public void processRecord(ComputationContext context, String inputStreamName, Record record) { BulkBucket bucket = BulkCodecs.getBucketCodec().decode(record.getData()); command = getCommand(bucket.getCommandId()); if (command == null) { log.error("[%s] Stopping processing, unknown command: {}, offset: {}, record: {}.", metadata.name(), bucket.getCommandId(), context.getLastOffset(), record); context.askForTermination(); return; } for (List<String> batch : Lists.partition(bucket.getIds(), command.getBatchSize())) { processBatchOfDocuments(batch); } endBucket(context, bucket.getIds().size()); context.askForCheckpoint(); }

Target:
public void processRecord(ComputationContext context, String inputStreamName, Record record) { BulkBucket bucket = BulkCodecs.getBucketCodec().decode(record.getData()); command = getCommand(bucket.getCommandId()); if (command != null) { for (List<String> batch : Lists.partition(bucket.getIds(), command.getBatchSize())) { processBatchOfDocuments(batch); } endBucket(context, bucket.getIds().size()); context.askForCheckpoint(); } else { if (isAbortedCommand(bucket.getCommandId())) { log.debug("Skipping aborted command: {}", bucket.getCommandId()); context.askForCheckpoint(); } else { log.error("Stopping processing, unknown command: {}, offset: {}, record: {}.", bucket.getCommandId(), context.getLastOffset(), record); context.askForTermination(); } } }
Source:
public List<Double> get(@PathParam("userID") String userID, @PathParam("itemID") List<PathSegment> pathSegmentsList) { ALSServingModelManager alsServingModelManager = (ALSServingModelManager) servletContext.getAttribute(ModelManagerListener.MANAGER_KEY); ALSServingModel alsServingModel = alsServingModelManager.getModel(); String[] itemIDs = new String[pathSegmentsList.size()]; for (int i = 0; i < itemIDs.length; i++) { itemIDs[i] = pathSegmentsList.get(i).getPath(); } return Doubles.asList(alsServingModel.dotProduct(userID, itemIDs)); }

Target:
public List<Double> get(@PathParam("userID") String userID, @PathParam("itemID") List<PathSegment> pathSegmentsList) { ServingModelManager<?> alsServingModelManager = (ServingModelManager<?>) servletContext.getAttribute(ModelManagerListener.MANAGER_KEY); ALSServingModel alsServingModel = (ALSServingModel) alsServingModelManager.getModel(); String[] itemIDs = new String[pathSegmentsList.size()]; for (int i = 0; i < itemIDs.length; i++) { itemIDs[i] = pathSegmentsList.get(i).getPath(); } return Doubles.asList(alsServingModel.dotProduct(userID, itemIDs)); }
Source:
private DatastoreConfig(final String dbName, final Config config) { final ConfigValue directory = config.root().get("migration.directory"); if (directory != null && directory.valueType() == ConfigValueType.STRING) { _directory = (String) directory.unwrapped(); } else { _directory = "cassandra/migration/" + dbName; } _hosts = config.getStringList("hosts"); _keyspace = config.getString("keyspace"); _replication = config.getObject("replication").unwrapped(); }

Target:
private DatastoreConfig(final String dbName, final Config config) { final ConfigValue directory = config.root().get("migration.directory"); if (directory != null && ConfigValueType.STRING.equals(directory.valueType())) { _directory = Paths.get((String) directory.unwrapped()); } else { _directory = Paths.get("cassandra/migration/" + dbName); } _hosts = config.getStringList("hosts"); _keyspace = config.getString("keyspace"); _replication = MAPPER.valueToTree(config.getObject("replication").unwrapped()); }
Source:
public boolean test() { shell = ShellLookup.getInstance().getCurrentActiveShell(); return shell != null ? true : false; }

Target:
public boolean test() { shell = ShellLookup.getInstance().getCurrentActiveShell(); return shell != null; }
Source:
private static Format[] getClosedCaptionsTrackFormats( List<AdaptationSet> adaptationSets, int[] adaptationSetIndices) { for (int i : adaptationSetIndices) { AdaptationSet adaptationSet = adaptationSets.get(i); List<Descriptor> descriptors = adaptationSets.get(i).accessibilityDescriptors; for (Descriptor descriptor : descriptors) { return parseClosedCaptionsDescriptor(adaptationSet.id, descriptor); } } return new Format[0]; }

Target:
private static Format[] getClosedCaptionsTrackFormats( List<AdaptationSet> adaptationSets, int[] adaptationSetIndices) { for (int i : adaptationSetIndices) { AdaptationSet adaptationSet = adaptationSets.get(i); List<Descriptor> descriptors = adaptationSets.get(i).accessibilityDescriptors; for (int j = 0; j < descriptors.size(); j++) { Descriptor descriptor = descriptors.get(j); if ("urn:scte:dash:cc:cea-608:2015".equals(descriptor.schemeIdUri)) { Format cea608Format = new Format.Builder() .setSampleMimeType(MimeTypes.APPLICATION_CEA608) .setId(adaptationSet.id + ":cea608") .build(); return parseClosedCaptionsDescriptor( descriptor, CEA608_SERVICE_DESCRIPTOR_REGEX, cea608Format); } else if ("urn:scte:dash:cc:cea-708:2015".equals(descriptor.schemeIdUri)) { Format cea708Format = new Format.Builder() .setSampleMimeType(MimeTypes.APPLICATION_CEA708) .setId(adaptationSet.id + ":cea708") .build(); return parseClosedCaptionsDescriptor( descriptor, CEA708_SERVICE_DESCRIPTOR_REGEX, cea708Format); } } } return new Format[0]; }
Source:
default ScheduledExecutorService getTimerExecutor() { return Executors.newScheduledThreadPool(1); }

Target:
default ScheduledExecutorService getTimerExecutor() { return null; }
Source:
public Credential getCredentialFromFileCredentialStoreForInstalledApp( String clientId, String clientSecret, String filePath, List<String> scopes) throws IOException, GeneralSecurityException { return getCredentialFromFileCredentialStoreForInstalledApp( clientId, clientSecret, filePath, scopes); }

Target:
public Credential getCredentialFromFileCredentialStoreForInstalledApp( String clientId, String clientSecret, String filePath, List<String> scopes) throws IOException, GeneralSecurityException { return getCredentialFromFileCredentialStoreForInstalledApp( clientId, clientSecret, filePath, scopes, getStaticHttpTransport()); }
Source:
public void setUp() throws Exception { if (!mKernelImageCheckTool.exists()) { throw new RuntimeException("Invalid kernel image tool: " + mKernelImageCheckTool); } mKernelImageFile = getBuild().getFile(mKernelImageName); mKernelAbiFile = getBuild().getFile("abi.out"); if (mKernelImageFile == null || !mKernelImageFile.exists()) { File imageDir = new File(mKernelImageAltPath); if (imageDir.isDirectory()) { mKernelImageFile = new File(imageDir, mKernelImageName); mKernelAbiFile = new File(imageDir, "abi.out"); } } if (mKernelImageFile == null || !mKernelImageFile.exists()) { throw new RuntimeException("Cannot find kernel image file: " + mKernelImageName); } }

Target:
public void setUp() throws Exception { if (!mKernelImageCheckTool.exists()) { throw new IOException("Could not find kernel image tool at: " + mKernelImageCheckTool); } if (!mKernelAbiFile.exists()) { throw new IOException("Could not find kernel ABI at: " + mKernelAbiFile); } mKernelImageFile = getBuild().getFile(mKernelImageName); if (mKernelImageFile == null || !mKernelImageFile.exists()) { File imageDir = new File(mKernelImageAltPath); if (imageDir.isDirectory()) { mKernelImageFile = new File(imageDir, mKernelImageName); } } if (mKernelImageFile == null || !mKernelImageFile.exists()) { throw new RuntimeException("Cannot find kernel image file: " + mKernelImageName); } }
Source:
private void checkSetters(ASTMethodDeclaration node, Object data, String nameOfMethod) { if (!hasIgnoredAnnotation(node)) { ASTResultType resultType = node.getResultType(); if (hasPrefix(nameOfMethod, "set") && !resultType.isVoid()) { addViolationWithMessage(data, node, "Linguistics Antipattern - The setter ''{0}'' should not return any type except void linguistically", new Object[] { nameOfMethod }); } } }

Target:
private void checkSetters(ASTMethodDeclaration node, Object data, String nameOfMethod) { ASTResultType resultType = node.getResultType(); if (hasPrefix(nameOfMethod, "set") && !resultType.isVoid()) { addViolationWithMessage(data, node, "Linguistics Antipattern - The setter ''{0}'' should not return any type except void linguistically", new Object[] { nameOfMethod }); } }
Source:
private static boolean startsWithInheritDoc(DetailNode root) { boolean flag = false; final DetailNode[] children = root.getChildren(); for (int i = 0; !flag && i < children.length - 1; i++) { final DetailNode child = children[i]; if (child.getType() == JavadocTokenTypes.JAVADOC_INLINE_TAG && child.getChildren()[1].getType() == JavadocTokenTypes.INHERIT_DOC_LITERAL) { flag = true; } else if (child.getType() != JavadocTokenTypes.LEADING_ASTERISK && !CommonUtils.isBlank(child.getText())) { break; } } return flag; }

Target:
private static boolean startsWithInheritDoc(DetailNode root) { boolean found = false; final DetailNode[] children = root.getChildren(); for (int i = 0; !found && i < children.length - 1; i++) { final DetailNode child = children[i]; if (child.getType() == JavadocTokenTypes.JAVADOC_INLINE_TAG && child.getChildren()[1].getType() == JavadocTokenTypes.INHERIT_DOC_LITERAL) { found = true; } else if (child.getType() != JavadocTokenTypes.LEADING_ASTERISK && !CommonUtils.isBlank(child.getText())) { break; } } return found; }
Source:
public Channel getChannel() { synchronized (this.consumersMonitor) { Channel channel = null; while (channel == null) { for (SimpleConsumer consumer : getConsumers()) { if (this.inUseConsumerChannels.putIfAbsent(consumer.getChannel(), Boolean.TRUE) == null) { channel = consumer.getChannel(); break; } } if (channel == null) { this.consumerCount++; super.setConsumersPerQueue(this.consumerCount); } } return channel; } }

Target:
public Channel getChannel() { synchronized (this.consumersMonitor) { Channel channel = null; while (channel == null) { if (!isRunning()) { throw new IllegalStateException("Direct reply-to container is not running"); } for (SimpleConsumer consumer : this.consumers) { Channel candidate = consumer.getChannel(); if (candidate.isOpen() && this.inUseConsumerChannels.putIfAbsent(candidate, consumer) == null) { channel = candidate; this.whenUsed.put(consumer, System.currentTimeMillis()); break; } } if (channel == null) { this.consumerCount++; super.setConsumersPerQueue(this.consumerCount); } } return channel; } }
Source:
protected Map<String, String> getProperties() { ExploreProperties.Builder builder = ExploreProperties.builder(); builder.addAll(new HashMap<>(tableSinkConfig.getProperties().getProperties())); builder.setExploreTableName(tableSinkConfig.getName()); builder.add(Properties.BatchReadableWritable.TYPE, Table.class.getName()); return builder.build().getProperties(); }

Target:
protected Map<String, String> getProperties() { ExploreProperties.Builder builder = ExploreProperties.builder(); builder.addAll(tableSinkConfig.getProperties().getProperties()); if ((tableSinkConfig.exploreName != null) && (!tableSinkConfig.exploreName.isEmpty())) { builder.setExploreTableName(tableSinkConfig.exploreName); } else { builder.setExploreTableName(tableSinkConfig.getName()); } builder.add(Properties.BatchReadableWritable.TYPE, Table.class.getName()); return builder.build().getProperties(); }
Source:
public Map<String, String> getProperties() { Map<String, String> results = new HashMap<>(); if (hashiCorpVaultToken == null) { printMisconfigurationMessage(); return results; } final WebTarget secretsTarget = client .target(configuration.getVaultAddress() + "/v1" + configuration.getPath()); final Response secretsResponse = secretsTarget .request() .accept(MediaType.APPLICATION_JSON) .header("Authorization", "Bearer " + hashiCorpVaultToken) .get(); if (secretsResponse.getStatus() != 200) { LOGGER.log(Level.WARNING, "Unable to get secrets from the vault. Make sure all the configurtaion options has been entered correctly"); return results; } try { final String secretString = readSecretString((InputStream) secretsResponse.getEntity()); try (final StringReader reader = new StringReader(secretString)) { return readMap(reader); } } catch (ProcessingException | JsonException | IOException ex) { LOGGER.log(Level.WARNING, "Unable to read secret value", ex); } return results; }

Target:
public Map<String, String> getProperties() { Map<String, String> results = new HashMap<>(); if (hashiCorpVaultToken == null) { printMisconfigurationMessage(); return results; } String secretsURL = vaultAddress + "/v1/" + secretsEnginePath + "/data/" + secretsPath; if (apiVersion == 1) { secretsURL = vaultAddress + "/v1/" + secretsEnginePath + "/" + secretsPath; } final WebTarget secretsTarget = client .target(secretsURL); final Response secretsResponse = secretsTarget .request() .accept(MediaType.APPLICATION_JSON) .header("Authorization", "Bearer " + hashiCorpVaultToken) .get(); if (secretsResponse.getStatus() != 200) { LOGGER.log(Level.WARNING, "Unable to get secrets from the vault using the following URL: " + secretsURL + ". " + "Make sure all the configurtaion options has been entered correctly and HashiCorp Vault Token is correct"); return results; } try { final String secretString = readSecretString((InputStream) secretsResponse.getEntity()); try (final StringReader reader = new StringReader(secretString)) { return readMap(reader); } } catch (ProcessingException | JsonException | IOException ex) { LOGGER.log(Level.WARNING, "Unable to read secret value", ex); } return results; }
Source:
private static RqRegex request(final String code) throws Exception { return new RqRegex.Fake( PATTERN, URLEncoder.encode(TkEmVerifyTest.ENC.encrypt(code), "UTF-8") ); }

Target:
private static RqRegex request(final String code) throws Exception { return new RqRegex.Fake( TkEmVerifyTest.PATTERN, URLEncoder.encode(TkEmVerifyTest.ENC.encrypt(code), "UTF-8") ); }
Source:
protected boolean moveSegment( final BalancerSegmentHolder segment, final ImmutableDruidServer toServer, final DruidCoordinatorRuntimeParams params ) { final LoadQueuePeon toPeon = params.getLoadManagementPeons().get(toServer.getName()); final ImmutableDruidServer fromServer = segment.getFromServer(); final DataSegment segmentToMove = segment.getSegment(); final String segmentName = segmentToMove.getIdentifier(); if (!toPeon.getSegmentsToLoad().contains(segmentToMove) && (toServer.getSegment(segmentName) == null) && new ServerHolder(toServer, toPeon).getAvailableSize() > segmentToMove.getSize()) { log.info("Moving [%s] from [%s] to [%s]", segmentName, fromServer.getName(), toServer.getName()); LoadPeonCallback callback = null; try { Map<String, BalancerSegmentHolder> movingSegments = currentlyMovingSegments.get(toServer.getTier()); movingSegments.put(segmentName, segment); callback = () -> movingSegments.remove(segmentName); coordinator.moveSegment( fromServer, toServer, segmentToMove, callback ); return true; } catch (Exception e) { log.makeAlert(e, StringUtils.format("[%s] : Moving exception", segmentName)).emit(); if (callback != null) { callback.execute(); } } } return false; }

Target:
protected boolean moveSegment( final BalancerSegmentHolder segment, final ImmutableDruidServer toServer, final DruidCoordinatorRuntimeParams params ) { final LoadQueuePeon toPeon = params.getLoadManagementPeons().get(toServer.getName()); final ImmutableDruidServer fromServer = segment.getFromServer(); final DataSegment segmentToMove = segment.getSegment(); final SegmentId segmentId = segmentToMove.getId(); if (!toPeon.getSegmentsToLoad().contains(segmentToMove) && (toServer.getSegment(segmentId) == null) && new ServerHolder(toServer, toPeon).getAvailableSize() > segmentToMove.getSize()) { log.debug("Moving [%s] from [%s] to [%s]", segmentId, fromServer.getName(), toServer.getName()); LoadPeonCallback callback = null; try { ConcurrentMap<SegmentId, BalancerSegmentHolder> movingSegments = currentlyMovingSegments.get(toServer.getTier()); movingSegments.put(segmentId, segment); callback = () -> movingSegments.remove(segmentId); coordinator.moveSegment( fromServer, toServer, segmentToMove, callback ); return true; } catch (Exception e) { log.makeAlert(e, StringUtils.format("[%s] : Moving exception", segmentId)).emit(); if (callback != null) { callback.execute(); } } } return false; }
Source:
public void dispose() { for (Object element : cache) { ((EditorContribution) element).dispose(); } }

Target:
public void dispose() { for (Object contribution : cache) { ((EditorContribution) contribution).dispose(); } }
Source:
private Writer getWriter(XMLResource res, File dest) throws XMLDBException, FileNotFoundException { final Writer writer; if (dest.isDirectory()) { String fname = res.getId(); final File file = new File(dest, fname); writer = new OutputStreamWriter(new FileOutputStream(file), UTF_8); } else { writer = new OutputStreamWriter(new FileOutputStream(dest), UTF_8); } return writer; }

Target:
private Writer getWriter(XMLResource res, File dest) throws XMLDBException, IOException { final Writer writer; if (dest.isDirectory()) { final Path file = dest.toPath().resolve(res.getId()); writer = Files.newBufferedWriter(file, UTF_8); } else { writer = Files.newBufferedWriter(destFile.toPath(), UTF_8); } return writer; }
Source:
public ValidationResult validateDiskNotAlreadyExistOnDB(List<DiskImage> images, boolean allowPartial, Map<Guid, Guid> imageToDestinationDomainMap, Map<Guid, String> failedDisksToImport) { for (DiskImage image : new ArrayList<>(images)) { DiskImage diskImage = getDiskImageDao().get(image.getImageId()); if (diskImage != null) { log.info("Disk '{}' with id '{}', already exist on storage domain '{}'", diskImage.getDiskAlias(), diskImage.getImageId(), diskImage.getStoragesNames().get(0)); if (!allowPartial) { return new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_IMPORT_DISKS_ALREADY_EXIST, String.format("$diskAlias %s", diskImage.getDiskAlias())); } failedDisksToImport.putIfAbsent(image.getId(), image.getDiskAlias()); imageToDestinationDomainMap.remove(image.getId()); images.remove(image); } } return ValidationResult.VALID; }

Target:
public ValidationResult validateDiskNotAlreadyExistOnDB(List<DiskImage> images, boolean allowPartial, Map<Guid, Guid> imageToDestinationDomainMap, Map<Guid, String> failedDisksToImport) { for (DiskImage image : images) { DiskImage diskImage = getDiskImageDao().get(image.getImageId()); if (diskImage != null) { log.info("Disk '{}' with id '{}', already exist on storage domain '{}'", diskImage.getDiskAlias(), diskImage.getImageId(), diskImage.getStoragesNames().get(0)); if (!allowPartial) { return new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_IMPORT_DISKS_ALREADY_EXIST, String.format("$diskAlias %s", diskImage.getDiskAlias())); } failedDisksToImport.putIfAbsent(image.getId(), image.getDiskAlias()); imageToDestinationDomainMap.remove(image.getId()); images.remove(image); } } return ValidationResult.VALID; }
Source:
public void testInvalidContentDRL() throws Exception { final String error102 = "[ERR 102] Line 1:7 mismatched input ''"; final String error107 = "[ERR 107] Line 1:0 mismatched input 'asd' " + "expecting one of the following tokens: " + "'[package, unit, import, global, declare, function, rule, query]'."; final String errorPackage = "Parser returned a null Package"; final String regexpExpression = "\\A\\[(.*?)\\][:]\\s"; validateResource(INVALID_CONTENT_DRL); Assertions.assertThat(validationMessages).hasSize(6); Assertions.assertThat(validationMessages .stream() .map(validationMessage -> validationMessage .getText() .replaceAll(regexpExpression, ""))) .contains(error102, error107, errorPackage); }

Target:
public void testInvalidContentDRL() throws Exception { final String error102 = "[ERR 102] Line 1:7 mismatched input ''"; final String error107 = "[ERR 107] Line 1:0 mismatched input 'asd' " + "expecting one of the following tokens: " + "'[package, unit, import, global, declare, function, rule, query]'."; final String errorPackage = "Parser returned a null Package"; final String regexpExpression = "\\A\\[(.*?)\\][:]\\s"; validateResource(INVALID_CONTENT_DRL); Assertions.assertThat(validationMessages).hasSize(6); Assertions.assertThat(validationMessages .stream() .map(validationMessage -> validationMessage .getText() .replaceAll(regexpExpression, ""))) .containsOnly(error102, error107, errorPackage); }
Source:
Stream<DynamicTest> runFastAndFullAssert() { checkRunTurtleTests(); CommonApp<Solution_> commonApp = createCommonApp(); ProblemFactory<Solution_> problemFactory = createProblemFactory(commonApp); return getSolutionFiles(commonApp).stream() .map(solutionFile -> DynamicTest.dynamicTest(solutionFile.getName(), () -> runFastAndFullAssert( buildSolverConfig(commonApp.getSolverConfigResource()), problemFactory.loadProblem(solutionFile) ))); }

Target:
Stream<DynamicTest> runFastAndFullAssert() { CommonApp<Solution_> commonApp = createCommonApp(); ProblemFactory<Solution_> problemFactory = createProblemFactory(commonApp); return getSolutionFiles(commonApp).stream() .map(solutionFile -> dynamicTest(solutionFile.getName(), () -> runFastAndFullAssert( buildSolverConfig(commonApp.getSolverConfigResource()), problemFactory.loadProblem(solutionFile) ))); }
Source:
public final void updateSliders() { getChart().getXYPlot().clearAnnotations(); final ValueAxis domainAxis = getChart().getXYPlot().getDomainAxis(); final ValueAxis rangeAxis = getChart().getXYPlot().getRangeAxis(); final double SLIDER_CONST = 0.001; if (horizontalMaximum - domainAxis.getRange().getUpperBound() > SLIDER_CONST) { horizontalSlider.setVisible(true); horizontalSlider.setEnabled(true); horizontalRatio = horizontalSlider.getMaximum() / horizontalMaximum; horizontalSlider.setThumb( (int) Math.round((domainAxis.getUpperBound() - domainAxis.getLowerBound()) * horizontalRatio)); horizontalSlider.setSelection((int) Math.round(domainAxis.getLowerBound() * horizontalRatio)); } else { horizontalSlider.setVisible(false); horizontalSlider.setEnabled(false); } if (verticalMaximum - rangeAxis.getRange().getUpperBound() > SLIDER_CONST) { verticalSlider.setVisible(true); verticalSlider.setEnabled(true); verticalRatio = verticalSlider.getMaximum() / verticalMaximum; verticalSlider.setThumb( (int) Math.round((rangeAxis.getUpperBound() - rangeAxis.getLowerBound()) * verticalRatio)); verticalSlider .setSelection((int) Math.round((verticalMaximum - rangeAxis.getUpperBound()) * verticalRatio)); } else { verticalSlider.setVisible(false); verticalSlider.setEnabled(false); } }

Target:
public final void updateSliders() { getChart().getXYPlot().clearAnnotations(); final ValueAxis domainAxis = getChart().getXYPlot().getDomainAxis(); final ValueAxis rangeAxis = getChart().getXYPlot().getRangeAxis(); final double SLIDER_EPSILON = 0.001; if (Math.abs(horizontalMaximum - domainAxis.getRange().getUpperBound()) > SLIDER_EPSILON) { horizontalSlider.setVisible(true); horizontalSlider.setEnabled(true); horizontalRatio = horizontalSlider.getMaximum() / horizontalMaximum; horizontalSlider.setThumb( (int) Math.round((domainAxis.getUpperBound() - domainAxis.getLowerBound()) * horizontalRatio)); horizontalSlider.setSelection((int) Math.round(domainAxis.getLowerBound() * horizontalRatio)); } else { horizontalSlider.setVisible(false); horizontalSlider.setEnabled(false); } if (Math.abs(verticalMaximum - rangeAxis.getRange().getUpperBound()) > SLIDER_EPSILON) { verticalSlider.setVisible(true); verticalSlider.setEnabled(true); verticalRatio = verticalSlider.getMaximum() / verticalMaximum; verticalSlider.setThumb( (int) Math.round((rangeAxis.getUpperBound() - rangeAxis.getLowerBound()) * verticalRatio)); verticalSlider .setSelection((int) Math.round((verticalMaximum - rangeAxis.getUpperBound()) * verticalRatio)); } else { verticalSlider.setVisible(false); verticalSlider.setEnabled(false); } }
Source:
public void onHighAlchemistJoin(cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent evt) { if (true) { ChatComponentText joinMsg = new ChatComponentText(String.format( EnumChatFormatting.BLUE + StatCollector.translateToLocal("pe.server.high_alchemist") + EnumChatFormatting.GOLD + " %s " + EnumChatFormatting.BLUE + StatCollector.translateToLocal("pe.server.has_joined"), evt.player.getDisplayName())); MinecraftServer.getServer().getConfigurationManager().sendChatMsg(joinMsg); } }

Target:
public void onHighAlchemistJoin(cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent evt) { if (PECore.uuids.contains((evt.player.getUniqueID().toString()))) { ChatComponentText joinMsg = new ChatComponentText(String.format( EnumChatFormatting.BLUE + StatCollector.translateToLocal("pe.server.high_alchemist") + EnumChatFormatting.GOLD + " %s " + EnumChatFormatting.BLUE + StatCollector.translateToLocal("pe.server.has_joined"), evt.player.getDisplayName())); MinecraftServer.getServer().getConfigurationManager().sendChatMsg(joinMsg); } }
Source:
private static CompletableFuture<Exception> publishItem( final Producer<String, String> producer, final String topicId, final BatchItem item) throws EventPublishingException { try { final CompletableFuture<Exception> result = new CompletableFuture<>(); final ProducerRecord<String, String> kafkaRecord = new ProducerRecord<>( topicId, toKafkaPartition(item.getPartition()), item.getPartition(), item.getEvent().toString()); producer.send(kafkaRecord, ((metadata, exception) -> { if (null != exception) { item.setStep(EventPublishingStep.FAILED_PUBLISH); item.updateStatusAndDetail(EventPublishingStatus.FAILED, "internal error"); result.complete(exception); } else { item.setStep(EventPublishingStep.PUBLISHED); item.updateStatusAndDetail(EventPublishingStatus.SUBMITTED, ""); result.complete(null); } })); return result; } catch (final InterruptException e) { Thread.currentThread().interrupt(); item.updateStatusAndDetail(EventPublishingStatus.FAILED, "internal error"); throw new EventPublishingException("Error publishing message to kafka", e); } catch (final RuntimeException e) { item.updateStatusAndDetail(EventPublishingStatus.FAILED, "internal error"); throw new EventPublishingException("Error publishing message to kafka", e); } }

Target:
private static CompletableFuture<Exception> publishItem( final Producer<String, String> producer, final String topicId, final BatchItem item) throws EventPublishingException { try { final CompletableFuture<Exception> result = new CompletableFuture<>(); final ProducerRecord<String, String> kafkaRecord = new ProducerRecord<>( topicId, toKafkaPartition(item.getPartition()), item.getPartition(), item.getEvent().toString()); producer.send(kafkaRecord, ((metadata, exception) -> { if (null != exception) { item.updateStatusAndDetail(EventPublishingStatus.FAILED, "internal error"); result.complete(exception); } else { item.updateStatusAndDetail(EventPublishingStatus.SUBMITTED, ""); result.complete(null); } })); return result; } catch (final InterruptException e) { Thread.currentThread().interrupt(); item.updateStatusAndDetail(EventPublishingStatus.FAILED, "internal error"); throw new EventPublishingException("Error publishing message to kafka", e); } catch (final RuntimeException e) { item.updateStatusAndDetail(EventPublishingStatus.FAILED, "internal error"); throw new EventPublishingException("Error publishing message to kafka", e); } }
Source:
private void postNicInit() { initSelectedType(); getName().setEntity(AsyncDataProvider.getNewNicName(getVmNicList())); initMAC(); if (!hotPlugSupported) { getPlugged().setChangeProhibitionReason(ConstantsManager.getInstance() .getMessages() .hotPlugNotSupported(getClusterCompatibilityVersion().toString())); } getPlugged().setIsChangable(hotPlugSupported || vmStatus.equals(VMStatus.Down)); getPlugged().setEntity(hotPlugSupported || vmStatus.equals(VMStatus.Down)); initLinked(); initProfiles(); initCommands(); }

Target:
private void postNicInit() { initSelectedType(); getName().setEntity(AsyncDataProvider.getNewNicName(getVmNicList())); initMAC(); if (!hotPlugSupported) { getPlugged().setChangeProhibitionReason(ConstantsManager.getInstance() .getMessages() .hotPlugNotSupported(getClusterCompatibilityVersion().toString())); } getPlugged().setIsChangable(allowHotPlug()); getPlugged().setEntity(allowHotPlug()); initLinked(); initProfiles(); initCommands(); }
Source:
private PreUploadHookChain(List<PreUploadHook> hooks) { this.hooks = new ArrayList<>(hooks); }

Target:
private PreUploadHookChain(List<PreUploadHook> hooks) { this.hooks = Collections.unmodifiableList(hooks); }
Source:
public static String removeEnclosingSquareBrackets(String str) { if (str != null) { String trimmedString = str.trim(); if (trimmedString.startsWith("[") && trimmedString.endsWith("]")) { return trimmedString.substring(1, trimmedString.length() - 1).trim(); } } return str; }

Target:
public static String removeEnclosingSquareBrackets(String str) { if (str == null) { return null; } if (!str.startsWith("[") || !str.endsWith("]")) { return str; } return str.substring(1, str.length() - 1); }
Source:
private List<AuditEntry> getRuleHistory( final String dataSourceName, final String interval, final Integer count ) throws IllegalArgumentException { Interval theInterval = interval == null ? null : new Interval(interval); if (theInterval == null && count != null) { if (dataSourceName != null) { return auditManager.fetchAuditHistory(dataSourceName, "rules", count); } return auditManager.fetchAuditHistory("rules", count); } if (dataSourceName != null) { return auditManager.fetchAuditHistory(dataSourceName, "rules", theInterval); } return auditManager.fetchAuditHistory("rules", theInterval); }

Target:
private List<AuditEntry> getRuleHistory( final String dataSourceName, final String interval, final Integer count ) throws IllegalArgumentException { if (interval == null && count != null) { if (dataSourceName != null) { return auditManager.fetchAuditHistory(dataSourceName, "rules", count); } return auditManager.fetchAuditHistory("rules", count); } Interval theInterval = interval == null ? null : new Interval(interval); if (dataSourceName != null) { return auditManager.fetchAuditHistory(dataSourceName, "rules", theInterval); } return auditManager.fetchAuditHistory("rules", theInterval); }
Source:
public void setCustomDisplayName(String name) { ((TileEntityLockableLoot) (Object) this).setCustomName(name); }

Target:
public void setCustomDisplayName(String name) { setCustomName(name); }
Source:
private static void handleDeleteDialog(boolean deleteResources, SWTWorkbenchBot bot) { SWTBotShell parentShell = bot.shell("Delete Resources"); if (deleteResources) { parentShell.setFocus(); final SWTBotCheckBox checkBox = bot.checkBox(); bot.waitUntil(Conditions.widgetIsEnabled(checkBox)); checkBox.click(); } final SWTBotButton okButton = bot.button("OK"); bot.waitUntil(Conditions.widgetIsEnabled(okButton)); okButton.click(); bot.waitWhile(new DefaultCondition() { @Override public boolean test() throws Exception { boolean deleteShellFound = false; for (SWTBotShell shell : bot.shells()) { if (shell.getText().equals("Delete Resources")) { deleteShellFound = true; if (shell.widget != parentShell.widget) { shell.bot().button("Continue").click(); } } } return deleteShellFound; } @Override public String getFailureMessage() { return "Unable to delete project the project"; } }); }

Target:
private static void handleDeleteDialog(boolean deleteResources, SWTWorkbenchBot bot) { SWTBotShell parentShell = bot.shell("Delete Resources"); if (deleteResources) { parentShell.setFocus(); final SWTBotCheckBox checkBox = parentShell.bot().checkBox(); checkBox.click(); } final SWTBotButton okButton = parentShell.bot().button("OK"); okButton.click(); bot.waitWhile(new DefaultCondition() { @Override public boolean test() throws Exception { boolean deleteShellFound = false; for (SWTBotShell shell : bot.shells()) { if (shell.getText().equals("Delete Resources")) { deleteShellFound = true; if (shell.widget != parentShell.widget) { shell.bot().button("Continue").click(); } } } return deleteShellFound; } @Override public String getFailureMessage() { return "Delete Resources shell did not close"; } }); }
Source:
protected IndentLevel getChildrenExpectedIndent() { final IndentLevel expectedIndent = new IndentLevel(getIndent(), getIndentCheck().getArrayInitIndent(), getLineWrappingIndentation()); final int firstLine = getFirstLine(Integer.MAX_VALUE, getListChild()); final int lcurlyPos = expandedTabsColumnNo(getLeftCurly()); final int firstChildPos = getNextFirstNonBlankOnLineAfter(firstLine, lcurlyPos); if (firstChildPos >= 0) { expectedIndent.addAcceptedIndent(firstChildPos); expectedIndent.addAcceptedIndent(lcurlyPos + getLineWrappingIndentation()); } return expectedIndent; }

Target:
protected IndentLevel getChildrenExpectedIndent() { final IndentLevel expectedIndent = new IndentLevel(getIndent(), getIndentCheck().getArrayInitIndent(), getIndentCheck().getLineWrappingIndentation()); final int firstLine = getFirstLine(Integer.MAX_VALUE, getListChild()); final int lcurlyPos = expandedTabsColumnNo(getLeftCurly()); final int firstChildPos = getNextFirstNonBlankOnLineAfter(firstLine, lcurlyPos); if (firstChildPos >= 0) { expectedIndent.addAcceptedIndent(firstChildPos); expectedIndent.addAcceptedIndent(lcurlyPos + getLineWrappingIndentation()); } return expectedIndent; }
Source:
protected URL[] getRedirectURLs(RepoObject repoObject) throws RepoException{ URL[] urls = null; try { String[] paths = getFilePaths(repoObject); if( paths != null && paths.length > 0 ) { int pathCount = paths.length; urls = new URL[pathCount]; for (int i = 0; i < pathCount; i++) { urls[i] = new URL(paths[i]); } } else { urls = new URL[0]; repoObject.setStatus(Status.MISSING_DATA); log.info(" Missing Data when trying to fetch reproxy url, key: , bucket name: , content checksum: , version number: ", repoObject.getKey(), repoObject.getBucketName(), repoObject.getChecksum(), repoObject.getVersionNumber()); } } catch (MalformedURLException e) { throw new RepoException(RepoException.Type.ServerError); } catch (Exception e) { throw new RepoException(e); } return urls; }

Target:
protected URL[] getRedirectURLs(RepoObject repoObject) throws RepoException{ URL[] urls = new URL[0]; try { String[] paths = getFilePaths(repoObject); if(paths.length > 0) { int pathCount = paths.length; urls = new URL[pathCount]; for (int i = 0; i < pathCount; i++) { urls[i] = new URL(paths[i]); } } } catch (RepoException e){ if(RepoException.Type.ObjectFilePathMissing.equals(e.getType()) ) { repoObject.setStatus(Status.MISSING_DATA); log.error(" Missing Data when trying to fetch reproxy url, key: , bucket name: , content checksum: , version number: ", repoObject.getKey(), repoObject.getBucketName(), repoObject.getChecksum(), repoObject.getVersionNumber()); } else { throw e; } } catch (MalformedURLException e) { throw new RepoException(RepoException.Type.ServerError); } catch (Exception e) { throw new RepoException(e); } return urls; }
Source:
private ExecRow buildTemplateRow(DataTypeDescriptor[] dataTypeDescriptors) throws StandardException{ ExecRow row = new ValueRow(dataTypeDescriptors.length); int outputCol = 0; for (DataTypeDescriptor dtd : dataTypeDescriptors) { row.setColumn(outputCol + 1, dtd.getNull()); if (row.getColumn(outputCol + 1 ) instanceof SQLDecimal) { ((SQLDecimal) row.getColumn(outputCol + 1)).setPrecision(dtd.getPrecision()); ((SQLDecimal) row.getColumn(outputCol + 1)).setScale(dtd.getScale()); } outputCol++; } return row; }

Target:
private ExecRow buildTemplateRow(DataTypeDescriptor[] dataTypeDescriptors) throws StandardException{ ExecRow row = new ValueRow(dataTypeDescriptors.length); int outputCol = 0; for (DataTypeDescriptor dtd : dataTypeDescriptors) { row.setColumn(outputCol + 1, dtd.getNull()); outputCol++; } return row; }
Source:
public Map<String, String> getExtensionArtifacts(final String extensionName) throws FalconException { Map<String, String> extensionFileMap = new HashMap<>(); Path extensionPath; try { RemoteIterator<LocatedFileStatus> fileStatusListIterator; if (AbstractExtension.isExtensionTrusted(extensionName)){ extensionPath = new Path(storePath, extensionName.toLowerCase()); fileStatusListIterator = fs.listFiles(extensionPath, true); }else{ ExtensionBean extensionBean = metaStore.getDetail(extensionName); extensionPath = new Path(extensionBean.getLocation()); FileSystem fileSystem = getHdfsFileSystem(extensionBean.getLocation()); fileStatusListIterator = fileSystem.listFiles(extensionPath, true); } if (!fileStatusListIterator.hasNext()) { throw new StoreAccessException(new Exception(" For extension " + extensionName + " there are no artifacts at the extension store path " + storePath)); } while (fileStatusListIterator.hasNext()) { LocatedFileStatus fileStatus = fileStatusListIterator.next(); Path filePath = fileStatus.getPath(); extensionFileMap.put(filePath.getName(), filePath.toString()); } } catch (IOException e) { throw new StoreAccessException(e); } return extensionFileMap; }

Target:
public Map<String, String> getExtensionArtifacts(final String extensionName) throws FalconException { Map<String, String> extensionFileMap = new HashMap<>(); Path extensionPath; try { RemoteIterator<LocatedFileStatus> fileStatusListIterator; if (AbstractExtension.isExtensionTrusted(extensionName)){ extensionPath = new Path(storePath, extensionName.toLowerCase()); fileStatusListIterator = fs.listFiles(extensionPath, true); }else{ ExtensionBean extensionBean = metaStore.getDetail(extensionName); extensionPath = new Path(extensionBean.getLocation()); FileSystem fileSystem = getHdfsFileSystem(extensionBean.getLocation()); fileStatusListIterator = fileSystem.listFiles(extensionPath, true); } if (!fileStatusListIterator.hasNext()) { throw new StoreAccessException(" For extension " + extensionName + " there are no artifacts at the extension store path " + storePath); } while (fileStatusListIterator.hasNext()) { LocatedFileStatus fileStatus = fileStatusListIterator.next(); Path filePath = fileStatus.getPath(); extensionFileMap.put(filePath.getName(), filePath.toString()); } } catch (IOException e) { throw new StoreAccessException(e); } return extensionFileMap; }
Source:
private void score(final String id) { if (id.equals(Plus.PeopleApi.getCurrentPerson(getGoogleApiClient()).getId())) { Toast.makeText(this, R.string.arrow_selfie, Toast.LENGTH_LONG).show(); return; } storeInAppState(id); storeInSnapshot(id, null, 0); }

Target:
private void score(final String id) { if (id.equals(Plus.PeopleApi.getCurrentPerson(getGoogleApiClient()).getId())) { Toast.makeText(this, R.string.arrow_selfie, Toast.LENGTH_LONG).show(); return; } new StoreSnapshotTask(getGoogleApiClient()).execute(id); }