auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public JavaDocContextType() { addResolver(new GlobalTemplateVariables.Cursor()); addResolver(new Selection(org.eclipse.jface.text.templates.GlobalTemplateVariables.LineSelection.NAME, JavaTemplateMessages.CompilationUnitContextType_variable_description_line_selection)); addResolver(new Selection(org.eclipse.jface.text.templates.GlobalTemplateVariables.WordSelection.NAME, JavaTemplateMessages.JavaDocContextType_variable_description_word_selection)); addResolver(new GlobalTemplateVariables.Dollar()); addResolver(new GlobalTemplateVariables.Date()); addResolver(new GlobalTemplateVariables.Year()); addResolver(new GlobalTemplateVariables.Time()); addResolver(new GlobalTemplateVariables.User()); addResolver(new File()); addResolver(new PrimaryTypeName()); addResolver(new Method()); addResolver(new ReturnType()); addResolver(new Arguments()); addResolver(new Type()); addResolver(new Package()); addResolver(new Project()); }

Target:
public JavaDocContextType() { addResolver(new GlobalTemplateVariables.Cursor()); addResolver(new GlobalTemplateVariables.Selection(GlobalTemplateVariables.LineSelection.NAME, JavaTemplateMessages.CompilationUnitContextType_variable_description_line_selection)); addResolver(new GlobalTemplateVariables.Selection(GlobalTemplateVariables.WordSelection.NAME, JavaTemplateMessages.JavaDocContextType_variable_description_word_selection)); addResolver(new GlobalTemplateVariables.Dollar()); addResolver(new GlobalTemplateVariables.Date()); addResolver(new GlobalTemplateVariables.Year()); addResolver(new GlobalTemplateVariables.Time()); addResolver(new GlobalTemplateVariables.User()); addResolver(new File()); addResolver(new PrimaryTypeName()); addResolver(new Method()); addResolver(new ReturnType()); addResolver(new Arguments()); addResolver(new Type()); addResolver(new Package()); addResolver(new Project()); }
Source:
protected void initChannel(SocketChannel channel) throws Exception { channel.pipeline() .addLast(new HttpServerCodec()) .addLast(new HttpObjectAggregator(65536)) .addLast(StompWebSocketClientPageHandler.INSTANCE) .addLast(new WebSocketServerProtocolHandler(chatPath, StompVersion.SUB_PROTOCOLS)) .addLast("stompWebSocketProtocolCodec", stompWebSocketProtocolCodec); }

Target:
protected void initChannel(SocketChannel channel) throws Exception { channel.pipeline() .addLast(new HttpServerCodec()) .addLast(new HttpObjectAggregator(65536)) .addLast(StompWebSocketClientPageHandler.INSTANCE) .addLast(new WebSocketServerProtocolHandler(chatPath, StompVersion.SUB_PROTOCOLS)) .addLast(stompWebSocketProtocolCodec); }
Source:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ((WordPress) getApplication()).component().inject(this); setContentView(R.layout.site_picker_activity); restoreSavedInstanceState(savedInstanceState); setupActionBar(); setupRecycleView(); initSwipeToRefreshHelper(findViewById(android.R.id.content)); }

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ((WordPress) getApplication()).component().inject(this); setContentView(R.layout.site_picker_activity); restoreSavedInstanceState(savedInstanceState); setupActionBar(); setupRecycleView(); initSwipeToRefreshHelper(findViewById(android.R.id.content)); if (savedInstanceState != null) { mSwipeToRefreshHelper.setRefreshing(savedInstanceState.getBoolean(KEY_REFRESHING, false)); } }
Source:
protected void prepareHandlers(Context context) { super.prepareHandlers(context); addHandler(Attributes.CheckBox.Text, new StringAttributeProcessor<T>() { @Override public void handle(ParserContext parserContext, String attributeKey, String attributeValue, T view) { view.setText(attributeValue); } }); addHandler(Attributes.TextView.TextColor, new StringAttributeProcessor<T>() { @Override public void handle(ParserContext parserContext, String attributeKey, String attributeValue, T view) { view.setTextColor(ParseHelper.parseColor(attributeValue)); } }); addHandler(Attributes.CheckBox.Button , new ResourceReferenceProcessor<T>(context) { @Override public void setDrawable(T view, Drawable drawable) { view.setButtonDrawable(drawable); } }); addHandler(Attributes.CheckBox.Checked, new StringAttributeProcessor<T>() { @Override public void handle(ParserContext parserContext, String attributeKey, String attributeValue, T view) { view.setChecked(Boolean.parseBoolean(attributeValue)); } }); }

Target:
protected void prepareHandlers(Context context) { super.prepareHandlers(context); addHandler(Attributes.CheckBox.Button , new ResourceReferenceProcessor<T>(context) { @Override public void setDrawable(T view, Drawable drawable) { view.setButtonDrawable(drawable); } }); addHandler(Attributes.CheckBox.Checked, new StringAttributeProcessor<T>() { @Override public void handle(ParserContext parserContext, String attributeKey, String attributeValue, T view) { view.setChecked(Boolean.parseBoolean(attributeValue)); } }); }
Source:
public void RTEDisabledEditorEntryCKPreferredTests_002_MainEditEntry() { ArticlePageObject article = base.openArticleByName(wikiURL, PageContent.articleNamePrefix + base.getTimeStamp()); SourceEditModePageObject src = article.openSrcModeWithMainEditButton(); src.verifySourceOnlyMode(); }

Target:
public void RTEDisabledEditorEntryCKPreferredTests_002_MainEditEntry() { ArticlePageObject article = base.openArticleByName(wikiURL, PageContent.articleNamePrefix + base.getTimeStamp()); SourceEditModePageObject src = article.editArticleInSrcUsingDropdown(); src.verifySourceOnlyMode(); }
Source:
public void addQueues(Queue... queues) { this.addQueueNames(collectQueueNames(queues)); }

Target:
public final void addQueues(Queue... queues) { addQueueNames(collectQueueNames(queues)); }
Source:
private void assertDataIdentity() { Assert.assertEquals("Number of chunks should match", numChunks, compositeBuffers.size()); int i = 0; ByteBuffer dest = ByteBuffer.allocate(totalSizeWritten); for (Map.Entry<Integer, ByteBuffer> entry : compositeBuffers.entrySet()) { int j = entry.getKey(); Assert.assertEquals("All chunks should have come in", i, j); i++; ByteBuffer buf = entry.getValue(); buf.flip(); dest.put(buf); } Assert.assertTrue("Filled chunk contents must exactly match the input buffer ", Arrays.equals(putContent, dest.array())); }

