auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected CollectionRest createAndReturn(Context context, UUID id) throws AuthorizeException { if (id == null) { throw new DSpaceBadRequestException("The given parent parameter was invalid: " + id); } HttpServletRequest req = getRequestService().getCurrentRequest().getHttpServletRequest(); ObjectMapper mapper = new ObjectMapper(); CollectionRest collectionRest; try { ServletInputStream input = req.getInputStream(); collectionRest = mapper.readValue(input, CollectionRest.class); } catch (IOException e1) { throw new UnprocessableEntityException("Error parsing request body: " + e1.toString()); } Collection collection; try { Community parent = communityService.find(context, id); if (parent == null) { throw new UnprocessableEntityException("Parent community for id: " + id + " not found"); } collection = cs.create(context, parent); cs.update(context, collection); metadataConverter.setMetadata(context, collection, collectionRest.getMetadata()); } catch (SQLException e) { throw new RuntimeException("Unable to create new Collection under parent Community " + id, e); } return converter.convert(collection); }

Target:
protected CollectionRest createAndReturn(Context context, UUID id) throws AuthorizeException { if (id == null) { throw new DSpaceBadRequestException("Parent Community UUID is null. " + "Cannot create a Collection without providing a parent Community"); } HttpServletRequest req = getRequestService().getCurrentRequest().getHttpServletRequest(); ObjectMapper mapper = new ObjectMapper(); CollectionRest collectionRest; try { ServletInputStream input = req.getInputStream(); collectionRest = mapper.readValue(input, CollectionRest.class); } catch (IOException e1) { throw new UnprocessableEntityException("Error parsing request body.", e1); } Collection collection; try { Community parent = communityService.find(context, id); if (parent == null) { throw new UnprocessableEntityException("Parent community for id: " + id + " not found"); } collection = cs.create(context, parent); cs.update(context, collection); metadataConverter.setMetadata(context, collection, collectionRest.getMetadata()); } catch (SQLException e) { throw new RuntimeException("Unable to create new Collection under parent Community " + id, e); } return converter.convert(collection); }
Source:
private ConfigurationInstance getConfiguration(Pair<ResolverSetResult, ResolverSetResult> resolverSetResult, CoreEvent event) throws Exception { ConfigurationInstance configuration = cache.getIfPresent(resolverSetResult); if (configuration != null) { updateUsageStatistic(configuration); return configuration; } configuration = cache.getIfPresent(resolverSetResult); if (configuration == null) { configuration = createConfiguration(resolverSetResult, event); cache.put(resolverSetResult, configuration); } updateUsageStatistic(configuration); return configuration; }

Target:
private ConfigurationInstance getConfiguration(Pair<ResolverSetResult, ResolverSetResult> resolverSetResult, CoreEvent event) { return cache.get(new ResolverResultAndEvent(resolverSetResult, event)); }
Source:
protected void executeVdsBrokerCommand() { status = getBroker().glusterVolumeGeoRepSessionStop(getParameters().getVolumeName(), getParameters().getSlaveHost(), getParameters().getVolumeName(), getParameters().getForce()); proceedProxyReturnValue(); }

Target:
protected void executeVdsBrokerCommand() { status = getBroker().glusterVolumeGeoRepSessionStop(getParameters().getVolumeName(), getParameters().getSlaveHost(), getParameters().getSlaveVolume(), getParameters().getForce()); proceedProxyReturnValue(); }
Source:
private void writeResponse(Request httpRequest, Response httpResponse, List<OrganizationDto> organizations, Set<String> adminOrganizationUuids, Paging paging) { Organizations.SearchWsResponse.Builder response = Organizations.SearchWsResponse.newBuilder(); response.setPaging(paging); Organization.Builder wsOrganization = Organization.newBuilder(); organizations .forEach(o -> { boolean isAdmin = userSession.isRoot() || adminOrganizationUuids.contains(o.getUuid()); wsOrganization.clear(); wsOrganization.setIsAdmin(isAdmin); response.addOrganizations(wsSupport.toOrganization(wsOrganization, o)); }); writeProtobuf(response.build(), httpRequest, httpResponse); }

Target:
private void writeResponse(Request httpRequest, Response httpResponse, List<OrganizationDto> organizations, Set<String> adminOrganizationUuids, Paging paging) { Organizations.SearchWsResponse.Builder response = Organizations.SearchWsResponse.newBuilder(); response.setPaging(paging); Organization.Builder wsOrganization = Organization.newBuilder(); organizations .forEach(o -> { boolean isAdmin = adminOrganizationUuids.contains(o.getUuid()); wsOrganization.clear(); wsOrganization.setIsAdmin(isAdmin); response.addOrganizations(wsSupport.toOrganization(wsOrganization, o)); }); writeProtobuf(response.build(), httpRequest, httpResponse); }
Source:
public Callback getCallback(ObjectNode node, String location, ParseResult result) { if (node == null) { return null; } Callback callback = new Callback(); Set<String> keys = getKeys(node); for(String name : keys) { JsonNode value = node.get(name); if (!value.getNodeType().equals(JsonNodeType.OBJECT)) { result.invalidType(location, name, "object", value); } else { if (node!= null){ callback.addPathItem(name,getPathItem((ObjectNode) value,location,result)); callback.setExtensions(new LinkedHashMap<>()); keys = getKeys(node); for (String key : keys) { if (key.startsWith("x-")) { callback.getExtensions().put(key, Json.mapper().convertValue(node.get(key), Object.class)); } } } } } return callback; }

Target:
public Callback getCallback(ObjectNode node, String location, ParseResult result) { if (node == null) { return null; } Callback callback = new Callback(); Set<String> keys = getKeys(node); for(String name : keys) { JsonNode value = node.get(name); if (!value.getNodeType().equals(JsonNodeType.OBJECT)) { result.invalidType(location, name, "object", value); } else { if (node!= null){ callback.addPathItem(name,getPathItem((ObjectNode) value,location,result)); Map <String,Object> extensions = getExtensions(node,location,result); if(extensions != null && extensions.size() > 0) { callback.setExtensions(extensions); } } } } return callback; }
Source:
public void onRunningTask(final RunningTask task) { final ActiveContext context = pendingTaskSubmissions.get(task.getActiveContext().getId()); if (context != null) { runningTasks.put(task.getId(), task); runningTaskLatch.countDown(); } }

