auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static IBlockState getBlockState(String name, String properties) { IBlockState iBlock = null; Block block = ForgeRegistries.BLOCKS.getValue(new ResourceLocation(name)); if (block != null) { iBlock = new MCBlockState(block.getDefaultState()); if (properties != null && properties.length() > 0) { for (String propertyPair : properties.split(",")) { String[] splitPair = propertyPair.split("="); if (splitPair.length != 2) return null; iBlock = iBlock.withProperty(splitPair[0], splitPair[1]); } } } return iBlock; }

Target:
public static IBlockState getBlockState(String name, String properties) { IBlockState blockState = null; if (!ForgeRegistries.BLOCKS.containsKey(new ResourceLocation(name))) { CraftTweakerAPI.logError("No block found with name '" + name + "'. Air block used instead."); } Block block = ForgeRegistries.BLOCKS.getValue(new ResourceLocation(name)); if (block != null) { blockState = new MCBlockState(block.getDefaultState()); if (properties != null && properties.length() > 0) { for (String propertyPair : properties.split(",")) { String[] splitPair = propertyPair.split("="); if (splitPair.length != 2) { CraftTweakerAPI.logWarning("Invalid blockstate property format '" + propertyPair + "'. Using default property value."); continue; } blockState = blockState.withProperty(splitPair[0], splitPair[1]); } } } return blockState; }
Source:
public SeekableByteChannel open( final StorageResourceId resourceId, GoogleCloudStorageReadOptions readOptions) throws IOException { logger.atFine().log("open(%s, %s)", resourceId, readOptions); Preconditions.checkArgument( resourceId.isStorageObject(), "Expected full StorageObject id, got %s", resourceId); GoogleCloudStorageItemInfo info; if (readOptions.getFastFailOnNotFound()) { info = getItemInfo(resourceId); if (!info.exists()) { throw createFileNotFoundException( resourceId.getBucketName(), resourceId.getObjectName(), null); } } else { info = null; } return new GoogleCloudStorageReadChannel( gcs, resourceId, errorExtractor, clientRequestHelper, readOptions) { @Override @Nullable protected GoogleCloudStorageItemInfo getInitialMetadata() { return info; } @Override protected Storage.Objects.Get createRequest() throws IOException { Storage.Objects.Get getObject = super.createRequest(); setEncryptionHeaders(getObject); return configureRequest(getObject, resourceId.getBucketName()); } }; }

Target:
public SeekableByteChannel open( final StorageResourceId resourceId, GoogleCloudStorageReadOptions readOptions) throws IOException { logger.atFine().log("open(%s, %s)", resourceId, readOptions); Preconditions.checkArgument( resourceId.isStorageObject(), "Expected full StorageObject id, got %s", resourceId); GoogleCloudStorageItemInfo info; if (readOptions.getFastFailOnNotFound()) { info = getItemInfo(resourceId); if (!info.exists()) { throw createFileNotFoundException( resourceId.getBucketName(), resourceId.getObjectName(), null); } } else { info = null; } return new GoogleCloudStorageReadChannel( gcs, resourceId, errorExtractor, clientRequestHelper, readOptions) { @Override @Nullable protected GoogleCloudStorageItemInfo getInitialMetadata() { return info; } @Override protected Storage.Objects.Get createRequest() throws IOException { return configureRequest(super.createRequest(), resourceId.getBucketName()); } }; }
Source:
public Req understand(final Comment.Smart comment, final URI home) throws IOException { final Req req; final List<String> logins = new ListOf<>( new Mapped<>( input -> input.toLowerCase(Locale.ENGLISH), this.profile.read().xpath(this.xpath) ) ); final boolean legal = logins.isEmpty() || logins.contains( comment.author().login().toLowerCase(Locale.ENGLISH) ); if (legal) { req = this.origin.understand(comment, home); } else { new Answer(comment).post( true, String.format( QnByArchitect.PHRASES.getString("QnByArchitect.denied"), logins.get(0).toLowerCase(Locale.ENGLISH) ) ); req = Req.DONE; } return req; }

Target:
public Req understand(final Comment.Smart comment, final URI home) throws IOException { final Req req; final SolidList<String> logins = new SolidList<>( new Mapped<>( input -> input.toLowerCase(Locale.ENGLISH), this.profile.read().xpath(this.xpath) ) ); final boolean legal = logins.isEmpty() || logins.contains( comment.author().login().toLowerCase(Locale.ENGLISH) ); if (legal) { req = this.origin.understand(comment, home); } else { new Answer(comment).post( true, String.format( QnByArchitect.PHRASES.getString("QnByArchitect.denied"), logins.get(0).toLowerCase(Locale.ENGLISH) ) ); req = Req.DONE; } return req; }
Source:
public <Msg> void identifier(MessageAdapter<Msg> adapter, Msg message, SpanCustomizer customizer) { String identifier = adapter.identifier(message); if (identifier != null) { customizer.tag(adapter.identifierTagKey(), adapter.identifier(message)); } }

Target:
public <Msg> void identifier(MessageAdapter<Msg> adapter, Msg message, SpanCustomizer customizer) { String identifier = adapter.identifier(message); if (identifier != null) { customizer.tag(adapter.identifierTagKey(), identifier); } }
Source:
public PrefetchableAndPredicate(Predicate<ChangeData>... that) { super(that); }

Target:
PrefetchableAndPredicate(Predicate<ChangeData>... that) { super(that); }
Source:
protected File writeFileContent(String fileContent) throws IOException { new RenderingManager().render( this.outputDirectory, this.applicationTemplate, this.applicationDirectory, Renderer.FOP, options ); File index_fo = new File( this.outputDirectory, "index.fo" ); File index_pdf = new File( this.outputDirectory, "index.pdf" ); InputStream conf = getClass().getResourceAsStream( "/fop.xconf" ); File fopConfig = new File( this.outputDirectory, "fop.xconf" ); Utils.copyStream( conf, fopConfig ); OutputStream out = null; try { out = new BufferedOutputStream( new FileOutputStream(index_pdf) ); FopFactory fopFactory = FopFactory.newInstance( fopConfig ); Fop fop = fopFactory.newFop( "application/pdf", out ); Source src = new StreamSource( index_fo ); TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = factory.newTransformer(); Result res = new SAXResult(fop.getDefaultHandler()); transformer.transform(src, res); } catch (SAXException e) { e.printStackTrace(); } catch (TransformerConfigurationException e) { e.printStackTrace(); } catch (TransformerException e) { e.printStackTrace(); } finally { Utils.closeQuietly ( out ); } return index_pdf; }