Target:
private void assertDataIdentity() { ByteBuffer dest = ByteBuffer.allocate(totalSizeWritten); for (ByteBuffer buf : compositeBuffers) { Assert.assertNotNull("All chunks should have come in", buf); buf.flip(); dest.put(buf); } Assert.assertTrue("Filled chunk contents must exactly match the input buffer ", Arrays.equals(putContent, dest.array())); }
Source:
public Response systemScopesScopeNameGet(String scope, String username, MessageContext messageContext) throws APIManagementException { ScopeSettingsDTO scopeSettingsDTO = new ScopeSettingsDTO(); APIAdmin apiAdmin = new APIAdminImpl(); String decodedScope = new String(Base64.getDecoder().decode(scope)); boolean existence; if (username == null) { existence = apiAdmin.isScopeExists(RestApiUtil.getLoggedInUsername(), decodedScope); if (existence) { scopeSettingsDTO.setName(decodedScope); } else { throw new APIManagementException("Scope Not Found. Scope : " + decodedScope + ExceptionCodes.SCOPE_NOT_FOUND); } } else { existence = apiAdmin.isScopeExistsForUser(username, decodedScope); if (existence) { scopeSettingsDTO.setName(decodedScope); } else { throw new APIManagementException("User does not have scope. Username : " + username + " Scope : " + decodedScope, ExceptionCodes.SCOPE_NOT_FOUND_FOR_USER); } } return Response.ok().entity(scopeSettingsDTO).build(); }

Target:
public Response systemScopesScopeNameGet(String scope, String username, MessageContext messageContext) throws APIManagementException { ScopeSettingsDTO scopeSettingsDTO = new ScopeSettingsDTO(); APIAdmin apiAdmin = new APIAdminImpl(); String decodedScope = new String(Base64.getDecoder().decode(scope)); boolean existence; if (username == null) { existence = apiAdmin.isScopeExists(RestApiUtil.getLoggedInUsername(), decodedScope); if (existence) { scopeSettingsDTO.setName(decodedScope); } else { throw new APIManagementException("Scope Not Found. Scope : " + decodedScope, ExceptionCodes.SCOPE_NOT_FOUND); } } else { existence = apiAdmin.isScopeExistsForUser(username, decodedScope); if (existence) { scopeSettingsDTO.setName(decodedScope); } else { throw new APIManagementException("User does not have scope. Username : " + username + " Scope : " + decodedScope, ExceptionCodes.SCOPE_NOT_FOUND_FOR_USER); } } return Response.ok().entity(scopeSettingsDTO).build(); }
Source:
public static void deleteRoleGroup(Context context, Collection collection, String roleID) throws SQLException, IOException, WorkflowConfigurationException { Workflow workflow = WorkflowFactory.getWorkflow(collection); Role role = workflow.getRoles().get(roleID); if(role.getScope() == Role.Scope.COLLECTION){ CollectionRole ass = CollectionRole.find(context, collection.getID(), roleID); ass.delete(); }else if(role.getScope() == Role.Scope.REPOSITORY){ Group groupToDelete = Group.findByName(context, roleID); if(groupToDelete != null){ groupToDelete.delete(); } } }

Target:
public static void deleteRoleGroup(Context context, Collection collection, String roleID) throws SQLException, IOException, WorkflowConfigurationException { Workflow workflow = WorkflowFactory.getWorkflow(collection); Role role = workflow.getRoles().get(roleID); if(role.getScope() == Role.Scope.COLLECTION){ CollectionRole ass = CollectionRole.find(context, collection.getID(), roleID); ass.delete(); } }
Source:
public Map getVmStats(String uuid) { final Host host = getActiveHost(); Map resultMap = getDoneStatus(); List statusList = new ArrayList(); VM vm = host.getRunningVMs().get(uuid); statusList.add(fillVmStatsMap(vm)); resultMap.put("statsList", statusList); Utils.getLatency(); return resultMap; }

Target:
public Map getVmStats(String uuid) { final Host host = getActiveHost(); Map resultMap = getDoneStatus(); List statusList = new ArrayList(); VM vm = host.getRunningVMs().get(uuid); if (vm != null){ statusList.add(fillVmStatsMap(vm)); } resultMap.put("statsList", statusList); Utils.getLatency(); return resultMap; }
Source:
public void destroyNode(String id) { int event = api.getDropletApi().destroy(Integer.valueOf(id), true); nodeTerminatedPredicate.apply(event); }

Target:
public void destroyNode(String id) { Droplet droplet = api.getDropletApi().get(Integer.valueOf(id)); final String nodeName = droplet.getName(); int event = api.getDropletApi().destroy(Integer.valueOf(id), true); nodeTerminatedPredicate.apply(event); Iterable<SshKey> keys = filter(api.getKeyPairApi().list(), new Predicate<SshKey>() { @Override public boolean apply(SshKey input) { return input.getName().equals(nodeName); } }); for (SshKey key : keys) { try { logger.info(">> deleting keypair %s...", key); api.getKeyPairApi().delete(key.getId()); } catch (RuntimeException ex) { logger.warn(ex, ">> could not delete keypair %s. You can safely delete this key pair manually", key); } } }
Source:
public AbstractViewTest(boolean followBackpointers) { CorfuRuntime.overrideGetRouterFunction = this::getRouterFunction; runtime = CorfuRuntime.fromParameters(CorfuRuntimeParameters.builder() .followBackpointersEnabled(followBackpointers) .garbageCollectionEnable(false) .nettyEventLoop(NETTY_EVENT_LOOP) .build()); runtime.getParameters().setHoleFillRetry(0); }

Target:
public AbstractViewTest(boolean followBackpointers) { CorfuRuntime.overrideGetRouterFunction = this::getRouterFunction; runtime = CorfuRuntime.fromParameters(CorfuRuntimeParameters.builder() .followBackpointersEnabled(followBackpointers) .garbageCollectionEnabled(false) .nettyEventLoop(NETTY_EVENT_LOOP) .build()); runtime.getParameters().setHoleFillRetry(0); }
Source:
public void recomputeDynamicFacets() { recomputeFacets(); }

Target:
public void recomputeDynamicFacets() { recomputeFacets(); dirty = false; }
Source:
public void addLinks(List<String> sourceIds, String targetId, Session session) { MongoDBSession mongodbSession = (MongoDBSession) session; MongoCollection<Document> coll = getCollection(mongodbSession); List<Document> newDocs = sourceIds.stream() .map(sourceId -> buildDoc(sourceId, targetId)) .filter(doc -> countDocuments(mongodbSession.getDirectory().databaseID, coll, doc) == 0) .collect(Collectors.toList()); if (!newDocs.isEmpty()) { coll.insertMany(newDocs); } }