Target:
public void onRunningTask(final RunningTask task) { if (pendingTaskSubmissions.containsKey(task.getActiveContext().getId())) { runningTasks.put(task.getId(), task); runningTaskLatch.countDown(); } }
Source:
protected void runInProtocolStage(final Runnable task) { try { executor.execute(new Runnable() { @Override public void run() { try { task.run(); } catch (final Throwable t) { LOGGER.error("exception in protocol stage thread: {}", t.getMessage(), t); } } }); } catch (RejectedExecutionException e) { LOGGER.debug("{} execute:", this, e); } }

Target:
private void runInProtocolStage(final Runnable task) { try { executor.execute(new Runnable() { @Override public void run() { try { task.run(); } catch (final Throwable t) { LOGGER.error("exception in protocol stage thread: {}", t.getMessage(), t); } } }); } catch (RejectedExecutionException e) { LOGGER.debug("{} execute:", this, e); } }
Source:
public void buildCidMap__onPartWithNoBody__shouldReturnEmptyMap() throws Exception { AttachmentInfoExtractor attachmentInfoExtractor = mock(AttachmentInfoExtractor.class); Part part = mock(Part.class); when(part.getContentId()).thenReturn(null); Map<String,Uri> result = AttachmentResolver.buildCidToAttachmentUriMap(attachmentInfoExtractor, part); assertTrue(result.isEmpty()); }

Target:
public void buildCidMap__onPartWithNoBody__shouldReturnEmptyMap() throws Exception { Part part = new MimeBodyPart(); Map<String,Uri> result = AttachmentResolver.buildCidToAttachmentUriMap(attachmentInfoExtractor, part); assertTrue(result.isEmpty()); }
Source:
public void setAuditorLedgerVerificationPercentage(long auditorLedgerVerificationPercentage) { setProperty(AUDITOR_LEDGER_VERIFICATION_PERCENTAGE, auditorLedgerVerificationPercentage); }

Target:
public ServerConfiguration setAuditorLedgerVerificationPercentage(long auditorLedgerVerificationPercentage) { setProperty(AUDITOR_LEDGER_VERIFICATION_PERCENTAGE, auditorLedgerVerificationPercentage); return this; }
Source:
public String ensureIndexed(List<FieldSort> fieldNames, String indexName, IndexType indexType, String tokenize) throws QueryException { if (indexName == null) { List<Index> indexes = this.listIndexes(); List<FieldSort> mFieldNames = new ArrayList<FieldSort>(fieldNames); Collections.sort(mFieldNames); for (Index index : indexes) { Collections.sort(index.fieldNames); if (!mFieldNames.equals(filterMeta(index.fieldNames))) { continue; } boolean equalTokenize = tokenize == null ? index.tokenize == null : tokenize.equals(index.tokenize); if(!equalTokenize){ continue; } if (index.indexType != indexType){ continue; } return index.indexName; } } return IndexCreator.ensureIndexed(new Index(fieldNames, indexName, indexType, tokenize), database, dbQueue); }

Target:
public String ensureIndexed(List<FieldSort> fieldNames, String indexName, IndexType indexType, String tokenize) throws QueryException { if (indexName == null) { List<Index> indexes = this.listIndexes(); Set<FieldSort> fieldNamesSet = new HashSet<FieldSort>(filterMeta(fieldNames)); for (Index index : indexes) { Set<FieldSort> indexFieldNamesSet = new HashSet<FieldSort>(filterMeta(index.fieldNames)); if (!indexFieldNamesSet.equals(fieldNamesSet)) { continue; } boolean equalTokenize = tokenize == null ? index.tokenize == null : tokenize.equals(index.tokenize); if(!equalTokenize){ continue; } if (index.indexType != indexType){ continue; } return index.indexName; } } return IndexCreator.ensureIndexed(new Index(fieldNames, indexName, indexType, tokenize), database, dbQueue); }
Source:
public void ensureXmlTestIsNotNull(Class<?> clazz, XmlSuite.ParallelMode mode) { XmlSuite xmlSuite = createXmlSuite("Suite"); createXmlTest(xmlSuite, "GITHUB-1029-Test", clazz); xmlSuite.setParallel(mode); Issue1029InvokedMethodListener listener = new Issue1029InvokedMethodListener(); TestNG testng = create(xmlSuite); testng.addListener((ITestNGListener) listener); testng.setThreadCount(10); testng.setThreadCount(10); testng.run(); List<String> expected = Collections.nCopies(5, "GITHUB-1029-Test"); assertThat(listener.getBeforeInvocation()).containsExactlyElementsOf(expected); assertThat(listener.getAfterInvocation()).containsExactlyElementsOf(expected); }

Target:
public void ensureXmlTestIsNotNull(Class<?> clazz, XmlSuite.ParallelMode mode) { XmlSuite xmlSuite = createXmlSuite("Suite"); createXmlTest(xmlSuite, "GITHUB-1029-Test", clazz); xmlSuite.setParallel(mode); Issue1029InvokedMethodListener listener = new Issue1029InvokedMethodListener(); TestNG testng = create(xmlSuite); testng.addListener((ITestNGListener) listener); testng.setThreadCount(10); testng.setDataProviderThreadCount(10); testng.run(); List<String> expected = Collections.nCopies(5, "GITHUB-1029-Test"); assertThat(listener.getBeforeInvocation()).containsExactlyElementsOf(expected); assertThat(listener.getAfterInvocation()).containsExactlyElementsOf(expected); }
Source:
public void onRunFinish(boolean succeeded, BatchSinkContext context) { super.onRunFinish(succeeded, context); if (succeeded) { try { if (config.getCleanPartitionsOlderThan() != null) { long cutoffTime = context.getLogicalStartTime() - TimeParser.parseDuration(config.getCleanPartitionsOlderThan()); snapshotFileSet.deleteMatchingPartitionsByTime(cutoffTime); LOG.info("Cleaning up old partition for timestamp {}", cutoffTime); } snapshotFileSet.onSuccess(context.getLogicalStartTime()); } catch (Exception e) { LOG.error("Exception updating state file with value of latest snapshot, ", e); } } }

Target:
public void onRunFinish(boolean succeeded, BatchSinkContext context) { super.onRunFinish(succeeded, context); if (succeeded) { try { snapshotFileSet.onSuccess(context.getLogicalStartTime()); } catch (Exception e) { LOG.error("Exception updating state file with value of latest snapshot, ", e); } try { if (config.getCleanPartitionsOlderThan() != null) { long cutoffTime = context.getLogicalStartTime() - TimeParser.parseDuration(config.getCleanPartitionsOlderThan()); snapshotFileSet.deleteMatchingPartitionsByTime(cutoffTime); LOG.info("Cleaning up snapshots older than {}", cutoffTime); } } catch (IOException e) { LOG.error("Exception occurred while cleaning up older snapshots", e); } } }
Source:
public void testGetInt_invalid() throws CTFReaderException { BitBuffer small_fixture = new BitBuffer(ByteBuffer.allocateDirect(128)); small_fixture.setByteOrder(ByteOrder.BIG_ENDIAN); createBuffer(small_fixture, 2); small_fixture.position(10); int length = 32; boolean signed = true; small_fixture.get(length, signed); }