Target:
protected File writeFileContent(String fileContent) throws IOException { new RenderingManager().render( this.outputDirectory, this.applicationTemplate, this.applicationDirectory, Renderer.FOP, options ); File index_fo = new File( this.outputDirectory, "index.fo" ); File index_pdf = new File( this.outputDirectory, "index.pdf" ); InputStream conf = getClass().getResourceAsStream( "/fop.xconf" ); File fopConfig = new File( this.outputDirectory, "fop.xconf" ); Utils.copyStream( conf, fopConfig ); OutputStream out = null; try { out = new BufferedOutputStream( new FileOutputStream(index_pdf) ); FopFactory fopFactory = FopFactory.newInstance( fopConfig ); Fop fop = fopFactory.newFop( "application/pdf", out ); Source src = new StreamSource( index_fo ); TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = factory.newTransformer(); Result res = new SAXResult(fop.getDefaultHandler()); transformer.transform(src, res); } catch ( Exception e) { throw new IOException( e ); } finally { Utils.closeQuietly ( out ); } return index_pdf; }
Source:
public void testFindNew() throws NoSuchFieldException, IllegalAccessException, ExecutionException, InterruptedException { long startTime = System.currentTimeMillis(); MetadataStorageConnectorConfig config = new MetadataStorageConnectorConfig(); Field uriField = MetadataStorageConnectorConfig.class.getDeclaredField("connectURI"); uriField.setAccessible(true); uriField.set(config, connectionURI); final JDBCExtractionNamespace extractionNamespace = new JDBCExtractionNamespace( namespace, config, tableName, keyName, valName, tsColumn, new Period(10) ); extractionCacheManager.schedule(extractionNamespace); while (!fnCache.containsKey(extractionNamespace.getNamespace())) { Thread.sleep(1); Assert.assertTrue("Timeout waiting on fn cache update", System.currentTimeMillis() - startTime < 30_000); } Function<String, String> extractionFn = fnCache.get(extractionNamespace.getNamespace()); Assert.assertEquals( "sanity check", "bar", extractionFn.apply("foo") ); insertValues("foo", "baz", "2900-01-01 00:00:00"); startTime = System.currentTimeMillis(); long pre = 0L; synchronized (updateLock) { pre = updates.get(); } do { Thread.sleep(1); synchronized (updateLock) { Assert.assertTrue("Failed waiting for update", System.currentTimeMillis() - startTime < 10_000); } } while (updates.get() < pre + 2); extractionFn = fnCache.get(extractionNamespace.getNamespace()); Assert.assertEquals( "update check", "baz", extractionFn.apply("foo") ); Assert.assertTrue("Delete failed", extractionCacheManager.delete(namespace)); }

Target:
public void testFindNew() throws NoSuchFieldException, IllegalAccessException, ExecutionException, InterruptedException { final JDBCExtractionNamespace extractionNamespace = ensureNamespace(); assertUpdated(extractionNamespace.getNamespace(), "foo", "bar"); insertValues("foo", "baz", "2900-01-01 00:00:00"); assertUpdated(extractionNamespace.getNamespace(), "foo", "baz"); }
Source:
public RinAndSeriInseparable(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}{G}{W}"); this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.DOG); this.subtype.add(SubType.CAT); this.power = new MageInt(4); this.toughness = new MageInt(4); this.addAbility(new SpellCastControllerTriggeredAbility( new CreateTokenEffect(new CatToken3()), dogSpellFilter, false )); this.addAbility(new SpellCastControllerTriggeredAbility( new CreateTokenEffect(new DogToken2()), catSpellFilter, false )); Effect damageEffect = new DamageTargetEffect(new DynamicValue() { @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { return game.getBattlefield().count(dogPermanentFilter, sourceAbility.getSourceId(), sourceAbility.getControllerId(), game); } @Override public DynamicValue copy() { return this; } @Override public String getMessage() { return "Dogs you control"; } }); damageEffect.setText("{source} deals damage to any target equal to the number of Dogs you control"); Effect lifeGainEffect = new GainLifeEffect(new DynamicValue() { @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { return game.getBattlefield().count(catPermanentFilter, sourceAbility.getSourceId(), sourceAbility.getControllerId(), game); } @Override public DynamicValue copy() { return this; } @Override public String getMessage() { return "Cats you control"; } }); lifeGainEffect.setText("You gain life equal to the number of Cats you control."); Ability ability = new SimpleActivatedAbility(damageEffect, new ManaCostsImpl("{R}{G}{W}")); ability.addTarget(new TargetAnyTarget()); ability.addEffect(lifeGainEffect); this.addAbility(ability); }

Target:
public RinAndSeriInseparable(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}{G}{W}"); this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.DOG); this.subtype.add(SubType.CAT); this.power = new MageInt(4); this.toughness = new MageInt(4); this.addAbility(new SpellCastControllerTriggeredAbility( new CreateTokenEffect(new GreenCatToken()), dogSpellFilter, false )); this.addAbility(new SpellCastControllerTriggeredAbility( new CreateTokenEffect(new WhiteDogToken()), catSpellFilter, false )); DynamicValue dogCount = new PermanentsOnBattlefieldCount(dogPermanentFilter); Effect damageEffect = new DamageTargetEffect(dogCount); damageEffect.setText("{source} deals damage to any target equal to the number of Dogs you control"); DynamicValue catCount = new PermanentsOnBattlefieldCount(catPermanentFilter); Effect lifeGainEffect = new GainLifeEffect(catCount); lifeGainEffect.setText("You gain life equal to the number of Cats you control"); Ability ability = new SimpleActivatedAbility(damageEffect, new ManaCostsImpl("{R}{G}{W}")); ability.addEffect(lifeGainEffect); ability.addTarget(new TargetAnyTarget()); ability.addHint(new ValueHint("Dogs you control", dogCount)); ability.addHint(new ValueHint("Cats you control", catCount)); this.addAbility(ability); }
Source:
public Preview.PreviewSurfaceProvider getPreviewSurfaceProvider() { return (resolution, surfaceReleaseFuture) -> { mResolution = resolution; mSurfaceReleaseFuture = surfaceReleaseFuture; return CallbackToFutureAdapter.getFuture( (CallbackToFutureAdapter.Resolver<Surface>) completer -> { completer.addCancellationListener(() -> { mSurfaceCompleter = null; mSurfaceReleaseFuture = null; }, ContextCompat.getMainExecutor(mTextureView.getContext())); mSurfaceCompleter = completer; tryToProvidePreviewSurface(); return "provide preview surface"; }); }; }