Target:
public void addLinks(List<String> sourceIds, String targetId, Session session) { MongoDBSession mongodbSession = (MongoDBSession) session; MongoCollection<Document> coll = getCollection(mongodbSession); String databaseID = mongodbSession.getDirectory().databaseID; List<Document> newDocs = sourceIds.stream() .map(sourceId -> buildDoc(sourceId, targetId)) .filter(doc -> countDocuments(databaseID, coll, doc) == 0) .collect(Collectors.toList()); if (!newDocs.isEmpty()) { coll.insertMany(newDocs); } }
Source:
private RAMDirectory index() throws IOException, UnsupportedEncodingException, FileNotFoundException { RAMDirectory directory = new RAMDirectory(); IndexWriterConfig config = new IndexWriterConfig( LUCENE_VERSION, new StandardAnalyzer(LUCENE_VERSION, CharArraySet.EMPTY_SET)); config.setOpenMode(OpenMode.CREATE); IndexWriter iwriter = new IndexWriter(directory, config); for (String inputFile : inputFiles) { File file = new File(inputFile); BufferedReader titleReader = new BufferedReader( new InputStreamReader(new FileInputStream(file), "UTF-8")); String title = titleReader.readLine(); if (title != null && title.startsWith("[[")) { title = titleReader.readLine(); } titleReader.close(); if (title != null) { Matcher matcher = SECTION_HEADER.matcher(title); if (matcher.matches()) { title = matcher.group(1); } } else { title = ""; } String outputFile = AsciiDoctor.mapInFileToOutFile( inputFile, inExt, outExt); FileReader reader = new FileReader(file); Document doc = new Document(); doc.add(new TextField(Constants.DOC_FIELD, reader)); doc.add(new StringField( Constants.URL_FIELD, prefix + outputFile, Field.Store.YES)); doc.add(new TextField(Constants.TITLE_FIELD, title, Field.Store.YES)); iwriter.addDocument(doc); reader.close(); } iwriter.close(); return directory; }

Target:
private RAMDirectory index() throws IOException, UnsupportedEncodingException, FileNotFoundException { RAMDirectory directory = new RAMDirectory(); IndexWriterConfig config = new IndexWriterConfig( LUCENE_VERSION, new StandardAnalyzer(LUCENE_VERSION, CharArraySet.EMPTY_SET)); config.setOpenMode(OpenMode.CREATE); IndexWriter iwriter = new IndexWriter(directory, config); for (String inputFile : inputFiles) { File file = new File(inputFile); if (file.length() == 0) { continue; } BufferedReader titleReader = new BufferedReader( new InputStreamReader(new FileInputStream(file), "UTF-8")); String title = titleReader.readLine(); if (title != null && title.startsWith("[[")) { title = titleReader.readLine(); } titleReader.close(); Matcher matcher = SECTION_HEADER.matcher(title); if (matcher.matches()) { title = matcher.group(1); } String outputFile = AsciiDoctor.mapInFileToOutFile( inputFile, inExt, outExt); FileReader reader = new FileReader(file); Document doc = new Document(); doc.add(new TextField(Constants.DOC_FIELD, reader)); doc.add(new StringField( Constants.URL_FIELD, prefix + outputFile, Field.Store.YES)); doc.add(new TextField(Constants.TITLE_FIELD, title, Field.Store.YES)); iwriter.addDocument(doc); reader.close(); } iwriter.close(); return directory; }
Source:
private static void addJSONArrayIfPresent(JSONObject root, int index, String key, Object[] parameterSet) { if (root.has(key)) { parameterSet[index] = root.getJSONArray(key); } else { parameterSet[index] = null; } }

Target:
private static void addJSONArrayIfPresent(JSONObject root, int index, String key, Object[] parameterSet) { if (root.has(key)) { parameterSet[index] = root.getJSONArray(key); } }
Source:
public static void discardAllChanges() { Util.bot.toolbarButtonWithTooltip("Discard all local changes and synchronize with server").click(); Util.bot.button(CommonConstants.YES).click(); }

Target:
public static void discardAllChanges() { WorkbenchElementsValidator.bot .toolbarButtonWithTooltip( APIMConstants.DISCARD_ALL_LOCAL_CHANGES_AND_SYNCHRONIZE_WITH_SERVER) .click(); WorkbenchElementsValidator.bot.button(CommonConstants.YES).click(); }
Source:
protected void initFromBuffer(ByteBuffer buf) throws IOException { m_path = new byte[buf.getInt()]; buf.get(m_path); m_stypeBytes = new byte[buf.getInt()]; buf.get(m_stypeBytes); m_nonce = new byte[buf.getInt()]; buf.get(m_nonce); m_response = PrivateVoltTableFactory.createVoltTableFromSharedBuffer(buf); m_stype = SnapthotPathType.valueOf(new String(m_stypeBytes, Charsets.UTF_8)); }

Target:
protected void initFromBuffer(ByteBuffer buf) throws IOException { m_path = new byte[buf.getInt()]; buf.get(m_path); m_stypeBytes = new byte[buf.getInt()]; buf.get(m_stypeBytes); m_nonce = new byte[buf.getInt()]; buf.get(m_nonce); m_response = PrivateVoltTableFactory.createVoltTableFromSharedBuffer(buf); m_stype = SnapshotPathType.valueOf(new String(m_stypeBytes, Charsets.UTF_8)); }
Source:
public void testRegistryConfigDocumentParse() throws Exception { File document = new File("src/test/resources/test.doc"); template.sendBody("direct:start3", document); resultEndpoint.setExpectedMessageCount(1); resultEndpoint.expectedMessagesMatches(new Predicate() { @Override public boolean matches(Exchange exchange) { Object body = exchange.getIn().getBody(String.class); Map<String, Object> headerMap = exchange.getIn().getHeaders(); assertThat(body, instanceOf(String.class)); assertThat((String) body, containsString("<body/>")); assertThat(headerMap.get("TikaContent-Type"), equalTo("application/msword")); return true; } }); resultEndpoint.assertIsSatisfied(); }