Target:
public void testGetInt_invalid() throws CTFReaderException { final BitBuffer small_fixture = new BitBuffer( java.nio.ByteBuffer.allocateDirect(128)); small_fixture.setByteOrder(ByteOrder.BIG_ENDIAN); createBuffer(small_fixture, 2); small_fixture.position(10); final int length = 32; final boolean signed = true; small_fixture.get(length, signed); }
Source:
public IAnswerData getAnswer() { return !binding.widgetAnswerText.getText().equals(getContext().getString(R.string.no_time_selected)) ? DateTimeWidgetUtils.getTimeData(hourOfDay, minuteOfHour) : null; }

Target:
public IAnswerData getAnswer() { return binding.timeAnswerText.getText().equals(getContext().getString(R.string.no_time_selected)) ? null : new TimeData(selectedTime.toDateTime().toDate()); }
Source:
private RevCommit resolveReflog(RevWalk rw, Ref ref, String time) throws IOException { int number; try { number = Integer.parseInt(time); } catch (NumberFormatException nfe) { throw new RevisionSyntaxException( JGitText.get().reflogResolveRequiresPositiveInteger); } if (number < 0) throw new RevisionSyntaxException( JGitText.get().reflogResolveRequiresPositiveInteger); ReflogReader reader = new ReflogReader(this, ref.getName()); List<ReflogEntry> entries = reader.getReverseEntries(number + 1); if (number >= entries.size()) throw new RevisionSyntaxException(MessageFormat.format( JGitText.get().reflogEntryNotFound, Integer.valueOf(number), ref.getName(), Integer.valueOf(entries.size()))); return rw.parseCommit(entries.get(number).getNewId()); }

Target:
private RevCommit resolveReflog(RevWalk rw, Ref ref, String time) throws IOException { int number; try { number = Integer.parseInt(time); } catch (NumberFormatException nfe) { throw new RevisionSyntaxException(MessageFormat.format( JGitText.get().invalidReflogRevision, time)); } if (number < 0) throw new RevisionSyntaxException(MessageFormat.format( JGitText.get().invalidReflogRevision, time)); ReflogReader reader = new ReflogReader(this, ref.getName()); List<ReflogEntry> entries = reader.getReverseEntries(number + 1); if (number >= entries.size()) throw new RevisionSyntaxException(MessageFormat.format( JGitText.get().reflogEntryNotFound, Integer.valueOf(number), ref.getName(), Integer.valueOf(entries.size()))); return rw.parseCommit(entries.get(number).getNewId()); }
Source:
public void testPingPongRoot() throws Exception { assertTrue("Device is vulnerable to CVE-2015-3636, a vulnerability in the ping " + "socket implementation. Please apply the security patch at " + "<LINK_10>", doPingPongRootTest()); public void testPipeReadV() throws Exception { assertTrue("Device is vulnerable to CVE-2015-1805 and/or CVE-2016-0774," + " a vulnerability in the pipe_read() function." + " Please apply the following patches:\n" + "<LINK_6>\n" + "<LINK_9>\n", doPipeReadVTest()); } private static native boolean doPerfEventTest(); private static native boolean doPerfEventTest2(); private static native int doSockDiagTest(); private static native boolean doVrootTest(); public void testCVE20141710() throws Exception { assertTrue("Device is vulnerable to CVE-2014-1710", doCVE20141710Test()); } private static native boolean doFutexTest(); private static native boolean doCVE20141710Test(); private static native boolean doPingPongRootTest(); private static native boolean doPipeReadVTest(); }

Target:
public void testPingPongRoot() throws Exception { assertTrue("Device is vulnerable to CVE-2015-3636, a vulnerability in the ping " + "socket implementation. Please apply the security patch at " + "<LINK_10>", doPingPongRootTest()); }
Source:
public List<SinkRecord> add(SinkRecord record) throws SQLException { final SchemaPair schemaPair = new SchemaPair( record.keySchema(), record.valueSchema() ); if (currentSchemaPair == null) { currentSchemaPair = schemaPair; fieldsMetadata = FieldsMetadata.extract( tableId.tableName(), config.pkMode, config.pkFields, config.fieldsWhitelist, currentSchemaPair ); dbStructure.createOrAmendIfNecessary( config, connection, tableId, fieldsMetadata ); final String sql = getInsertSql(); log.debug( "{} sql: {}", config.insertMode, sql ); close(); preparedStatement = connection.prepareStatement(sql); preparedStatementBinder = dbDialect.statementBinder( preparedStatement, config.pkMode, schemaPair, fieldsMetadata, config.insertMode ); } final List<SinkRecord> flushed; if (currentSchemaPair.equals(schemaPair)) { records.add(record); if (records.size() >= config.batchSize) { log.debug("Flushing buffered records after exceeding configured batch size."); flushed = flush(); } else { flushed = Collections.emptyList(); } } else { log.debug("Flushing buffered records after due to unequal schema pairs: " + "Current Schemas: {}, Next Schemas: {}", currentSchemaPair, schemaPair); flushed = flush(); currentSchemaPair = null; flushed.addAll(add(record)); } return flushed; }

Target:
public List<SinkRecord> add(SinkRecord record) throws SQLException { final SchemaPair schemaPair = new SchemaPair( record.keySchema(), record.valueSchema() ); if (currentSchemaPair == null) { currentSchemaPair = schemaPair; fieldsMetadata = FieldsMetadata.extract( tableId.tableName(), config.pkMode, config.pkFields, config.fieldsWhitelist, currentSchemaPair ); dbStructure.createOrAmendIfNecessary( config, connection, tableId, fieldsMetadata ); final String sql = getInsertSql(); log.debug( "{} sql: {}", config.insertMode, sql ); close(); preparedStatement = connection.prepareStatement(sql); preparedStatementBinder = dbDialect.statementBinder( preparedStatement, config.pkMode, schemaPair, fieldsMetadata, config.insertMode ); } final List<SinkRecord> flushed; if (currentSchemaPair.equals(schemaPair)) { records.add(record); if (records.size() >= config.batchSize) { log.debug("Flushing buffered records after exceeding configured batch size {}.", config.batchSize); flushed = flush(); } else { flushed = Collections.emptyList(); } } else { log.debug("Flushing buffered records after due to unequal schema pairs: " + "current schemas: {}, next schemas: {}", currentSchemaPair, schemaPair); flushed = flush(); currentSchemaPair = null; flushed.addAll(add(record)); } return flushed; }
Source:
Map<String, String> getCheckConstraints() { return ImmutableMap.<String, String>builder().putAll(checkConstraints).build(); }