Target:
public Preview.PreviewSurfaceProvider getPreviewSurfaceProvider() { return (resolution, surfaceReleaseFuture) -> { mResolution = resolution; mSurfaceReleaseFuture = surfaceReleaseFuture; return CallbackToFutureAdapter.getFuture( (CallbackToFutureAdapter.Resolver<Surface>) completer -> { completer.addCancellationListener(() -> { if (mSurfaceCompleter == completer) { mSurfaceCompleter = null; mSurfaceReleaseFuture = null; } }, ContextCompat.getMainExecutor(mTextureView.getContext())); mSurfaceCompleter = completer; tryToProvidePreviewSurface(); return "provide preview surface"; }); }; }
Source:
private void processHandshakeRecord(final Record record, final Connection connection) { LOGGER.debug("Received record from peer [{}]", record.getType(), record.getPeerAddress()); try { if (record.isNewClientHello()) { throw new IllegalArgumentException("new CLIENT_HELLO must be processed by processClientHello!"); } HandshakeMessage handshakeMessage = (HandshakeMessage) record.getFragment(); switch (handshakeMessage.getMessageType()) { case CLIENT_HELLO: if (record.getEpoch() > 0) { DTLSSession session = connection.getEstablishedSession(); send(new AlertMessage(AlertLevel.WARNING, AlertDescription.NO_RENEGOTIATION, record.getPeerAddress()), session); } else { LOGGER.error("Unexpected CLIENT_HELLO {}", record.getPeerAddress(), new IllegalArgumentException("Unexpected CLIENT_HELLO")); } break; case HELLO_REQUEST: processHelloRequest(connection); break; default: Handshaker handshaker = connection.getOngoingHandshake(); if (handshaker != null) { handshaker.processMessage(record); } else { LOGGER.debug( "Discarding HANDSHAKE message [epoch={}] from peer [{}], no ongoing handshake!", record.getEpoch(), record.getPeerAddress()); } break; } } catch (HandshakeException e) { handleExceptionDuringHandshake(e, e.getAlert().getLevel(), e.getAlert().getDescription(), connection, record); } }

Target:
private void processHandshakeRecord(final Record record, final Connection connection) { LOGGER.debug("Received record from peer [{}]", record.getType(), record.getPeerAddress()); try { if (record.isNewClientHello()) { throw new IllegalArgumentException("new CLIENT_HELLO must be processed by processClientHello!"); } HandshakeMessage handshakeMessage = (HandshakeMessage) record.getFragment(); switch (handshakeMessage.getMessageType()) { case CLIENT_HELLO: if (record.getEpoch() > 0) { DTLSSession session = connection.getEstablishedSession(); send(new AlertMessage(AlertLevel.WARNING, AlertDescription.NO_RENEGOTIATION, record.getPeerAddress()), session); } break; case HELLO_REQUEST: processHelloRequest(connection); break; default: Handshaker handshaker = connection.getOngoingHandshake(); if (handshaker != null) { handshaker.processMessage(record); } else { LOGGER.debug( "Discarding HANDSHAKE message [epoch={}] from peer [{}], no ongoing handshake!", record.getEpoch(), record.getPeerAddress()); } break; } } catch (HandshakeException e) { handleExceptionDuringHandshake(e, e.getAlert().getLevel(), e.getAlert().getDescription(), connection, record); } }
Source:
private Workbook readEncryptedFile(String fileName) throws IOException, GeneralSecurityException { InputStream inp = new FileInputStream(fileName); POIFSFileSystem fs = new POIFSFileSystem(inp); EncryptionInfo info = new EncryptionInfo(fs); Decryptor decryptor = Decryptor.getInstance(info); if (!decryptor.verifyPassword(password)) { throw new GeneralSecurityException("Error: Wrong password provided!"); } InputStream dataStream = decryptor.getDataStream(fs); return WorkbookFactory.create(dataStream); }

Target:
private Workbook readEncryptedFile(String fileName) throws IOException, GeneralSecurityException { InputStream inp = new FileInputStream(fileName); POIFSFileSystem fs = new POIFSFileSystem(inp); EncryptionInfo info = new EncryptionInfo(fs); Decryptor decryptor = Decryptor.getInstance(info); if (!decryptor.verifyPassword(password)) { throw new GeneralSecurityException("Error: Incorrect password!"); } InputStream dataStream = decryptor.getDataStream(fs); return WorkbookFactory.create(dataStream); }
Source:
protected void scanDirectory() { if (System.currentTimeMillis() - scanIntervalMillis >= lastScanMillis) { if (!visitedDirectory) { visitDirectory(filePath); visitedDirectory = true; } Set<Path> newPaths = scanner.scan(fs, filePath, processedFiles); for (Path newPath : newPaths) { String newPathString = newPath.toString(); pendingFiles.add(newPathString); processedFiles.add(newPathString); localProcessedFileCount.increment(); } lastScanMillis = System.currentTimeMillis(); } }

Target:
protected void scanDirectory() { if (System.currentTimeMillis() - scanIntervalMillis >= lastScanMillis) { Set<Path> newPaths = scanner.scan(fs, filePath, processedFiles); for (Path newPath : newPaths) { try { FileStatus fileStatus = fs.getFileStatus(newPath); if (fileStatus.isDirectory()) { checkVisitedDirectory(newPath); } else { String newPathString = newPath.toString(); pendingFiles.add(newPathString); processedFiles.add(newPathString); localProcessedFileCount.increment(); } } catch (IOException e) { throw new RuntimeException(e); } } lastScanMillis = System.currentTimeMillis(); } }
Source:
protected List<Metacard> query(CatalogFacade framework, int startIndex, Filter filter) { QueryImpl query = new QueryImpl(filter); query.setRequestsTotalResultsCount(false); query.setPageSize(batchSize); query.setSortBy(new SortByImpl(Metacard.MODIFIED, SortOrder.DESCENDING)); QueryRequest queryRequest = new QueryRequestImpl(query); query.setStartIndex(startIndex); SourceResponse response = null; try { LOGGER.debug("Querying with startIndex: {}", startIndex); response = framework.query(queryRequest); } catch (UnsupportedQueryException e) { console.printf("Received error from Framework: %s\n", e.getMessage()); return null; } catch (SourceUnavailableException e) { console.printf("Received error from Frameworks: %s\n", e.getMessage()); return null; } catch (FederationException e) { console.printf("Received error from Frameworks: %s\n", e.getMessage()); return null; } if (response.getProcessingDetails() != null && !response.getProcessingDetails().isEmpty()) { for (SourceProcessingDetails details : response.getProcessingDetails()) { LOGGER.debug("Got Issues: {}", details.getWarnings()); } return null; } List<Metacard> metacards = new ArrayList<Metacard>(); for (Result result : response.getResults()) { metacards.add(result.getMetacard()); } return metacards; }