Target:
public void testRegistryConfigDocumentParse() throws Exception { File document = new File("src/test/resources/test.doc"); template.sendBody("direct:start3", document); resultEndpoint.setExpectedMessageCount(1); resultEndpoint.expectedMessagesMatches(new Predicate() { @Override public boolean matches(Exchange exchange) { Object body = exchange.getIn().getBody(String.class); Map<String, Object> headerMap = exchange.getIn().getHeaders(); assertThat(body, instanceOf(String.class)); assertThat((String) body, containsString("<body/>")); assertThat(headerMap.get(Exchange.CONTENT_TYPE), equalTo("application/msword")); return true; } }); resultEndpoint.assertIsSatisfied(); }
Source:
public Report getReport(long reportId, EnumSet<ReportInclusion> includes, Integer pageSize, Integer page) throws SmartsheetException{ this.checkParameters(pageSize, page); String path = "reports/" + reportId; HashMap<String, String> parameters = new HashMap<String, String>(); parameters.put("include", QueryUtil.generateCommaSeparatedList(includes)); if (pageSize != null) { parameters.put("pageSize", pageSize.toString()); } if (page != null) { parameters.put("page", page.toString()); } path += QueryUtil.generateUrl(null, parameters); return this.getResource(path, Report.class); }

Target:
public Report getReport(long reportId, EnumSet<ReportInclusion> includes, Integer pageSize, Integer page) throws SmartsheetException{ String path = "reports/" + reportId; HashMap<String, String> parameters = new HashMap<String, String>(); parameters.put("include", QueryUtil.generateCommaSeparatedList(includes)); parameters.put("pageSize", pageSize.toString()); parameters.put("page", page.toString()); path += QueryUtil.generateUrl(null, parameters); return this.getResource(path, Report.class); }
Source:
public boolean updateSeenCategories(final Long accountId, final InsightCard.Category category) { final Map<String, AttributeValueUpdate> updates = Maps.newHashMap(); updates.put(MarketingInsightsSeenAttribute.CATEGORIES.shortName(), Util.addToSetAction(category.getValue())); final String now = DateTime.now(DateTimeZone.UTC).toString(DateTimeUtil.DYNAMO_DB_DATETIME_FORMAT); updates.put(MarketingInsightsSeenAttribute.UPDATED.shortName(), Util.putAction(now)); final Map<String, AttributeValue> key = getKey(accountId); final UpdateItemResult result = dynamoDBClient.updateItem(tableName, key, updates, "ALL_NEW"); if (result.getAttributes() == null) { return false; } if (result.getAttributes().size() > 0) { final List<String> categories = result.getAttributes().get(MarketingInsightsSeenAttribute.CATEGORIES.shortName()).getNS(); final String updatedCategory = String.valueOf(category.getValue()); if (categories.contains(updatedCategory)) { return true; } } return false; }

Target:
public boolean updateSeenCategories(final Long accountId, final InsightCard.Category category) { final Map<String, AttributeValueUpdate> updates = Maps.newHashMap(); updates.put(MarketingInsightsSeenAttribute.CATEGORIES.shortName(), Util.addToSetAction(category.getValue())); final String now = DateTime.now(DateTimeZone.UTC).toString(DateTimeUtil.DYNAMO_DB_DATETIME_FORMAT); updates.put(MarketingInsightsSeenAttribute.UPDATED.shortName(), Util.putAction(now)); final Map<String, AttributeValue> key = getKey(accountId); final UpdateItemResult result = dynamoDBClient.updateItem(tableName, key, updates, "ALL_NEW"); if (result.getAttributes() == null) { return false; } if (!result.getAttributes().isEmpty()) { final List<String> categories = result.getAttributes().get(MarketingInsightsSeenAttribute.CATEGORIES.shortName()).getNS(); final String updatedCategory = String.valueOf(category.getValue()); if (categories.contains(updatedCategory)) { return true; } } return false; }
Source:
protected Void doInBackground(Void... voids) { SimperiumUtils.updateLastSeenTime(); return null; }

Target:
protected Boolean doInBackground(Void... voids) { return SimperiumUtils.updateLastSeenTime(); }
Source:
public ResultScanner adapt( final com.google.cloud.bigtable.grpc.scanner.ResultScanner<FlatRow> bigtableResultScanner, final Span span) { return new AbstractClientScanner() { @Override public Result next() throws IOException { FlatRow row = bigtableResultScanner.next(); if (row == null) { closeSpan(); return null; } if (!hasMatchingLabels(row)) { close(); return null; } return rowAdapter.adaptResponse(row); } protected void closeSpan() { try (NonThrowingCloseable s = Tracing.getTracer().withSpan(span)) { span.end(); } } @Override public void close() { try { bigtableResultScanner.close(); } catch (IOException ioe) { throw Throwables.propagate(ioe); } finally { closeSpan(); } } public boolean renewLease() { throw new UnsupportedOperationException("renewLease"); } }; }

Target:
public ResultScanner adapt( final com.google.cloud.bigtable.grpc.scanner.ResultScanner<FlatRow> bigtableResultScanner, final Span span) { return new AbstractClientScanner() { @Override public Result next() throws IOException { FlatRow row = bigtableResultScanner.next(); if (row == null) { closeSpan(); return null; } if (!hasMatchingLabels(row)) { close(); return null; } return rowAdapter.adaptResponse(row); } protected void closeSpan() { try (AutoCloseable c = Tracing.getTracer().withSpan(span)) { span.end(); } catch (Exception e) { } } @Override public void close() { try { bigtableResultScanner.close(); } catch (IOException ioe) { throw Throwables.propagate(ioe); } finally { closeSpan(); } } public boolean renewLease() { throw new UnsupportedOperationException("renewLease"); } }; }
Source:
public boolean shouldSchedule(Queue.Task p, List<Action> actions) { for (Action action : actions) { if (action instanceof CauseAction) { for (Cause c : ((CauseAction) action).getCauses()) { if (c instanceof BranchIndexingCause) { if (p instanceof Job) { Job j = (Job) p; if (j.getParent() instanceof MultiBranchProject) { OverrideIndexTriggersJobProperty overrideProp = (OverrideIndexTriggersJobProperty) j.getProperty(OverrideIndexTriggersJobProperty.class); for (BranchProperty prop : ((MultiBranchProject) j.getParent()).getProjectFactory().getBranch(j).getProperties()) { if (prop instanceof NoTriggerBranchProperty && (overrideProp == null || !overrideProp.getEnableTriggers())) { return false; } } } } } } } } return true; }