Target:
Map<String, String> getCheckConstraints() { return Map.copyOf(checkConstraints); }
Source:
public void testWebDavResponse() { byte[] data = ("HTTP/1.1 102 Processing\r\n" + "Status-URI: Status-URI:<LINK_0>; 404\r\n" + "\r\n" + "1234567812345678").getBytes(); EmbeddedChannel ch = new EmbeddedChannel(new HttpClientCodec()); assertTrue(ch.writeInbound(Unpooled.wrappedBuffer(data))); HttpResponse res = ch.readInbound(); assertThat(res.protocolVersion(), sameInstance(HttpVersion.HTTP_1_1)); assertThat(res.status(), is(HttpResponseStatus.PROCESSING)); HttpContent content = ch.readInbound(); assertThat(content.content().readableBytes(), is(0)); content.release(); assertThat(ch.finish(), is(false)); assertThat(ch.readInbound(), is(nullValue())); }

Target:
public void testWebDavResponse() { byte[] data = ("HTTP/1.1 102 Processing\r\n" + "Status-URI: Status-URI:<LINK_0>; 404\r\n" + "\r\n" + "1234567812345678").getBytes(); EmbeddedChannel ch = new EmbeddedChannel(new HttpClientCodec()); assertTrue(ch.writeInbound(Unpooled.wrappedBuffer(data))); HttpResponse res = ch.readInbound(); assertThat(res.protocolVersion(), sameInstance(HttpVersion.HTTP_1_1)); assertThat(res.status(), is(HttpResponseStatus.PROCESSING)); HttpContent content = ch.readInbound(); assertThat(content.content().readableBytes(), is(0)); content.release(); assertThat(ch.finish(), is(false)); }
Source:
void shouldUpdateChargeToAuthorisationRejected_IfEpdqStatusIs2() { final String payload = notificationPayloadForTransaction(payId, EPDQ_AUTHORISATION_REFUSED); setUpGatewayAccountToReturnGatewayAccountEntity(Optional.of(gatewayAccountEntity)); setUpChargeServiceToReturnCharge(Optional.of(charge)); final boolean result = notificationService.handleNotificationFor(payload, FORWARDED_IP_ADDRESSES); assertTrue(result); verify(mockChargeNotificationProcessor).invoke(payId, charge, AUTHORISATION_REJECTED, null); }

Target:
void shouldUpdateChargeToAuthorisationRejected_IfEpdqStatusIs2() { final String payload = notificationPayloadForTransaction(payId, EPDQ_AUTHORISATION_REFUSED); setUpGatewayAccountToReturnGatewayAccountEntity(Optional.of(gatewayAccountEntity)); setUpChargeServiceToReturnCharge(Optional.of(charge)); assertTrue(notificationService.handleNotificationFor(payload, FORWARDED_IP_ADDRESSES)); verify(mockChargeNotificationProcessor).invoke(payId, charge, AUTHORISATION_REJECTED, null); }
Source:
protected Object buildPreviewNotAvailable() { return Response.status(404).entity(getTemplate("preview/preview_not_available.ftl")).type("text/html").build(); }

Target:
protected Object buildPreviewNotAvailable() { return Response.status(NOT_FOUND) .entity(getTemplate("preview/preview_not_available.ftl")) .type("text/html") .build(); }
Source:
public static boolean isSupported(Class<? extends DeletionQuery> type) { if ( SUPPORTED_TYPES == null ) { SUPPORTED_TYPES_LOCK.lock(); try { if ( SUPPORTED_TYPES == null ) { Map<Integer, Class<? extends DeletionQuery>> map = new HashMap<>(); map.put( SingularTermDeletionQuery.QUERY_KEY, SingularTermDeletionQuery.class ); SUPPORTED_TYPES = Collections.unmodifiableSet( new HashSet<>( map.values() ) ); } } finally { SUPPORTED_TYPES_LOCK.unlock(); } } return SUPPORTED_TYPES.contains( type ); }

Target:
public static boolean isSupported(Class<? extends DeletionQuery> type) { if ( SingularTermDeletionQuery.class == type ) { return true; } return false; }
Source:
public void addPart(Part p, int transitDays) { if ((p.getUnit() != null) && (p.getUnit() instanceof TestUnit)) { return; } p.setDaysToArrival(transitDays); p.setBrandNew(false); int id = lastPartId + 1; p.setId(id); p.postProcessCampaignAddition(); if (p instanceof MissingPart && (null == p.getUnit() || null == p.getUnitId())) { p.setId(-1); return; } if (null == p.getUnit() && !p.hasParentPart()) { Part spare = checkForExistingSparePart(p); if (null != spare) { if (p instanceof Armor) { if (spare instanceof Armor) { ((Armor) spare).setAmount(((Armor) spare).getAmount() + ((Armor) p).getAmount()); MekHQ.triggerEvent(new PartChangedEvent(spare)); p.setId(-1); return; } } else if (p instanceof AmmoStorage) { if (spare instanceof AmmoStorage) { ((AmmoStorage) spare).changeShots(((AmmoStorage) p) .getShots()); MekHQ.triggerEvent(new PartChangedEvent(spare)); p.setId(-1); return; } } else { spare.incrementQuantity(); MekHQ.triggerEvent(new PartChangedEvent(spare)); p.setId(-1); return; } } } parts.put(id, p); lastPartId = id; MekHQ.triggerEvent(new PartNewEvent(p)); }