Target:
protected List<Metacard> query(CatalogFacade framework, int startIndex, Filter filter) { QueryImpl query = new QueryImpl(filter); query.setRequestsTotalResultsCount(false); query.setPageSize(batchSize); query.setSortBy(new SortByImpl(Metacard.MODIFIED, SortOrder.DESCENDING)); QueryRequest queryRequest = new QueryRequestImpl(query); query.setStartIndex(startIndex); SourceResponse response = null; try { LOGGER.debug("Querying with startIndex: {}", startIndex); response = framework.query(queryRequest); } catch (UnsupportedQueryException e) { printErrorMessage(String.format("Received error from Framework: %s\n", e.getMessage())); return null; } catch (SourceUnavailableException e) { printErrorMessage(String.format("Received error from Frameworks: %s\n", e.getMessage())); return null; } catch (FederationException e) { printErrorMessage(String.format("Received error from Frameworks: %s\n", e.getMessage())); return null; } if (response.getProcessingDetails() != null && !response.getProcessingDetails().isEmpty()) { for (SourceProcessingDetails details : response.getProcessingDetails()) { LOGGER.debug("Got Issues: {}", details.getWarnings()); } return null; } List<Metacard> metacards = new ArrayList<Metacard>(); for (Result result : response.getResults()) { metacards.add(result.getMetacard()); } return metacards; }
Source:
public void synchronizeGroups() { Perun perun = ldapcManager.getPerunBl(); try { log.debug("Group synchronization - getting list of VOs"); List<Vo> vos = perun.getVosManager().getVos(ldapcManager.getPerunSession()); for(Vo vo : vos) { try { log.debug("Getting list of groups for VO {}", vo); List<Group> groups = perun.getGroupsManager().getAllGroups(ldapcManager.getPerunSession(), vo); for(Group group : groups) { try { log.debug("Synchronizing group {}", group); perunGroup.synchronizeEntry(group); log.debug("Getting list of members for group {}", group.getId()); List<Member> members = perun.getGroupsManager().getActiveGroupMembers(ldapcManager.getPerunSession(), group); log.debug("Synchronizing members of group {}", members.size(), group.getId()); perunGroup.synchronizeMembers(group, members); log.debug("Getting list of resources assigned to group {}", group.getId()); List<Resource> resources = perun.getResourcesManager().getAssignedResources(ldapcManager.getPerunSession(), group); log.debug("Synchronizing resources assigned to group {}", resources.size(), group.getId()); perunGroup.synchronizeResources(group, resources); } catch (PerunException e) { log.error("Error synchronizing group", e); } } } catch (PerunException e) { log.error("Error synchronizing groups", e); } } } catch (InternalErrorException | PrivilegeException e) { log.error("Error reading list of VOs", e); } }

Target:
public void synchronizeGroups() { Perun perun = ldapcManager.getPerunBl(); try { log.debug("Group synchronization - getting list of VOs"); List<Vo> vos = perun.getVosManager().getVos(ldapcManager.getPerunSession()); for(Vo vo : vos) { try { log.debug("Getting list of groups for VO {}", vo); List<Group> groups = perun.getGroupsManager().getAllGroups(ldapcManager.getPerunSession(), vo); for(Group group : groups) { try { log.debug("Synchronizing group {}", group); perunGroup.synchronizeEntry(group); log.debug("Getting list of members for group {}", group.getId()); List<Member> members = ((PerunBl)perun).getGroupsManagerBl().getActiveGroupMembers(ldapcManager.getPerunSession(), group, Status.VALID); log.debug("Synchronizing members of group {}", members.size(), group.getId()); perunGroup.synchronizeMembers(group, members); log.debug("Getting list of resources assigned to group {}", group.getId()); List<Resource> resources = perun.getResourcesManager().getAssignedResources(ldapcManager.getPerunSession(), group); log.debug("Synchronizing resources assigned to group {}", resources.size(), group.getId()); perunGroup.synchronizeResources(group, resources); } catch (PerunException e) { log.error("Error synchronizing group", e); } } } catch (PerunException e) { log.error("Error synchronizing groups", e); } } } catch (InternalErrorException | PrivilegeException e) { log.error("Error reading list of VOs", e); } }
Source:
public LoadData<InputStream> buildLoadData(@NonNull CloudinaryRequest model, int width, int height, @NonNull Options options) { Url url = MediaManager.get().url().publicId(model.getPublicId()); Transformation transformation = model.getTransformation(); if (transformation == null) { transformation = options.get(TRANSFORMATION); } if (transformation != null) { url.transformation(transformation); } ResponsiveUrl.Preset responsive = model.getResponsive(); if (responsive == null) { responsive = options.get(RESPONSIVE); } if (responsive != null) { url = MediaManager.get().responsiveUrl(responsive).buildUrl(url, width, height); } return urlLoader.buildLoadData(new GlideUrl(url.generate()), width, height, options); }

Target:
public LoadData<InputStream> buildLoadData(@NonNull CloudinaryRequest model, int width, int height, @NonNull Options options) { Url url = MediaManager.get().url().publicId(model.getPublicId()); Transformation transformation = model.getTransformation(); if (transformation == null) { transformation = options.get(TRANSFORMATION); } if (transformation != null) { url.transformation(transformation); } ResponsiveUrl responsive = model.getResponsive(); if (responsive == null) { responsive = options.get(RESPONSIVE); } if (responsive != null) { url = responsive.buildUrl(url, width, height); } return urlLoader.buildLoadData(new GlideUrl(url.generate()), width, height, options); }
Source:
private Map<String, Map<String, HiveColumnStatistics>> getPartitionColumnStatistics(String databaseName, String tableName, Set<String> partitionNames, List<String> columnNames) { try { return retry() .stopOn(NoSuchObjectException.class, HiveViewNotSupportedException.class) .stopOnIllegalExceptions() .run("getPartitionColumnStatistics", stats.getGetPartitionColumnStatistics().wrap(() -> { try (HiveMetastoreClient client = clientProvider.createMetastoreClient()) { Map<String, List<ColumnStatisticsObj>> partitionColumnStatistics = client.getPartitionColumnStatistics(databaseName, tableName, ImmutableList.copyOf(partitionNames), columnNames); return partitionColumnStatistics.entrySet() .stream() .filter(entry -> !entry.getValue().isEmpty()) .collect(toImmutableMap(Map.Entry::getKey, entry -> groupStatisticsByColumn(entry.getValue()))); } })); } catch (NoSuchObjectException e) { return ImmutableMap.of(); } catch (TException e) { throw new PrestoException(HIVE_METASTORE_ERROR, e); } catch (Exception e) { throw propagate(e); } }