Target:
public boolean shouldSchedule(Queue.Task p, List<Action> actions) { for (Action action : actions) { if (action instanceof CauseAction) { for (Cause c : ((CauseAction) action).getCauses()) { if (c instanceof BranchIndexingCause) { if (p instanceof Job) { Job<?,?> j = (Job) p; if (j.getParent() instanceof MultiBranchProject) { OverrideIndexTriggersJobProperty overrideProp = j.getProperty(OverrideIndexTriggersJobProperty.class); if (overrideProp != null) { return overrideProp.getEnableTriggers(); } else { for (BranchProperty prop : ((MultiBranchProject) j.getParent()).getProjectFactory().getBranch(j).getProperties()) { if (prop instanceof NoTriggerBranchProperty) { return false; } } } } } } } } } return true; }
Source:
public BtVodDescribedFieldsExtractor( ImageExtractor imageExtractor, TopicCreatingTopicResolver topicCreatingTopicResolver, TopicWriter topicWriter ) { this.imageExtractor = checkNotNull(imageExtractor); this.topicCreatingTopicResolver = checkNotNull(topicCreatingTopicResolver); this.topicWriter = checkNotNull(topicWriter); this.subGenreParser = new BtVodSubGenreParser(); this.topics = CacheBuilder.newBuilder() .maximumSize(1000) .build(); }

Target:
public BtVodDescribedFieldsExtractor( ImageExtractor imageExtractor, TopicCreatingTopicResolver topicCreatingTopicResolver, TopicWriter topicWriter ) { this.imageExtractor = checkNotNull(imageExtractor); this.topicCreatingTopicResolver = checkNotNull(topicCreatingTopicResolver); this.topicWriter = checkNotNull(topicWriter); this.subGenreParser = new BtVodSubGenreParser(); this.topics = CacheBuilder.newBuilder() .maximumSize(TOPIC_CACHE_SIZE) .build(); }
Source:
protected Object cleanSimplePropertyValue( Class<? extends PersistableBusinessObject> businessObjectClass, String propertyName, Object propertyValue) { if (propertyValue instanceof String) { return cleanStringValue(businessObjectClass, propertyName, (String) propertyValue); } else if (propertyValue instanceof Date) { return cleanDateValue(businessObjectClass, propertyName, (Date) propertyValue); } else if (propertyValue instanceof Boolean) { return cleanBooleanValue(businessObjectClass, propertyName, (Boolean) propertyValue); } else { return propertyValue; } }

Target:
protected Object cleanSimplePropertyValue( Class<? extends PersistableBusinessObject> businessObjectClass, String propertyName, Object propertyValue) { if (propertyValue instanceof String) { return cleanStringValue(businessObjectClass, propertyName, (String) propertyValue); } else if (propertyValue instanceof Date) { return cleanDateValue(businessObjectClass, propertyName, (Date) propertyValue); } else if (propertyValue instanceof Boolean) { return cleanBooleanValue(businessObjectClass, propertyName, (Boolean) propertyValue); } else if (ObjectUtils.isNull(propertyValue)) { LOG.debug("cleanSimplePropertyValue, property " + StringUtils.defaultIfBlank(propertyName, "[Blank]") + " is null on business object " + businessObjectClass.getName()); } else { LOG.debug("cleanSimplePropertyValue, no cleaning for property " + StringUtils.defaultIfBlank(propertyName, "[Blank]") + " on business object " + businessObjectClass.getName() + " (value: " + propertyValue.toString() + ")"); } return propertyValue; }
Source:
private MacPool createPoolInternal(org.ovirt.engine.core.common.businessentities.MacPool macPool, boolean engineStartup) { if (macPools.containsKey(macPool.getId())) { throw new IllegalStateException(UNABLE_TO_CREATE_MAC_POOL_IT_ALREADY_EXIST); } log.debug("Creating new MacPool {}.", macPool); MacPool poolForScope = macPoolFactory.createMacPool(macPool, engineStartup); boolean isOverlapping = macPools.entrySet().stream() .anyMatch(poolEntry -> poolEntry.getKey() != poolForScope.getId() && poolEntry.getValue().overlaps(poolForScope)); if (isOverlapping) { String msg = "MAC pool '%s' overlaps with other MAC pools in the system"; log.warn(String.format(msg, macPool.getName())); auditLogDirector.log(new AuditLogableImpl(), AuditLogType.MAC_POOL_VIOLATES_NO_OVERLAPPING_RANGES, String.format(msg, macPool.getName())); } macPools.put(macPool.getId(), poolForScope); return poolForScope; }

Target:
private MacPool createPoolInternal(org.ovirt.engine.core.common.businessentities.MacPool macPool, boolean engineStartup) { if (macPools.containsKey(macPool.getId())) { throw new IllegalStateException(UNABLE_TO_CREATE_MAC_POOL_IT_ALREADY_EXIST); } log.debug("Creating new MacPool {}.", macPool); MacPool poolForScope = macPoolFactory.createMacPool(macPool, engineStartup); List<MacPool> overlappingPools = macPools.entrySet().stream() .filter(poolEntry -> poolEntry.getKey() != poolForScope.getId() && poolEntry.getValue().overlaps(poolForScope)) .map(Map.Entry::getValue) .collect(Collectors.toList()); if (!overlappingPools.isEmpty()) { StringJoiner joiner = new StringJoiner(", "); overlappingPools.forEach(pool -> joiner.add(pool.getId().toString())); String macReport = joiner.toString(); String msg = "MAC pool '%s' overlaps with other MAC pools: [%s]"; log.warn(String.format(msg, macPool.getName(), macReport)); AuditLogableImpl auditLoggable = new AuditLogableImpl(); auditLoggable.addCustomValue("macPoolName", macPool.getName()); auditLoggable.addCustomValue("overlapping", macReport); auditLogDirector.log(auditLoggable, AuditLogType.MAC_POOL_VIOLATES_NO_OVERLAPPING_MAC_POOLS); } macPools.put(macPool.getId(), poolForScope); return poolForScope; }
Source:
private void appendData(DecodedBlockNode[] decodedBlocks, int fixedWidthRowSize, List<Integer> variableWidthChannels, OutputBuffer outputBuffer) { if (decodedBlocks.length != channelCount) { throw new IllegalArgumentException(format("Unexpected number of decoded blocks %d. It should be %d.", decodedBlocks.length, channelCount)); } if (positionCount == 0) { return; } if (channelCount == 0) { bufferedRowCount += positionCount; return; } initializeBlockEncodingBuffers(decodedBlocks); verify(blockEncodingBuffers != null, "blockEncodingBuffers is null"); for (int i = 0; i < channelCount; i++) { blockEncodingBuffers[i].setupDecodedBlocksAndPositions(decodedBlocks[i], positions, positionCount); } populateSerializedRowSizes(fixedWidthRowSize, variableWidthChannels); int offset = 0; do { int batchSize = calculateNextBatchSize(fixedWidthRowSize, variableWidthChannels, offset); for (int i = 0; i < channelCount; i++) { blockEncodingBuffers[i].setNextBatch(offset, batchSize); blockEncodingBuffers[i].appendDataInBatch(); } bufferedRowCount += batchSize; offset += batchSize; if (bufferFull) { flush(outputBuffer); bufferFull = false; } } while (offset < positionCount); }