Target:
public void addPart(Part p, int transitDays) { if ((p.getUnit() != null) && (p.getUnit() instanceof TestUnit)) { return; } p.setDaysToArrival(transitDays); p.setBrandNew(false); int id = lastPartId + 1; p.setId(id); p.postProcessCampaignAddition(); if (p instanceof MissingPart && (null == p.getUnit() || null == p.getUnitId())) { p.setId(-1); return; } if ((null == p.getUnit()) && !p.hasParentPart()) { Part spare = checkForExistingSparePart(p); if (null != spare) { if (p instanceof Armor) { if (spare instanceof Armor) { ((Armor) spare).setAmount(((Armor) spare).getAmount() + ((Armor) p).getAmount()); MekHQ.triggerEvent(new PartChangedEvent(spare)); p.setId(-1); return; } } else if (p instanceof AmmoStorage) { if (spare instanceof AmmoStorage) { ((AmmoStorage) spare).changeShots(((AmmoStorage) p) .getShots()); MekHQ.triggerEvent(new PartChangedEvent(spare)); p.setId(-1); return; } } else { spare.incrementQuantity(); MekHQ.triggerEvent(new PartChangedEvent(spare)); p.setId(-1); return; } } } parts.put(id, p); lastPartId = id; MekHQ.triggerEvent(new PartNewEvent(p)); }
Source:
public List<List<String>> createAlternativeNamesDictionary(List<String> classpathCsvResources) throws IOException { List<List<String>> dictionary = Lists.newArrayList(); for (String resource : classpathCsvResources) { List<List<String>> dictionaryFromCsv = createAltNamesDictionaryFromCsv(resource); dictionary.addAll(dictionaryFromCsv); } return dictionary; }

Target:
public List<Set<String>> createAlternativeNamesDictionary(List<String> classpathCsvResources) throws IOException { List<Set<String>> dictionary = Lists.newArrayList(); for (String resource : classpathCsvResources) { List<Set<String>> dictionaryFromCsv = createAltNamesDictionaryFromCsv(resource); dictionary.addAll(dictionaryFromCsv); } return dictionary; }
Source:
public IStyledString.IComposedStyledString getStyledText(Object object) { final ReferenceChange refChange = (ReferenceChange)object; final String valueText = getValueText(refChange); final String referenceText = getReferenceText(refChange); ComposedStyledString ret = new ComposedStyledString(); if (refChange.getReference().isContainment()) { EObject value = refChange.getValue(); Match match = refChange.getMatch().getComparison().getMatch(value); if (match != null) { Iterable<Diff> subDifferences = match.getAllDifferences(); if (refChange.getState() != DifferenceState.UNRESOLVED && any(subDifferences, EMFComparePredicates.hasState(DifferenceState.UNRESOLVED))) { ret.append("> ", Style.DECORATIONS_STYLER); } } } final EObject refChangeValue = refChange.getValue(); if (refChangeValue.eIsProxy()) { StyleBuilder sb = new StyleBuilder(); sb.setFont(IItemFontProvider.ITALIC_FONT); ret.append(valueText, sb.build()); } else { ret.append(valueText); } ret.append(" [" + referenceText, Style.DECORATIONS_STYLER); switch (refChange.getKind()) { case ADD: ret.append(" add", Style.DECORATIONS_STYLER); break; case DELETE: ret.append(" delete", Style.DECORATIONS_STYLER); break; case CHANGE: ret.append(" " + changeText(refChange, refChange.getReference()), Style.DECORATIONS_STYLER); break; case MOVE: ret.append(" move", Style.DECORATIONS_STYLER); break; default: throw new IllegalStateException("Unsupported " + DifferenceKind.class.getSimpleName() + " value: " + refChange.getKind()); } ret.append("]", Style.DECORATIONS_STYLER); return ret; }

Target:
public IStyledString.IComposedStyledString getStyledText(Object object) { final ReferenceChange refChange = (ReferenceChange)object; final String valueText = getValueText(refChange); final String referenceText = getReferenceText(refChange); ComposedStyledString ret = new ComposedStyledString(); if (refChange.getReference().isContainment()) { EObject value = refChange.getValue(); Match match = refChange.getMatch().getComparison().getMatch(value); if (match != null) { Iterable<Diff> subDifferences = match.getAllDifferences(); if (refChange.getState() != DifferenceState.UNRESOLVED && any(subDifferences, EMFComparePredicates.hasState(DifferenceState.UNRESOLVED))) { ret.append("> ", Style.DECORATIONS_STYLER); } } } final EObject refChangeValue = refChange.getValue(); if (refChangeValue.eIsProxy()) { Style italic = Style.builder().setFont(IItemFontProvider.ITALIC_FONT).build(); ret.append(valueText, italic); } else { ret.append(valueText); } ret.append(" [" + referenceText, Style.DECORATIONS_STYLER); switch (refChange.getKind()) { case ADD: ret.append(" add", Style.DECORATIONS_STYLER); break; case DELETE: ret.append(" delete", Style.DECORATIONS_STYLER); break; case CHANGE: ret.append(" " + changeText(refChange, refChange.getReference()), Style.DECORATIONS_STYLER); break; case MOVE: ret.append(" move", Style.DECORATIONS_STYLER); break; default: throw new IllegalStateException("Unsupported " + DifferenceKind.class.getSimpleName() + " value: " + refChange.getKind()); } ret.append("]", Style.DECORATIONS_STYLER); return ret; }
Source:
public void onSiteChanged(OnSiteChanged event) { if (!isAdded() || mLoginFinished) { return; } if (event.isError()) { AppLog.e(AppLog.T.API, "onSiteChanged has error: " + event.error.type + " - " + event.error.toString()); if (!isAdded() || event.error.type != SiteErrorType.DUPLICATE_SITE) { onLoginFinished(false); return; } if (event.rowsAffected == 0) { ToastUtils.showToast(getContext(), R.string.cannot_add_duplicate_site); onLoginFinished(false); return; } else { ToastUtils.showToast(getContext(), R.string.duplicate_site_detected); } } if (mLoginListener instanceof LoginListener) { ((LoginListener) mLoginListener).startPostLoginServices(); } onLoginFinished(true); }

Target:
public void onSiteChanged(OnSiteChanged event) { if (!isAdded() || mLoginFinished) { return; } if (event.isError()) { AppLog.e(AppLog.T.API, "onSiteChanged has error: " + event.error.type + " - " + event.error.toString()); if (!isAdded() || event.error.type != SiteErrorType.DUPLICATE_SITE) { onLoginFinished(false); return; } if (event.rowsAffected == 0) { ToastUtils.showToast(getContext(), R.string.cannot_add_duplicate_site); onLoginFinished(false); return; } else { ToastUtils.showToast(getContext(), R.string.duplicate_site_detected); } } onLoginFinished(true); }
Source:
default long position() { return -1L; }

Target:
default OptionalLong position() { return OptionalLong.empty(); }
Source:
public void sanitizeForSaving() { this.googleId = googleId; this.name = name; this.institute = institute; }