Target:
private Map<String, Map<String, HiveColumnStatistics>> getPartitionColumnStatistics(String databaseName, String tableName, Set<String> partitionNames, List<String> columnNames) { try { return retry() .stopOn(NoSuchObjectException.class, HiveViewNotSupportedException.class) .stopOnIllegalExceptions() .run("getPartitionColumnStatistics", stats.getGetPartitionColumnStatistics().wrap(() -> { try (HiveMetastoreClient client = clientProvider.createMetastoreClient()) { Map<String, List<ColumnStatisticsObj>> partitionColumnStatistics = client.getPartitionColumnStatistics(databaseName, tableName, ImmutableList.copyOf(partitionNames), columnNames); return partitionColumnStatistics.entrySet() .stream() .filter(entry -> !entry.getValue().isEmpty()) .collect(toImmutableMap(Map.Entry::getKey, entry -> groupStatisticsByColumn(entry.getValue()))); } })); } catch (NoSuchObjectException e) { throw new TableNotFoundException(new SchemaTableName(databaseName, tableName)); } catch (TException e) { throw new PrestoException(HIVE_METASTORE_ERROR, e); } catch (Exception e) { throw propagate(e); } }
Source:
public static ArrayList<String> splitParams(String parameterString) { ArrayList<String> params = new ArrayList<>(); Matcher m = WHITESPACE_IF_NOT_QUOTED.matcher(parameterString); while (m.find()) { if (m.group(1) != null) { params.add(m.group(1)); } else { params.add(m.group(2)); } } return params; }

Target:
public static List<String> splitParams(String parameterString) { ArrayList<String> params = new ArrayList<>(); Matcher m = WHITESPACE_IF_NOT_QUOTED.matcher(parameterString); while (m.find()) { if (m.group(1) != null) { params.add(m.group(1)); } else { params.add(m.group(2)); } } return params; }
Source:
public void visit(NodeTraversal t, Node n, Node parent) { if (!n.isFunction() || parent == null) { return; } Node call; if (parent.isCall() && parent.getFirstChild() == n) { call = parent; } else if (parent.isGetProp() && parent.getFirstChild() == n && n.getNext() != null && n.getNext().isString() && n.getNext().getString().equals("call") && parent.getParent() != null && parent.getParent().isCall() && parent.getParent().getFirstChild() == parent) { call = parent.getParent(); } else { return; } Node funcParams = n.getSecondChild(); if (!funcParams.hasChildren() || NodeUtil.isVarArgsFunction(n)) { return; } Node param = funcParams.getFirstChild(); List<Node> newVars = new ArrayList<>(); while (param != null) { newVars.add(IR.var(param.cloneNode(), getCallArgument(param, call)) .useSourceInfoFromForTree(param)); param = param.getNext(); } funcParams.removeChildren(); for (int i = newVars.size() - 1; i >= 0; i--) { funcParams.getNext().addChildToFront(newVars.get(i)); } Node removeRef; if (call.getBooleanProp(Node.FREE_CALL)) { removeRef = call.getFirstChild(); } else { removeRef = call.getSecondChild(); } while (removeRef.getNext() != null) { call.removeChildAfter(removeRef); } compiler.reportCodeChange(); }

Target:
public void visit(NodeTraversal t, Node n, Node parent) { if (!n.isFunction() || parent == null) { return; } Node call; Node grandparent = parent.getParent(); if (parent.isCall() && parent.getFirstChild() == n) { call = parent; } else if (parent.isGetProp() && parent.getFirstChild() == n && n.getNext() != null && n.getNext().isString() && n.getNext().getString().equals("call") && grandparent != null && grandparent.isCall() && grandparent.getFirstChild() == parent) { call = grandparent; } else { return; } Node funcParams = NodeUtil.getFunctionParameters(n); if (!funcParams.hasChildren() || NodeUtil.isVarArgsFunction(n)) { return; } Node param = funcParams.getFirstChild(); List<Node> newVars = new ArrayList<>(); while (param != null) { newVars.add(IR.var(param.cloneNode(), getCallArgument(param, call)) .useSourceInfoFromForTree(param)); param = param.getNext(); } funcParams.removeChildren(); for (int i = newVars.size() - 1; i >= 0; i--) { funcParams.getNext().addChildToFront(newVars.get(i)); } Node removeRef; if (call.getBooleanProp(Node.FREE_CALL)) { removeRef = call.getFirstChild(); } else { removeRef = call.getSecondChild(); } while (removeRef.getNext() != null) { call.removeChildAfter(removeRef); } compiler.reportCodeChange(); }
Source:
public SpongeExecutorService get() { return this.schedulerService.createSyncExecutor(this.container.getInstance()); }

Target:
public SpongeExecutorService get() { return this.schedulerService.createSyncExecutor(this.container); }
Source:
private void setupBackgroundImageControls(SharedPreferences prefs) { if (!Utility.isLowRamDevice(mContext)) { showPreference("preference_category_background"); } String selection = prefs.getString("backgroundMode", "1"); showPreference("chooseBackgroundImage", selection.equals("3")); showPreference("slideshowStyle", selection.equals("4")); boolean on = selection.equals("4"); showPreference("backgroundImageDuration", on); showPreference("zoominBackgroundImage", on); showPreference("fadeinBackgroundImage", on); showPreference("moveinBackgroundImage", on); on = selection.equals("3") || selection.equals(("4")); showPreference("hideBackgroundImage", on); showPreference("autoAccentColor", on); if (settings.background_movein && selection.equals("4")) showPreference("backgroundMovein", true); else showPreference("backgroundMovein", false); boolean isPurchasedWeather = isPurchased(BillingHelperActivity.ITEM_WEATHER_DATA); showPreference("purchaseDesignPackageBackground", selection.equals("4") && !isPurchasedWeather); }