Target:
private void appendData(DecodedBlockNode[] decodedBlocks, int fixedWidthRowSize, List<Integer> variableWidthChannels, OutputBuffer outputBuffer) { if (decodedBlocks.length != channelCount) { throw new IllegalArgumentException(format("Unexpected number of decoded blocks %d. It should be %d.", decodedBlocks.length, channelCount)); } if (positionCount == 0) { return; } if (channelCount == 0) { bufferedRowCount += positionCount; return; } initializeBlockEncodingBuffers(decodedBlocks); for (int i = 0; i < channelCount; i++) { blockEncodingBuffers[i].setupDecodedBlocksAndPositions(decodedBlocks[i], positions, positionCount); } populateSerializedRowSizes(fixedWidthRowSize, variableWidthChannels); int offset = 0; do { int batchSize = calculateNextBatchSize(fixedWidthRowSize, variableWidthChannels, offset); for (int i = 0; i < channelCount; i++) { blockEncodingBuffers[i].setNextBatch(offset, batchSize); blockEncodingBuffers[i].appendDataInBatch(); } bufferedRowCount += batchSize; offset += batchSize; if (bufferFull) { flush(outputBuffer); bufferFull = false; } } while (offset < positionCount); }
Source:
private void writeHeaderLong(FileSmoosher smoosher, RandomAccessFile headerFile, int bagSizePower, byte[] buffer) throws IOException { ByteBuffer helperBuffer = ByteBuffer.allocate(Ints.BYTES).order(ByteOrder.nativeOrder()); try (CountingOutputStream finalHeaderOut = new CountingOutputStream( ioPeon.makeOutputStream(makeFilename("header_final")))) { int numberOfElementsPerValueFile = 1 << bagSizePower; long currentNumBytes = 0; long relativeRefBytes = 0; long relativeNumBytes; headerFile.seek(0); for (int pos = 0; pos < numWritten; pos++) { if ((pos & (numberOfElementsPerValueFile - 1)) == 0) { relativeRefBytes = currentNumBytes; numberOfElementsPerValueFile = 1 << bagSizePower; } currentNumBytes = Long.reverseBytes(headerFile.readLong()); relativeNumBytes = currentNumBytes - relativeRefBytes; helperBuffer.putInt(0, Ints.checkedCast(relativeNumBytes)); finalHeaderOut.write(helperBuffer.array()); } long numBytesToPutInFile = finalHeaderOut.getCount(); finalHeaderOut.close(); try (InputStream is = new FileInputStream(ioPeon.getFile(makeFilename("header_final")))) { try (SmooshedWriter smooshChannel = smoosher .addWithSmooshedWriter(generateHeaderFileName(filenameBase), numBytesToPutInFile)) { writeBytesIntoSmooshedChannel(numBytesToPutInFile, buffer, smooshChannel, is); } } } }

Target:
private void writeHeaderLong(FileSmoosher smoosher, RandomAccessFile headerFile, int bagSizePower, byte[] buffer) throws IOException { ByteBuffer helperBuffer = ByteBuffer.allocate(Ints.BYTES).order(ByteOrder.nativeOrder()); try (CountingOutputStream finalHeaderOut = new CountingOutputStream( ioPeon.makeOutputStream(makeFilename("header_final")))) { int numberOfElementsPerValueFile = 1 << bagSizePower; long currentNumBytes = 0; long relativeRefBytes = 0; long relativeNumBytes; headerFile.seek(0); for (int pos = 0; pos < numWritten; pos++) { if ((pos & (numberOfElementsPerValueFile - 1)) == 0) { relativeRefBytes = currentNumBytes; } currentNumBytes = Long.reverseBytes(headerFile.readLong()); relativeNumBytes = currentNumBytes - relativeRefBytes; writeIntValueToOutputStream(helperBuffer, Ints.checkedCast(relativeNumBytes), finalHeaderOut); } long numBytesToPutInFile = finalHeaderOut.getCount(); finalHeaderOut.close(); try (InputStream is = new FileInputStream(ioPeon.getFile(makeFilename("header_final")))) { try (SmooshedWriter smooshChannel = smoosher .addWithSmooshedWriter(generateHeaderFileName(filenameBase), numBytesToPutInFile)) { writeBytesIntoSmooshedChannel(numBytesToPutInFile, buffer, smooshChannel, is); } } } }
Source:
private static XMLInputFactory getOrCreateInputFactory() throws FactoryConfigurationError { if (ourInputFactory == null) { try { Class.forName("ca.uhn.fhir.repackage.javax.xml.stream.XMLInputFactory"); System.setProperty("javax.xml.stream.XMLInputFactory", "com.ctc.wstx.stax.WstxInputFactory"); } catch (ClassNotFoundException e) { } XMLInputFactory inputFactory = newInputFactory(); if (!ourHaveLoggedStaxImplementation) { logStaxImplementation(inputFactory.getClass()); } inputFactory.setProperty(XMLInputFactory.SUPPORT_DTD, false); inputFactory.setProperty("javax.xml.stream.isSupportingExternalEntities", false); try { Class.forName("com.ctc.wstx.stax.WstxInputFactory"); boolean isWoodstox = inputFactory instanceof com.ctc.wstx.stax.WstxInputFactory; if ( !isWoodstox ) { try { isWoodstox = inputFactory.getProperty( "org.codehaus.stax2.implVersion" ) != null; } catch ( IllegalArgumentException e ) { } } if (isWoodstox) { inputFactory.setProperty(WstxInputProperties.P_UNDECLARED_ENTITY_RESOLVER, XML_RESOLVER); try { inputFactory.setProperty(WstxInputProperties.P_MAX_ATTRIBUTE_SIZE, "100000000"); } catch (IllegalArgumentException e) { } } } catch (ClassNotFoundException e) { ourLog.debug("WstxOutputFactory (Woodstox) not found on classpath"); } ourInputFactory = inputFactory; } return ourInputFactory; }