Target:
public void sanitizeForSaving() { this.googleId = SanitizationHelper.sanitizeGoogleId(googleId); this.name = SanitizationHelper.sanitizeName(name); this.email = SanitizationHelper.sanitizeEmail(email); this.institute = SanitizationHelper.sanitizeTitle(institute); }
Source:
private static boolean isCompileTimeEvaluationPossible(Expression funcExpr) { boolean compileTimeEvaluationPossible = true; Function functionCall = funcExpr.getFunctionCall(); if(functionCall.getOperandsSize() > 0) { for (Expression expression : functionCall.getOperands()) { if (expression.getType() != ExpressionType.LITERAL) { compileTimeEvaluationPossible = false; break; } } } return compileTimeEvaluationPossible; }

Target:
private static boolean isCompileTimeEvaluationPossible(Expression funcExpr) { Function functionCall = funcExpr.getFunctionCall(); if (functionCall.getOperandsSize() > 0) { for (Expression expression : functionCall.getOperands()) { if (expression.getType() == ExpressionType.FUNCTION) { if (!isCompileTimeEvaluationPossible(expression)){ return false; } } else if (expression.getType() != ExpressionType.LITERAL) { return false; } } } return true; }
Source:
public void testRowKeysWithRegEx() throws Exception{ Table table = getDefaultTable(); String[] rowKeys = { "/firstKey=1/secKey=AB/thirdKey=111", "/firstKey=1/secKey=ABC/thirdKey=222", "/firstKey=2/secKey=CD/thirdKey=333", "/firstKey=3/secKey=BT/thirdKey=444", "/firstKey=4/secKey=BTL/thirdKey=555", "/firstKey=4/secKey=AD/thirdKey=666", "/firstKey=5/secKey=SET/thirdKey=777", "/firstKey=11/secKey=AA/thirdKey=888" }; List<Put> puts = new ArrayList<>(); byte[] qualA = dataHelper.randomData("test-regex"); for (int i = 0; i < rowKeys.length; i++) { String indexStr = String.valueOf(i); puts.add( new Put(rowKeys[i].getBytes()).addColumn(COLUMN_FAMILY, qualA, Bytes.toBytes(indexStr))); } table.put(puts); int[] expected = { 5, 4 }; String[] conditions = { "/firstKey=4.*" }; assertRowKeysWithRegex(table, conditions, rowKeys, expected); expected = new int[] { 0, 1 }; conditions = new String[] { ".*secKey=AB.*" }; assertRowKeysWithRegex(table, conditions, rowKeys, expected); expected = new int[] { 0, 6 }; conditions = new String[] { ".*/thirdKey=111.*", ".*/thirdKey=777.*" }; assertRowKeysWithRegex(table, conditions, rowKeys, expected); }

Target:
public void testRowKeysWithRegEx() throws Exception{ Table table = getDefaultTable(); String[] rowKeys = { "/firstKey=1/secKey=AB/thirdKey=111", "/firstKey=1/secKey=ABC/thirdKey=222", "/firstKey=11/secKey=AA/thirdKey=888", "/firstKey=2/secKey=CD/thirdKey=333", "/firstKey=3/secKey=BT/thirdKey=444", "/firstKey=4/secKey=AD/thirdKey=555", "/firstKey=4/secKey=BTL/thirdKey=666", "/firstKey=5/secKey=SET/thirdKey=777", }; List<Put> puts = new ArrayList<>(); String rowPrefix = dataHelper.randomString("testrow-"); byte[] qualA = dataHelper.randomData("test-regex"); for (int i = 0; i < rowKeys.length; i++) { String indexStr = String.valueOf(i); puts.add( new Put(Bytes.toBytes(rowPrefix + rowKeys[i])).addColumn(COLUMN_FAMILY, qualA, Bytes.toBytes(indexStr))); } table.put(puts); int[] expected = { 0, 1, 2, 3, 4, 5, 6, 7 }; String[] conditions = { ".*" }; assertRowKeysWithRegex(table, conditions, rowPrefix, rowKeys, expected); expected = new int[]{ 5, 6 }; conditions = new String[]{ ".*/firstKey=4.*" }; assertRowKeysWithRegex(table, conditions, rowPrefix, rowKeys, expected); expected = new int[] { 0, 1 }; conditions = new String[] { ".*secKey=AB.*" }; assertRowKeysWithRegex(table, conditions, rowPrefix, rowKeys, expected); expected = new int[] { 0, 7 }; conditions = new String[] { ".*/thirdKey=111.*", ".*/thirdKey=777.*" }; assertRowKeysWithRegex(table, conditions, rowPrefix, rowKeys, expected); expected = new int[]{}; conditions = new String[]{ "" }; assertRowKeysWithRegex(table, conditions, rowPrefix, rowKeys, expected); expected = new int[]{}; conditions = new String[]{ "/unMatchedKey=NA" }; assertRowKeysWithRegex(table, conditions, rowPrefix, rowKeys, expected); }
Source:
public List<Transaction> getTransactionList() { if(transactionList == null) { transactionList = new ArrayList<>(); } return transactionList; }

Target:
public List<Transaction> getTransactionList() { return transactionList == null ? Collections.<Transaction>emptyList() : transactionList; }
Source:
private boolean isArtifact(ITask task) { boolean hasAssosciatedTask = true; boolean hasContext = TasksUiPlugin.getContextStore().hasContext(task); boolean hasScheduledDate = false; AbstractTask abstractTask = (AbstractTask) task; if (abstractTask != null) { hasScheduledDate = abstractTask.getScheduledForDate() != null; } boolean hasDueDate = task.getDueDate() != null; return hasAssosciatedTask && !(hasAssosciatedTask || hasScheduledDate || hasDueDate); }