Target:
private void setupBackgroundImageControls(SharedPreferences prefs) { if (!Utility.isLowRamDevice(mContext)) { showPreference("preference_category_background"); } String selection = prefs.getString("backgroundMode", "1"); showPreference("chooseBackgroundImage", selection.equals("3")); boolean on = selection.equals("4"); showPreference("backgroundImageDuration", on); showPreference("backgroundImageZoomIn", on); showPreference("backgroundImageFadeIn", on); showPreference("backgroundImageMoveIn", on); showPreference("backgroundMovein", on); on = selection.equals("3") || selection.equals(("4")); showPreference("slideshowStyle", on); showPreference("hideBackgroundImage", on); showPreference("autoAccentColor", on); boolean isPurchasedWeather = isPurchased(BillingHelperActivity.ITEM_WEATHER_DATA); showPreference("purchaseDesignPackageBackground", selection.equals("4") && !isPurchasedWeather); }
Source:
public double simpleGeometry(BenchmarkData data) { return GeoFunctions.stXMin(data.simpleGeometry); }

Target:
public double simpleGeometry(BenchmarkData data) { return stXMin(data.simpleGeometry); }
Source:
protected Map<QuestionGroupDto, List<QuestionDto>> loadAllQuestions( String surveyId, boolean performRollups, String serverBase, String apiKey) throws Exception { Map<QuestionGroupDto, List<QuestionDto>> questionMap = new HashMap<QuestionGroupDto, List<QuestionDto>>(); orderedGroupList = fetchQuestionGroups(serverBase, surveyId, apiKey); rollupOrder = new ArrayList<QuestionDto>(); for (QuestionGroupDto group : orderedGroupList) { List<QuestionDto> questions = fetchQuestions(serverBase, group.getKeyId(), apiKey); if (performRollups && questions != null) { for (QuestionDto q : questions) { for (int i = 0; i < ROLLUP_QUESTIONS.length; i++) { if (ROLLUP_QUESTIONS[i].equalsIgnoreCase(q.getText())) { rollupOrder.add(q); } } } } questionMap.put(group, questions); } return questionMap; }

Target:
protected Map<QuestionGroupDto, List<QuestionDto>> loadAllQuestions( String surveyId, boolean performRollups, String serverBase, String apiKey) throws Exception { Map<QuestionGroupDto, List<QuestionDto>> questionMap = new HashMap<>(); orderedGroupList = fetchQuestionGroups(serverBase, surveyId, apiKey); List<QuestionDto> allQuestions = fetchQuestionsOfSurvey(serverBase, surveyId, apiKey); Map<Long, List<QuestionDto>> idMap = new HashMap<>(); for (QuestionGroupDto group : orderedGroupList) { List<QuestionDto> questions = new ArrayList<>(); idMap.put(group.getKeyId(), questions); } for (QuestionDto q:allQuestions) { List<QuestionDto> myList = idMap.get(q.getQuestionGroupId()); myList.add(q); } rollupOrder = new ArrayList<QuestionDto>(); for (QuestionGroupDto group : orderedGroupList) { List<QuestionDto> questions = idMap.get(group.getKeyId()); Collections.sort(questions, new Comparator<QuestionDto>() { @Override public int compare(QuestionDto o1, QuestionDto o2) { int v1 = o1.getOrder() != null ? o1.getOrder() : 0; int v2 = o2.getOrder() != null ? o2.getOrder() : 0; return v1-v2; } }); if (performRollups && questions != null) { for (QuestionDto q : questions) { for (int i = 0; i < ROLLUP_QUESTIONS.length; i++) { if (ROLLUP_QUESTIONS[i].equalsIgnoreCase(q.getText())) { rollupOrder.add(q); } } } } questionMap.put(group, questions); } return questionMap; }
Source:
private void swapHighFrequencyTriggersData() { synchronized (lock) { if (System.currentTimeMillis() - highFrequencyTriggersTS.get() > highFrequencyDataRecycleMS) { highFrequencyMetrics.set(new HashMap<>()); highFrequencyTriggersTS.set(System.currentTimeMillis()); } } }

Target:
private synchronized void swapHighFrequencyTriggersData() { if (System.currentTimeMillis() - highFrequencyTriggersTS.get() > highFrequencyDataRecycleMS) { highFrequencyMetrics.set(new HashMap<>()); highFrequencyTriggersTS.set(System.currentTimeMillis()); } }
Source:
private static DistributionType determineDistributionType(JoinNode node, Context context) { JoinNode.Type type = node.getType(); if (type == RIGHT || type == FULL) { return PARTITIONED; } if (node.getCriteria().isEmpty() && type == INNER) { return REPLICATED; } if (isAtMostScalar(node.getRight(), context.getLookup())) { return REPLICATED; } if (isDistributedJoinEnabled(context.getSession())) { return PARTITIONED; } return REPLICATED; }

Target:
private static DistributionType determineDistributionType(JoinNode node, Context context) { JoinNode.Type type = node.getType(); if (type == RIGHT || type == FULL) { return PARTITIONED; } if (node.getCriteria().isEmpty() && (type == INNER || type == LEFT)) { return REPLICATED; } if (isAtMostScalar(node.getRight(), context.getLookup())) { return REPLICATED; } if (isDistributedJoinEnabled(context.getSession())) { return PARTITIONED; } return REPLICATED; }
Source:
static void connectionWithQueryOptions(String projectId, String instanceId, String databaseId) throws SQLException { String optimizerVersion = "LATEST"; String connectionUrl = String.format( "jdbc:cloudspanner:/projects/%s/instances/%s/databases/%s?optimizerVersion=%s", projectId, instanceId, databaseId, optimizerVersion); try (Connection connection = DriverManager.getConnection(connectionUrl)) { try (Statement statement = connection.createStatement()) { try (ResultSet rs = statement.executeQuery( "SELECT SingerId, FirstName, LastName FROM Singers ORDER BY LastName")) { while (rs.next()) { System.out.printf("%d %s %s\n", rs.getLong(1), rs.getString(2), rs.getString(3)); } } try (ResultSet rs = statement.executeQuery("SHOW VARIABLE OPTIMIZER_VERSION")) { while (rs.next()) { System.out.printf("Optimizer version: %s\n", rs.getString(1)); } } } } }