Target:
private static XMLInputFactory getOrCreateInputFactory() throws FactoryConfigurationError { if (ourInputFactory == null) { try { Class.forName("ca.uhn.fhir.repackage.javax.xml.stream.XMLInputFactory"); System.setProperty("javax.xml.stream.XMLInputFactory", "com.ctc.wstx.stax.WstxInputFactory"); } catch (ClassNotFoundException e) { } XMLInputFactory inputFactory = newInputFactory(); if (!ourHaveLoggedStaxImplementation) { logStaxImplementation(inputFactory.getClass()); } inputFactory.setProperty(XMLInputFactory.SUPPORT_DTD, false); inputFactory.setProperty("javax.xml.stream.isSupportingExternalEntities", false); try { Class.forName("com.ctc.wstx.stax.WstxInputFactory"); boolean isWoodstox = inputFactory instanceof com.ctc.wstx.stax.WstxInputFactory; if ( !isWoodstox ) { try { isWoodstox = inputFactory.getProperty( "org.codehaus.stax2.implVersion" ) != null; } catch ( Exception e ) { } } if (isWoodstox) { inputFactory.setProperty(WstxInputProperties.P_UNDECLARED_ENTITY_RESOLVER, XML_RESOLVER); try { inputFactory.setProperty(WstxInputProperties.P_MAX_ATTRIBUTE_SIZE, "100000000"); } catch (IllegalArgumentException e) { } } } catch (ClassNotFoundException e) { ourLog.debug("WstxOutputFactory (Woodstox) not found on classpath"); } ourInputFactory = inputFactory; } return ourInputFactory; }
Source:
public void writeExternal(ObjectOutput out) throws IOException { super.writeExternal(out); out.writeUTF(bulkImportDirectory); out.writeBoolean(samplingOnly); out.writeBoolean(outputKeysOnly); out.writeBoolean(skipSampling); out.writeUTF(indexName); out.writeDouble(sampleFraction); ArrayUtil.writeByteArray(out, token); }

Target:
public void writeExternal(ObjectOutput out) throws IOException { super.writeExternal(out); out.writeUTF(bulkImportDirectory); out.writeBoolean(samplingOnly); out.writeBoolean(outputKeysOnly); out.writeBoolean(skipSampling); out.writeUTF(indexName); out.writeDouble(sampleFraction); }
Source:
public RegisteredService findServiceBy(final long id) { RegisteredService result = this.services.get(id); if (result == null) { result = this.serviceRegistry.findServiceById(id); } return validateRegisteredService(result); }

Target:
public RegisteredService findServiceBy(final long id) { val result = this.services.get(id, k -> this.serviceRegistry.findServiceById(id)); return validateRegisteredService(result); }
Source:
for (Class<? extends Context> contextClass: CONTEXT_CLASSES) { Map<String, Attribute<?>> simpleAttributeNameToAttribute = Maps.newHashMap(); CONTEXT_TO_ATTRIBUTE_NAME_TO_ATTRIBUTE.put(contextClass, simpleAttributeNameToAttribute); Set<Attribute<Object>> attributes = AttributeInitializer.getAttributesNoSave(contextClass); LOG.debug("context class and attributes {}", contextClass, attributes); for (Attribute<Object> attribute: attributes) { simpleAttributeNameToAttribute.put(AttributeParseUtils.getSimpleName(attribute), attribute); } }

Target:
for (Class<? extends Context> contextClass: CONTEXT_CLASSES) { Set<String> contextAttributes = Sets.newHashSet(); Field[] fields = contextClass.getDeclaredFields(); for (Field field: fields) { if (!Attribute.class.isAssignableFrom(field.getType())) { continue; } contextAttributes.add(field.getName()); } CONTEXT_CLASS_TO_ATTRIBUTES.put(contextClass, contextAttributes); }
Source:
public static String createSubscriptionListUri(final Optional<String> owningApplication, final Set<String> eventTypes, final int offset, final int limit) { final StringBuilder urlBuilder = new StringBuilder("/subscriptions?"); if (!eventTypes.isEmpty()) { eventTypes.stream() .map(et -> format("event_type={0}", et)) .forEach(et -> urlBuilder.append(et).append("&")); } owningApplication.ifPresent(owningApp -> urlBuilder .append("owning_application=") .append(owningApp) .append("&")); urlBuilder .append("offset=") .append(offset) .append("&limit=") .append(limit); return urlBuilder.toString(); }

Target:
public static String createSubscriptionListUri(final Optional<String> owningApplication, final Set<String> eventTypes, final int offset, final int limit) { final UriComponentsBuilder urlBuilder = UriComponentsBuilder.fromPath("/subscriptions"); if (!eventTypes.isEmpty()) { urlBuilder.queryParam("event_type", eventTypes.toArray()); } owningApplication.ifPresent(owningApp -> urlBuilder.queryParam("owning_application", owningApp)); return urlBuilder .queryParam("offset", offset) .queryParam("limit", limit) .build() .toString(); }
Source:
public void validate(final boolean binary) { if (binary) { throw new RuntimeException("Programmer error: wrong validator used"); } }

Target:
public void validate(final boolean binary) { if (binary) { throw new IllegalStateException("Programmer error: wrong validator used"); } }
Source:
public void testDeserialize() { String jsonStr = "[\"2016-06-20T04:25:16.218+0000\", \"2016-06-20T04:25:16\", \"2016-06-20T04:25:16.218Z\",\"2015-05-28T18:01:57Z\",\"2016-06-20T04:25:16.218+0000\"]"; JsonParser parser = new JsonParser(); JsonElement element = parser.parse(jsonStr); DateDeserializer deserializer = new DateDeserializer(); for (int i = 0; i < 5; i++) { assertTrue(deserializer.deserialize(element.getAsJsonArray().get(i), null, null) != null); } }

Target:
public void testDeserialize() { String[] dateStrings = {"2016-06-20T04:25:16.218+0000", "2016-06-20T04:25:16", "2016-06-20T04:25:16.218Z", "2015-05-28T18:01:57Z", "2016-06-20T04:25:16.218+0000"}; String jsonStr = "[\"" + StringUtils.join(dateStrings,"\",\"") + "\"]"; JsonParser parser = new JsonParser(); JsonElement element = parser.parse(jsonStr); DateDeserializer deserializer = new DateDeserializer(); for (int i = 0; i < 5; i++) { assertTrue(deserializer.deserialize(element.getAsJsonArray().get(i), null, null) != null); } }
Source:
private void addReferenceUpdates(IProgressMonitor pm) { pm.beginTask("", fReferences.length); String editName= RefactoringCoreMessages.RenameFieldRefactoring_Update_field_reference; for (SearchResultGroup fReference : fReferences) { ICompilationUnit cu= fReference.getCompilationUnit(); if (cu == null) continue; SearchMatch[] results= fReference.getSearchResults(); for (SearchMatch result : results) { addTextEdit(fChangeManager.get(cu), editName, createTextChange(result)); } pm.worked(1); } }