Target:
private boolean isArtifact(ITask task) { boolean hasAssosciatedTask = true; boolean hasContext = TasksUiPlugin.getContextStore().hasContext(task); boolean hasScheduledDate = false; if (task instanceof AbstractTask) { AbstractTask abstractTask = (AbstractTask) task; hasScheduledDate = abstractTask.getScheduledForDate() != null; } boolean hasDueDate = task.getDueDate() != null; return hasAssosciatedTask && !(hasContext || hasScheduledDate || hasDueDate); }
Source:
public RegisteredObservers load(CuratorFramework curator) throws Exception { byte[] data; try { data = curator.getData().forPath(CONFIG_FLUO_OBSERVERS2); } catch (NoNodeException nne) { return null; } String json = new String(data, UTF_8); JsonObservers jco = new Gson().fromJson(json, JsonObservers.class); ImmutableSet.Builder<Column> weakColumnsBuilder = new ImmutableSet.Builder<Column>(); ImmutableSet.Builder<Column> strongColumnsBuilder = new ImmutableSet.Builder<Column>(); for (Entry<Column, NotificationType> entry : jco.getObservedColumns().entrySet()) { switch (entry.getValue()) { case STRONG: strongColumns = strongColumnsBuilder.add(entry.getKey()).build(); break; case WEAK: weakColumns = weakColumnsBuilder.add(entry.getKey()).build(); break; default: throw new IllegalStateException("Unknown notification type " + entry.getValue()); } } return new RegisteredObservers() { @Override public Observers getObservers(Environment env) { return new ObserversV2(env, jco, strongColumns, weakColumns); } @Override public ImmutableSet<Column> getObservedColumns(NotificationType nt) { switch (nt) { case STRONG: return strongColumns; case WEAK: return weakColumns; default: throw new IllegalArgumentException("Unknown notification type " + nt); } } }; }

Target:
public RegisteredObservers load(CuratorFramework curator) throws Exception { byte[] data; try { data = curator.getData().forPath(CONFIG_FLUO_OBSERVERS2); } catch (NoNodeException nne) { return null; } String json = new String(data, UTF_8); JsonObservers jco = new Gson().fromJson(json, JsonObservers.class); ImmutableSet.Builder<Column> weakColumnsBuilder = new ImmutableSet.Builder<Column>(); ImmutableSet.Builder<Column> strongColumnsBuilder = new ImmutableSet.Builder<Column>(); for (Entry<Column, NotificationType> entry : jco.getObservedColumns().entrySet()) { switch (entry.getValue()) { case STRONG: strongColumnsBuilder.add(entry.getKey()); break; case WEAK: weakColumnsBuilder.add(entry.getKey()); break; default: throw new IllegalStateException("Unknown notification type " + entry.getValue()); } } strongColumns = strongColumnsBuilder.build(); weakColumns = weakColumnsBuilder.build(); return new RegisteredObservers() { @Override public Observers getObservers(Environment env) { return new ObserversV2(env, jco, strongColumns, weakColumns); } @Override public Set<Column> getObservedColumns(NotificationType nt) { switch (nt) { case STRONG: return strongColumns; case WEAK: return weakColumns; default: throw new IllegalArgumentException("Unknown notification type " + nt); } } }; }
Source:
public ParsedConstraints loadConstraints(Project aProject) throws IOException, ParseException { ParsedConstraints merged = null; for (ConstraintSet set : listConstraintSets(aProject)) { String script = readConstrainSet(set); ConstraintsGrammar parser = new ConstraintsGrammar(new StringReader(script)); Parse p = parser.Parse(); ParsedConstraints constraints = p.accept(new ParserVisitor()); if (merged == null) { merged = constraints; } else { for (Entry<String, String> e : constraints.getImports().entrySet()) { if (merged.getImports().containsKey(e.getKey()) && !e.getValue() .equalsIgnoreCase(merged.getImports().get(e.getKey()))) { String errorMessage = "Conflict detected in imports for key \"" + e.getKey() + "\", conflicting values are \"" + e.getValue() + "\" & \"" + merged.getImports().get(e.getKey()) + "\". Please contact Project Admin for correcting this. Constraints feature may not work." + "\nAborting Constraint rules merge!"; throw new ParseException(errorMessage); } } merged.getImports().putAll(constraints.getImports()); for (Scope scope : constraints.getScopes()) { Scope target = merged.getScopeByName(scope.getScopeName()); if (target == null) { merged.getScopes().add(scope); } else { target.getRules().addAll(scope.getRules()); } } } } return merged; }

Target:
public ParsedConstraints loadConstraints(Project aProject) throws IOException, ParseException { ParsedConstraints merged = null; for (ConstraintSet set : listConstraintSets(aProject)) { String script = readConstrainSet(set); ConstraintsGrammar parser = new ConstraintsGrammar(new StringReader(script)); Parse p = parser.Parse(); ParsedConstraints constraints = p.accept(new ParserVisitor()); if (merged == null) { merged = constraints; } else { for (Entry<String, String> e : constraints.getImports().entrySet()) { if (merged.getImports().containsKey(e.getKey()) && !e.getValue() .equalsIgnoreCase(merged.getImports().get(e.getKey()))) { String errorMessage = "Conflict detected in imports for key \"" + e.getKey() + "\", conflicting values are \"" + e.getValue() + "\" & \"" + merged.getImports().get(e.getKey()) + "\". Please contact Project Admin for correcting this." + "Constraints feature may not work." + "\nAborting Constraint rules merge!"; throw new ParseException(errorMessage); } } merged.getImports().putAll(constraints.getImports()); for (Scope scope : constraints.getScopes()) { Scope target = merged.getScopeByName(scope.getScopeName()); if (target == null) { merged.getScopes().add(scope); } else { target.getRules().addAll(scope.getRules()); } } } } return merged; }
Source:
private int numCompletedParts(List<Part> parts) { int completedTotal = 0; for (Part part : parts) { if (part.getMd5() != null) completedTotal++; } return completedTotal; }

Target:
private int numCompletedParts(List<Part> parts) { int completedTotal = 0; for (val part : parts) { if (part.getMd5() != null) { completedTotal++; } } return completedTotal; }
Source:
public void saveConcept_shouldSetAuditInfoIfAnItemIsRemovedFromAnyOfItsChildCollections() throws Exception { executeDataSet("org/openmrs/api/include/ConceptServiceTest-names.xml"); Concept concept = conceptService.getConcept(3000); concept.addDescription(new ConceptDescription("some description",Context.getLocale())); Assert.assertNull(concept.getDateChanged()); Assert.assertNull(concept.getChangedBy()); Assert.assertFalse(concept.getSynonyms().isEmpty()); concept.removeName(concept.getSynonyms().iterator().next()); conceptService.saveConcept(concept); Assert.assertNotNull(concept.getDateChanged()); Assert.assertNotNull(concept.getChangedBy()); }