Target:
static void connectionWithQueryOptions(String projectId, String instanceId, String databaseId) throws SQLException { String optimizerVersion = "1"; String connectionUrl = String.format( "jdbc:cloudspanner:/projects/%s/instances/%s/databases/%s?optimizerVersion=%s", projectId, instanceId, databaseId, optimizerVersion); try (Connection connection = DriverManager.getConnection(connectionUrl)) { try (Statement statement = connection.createStatement()) { try (ResultSet rs = statement.executeQuery( "SELECT SingerId, FirstName, LastName FROM Singers ORDER BY LastName")) { while (rs.next()) { System.out.printf("%d %s %s\n", rs.getLong(1), rs.getString(2), rs.getString(3)); } } try (ResultSet rs = statement.executeQuery("SHOW VARIABLE OPTIMIZER_VERSION")) { while (rs.next()) { System.out.printf("Optimizer version: %s\n", rs.getString(1)); } } } } }
Source:
public void updated(Map<String, Object> properties) { cancelPollTask(); this.options = new WatchdogServiceOptions(properties); if (this.options.isEnabled()) { try (PrintWriter wdWriter = new PrintWriter(this.options.getWatchdogDevice());) { wdWriter.write(this.options.getWatchdogDevice()); } catch (IOException e) { logger.error("Unable to write watchdog config file", e); } logger.debug("activating WatchdogService with watchdog enabled"); } else { logger.debug("activating WatchdogService with watchdog disabled"); } this.rebootCauseWriter = new RebootCauseFileWriter(this.options.getRebootCauseFilePath()); if (!this.options.isEnabled()) { disableWatchdog(); } else { this.pollTask = this.pollExecutor.scheduleAtFixedRate(() -> { Thread.currentThread().setName("WatchdogServiceImpl"); checkCriticalComponents(); }, 0, this.options.getPingInterval(), TimeUnit.MILLISECONDS); } }

Target:
public void updated(Map<String, Object> properties) { cancelPollTask(); this.options = new WatchdogServiceOptions(properties); if (this.options.isEnabled()) { this.rebootCauseWriter = new RebootCauseFileWriter(this.options.getRebootCauseFilePath()); try (PrintWriter wdWriter = new PrintWriter(this.options.getWatchdogDevice());) { wdWriter.write(this.options.getWatchdogDevice()); } catch (IOException e) { logger.error("Unable to write watchdog config file", e); } this.pollTask = this.pollExecutor.scheduleAtFixedRate(() -> { Thread.currentThread().setName("WatchdogServiceImpl"); checkCriticalComponents(); }, 0, this.options.getPingInterval(), TimeUnit.MILLISECONDS); } else { disableWatchdog(); } }
Source:
public Document toXml() throws IOException, SAXException { Document setDocument = Xml.newDocument(); Element rootElement = setDocument.createElementNS("urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", "PolicySet"); setDocument.appendChild(rootElement); for (Policy p: policies) { Document policyDocument = Xml.toXml(p.getPolicy()); Element policyElement = policyDocument.getDocumentElement(); rootElement.appendChild(setDocument.importNode(policyElement, true)); } return setDocument; }

Target:
public Document toXml() throws IOException, SAXException { Document setDocument = Xml.newDocument(); Element rootElement = setDocument.createElementNS(NAMESPACE, "PolicySet"); setDocument.appendChild(rootElement); rootElement.setAttributeNS(NAMESPACE, "PolicySetId", id); rootElement.setAttributeNS(NAMESPACE, "Version", VERSION); rootElement.setAttributeNS(NAMESPACE, "PolicySetId", COMBINING_POLICY); for (Policy p: policies) { Document policyDocument = Xml.toXml(p.getPolicy()); Element policyElement = policyDocument.getDocumentElement(); rootElement.appendChild(setDocument.importNode(policyElement, true)); } return setDocument; }
Source:
public String getColumnText(Object element, int columnIndex) { RepositoryTreeNode node = (RepositoryTreeNode) element; switch (node.getType()) { case REPO: File directory = ((Repository) node.getObject()).getDirectory() .getParentFile(); return (directory.getName() + " - " + directory .getAbsolutePath()); case BRANCHES: return "Branches"; case PROJECTS: return "Existing Projects"; case REF: Ref ref = (Ref) node.getObject(); String refName = ref.getName(); if (ref.isSymbolic()) { refName = refName + " - " + ref.getLeaf().getName(); } try { String fullBranch = node.getRepository().getFullBranch(); if (refName.equals(fullBranch)) { return "* " + refName; } } catch (IOException e1) { e1.printStackTrace(); } return refName; case PROJ: File file = (File) node.getObject(); for (IProject proj : ResourcesPlugin.getWorkspace().getRoot() .getProjects()) { if (proj.getLocation().equals( new Path(file.getAbsolutePath()))) { return ("* " + file.getName()); } } return file.getName(); default: return null; } }

Target:
public String getColumnText(Object element, int columnIndex) { RepositoryTreeNode node = (RepositoryTreeNode) element; switch (node.getType()) { case REPO: File directory = ((Repository) node.getObject()).getDirectory() .getParentFile(); return (directory.getName() + " - " + directory .getAbsolutePath()); case BRANCHES: return RepositoryViewUITexts.RepositoriesView_Branches_Nodetext; case PROJECTS: return RepositoryViewUITexts.RepositoriesView_ExistingProjects_Nodetext; case REF: Ref ref = (Ref) node.getObject(); String refName = node.getRepository().shortenRefName( ref.getName()); if (ref.isSymbolic()) { refName = refName + " - " + node.getRepository().shortenRefName( ref.getLeaf().getName()); } return refName; case PROJ: File file = (File) node.getObject(); return file.getName(); default: return null; } }
Source:
private Collection<AbstractNodeTemplate> getDeployableSubgraph(Collection<AbstractNodeTemplate> nodeTemplates, Map<String, Collection<Long>> nodeIds2situationIds) { Set<AbstractNodeTemplate> validDeploymentSubgraph = new HashSet<AbstractNodeTemplate>(nodeTemplates); Collection<AbstractNodeTemplate> toRemove = new HashSet<AbstractNodeTemplate>(); for (AbstractNodeTemplate nodeTemplate : nodeTemplates) { Collection<AbstractRelationshipTemplate> hostingRelations = this.getOutgoingHostedOnRelations(nodeTemplate); if (!hostingRelations.isEmpty()) { boolean foundValidHost = false; for (AbstractRelationshipTemplate relationshipTemplate : hostingRelations) { AbstractNodeTemplate hostingNode = relationshipTemplate.getTarget(); if (this.isValidUnderSituations(hostingNode, nodeIds2situationIds) && nodeTemplates.contains(hostingNode)) { foundValidHost = true; } if (foundValidHost) { break; } } if (!foundValidHost) { toRemove.add(nodeTemplate); } } } if (toRemove.isEmpty()) { return validDeploymentSubgraph; } else { validDeploymentSubgraph.removeAll(toRemove); return getDeployableSubgraph(validDeploymentSubgraph, nodeIds2situationIds); } }