Target:
private void addReferenceUpdates(IProgressMonitor pm) { pm.beginTask("", fReferences.length); String editName= RefactoringCoreMessages.RenameFieldRefactoring_Update_field_reference; for (SearchResultGroup reference : fReferences) { ICompilationUnit cu= reference.getCompilationUnit(); if (cu == null) continue; for (SearchMatch result : reference.getSearchResults()) { addTextEdit(fChangeManager.get(cu), editName, createTextChange(result)); } pm.worked(1); } }
Source:
protected void onDestroy() { super.onDestroy(); if (mSched != null) { mSched.setCurrentCard(null); } Timber.d("onDestroy()"); if (mSpeakText) { ReadText.releaseTts(); } if (mUnmountReceiver != null) { unregisterReceiver(mUnmountReceiver); } if (mCardFrame != null) { mCardFrame.removeAllViews(); } destroyWebView(mCard); }

Target:
protected void onDestroy() { super.onDestroy(); if (mSched != null) { mSched.discardCurrentCard(); } Timber.d("onDestroy()"); if (mSpeakText) { ReadText.releaseTts(); } if (mUnmountReceiver != null) { unregisterReceiver(mUnmountReceiver); } if (mCardFrame != null) { mCardFrame.removeAllViews(); } destroyWebView(mCard); }
Source:
static void brandGlowEffect(Context context, int brandColor) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { try { int glowDrawableId = context.getResources().getIdentifier("overscroll_glow", "drawable", "android"); Drawable androidGlow = context.getResources().getDrawable(glowDrawableId); assert androidGlow != null; androidGlow.setColorFilter(brandColor, PorterDuff.Mode.SRC_IN); int edgeDrawableId = context.getResources().getIdentifier("overscroll_edge", "drawable", "android"); Drawable androidEdge = context.getResources().getDrawable(edgeDrawableId); assert androidEdge != null; androidEdge.setColorFilter(brandColor, PorterDuff.Mode.SRC_IN); } catch (Exception ignored) { } } }

Target:
static void brandGlowEffect(Context context, int brandColor) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { try { int glowDrawableId = context.getResources().getIdentifier("overscroll_glow", "drawable", "android"); Drawable androidGlow = context.getResources().getDrawable(glowDrawableId); androidGlow.setColorFilter(brandColor, PorterDuff.Mode.SRC_IN); int edgeDrawableId = context.getResources().getIdentifier("overscroll_edge", "drawable", "android"); Drawable androidEdge = context.getResources().getDrawable(edgeDrawableId); androidEdge.setColorFilter(brandColor, PorterDuff.Mode.SRC_IN); } catch (Exception ignored) { } } }
Source:
public void onShoppingCartQuantityUpdated_updatesViewWithNewQuantity_whenCartItemIsSameAsCurrentOne() { int newQuantity = 414; ShoppingCartQuantityChangeEvent updateEvent = new ShoppingCartQuantityChangeEvent(currentShoppingCartItem, newQuantity); presenter.onShoppingCartQuantityChanged(updateEvent); verify(view).updateQuantity(newQuantity); }

Target:
public void onShoppingCartQuantityUpdated_updatesViewWithNewQuantity_whenCartItemIsSameAsCurrentOne() { ShoppingCartQuantityChangeEvent updateEvent = new ShoppingCartQuantityChangeEvent(currentShoppingCartItem, NEW_QUANTITY); presenter.onShoppingCartQuantityChanged(updateEvent); verify(view).updateQuantity(NEW_QUANTITY); }
Source:
public IpUtil() throws RuntimeException { ipAddressMatcherCache = new HashMap<String, IpAddressMatcher>(); for (String proxyIp : trustedProxies) { String sanitizedProxyIp = proxyIp.trim(); try { IpAddressMatcher matcher = new IpAddressMatcher(sanitizedProxyIp); ipAddressMatcherCache.put(sanitizedProxyIp, matcher); } catch (IllegalArgumentException ex) { throw new RuntimeException("Invalid entries found in the default trusted proxies list", ex); } } }

Target:
public IpUtil() { ipAddressMatcherCache = new HashSet<IpAddressMatcher>(); for (String proxyIp : trustedProxies) { String sanitizedProxyIp = proxyIp.trim(); try { IpAddressMatcher matcher = new IpAddressMatcher(sanitizedProxyIp); ipAddressMatcherCache.add(matcher); } catch (IllegalArgumentException e) { throw new RuntimeException("Invalid entry '" + proxyIp + "' found in the default trusted proxies list", e); } } }
Source:
private boolean isValidOperation(@NonNull final ContentProviderOperation operation) { return !NO_OPERATION.equals(operation); }

Target:
private static boolean isValidOperation(@NonNull final ContentProviderOperation operation) { return !NO_OPERATION.equals(operation); }
Source:
@NotNull private Cache makeCache() throws IOException { File cacheDir = File.createTempFile("cache-", ".dir"); cacheDir.delete(); return new Cache(cacheDir, 1024 * 1024); }

Target:
private Cache makeCache() throws IOException { File cacheDir = File.createTempFile("cache-", ".dir"); cacheDir.delete(); return new Cache(cacheDir, 1024 * 1024); }
Source:
public void testUnmarshallTopLevelEventWithEdgesEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateConditionalEvent emptyEvent = getCatchingIntermediateNodeById(diagram, EMPTY_WITH_EDGES_TOP_LEVEL_EVENT_ID, HAS_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptyEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertConditionalEventExecutionSet(emptyEvent.getExecutionSet(), CONDITION_EXPRESSION_SCRIPT_DEFAULT_VALUE, CONDITION_EXPRESSION_LANGUAGE, CONDITION_ERPRESSION_TYPE, CANCELLING, ""); }

Target:
public void testUnmarshallTopLevelEventWithEdgesEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateConditionalEvent emptyEvent = getCatchingIntermediateNodeById(diagram, EMPTY_WITH_EDGES_TOP_LEVEL_EVENT_ID, HAS_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptyEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertConditionalEventExecutionSet(emptyEvent.getExecutionSet(), CONDITION_EXPRESSION_SCRIPT_DEFAULT_VALUE, CONDITION_EXPRESSION_LANGUAGE, CONDITION_ERPRESSION_TYPE, CANCELLING, EMPTY_VALUE); }