Target:
public void saveConcept_shouldSetAuditInfoIfAnItemIsRemovedFromAnyOfItsChildCollections() throws Exception { Concept concept = conceptService.getConcept(3); Assert.assertNull(concept.getDateChanged()); Assert.assertNull(concept.getChangedBy()); Concept concept1= conceptService.getConcept(5); ConceptAnswer conceptanswer = new ConceptAnswer(concept1); concept.addAnswer(conceptanswer); conceptService.saveConcept(concept); Assert.assertNotNull(concept.getDateChanged()); Date date=concept.getDateChanged(); Assert.assertTrue(concept.removeAnswer(conceptanswer)); conceptService.saveConcept(concept); Assert.assertNotNull(concept.getDateChanged()); Date date1=concept.getDateChanged(); Assert.assertFalse(date.equals(date1)); Assert.assertNotNull(concept.getChangedBy()); }
Source:
private static InternalTask createTask(Job userJob, JavaTask task) throws JobCreationException { InternalTask javaTask; if (task.getExecutableClassName() != null) { HashMap<String, byte[]> args = task.getSerializedArguments(); try { if (isForkingTask()) { javaTask = new InternalForkedScriptTask(new ScriptExecutableContainer( new TaskScript(new SimpleScript(task.getExecutableClassName(), JavaClassScriptEngineFactory.JAVA_CLASS_SCRIPT_ENGINE_NAME, new Serializable[] { args })))); javaTask.setForkEnvironment(task.getForkEnvironment()); if (isRunAsMeTask()) { task.setRunAsMe(true); javaTask.setRunAsMe(true); } } else { javaTask = new InternalScriptTask(new ScriptExecutableContainer( new TaskScript(new SimpleScript(task.getExecutableClassName(), JavaClassScriptEngineFactory.JAVA_CLASS_SCRIPT_ENGINE_NAME, new Serializable[] { args })))); } } catch (InvalidScriptException e) { throw new JobCreationException(e); } } else { String msg = "You must specify your own executable task class to be launched (in every task)!"; logger.info(msg); throw new JobCreationException(msg); } try { setTaskCommonProperties(userJob, task, javaTask); } catch (Exception e) { throw new JobCreationException(e); } return javaTask; }

Target:
private static InternalTask createTask(Job userJob, JavaTask task) throws JobCreationException { InternalTask javaTask; if (task.getExecutableClassName() != null) { HashMap<String, byte[]> args = task.getSerializedArguments(); try { if (isForkingTask()) { javaTask = new InternalForkedScriptTask(new ScriptExecutableContainer( new TaskScript(new SimpleScript(task.getExecutableClassName(), JavaClassScriptEngineFactory.JAVA_CLASS_SCRIPT_ENGINE_NAME, new Serializable[] { args })))); javaTask.setForkEnvironment(task.getForkEnvironment()); configureRunAsMe(task); } else { javaTask = new InternalScriptTask(new ScriptExecutableContainer( new TaskScript(new SimpleScript(task.getExecutableClassName(), JavaClassScriptEngineFactory.JAVA_CLASS_SCRIPT_ENGINE_NAME, new Serializable[] { args })))); } } catch (InvalidScriptException e) { throw new JobCreationException(e); } } else { String msg = "You must specify your own executable task class to be launched (in every task)!"; logger.info(msg); throw new JobCreationException(msg); } try { setTaskCommonProperties(userJob, task, javaTask); } catch (Exception e) { throw new JobCreationException(e); } return javaTask; }
Source:
private void destroyClientTempEntities(AbstractMoveItemRequest removedRequest) { removedRequest.getClientSideTempEntities().stream().filter(tempEntity -> tempEntity.exists()).forEach(EntityRef::destroy); }

Target:
private void destroyClientTempEntities(AbstractMoveItemRequest removedRequest) { for (EntityRef tempEntity : removedRequest.getClientSideTempEntities()) { if (tempEntity.exists()) { tempEntity.destroy(); } } }
Source:
private void compareNumberOfArguments(SuperTreeImpl superTree, Symbol superClassSymbol) { Optional<ClassTree> baseClassTree = getDeclarationTree(superClassSymbol); if (baseClassTree.isPresent()) { Optional<MethodDeclarationTree> baseClassConstructor = getConstructor(baseClassTree.get()); if (baseClassConstructor.isPresent()) { Integer nbParams = baseClassConstructor.get().parameterList().size(); int nbArguments = ((CallExpressionTree) superTree.getParent()).arguments().parameters().size(); if (nbArguments != nbParams) { String message = String.format(MESSAGE_SUPER_WITH_CORRECT_NUMBER_OF_ARGUMENTS, nbParams, nbParams == 1 ? "" : "s"); addIssue(superTree, message); } } } }

Target:
private void compareNumberOfArguments(SuperTreeImpl superTree, Symbol superClassSymbol) { Optional<ClassTree> baseClassTree = getDeclarationTree(superClassSymbol); if (baseClassTree.isPresent()) { Optional<MethodDeclarationTree> baseClassConstructor = getConstructor(baseClassTree.get()); if (baseClassConstructor.isPresent()) { Integer nbParams = baseClassConstructor.get().parameterList().size(); int nbArguments = ((CallExpressionTree) superTree.getParent()).arguments().parameters().size(); if (nbArguments != nbParams) { String message = String.format(MESSAGE_SUPER_WITH_CORRECT_NUMBER_OF_ARGUMENTS, nbParams, nbParams == 1 ? "" : "s"); addIssue(CheckUtils.parent(superTree), message).secondary(baseClassConstructor.get().parameterClause()); } } } }
Source:
public void setUpSuite() throws Exception { super.setUpSuite(); setUpScriptProject("ModelMembers"); setUpScriptProject(BUILDPATH_PRJ_0); setUpScriptProject(BUILDPATH_PRJ_1); setUpScriptProject("p1"); setUpScriptProject("p2"); deleteProject("P"); Locale.setDefault(Locale.US); }

Target:
public void setUpSuite() throws Exception { super.setUpSuite(); setUpScriptProject("ModelMembers"); setUpScriptProject(BUILDPATH_PRJ_0); setUpScriptProject(BUILDPATH_PRJ_1); setUpScriptProject("p1"); setUpScriptProject("p2"); deleteProject("P"); }
Source:
private boolean isInterestingContainer(TaskContainerDelta delta) { if (delta.getElement() instanceof ITask) { ITask task = (ITask) delta.getElement(); boolean isProperKind = delta.getKind() == Kind.CONTENT || delta.getKind() == Kind.ADDED; boolean isReviewConnector = getConnectorFromTask(task) instanceof GerritConnector; return isProperKind && isReviewConnector; } return false; }

Target:
private boolean isInterestingContainer(TaskContainerDelta delta) { if (delta.getElement() instanceof ITask) { ITask task = (ITask) delta.getElement(); boolean isProperKind = delta.getKind() == Kind.CONTENT || delta.getKind() == Kind.ADDED; boolean isReviewConnector = getConnectorFromTask(task) instanceof ReviewsConnector; return isProperKind && isReviewConnector; } return false; }