Target:
private Collection<AbstractNodeTemplate> getDeployableSubgraph(Collection<AbstractNodeTemplate> nodeTemplates, Map<String, Collection<Long>> nodeIds2situationIds) { Set<AbstractNodeTemplate> validDeploymentSubgraph = new HashSet<AbstractNodeTemplate>(nodeTemplates); Collection<AbstractNodeTemplate> toRemove = new HashSet<AbstractNodeTemplate>(); for (AbstractNodeTemplate nodeTemplate : nodeTemplates) { Collection<AbstractRelationshipTemplate> hostingRelations = this.getOutgoingHostedOnRelations(nodeTemplate); if (!hostingRelations.isEmpty()) { boolean foundValidHost = false; for (AbstractRelationshipTemplate relationshipTemplate : hostingRelations) { AbstractNodeTemplate hostingNode = relationshipTemplate.getTarget(); if (this.isValidUnderSituations(hostingNode, nodeIds2situationIds) && nodeTemplates.contains(hostingNode)) { foundValidHost = true; break; } } if (!foundValidHost) { toRemove.add(nodeTemplate); } } } if (toRemove.isEmpty()) { return validDeploymentSubgraph; } else { validDeploymentSubgraph.removeAll(toRemove); return getDeployableSubgraph(validDeploymentSubgraph, nodeIds2situationIds); } }
Source:
private boolean validateAndSetStorageQuotaHelper(QuotaConsumptionParametersWrapper parameters) { lock.readLock().lock(); try { synchronized (storagePoolQuotaMap.get(parameters.getAuditLogable().getStoragePool().getId())) { if (storagePoolQuotaMap.get(parameters.getAuditLogable().getStoragePool().getId()) == null) { return false; } Map<Guid, Quota> quotaMap = storagePoolQuotaMap.get(parameters.getAuditLogable().getStoragePool().getId()); Map<Guid, Map<Guid, Double>> desiredStorageSizeQuotaMap = new HashMap<Guid, Map<Guid, Double>>(); Map<Guid, Double> newUsedGlobalStorageSize = new HashMap<Guid, Double>(); Map<Guid, Map<Guid, Double>> newUsedSpecificStorageSize = new HashMap<Guid, Map<Guid, Double>>(); generateDesiredStorageSizeQuotaMap(parameters, desiredStorageSizeQuotaMap); for (Guid quotaId : desiredStorageSizeQuotaMap.keySet()) { Quota quota = quotaMap.get(quotaId); if (quota.getGlobalQuotaStorage() != null) { if (checkConsumptionForGlobalStorageQuota(parameters, desiredStorageSizeQuotaMap, newUsedGlobalStorageSize, quotaId, quota)) return false; } else { if (checkConsumptionForSpecificSorageQuota(parameters, desiredStorageSizeQuotaMap, newUsedSpecificStorageSize, quotaId, quota)) return false; } } saveNewConsumptionValues(quotaMap, newUsedGlobalStorageSize, newUsedSpecificStorageSize); } return true; } finally { lock.readLock().unlock(); } }

Target:
private boolean validateAndSetStorageQuotaHelper(QuotaConsumptionParametersWrapper parameters) { Pair<AuditLogType, AuditLogableBase> auditLogPair = new Pair<AuditLogType, AuditLogableBase>(); auditLogPair.setSecond(parameters.getAuditLogable()); lock.readLock().lock(); try { if (storagePoolQuotaMap.get(parameters.getStoragePoolId()) == null) { return false; } synchronized (storagePoolQuotaMap.get(parameters.getStoragePoolId())) { Map<Guid, Quota> quotaMap = storagePoolQuotaMap.get(parameters.getStoragePoolId()); Map<Guid, Map<Guid, Double>> desiredStorageSizeQuotaMap = new HashMap<Guid, Map<Guid, Double>>(); Map<Guid, Double> newUsedGlobalStorageSize = new HashMap<Guid, Double>(); Map<Guid, Map<Guid, Double>> newUsedSpecificStorageSize = new HashMap<Guid, Map<Guid, Double>>(); generateDesiredStorageSizeQuotaMap(parameters, desiredStorageSizeQuotaMap); for (Guid quotaId : desiredStorageSizeQuotaMap.keySet()) { Quota quota = quotaMap.get(quotaId); if (quota.getGlobalQuotaStorage() != null) { if (!checkConsumptionForGlobalStorageQuota(parameters, desiredStorageSizeQuotaMap, newUsedGlobalStorageSize, quotaId, quota, auditLogPair)) return false; } else { if (!checkConsumptionForSpecificSorageQuota(parameters, desiredStorageSizeQuotaMap, newUsedSpecificStorageSize, quotaId, quota, auditLogPair)) return false; } } saveNewConsumptionValues(quotaMap, newUsedGlobalStorageSize, newUsedSpecificStorageSize); } return true; } finally { lock.readLock().unlock(); quotaManagerAuditLogger.auditLog(auditLogPair.getSecond(), auditLogPair.getFirst()); } }
Source:
private void setSelectionControlsEnabled(boolean enabled) { copyGraphButton.setEnabled(enabled); removeGraphButton.setEnabled(enabled); }

Target:
private void setSelectionControlsEnabled(boolean enabled) { copyGraphButton.setEnabled(enabled); editGraphButton.setEnabled(enabled); removeGraphButton.setEnabled(enabled); }
Source:
protected void remove(WorkflowTask task) { if (task != null && task.getWebasset() != null) { cache.remove(this.getKey(task.getWebasset(), task.getLanguageId()), TASK_GROUP); cache.remove(task.getWebasset(), STEP_GROUP); } if (task != null && UtilMethods.isSet(task.getId())) { cache.remove(task.getId(), TASK_GROUP); } }

Target:
protected void remove(WorkflowTask task) { if (UtilMethods.isSet(task) && UtilMethods.isSet(task.getWebasset())) { cache.remove(this.getKey(task.getWebasset(), task.getLanguageId()), TASK_GROUP); cache.remove(task.getWebasset(), STEP_GROUP); } if (UtilMethods.isSet(task) && UtilMethods.isSet(task.getId())) { cache.remove(task.getId(), TASK_GROUP); } }