auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testLongTransactionCleanup() throws Exception { conf.setInt(TxConstants.Manager.CFG_TX_CLEANUP_INTERVAL, 3); conf.setInt(TxConstants.Manager.CFG_TX_LONG_TIMEOUT, 2); TransactionManager txm = new TransactionManager (conf, new InMemoryTransactionStateStorage(), new TxMetricsCollector()); txm.startAndWait(); try { Assert.assertEquals(0, txm.getInvalidSize()); Assert.assertEquals(0, txm.getCommittedSize()); Transaction tx1 = txm.startLong(); Assert.assertEquals(0, txm.getInvalidSize()); Assert.assertEquals(0, txm.getCommittedSize()); TimeUnit.SECONDS.sleep(5); Assert.assertEquals(1, txm.getInvalidSize()); Assert.assertEquals(0, txm.getCommittedSize()); try { txm.canCommit(tx1, Collections.singleton(new byte[] { 0x11 })); Assert.fail(); } catch (TransactionNotInProgressException e) { } txm.abort(tx1); Assert.assertEquals(0, txm.getInvalidSize()); } finally { txm.stopAndWait(); } }

Target:
public void testLongTransactionCleanup() throws Exception { conf.setInt(TxConstants.Manager.CFG_TX_CLEANUP_INTERVAL, 3); conf.setInt(TxConstants.Manager.CFG_TX_LONG_TIMEOUT, 2); TransactionManager txm = new TransactionManager (conf, new InMemoryTransactionStateStorage(), new TxMetricsCollector()); txm.startAndWait(); try { Assert.assertEquals(0, txm.getInvalidSize()); Assert.assertEquals(0, txm.getCommittedSize()); Transaction tx1 = txm.startLong(); Assert.assertEquals(0, txm.getInvalidSize()); Assert.assertEquals(0, txm.getCommittedSize()); TimeUnit.SECONDS.sleep(5); Assert.assertEquals(1, txm.getInvalidSize()); Assert.assertEquals(0, txm.getCommittedSize()); try { txm.canCommit(tx1, Collections.singleton(new byte[] { 0x11 })); Assert.fail(); } catch (TransactionNotInProgressException e) { } txm.abort(tx1); Assert.assertEquals(1, txm.getInvalidSize()); } finally { txm.stopAndWait(); } }
Source:
private void loadClasses(AuthorizationStack stack, List<File> classfiles, List<File> jarfiles) { IAuthorizationPlugin pf; for (File file : classfiles) { String classname = getClassName(file); if (classname.isEmpty()) { continue; } if ((pf = handleLoadClass(classname)) != null) { stack.setPlugin(pf); } } for (File file : jarfiles) { try (JarFile jar = new JarFile(file)) { Enumeration<JarEntry> entries = jar.entries(); while (entries.hasMoreElements()) { JarEntry entry = entries.nextElement(); String classname = getClassName(entry); if (!entry.getName().endsWith(".class") || classname.isEmpty()) { continue; } if ((pf = handleLoadClass(classname)) != null) { stack.setPlugin(pf); } } } catch (IOException ex) { LOGGER.log(Level.WARNING, "Could not manipulate with file because of: ", ex); } } }

Target:
private void loadClasses(AuthorizationStack stack, List<File> classfiles, List<File> jarfiles) { IAuthorizationPlugin pf; for (File file : classfiles) { String classname = getClassName(file); if (classname.isEmpty()) { continue; } if ((pf = handleLoadClass(classname)) != null) { if (!stack.setPlugin(pf)) { LOGGER.log(Level.INFO, "plugin {0} is not configured in the stack", classname); } } } for (File file : jarfiles) { try (JarFile jar = new JarFile(file)) { Enumeration<JarEntry> entries = jar.entries(); while (entries.hasMoreElements()) { JarEntry entry = entries.nextElement(); String classname = getClassName(entry); if (!entry.getName().endsWith(".class") || classname.isEmpty()) { continue; } if ((pf = handleLoadClass(classname)) != null) { if (!stack.setPlugin(pf)) { LOGGER.log(Level.INFO, "plugin {0} is not configured in the stack", classname); } } } } catch (IOException ex) { LOGGER.log(Level.WARNING, "Could not manipulate with file because of: ", ex); } } }
Source:
private UserAgentInterceptor(String userAgent, Class<?> serviceClass) { Preconditions.checkArgument(VALID_USER_AGENT.matcher(userAgent).matches(), "User Agent must match pattern '%s': %s", VALID_USER_AGENT, userAgent); String version = getVersionString(serviceClass); this.userAgent = version.isEmpty() ? userAgent : String.format("%s (%s)", userAgent, version); }

Target:
private UserAgentInterceptor(String userAgent, Class<?> serviceClass) { Preconditions.checkArgument(VALID_USER_AGENT.matcher(userAgent).matches(), "User Agent must match pattern '%s': %s", VALID_USER_AGENT, userAgent); String version = getVersionString(serviceClass); this.userAgent = version.isEmpty() ? userAgent : userAgent + " (" + version + ")"; }
Source:
private void addFieldAndUnbindStatement(TypeSpec.Builder result, MethodSpec.Builder unbindMethod, ViewBindings bindings) { Map<ListenerClass, Map<ListenerMethod, Set<MethodViewBinding>>> classMethodBindings = bindings.getMethodBindings(); if (classMethodBindings.isEmpty()) { return; } String fieldName = "view" + bindings.getId(); result.addField(ClassName.get("android.view", "View"), fieldName); boolean needsNullChecked = bindings.getRequiredBindings().isEmpty(); if (needsNullChecked) { unbindMethod.beginControlFlow("if ($L != null)", fieldName); } for (ListenerClass listenerClass : classMethodBindings.keySet()) { if (!VIEW_TYPE.equals(listenerClass.targetType())) { unbindMethod.addStatement("(($T) $L).$L(null)", bestGuess(listenerClass.targetType()), fieldName, listenerClass.setter()); } else { unbindMethod.addStatement("$L.$L(null)", fieldName, listenerClass.setter()); } } if (needsNullChecked) { unbindMethod.endControlFlow(); } }

Target:
private void addFieldAndUnbindStatement(TypeSpec.Builder result, MethodSpec.Builder unbindMethod, ViewBindings bindings) { Map<ListenerClass, Map<ListenerMethod, Set<MethodViewBinding>>> classMethodBindings = bindings.getMethodBindings(); if (classMethodBindings.isEmpty()) { return; } String fieldName = "view" + bindings.getId(); result.addField(VIEW, fieldName); boolean needsNullChecked = bindings.getRequiredBindings().isEmpty(); if (needsNullChecked) { unbindMethod.beginControlFlow("if ($L != null)", fieldName); } for (ListenerClass listenerClass : classMethodBindings.keySet()) { if (!VIEW_TYPE.equals(listenerClass.targetType())) { unbindMethod.addStatement("(($T) $L).$L(null)", bestGuess(listenerClass.targetType()), fieldName, listenerClass.setter()); } else { unbindMethod.addStatement("$L.$L(null)", fieldName, listenerClass.setter()); } } if (needsNullChecked) { unbindMethod.endControlFlow(); } }
Source:
private static PersistableBundle getDefaults() { PersistableBundle defaults = new PersistableBundle(); defaults.putBoolean(KEY_PERSIST_LPP_MODE_BOOL, true); defaults.putString(KEY_SUPL_HOST_STRING, "supl.google.com"); defaults.putString(KEY_SUPL_PORT_STRING, "7275"); defaults.putString(KEY_SUPL_VER_STRING, "0x20000"); defaults.putString(KEY_SUPL_MODE_STRING, "1"); defaults.putString(KEY_SUPL_ES_STRING, "1"); defaults.putString(KEY_LPP_PROFILE_STRING, "0"); defaults.putString(KEY_USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL_STRING, "1"); defaults.putString(KEY_A_GLONASS_POS_PROTOCOL_SELECT_STRING, "0"); defaults.putString(KEY_GPS_LOCK_STRING, "3"); defaults.putString(KEY_ES_EXTENSION_SEC_STRING, "0"); defaults.putString(KEY_NFW_PROXY_APPS_STRING, ""); defaults.putInt(KEY_ES_SUPL_CONTROL_PLANE_SUPPORT_INT, SUPL_EMERGENCY_MODE_TYPE_CP_ONLY); defaults.putStringArray(KEY_ES_SUPL_CONTROL_PLANE_SUPPORT_INT, null); return defaults; }

Target:
private static PersistableBundle getDefaults() { PersistableBundle defaults = new PersistableBundle(); defaults.putBoolean(KEY_PERSIST_LPP_MODE_BOOL, true); defaults.putString(KEY_SUPL_HOST_STRING, "supl.google.com"); defaults.putString(KEY_SUPL_PORT_STRING, "7275"); defaults.putString(KEY_SUPL_VER_STRING, "0x20000"); defaults.putString(KEY_SUPL_MODE_STRING, "1"); defaults.putString(KEY_SUPL_ES_STRING, "1"); defaults.putString(KEY_LPP_PROFILE_STRING, "0"); defaults.putString(KEY_USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL_STRING, "1"); defaults.putString(KEY_A_GLONASS_POS_PROTOCOL_SELECT_STRING, "0"); defaults.putString(KEY_GPS_LOCK_STRING, "3"); defaults.putString(KEY_ES_EXTENSION_SEC_STRING, "0"); defaults.putString(KEY_NFW_PROXY_APPS_STRING, ""); defaults.putInt(KEY_ES_SUPL_CONTROL_PLANE_SUPPORT_INT, SUPL_EMERGENCY_MODE_TYPE_CP_ONLY); defaults.putStringArray(KEY_ES_SUPL_DATA_PLANE_ONLY_ROAMING_PLMN_STRING_ARRAY, null); return defaults; }
Source:
public void testUpdateDecisionWithTopLevelFunction() { final List<Decision> decisions = setupDecisionWithTopLevelFunction(); handler.update(DOCUMENT_NAME_ORIGINAL, DOCUMENT_NAME_UPDATED); assertTopLevelLiteralExpression(decisions.get(0)); assertTopLevelFunctionDefinition(decisions.get(1), DOCUMENT_NAME_UPDATED, DOCUMENT_NAME_ORIGINAL); assertTopLevelFunctionDefinition(decisions.get(2), "do-not-change", "do-not-change"); verify(expressionGrid1).initialiseUiCells(); verify(expressionGrid2).initialiseUiCells(); verify(expressionGrid3).initialiseUiCells(); }

Target:
public void testUpdateDecisionWithTopLevelFunction() { final List<Decision> decisions = setupDecisionWithTopLevelFunction(); handler.update(DOCUMENT_NAME_ORIGINAL, DOCUMENT_NAME_UPDATED); assertTopLevelLiteralExpression(decisions.get(0)); assertTopLevelFunctionDefinition(decisions.get(1), DOCUMENT_NAME_UPDATED, MODEL_NAME); assertTopLevelFunctionDefinition(decisions.get(2), UNAFFECTED_DOCUMENT, UNAFFECTED_MODEL); verify(expressionGrid1).initialiseUiCells(); verify(expressionGrid2).initialiseUiCells(); verify(expressionGrid3).initialiseUiCells(); }
Source:
List<LongRange> getTilesIntersectingEnvelope( Envelope referenceEnvelope, SpaceFillingCurveConfiguration config, SpaceFillingCurveMonitor monitor ) { SearchEnvelope search = new SearchEnvelope( this, referenceEnvelope ); SearchEnvelope wholeExtent = new SearchEnvelope( 0, this.getWidth(), nbrDim ); ArrayList<LongRange> results = new ArrayList<>(1000); if ( monitor != null ) { monitor.registerSearchArea( search.getArea() ); } addTilesIntersectingEnvelopeAt( config, monitor, 0, config.maxDepth( referenceEnvelope, this.range, nbrDim, maxLevel ), search, wholeExtent, rootCurve(), 0, this.getValueWidth(), results ); return results; }

Target:
List<LongRange> getTilesIntersectingEnvelope( Envelope referenceEnvelope, SpaceFillingCurveConfiguration config, SpaceFillingCurveMonitor monitor ) { SearchEnvelope search = new SearchEnvelope( this, referenceEnvelope ); SearchEnvelope wholeExtent = new SearchEnvelope( 0, this.getWidth(), nbrDim ); ArrayList<LongRange> results = new ArrayList<>( config.initialRangesListCapacity() ); if ( monitor != null ) { monitor.registerSearchArea( search.getArea() ); } addTilesIntersectingEnvelopeAt( config, monitor, 0, config.maxDepth( referenceEnvelope, this.range, nbrDim, maxLevel ), search, wholeExtent, rootCurve(), 0, this.getValueWidth(), results ); return results; }
Source:
private boolean updateEffectiveTime(SnomedRefSetMember member) { if (force) { final String effectiveTime = (String) properties.get(SnomedRf2Headers.FIELD_EFFECTIVE_TIME); if (effectiveTime != null) { member.setEffectiveTime(EffectiveTimes.parse(effectiveTime, DateFormats.SHORT)); member.setReleased(true); } else { member.unsetEffectiveTime(); } return true; } return false; }

Target:
private boolean updateEffectiveTime(SnomedRefSetMember member) { if (force) { final String effectiveTime = (String) properties.get(SnomedRf2Headers.FIELD_EFFECTIVE_TIME); if (!Strings.isNullOrEmpty(effectiveTime)) { final Date effectiveTimeDate = EffectiveTimes.parse(effectiveTime, DateFormats.SHORT); if (!effectiveTimeDate.equals(member.getEffectiveTime())) { member.setEffectiveTime(effectiveTimeDate); member.setReleased(true); return true; } } else { member.unsetEffectiveTime(); return true; } } return false; }
Source:
public Authentication supply(@Nonnull HttpServletRequest request) { NpmUser npmUser = deserializeNpmUser(request); if (isValidNpmUser(npmUser)) { return new PasswordAuthentication(npmUser.getName(), npmUser.getPassword()); } else { throw new BadCredentialsException("invalid.credentials"); } }

Target:
public Authentication supply(@Nonnull HttpServletRequest request) { NpmUser npmUser = deserializeNpmUser(request); if (!isValidNpmUser(npmUser) || !usernamesMatch(request.getRequestURI(), npmUser.getName())) { throw new BadCredentialsException("invalid.credentials"); } return new PasswordAuthentication(npmUser.getName(), npmUser.getPassword()); }
Source:
public @Nullable String resolveString(LamiTableEntry entry) { LamiData data = entry.getValue(fColIndex); if (data instanceof LamiIRQ) { LamiIRQ irq = (LamiIRQ) data; switch (irq.getType()) { case HARD: return "Hard"; case SOFT: return "Soft"; default: return "?"; } } return data.toString(); }

Target:
public @Nullable String resolveString(LamiTableEntry entry) { LamiData data = entry.getValue(fColIndex); if (data instanceof LamiIRQ) { LamiIRQ irq = (LamiIRQ) data; switch (irq.getType()) { case HARD: return Messages.LamiIRQTypeAspect_HardwareIRQ; case SOFT: return Messages.LamiIRQTypeAspect_SoftIRQ; default: return "?"; } } return data.toString(); }
Source:
public void configure(Configuration parameters) { inputFormat.configure(parameters); super.configure(parameters); }

Target:
public void configure(Configuration parameters) { super.configure(parameters); inputFormat.configure(parameters); }
Source:
public VCFSimpleHeaderLine altHeaderLine(final String description) { if (allele.isReference()) { throw new UnsupportedOperationException("you cannot ask for a ALT header line on a reference allele"); } return new VCFSimpleHeaderLine(ALT_KEY, name(), Utils.nonNull(description)); }

Target:
public VCFSimpleHeaderLine altHeaderLine(final String description) { if (allele.isReference()) { throw new UnsupportedOperationException("you cannot ask for an ALT header line on a reference allele"); } return new VCFSimpleHeaderLine(ALT_KEY, name(), Utils.nonNull(description)); }
Source:
public int maxRetryCount() { return this.maxRetryCount; }

Target:
public int maxRetryCount() { return maxRetryCount; }
Source:
private Collection<? extends Diff> findInterlockedOneToOneDiffs(ReferenceChange referenceChange, boolean mergeRightToLeft) { final EObject sourceContainer = ComparisonUtil.getExpectedSide(referenceChange.getMatch(), referenceChange.getSource(), mergeRightToLeft); if (sourceContainer != null) { final Object sourceValue = ReferenceUtil .safeEGet(sourceContainer, referenceChange.getReference()); if (sourceValue == sourceContainer) { final Match match = referenceChange.getMatch(); final Set<Diff> candidates = new LinkedHashSet<Diff>(); for (Diff diff : match.getDifferences()) { candidates.add(diff); if (diff.getEquivalence() != null) { candidates.addAll(diff.getEquivalence().getDifferences()); } } return filterInterlockedOneToOneDiffs(candidates, referenceChange, mergeRightToLeft); } } return new LinkedHashSet<Diff>(); }

Target:
private Collection<? extends Diff> findInterlockedOneToOneDiffs(ReferenceChange referenceChange, boolean mergeRightToLeft) { final EObject sourceContainer = ComparisonUtil.getExpectedSide(referenceChange.getMatch(), referenceChange.getSource(), mergeRightToLeft); if (sourceContainer != null) { final Object sourceValue = ReferenceUtil .safeEGet(sourceContainer, referenceChange.getReference()); if (sourceValue == sourceContainer) { final Match match = referenceChange.getMatch(); final Set<Diff> candidates = new LinkedHashSet<Diff>(); for (Diff diff : match.getDifferences()) { candidates.add(diff); if (diff.getEquivalence() != null) { candidates.addAll(diff.getEquivalence().getDifferences()); } } return filterInterlockedOneToOneDiffs(candidates, referenceChange, mergeRightToLeft); } } return Collections.emptyList(); }
Source:
protected void acceptRead(final SAMRecord rec, final ReferenceSequence ref) { if (ref == null) { if (!rec.getReadPairedFlag() || rec.getFirstOfPairFlag()) ++this.totalClusters; } else { if (ref.getContigIndex() != lastContig) { refBases = ref.getBases(); StringUtil.toUpperCase(refBases); final int refLength = refBases.length; final int lastWindowStart = refLength - WINDOW_SIZE; gc = calculateAllGcs(refBases, windowsByGc, lastWindowStart); lastContig = ref.getContigIndex(); } if (!rec.getReadPairedFlag() || rec.getFirstOfPairFlag()) ++this.totalClusters; if (!rec.getReadUnmappedFlag()) { final int pos = rec.getReadNegativeStrandFlag() ? rec.getAlignmentEnd() - WINDOW_SIZE : rec.getAlignmentStart(); ++this.totalAlignedReads; if (pos > 0) { final int windowGc = gc[pos]; if (windowGc >= 0) { ++readsByGc[windowGc]; basesByGc[windowGc] += rec.getReadLength(); errorsByGc[windowGc] += SequenceUtil.countMismatches(rec, refBases, IS_BISULFITE_SEQUENCED) + SequenceUtil.countInsertedBases(rec) + SequenceUtil.countDeletedBases(rec); } } } } }

Target:
protected void acceptRead(final SAMRecord rec, final ReferenceSequence ref) { if (!rec.getReadPairedFlag() || rec.getFirstOfPairFlag()) ++this.totalClusters; if (ref!=null) { if (ref.getContigIndex() != lastContig) { refBases = ref.getBases(); StringUtil.toUpperCase(refBases); final int refLength = refBases.length; final int lastWindowStart = refLength - WINDOW_SIZE; gc = calculateAllGcs(refBases, windowsByGc, lastWindowStart); lastContig = ref.getContigIndex(); } if (!rec.getReadPairedFlag() || rec.getFirstOfPairFlag()) ++this.totalClusters; if (!rec.getReadUnmappedFlag()) { final int pos = rec.getReadNegativeStrandFlag() ? rec.getAlignmentEnd() - WINDOW_SIZE : rec.getAlignmentStart(); ++this.totalAlignedReads; if (pos > 0) { final int windowGc = gc[pos]; if (windowGc >= 0) { ++readsByGc[windowGc]; basesByGc[windowGc] += rec.getReadLength(); errorsByGc[windowGc] += SequenceUtil.countMismatches(rec, refBases, IS_BISULFITE_SEQUENCED) + SequenceUtil.countInsertedBases(rec) + SequenceUtil.countDeletedBases(rec); } } } } }
Source:
public static String join(Collection<?> collection, String delimiter) { if (collection == null || collection.isEmpty()) { return EMPTY_STRING; } else if (delimiter == null) { delimiter = EMPTY_STRING; } StringBuilder builder = new StringBuilder(); Iterator<?> it = collection.iterator(); while (it.hasNext()) { builder.append(it.next()).append(delimiter); } int length = builder.toString().length(); builder.delete(length - delimiter.length(), length); return builder.toString(); }

Target:
public static String join(Collection<?> collection, String delimiter) { if (collection == null || collection.isEmpty()) { return EMPTY_STRING; } else if (delimiter == null) { delimiter = EMPTY_STRING; } StringBuilder builder = new StringBuilder(); Iterator<?> it = collection.iterator(); while (it.hasNext()) { builder.append(it.next()).append(delimiter); } int length = builder.length(); builder.delete(length - delimiter.length(), length); return builder.toString(); }
Source:
private boolean isGlacierObject(S3ObjectSummary object) { return object.getStorageClass().equals(StorageClass.Glacier.toString()); }

Target:
private boolean isGlacierObject(S3ObjectSummary object) { return Glacier.toString().equals(object.getStorageClass()); }
Source:
@Override public double determinant() { LUDecomposition dec = new LUDecomposition(this); double res = dec.determinant(); dec.destroy(); return res; }

Target:
@Override public double determinant() { try (LUDecomposition dec = new LUDecomposition(this)) { return dec.determinant(); } }
Source:
public GlusterVolumeProfileInfoReturnForXmlRpc(Guid clusterId, Map<String, Object> innerMap) { super(innerMap); status = new StatusForXmlRpc((Map<String, Object>) innerMap.get(STATUS)); Map<String, Object> profileInfo = (Map<String, Object>) innerMap.get(PROFILE_INFO); if (profileInfo != null) { String volumeName = (String) profileInfo.get(VOLUME_NAME); GlusterVolumeEntity volume = getGlusterVolumeDao().getByName(clusterId, volumeName); glusterVolumeProfileInfo.setVolumeId(volume.getId()); if(profileInfo.containsKey(BRICKS)) { glusterVolumeProfileInfo.setBrickProfileDetails(prepareBrickProfileDetails(volume, (Object[]) profileInfo.get(BRICKS))); } else { glusterVolumeProfileInfo.setNfsProfileDetails(prepareNfsProfileDetails((Object[]) profileInfo.get(NFSSERVERS))); } } }

Target:
public GlusterVolumeProfileInfoReturnForXmlRpc(Guid clusterId, Map<String, Object> innerMap) { super(innerMap); status = new StatusForXmlRpc((Map<String, Object>) innerMap.get(STATUS)); Map<String, Object> profileInfo = (Map<String, Object>) innerMap.get(PROFILE_INFO); if (profileInfo != null) { String volumeName = (String) profileInfo.get(VOLUME_NAME); GlusterVolumeEntity volume = getGlusterVolumeDao().getByName(clusterId, volumeName); glusterVolumeProfileInfo.setVolumeId(volume.getId()); if(profileInfo.containsKey(BRICKS)) { glusterVolumeProfileInfo.setBrickProfileDetails(prepareBrickProfileDetails(volume, (Object[]) profileInfo.get(BRICKS))); } else if(profileInfo.containsKey(NFSSERVERS)){ glusterVolumeProfileInfo.setNfsProfileDetails(prepareNfsProfileDetails((Object[]) profileInfo.get(NFSSERVERS))); } } }
Source:
public void shouldUploadReservedIdentifiers() throws Exception { String reservedIdentifiers = "{\"reservedIdentifiers\": \"100,200,300,400\"}"; MockHttpServletRequest getRequest = newGetRequest(getURI() + "/" + SEQUENTIAL_IDENTIFIER_SOURCE_UUID); getRequest.addParameter("v", "custom:(reservedIdentifiers)"); SimpleObject initialIdentifiers = deserialize(handle(getRequest)); assertEquals("[]", initialIdentifiers.get("reservedIdentifiers").toString()); MockHttpServletRequest postRequest = newPostRequest(getURI() + "/" + SEQUENTIAL_IDENTIFIER_SOURCE_UUID, reservedIdentifiers); SimpleObject uploadResult = deserialize(handle(postRequest)); assertThat( uploadResult.toString(), containsString(SEQUENTIAL_IDENTIFIER_SOURCE_UUID) ); MockHttpServletRequest getRequestAfterUpload = newGetRequest(getURI() + "/" + SEQUENTIAL_IDENTIFIER_SOURCE_UUID); getRequestAfterUpload.addParameter("v", "custom:(reservedIdentifiers)"); SimpleObject identifiersAfterUpload = deserialize(handle(getRequestAfterUpload)); assertThat(identifiersAfterUpload.get("reservedIdentifiers").toString(), allOf( containsString("100"), containsString("200"), containsString("300"), containsString("400"))); }

Target:
public void shouldUploadReservedIdentifiers() throws Exception { String reservedIdentifiers = "{\"reservedIdentifiers\": \"1,2,3,4\"}"; MockHttpServletRequest getRequest = newGetRequest(getURI() + "/" + SEQUENTIAL_IDENTIFIER_SOURCE_UUID); getRequest.addParameter("v", "custom:(reservedIdentifiers)"); SimpleObject initialIdentifiers = deserialize(handle(getRequest)); assertEquals("[]", initialIdentifiers.get("reservedIdentifiers").toString()); MockHttpServletRequest postRequest = newPostRequest(getURI() + "/" + SEQUENTIAL_IDENTIFIER_SOURCE_UUID, reservedIdentifiers); SimpleObject uploadResult = deserialize(handle(postRequest)); assertThat( uploadResult.toString(), containsString(SEQUENTIAL_IDENTIFIER_SOURCE_UUID) ); MockHttpServletRequest getRequestAfterUpload = newGetRequest(getURI() + "/" + SEQUENTIAL_IDENTIFIER_SOURCE_UUID); getRequestAfterUpload.addParameter("v", "custom:(reservedIdentifiers)"); SimpleObject identifiersAfterUpload = deserialize(handle(getRequestAfterUpload)); assertThat(identifiersAfterUpload.get("reservedIdentifiers").toString(), allOf( containsString("1"), containsString("2"), containsString("3"), containsString("4"))); }
Source:
private void executeHBaseShell(String cmd, Consumer<String> stdoutProcessor) throws IOException { try (AutoClosableProcess autoClosableProcess = AutoClosableProcess .create(hbaseDir.resolve(Paths.get("bin", "hbase")).toString(), "shell") .setStdoutProcessor(stdoutProcessor) .runNonBlocking()) { try (PrintStream printStream = new PrintStream(autoClosableProcess.getProcess().getOutputStream(), true, StandardCharsets.UTF_8.name())) { LOG.info("Executing hbase shell: {}", cmd); printStream.println(cmd); } try { autoClosableProcess.getProcess().waitFor(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } }

Target:
private void executeHBaseShell(String cmd, Consumer<String> stdoutProcessor) throws IOException { AutoClosableProcess .create(hbaseDir.resolve(Paths.get("bin", "hbase")).toString(), "shell") .setStdoutProcessor(stdoutProcessor) .setStdInputs(cmd) .runBlocking(); }
Source:
public void testRestoreOfAutoCommit() throws Exception { conn.setAutoCommit(false); Xid xid = new CustomXid(14); xaRes.start(xid, XAResource.TMNOFLAGS); xaRes.end(xid, XAResource.TMSUCCESS); xaRes.commit(xid, true); assertTrue(!conn.getAutoCommit()); conn.setAutoCommit(true); xid = new CustomXid(15); xaRes.start(xid, XAResource.TMNOFLAGS); xaRes.end(xid, XAResource.TMSUCCESS); xaRes.commit(xid, true); assertTrue(conn.getAutoCommit()); conn.setAutoCommit(true); xid = new CustomXid(16); xaRes.start(xid, XAResource.TMNOFLAGS); xaRes.end(xid, XAResource.TMSUCCESS); xaRes.start(xid, XAResource.TMJOIN); xaRes.end(xid, XAResource.TMSUCCESS); xaRes.commit(xid, true); assertTrue(conn.getAutoCommit()); }

Target:
public void testRestoreOfAutoCommit() throws Exception { conn.setAutoCommit(false); Xid xid = new CustomXid(14); xaRes.start(xid, XAResource.TMNOFLAGS); xaRes.end(xid, XAResource.TMSUCCESS); xaRes.commit(xid, true); assertFalse("XaResource should have restored connection autocommit mode after commit or rollback to the initial state.", conn.getAutoCommit()); conn.setAutoCommit(true); xid = new CustomXid(15); xaRes.start(xid, XAResource.TMNOFLAGS); xaRes.end(xid, XAResource.TMSUCCESS); xaRes.commit(xid, true); assertTrue("XaResource should have restored connection autocommit mode after commit or rollback to the initial state.", conn.getAutoCommit()); }
Source:
BeaconGenesis(Json json) { super(json.parentHash(), json.randaoReveal(), json.mainChainRef(), EMPTY, SLOT, new ArrayList<>()); this.timestamp = json.timestamp(); this.initialValidators = json.validatorSet(); }

Target:
BeaconGenesis(Json json) { super(json.parentHash(), json.randaoReveal(), json.mainChainRef(), EMPTY, SLOT, Collections.emptyList()); this.timestamp = json.timestamp(); this.initialValidators = json.validatorSet(); }
Source:
public static PDataType HiveType2PDataType(String hiveType) throws SerDeException { final String lctype = hiveType.toLowerCase(); if ("string".equals(lctype)) { return PVarchar.INSTANCE; }else if ("varchar".equals(lctype)) { return PVarchar.INSTANCE; }else if ("char".equals(lctype)) { return PChar.INSTANCE; } else if ("float".equals(lctype)) { return PFloat.INSTANCE; } else if ("double".equals(lctype)) { return PDouble.INSTANCE; } else if ("boolean".equals(lctype)) { return PBoolean.INSTANCE; } else if ("tinyint".equals(lctype)) { return PSmallint.INSTANCE; } else if ("smallint".equals(lctype)) { return PSmallint.INSTANCE; } else if ("int".equals(lctype)) { return PInteger.INSTANCE; } else if ("bigint".equals(lctype)) { return PLong.INSTANCE; } else if ("timestamp".equals(lctype)) { return PTimestamp.INSTANCE; } else if ("binary".equals(lctype)) { return PBinary.INSTANCE; } else if ("date".equals(lctype)) { return PDate.INSTANCE; } throw new SerDeException("Phoenix unrecognized column type: " + hiveType); }

Target:
public static PDataType HiveType2PDataType(String hiveType) throws SerDeException { final String lctype = hiveType.toLowerCase(); if ("string".equals(lctype)) { return PVarchar.INSTANCE; }else if ("varchar".equals(lctype)) { return PVarchar.INSTANCE; }else if ("char".equals(lctype)) { return PChar.INSTANCE; } else if ("float".equals(lctype)) { return PFloat.INSTANCE; } else if ("double".equals(lctype)) { return PDouble.INSTANCE; } else if ("boolean".equals(lctype)) { return PBoolean.INSTANCE; } else if ("tinyint".equals(lctype)) { return PSmallint.INSTANCE; } else if ("smallint".equals(lctype)) { return PSmallint.INSTANCE; } else if ("int".equals(lctype)) { return PInteger.INSTANCE; } else if ("bigint".equals(lctype)) { return PLong.INSTANCE; } else if ("timestamp".equals(lctype)) { return PTimestamp.INSTANCE; } else if ("binary".equals(lctype)) { return PBinary.INSTANCE; } else if ("decimal".equals(lctype)) { return PDecimal.INSTANCE; } else if ("date".equals(lctype)) { return PDate.INSTANCE; } throw new SerDeException("Phoenix unrecognized column type: " + hiveType); }
Source:
public void convert_not_approved() throws IOException { Result sourceDataset = documentEntity(EXT_IDENTIFIERS); when(fieldApprover.approve(any())).thenReturn(false); DataSetReference metadata = converter.convert(sourceDataset); assertNotNull(metadata); assertEquals(ID, metadata.getId()); assertEquals("unspecified", metadata.getReferenceType()); assertEquals("", metadata.getIdForGivenType()); assertEquals(1, metadata.getCreatorNames().size()); assertEquals(FULL_NAME, metadata.getCreatorNames().get(0)); assertEquals(0, metadata.getTitles().size()); assertNull(metadata.getDescription()); assertNull(metadata.getPublisher()); assertNull(metadata.getPublicationYear()); assertEquals(0, metadata.getFormats().size()); assertEquals("resource_type", metadata.getResourceTypeValue()); assertNull(metadata.getAlternateIdentifiers()); }

Target:
public void convert_not_approved() { Result sourceDataset = documentEntity(EXT_IDENTIFIERS); when(fieldApprover.approve(any())).thenReturn(false); DataSetReference metadata = converter.convert(sourceDataset); assertNotNull(metadata); assertEquals(ID, metadata.getId()); assertEquals("unspecified", metadata.getReferenceType()); assertEquals("", metadata.getIdForGivenType()); assertEquals(1, metadata.getCreatorNames().size()); assertEquals(FULL_NAME, metadata.getCreatorNames().get(0)); assertEquals(0, metadata.getTitles().size()); assertNull(metadata.getDescription()); assertNull(metadata.getPublisher()); assertNull(metadata.getPublicationYear()); assertEquals(0, metadata.getFormats().size()); assertEquals("resource_type", metadata.getResourceTypeValue()); assertNull(metadata.getAlternateIdentifiers()); }
Source:
public Iterator<ProcessStatusInterval> getKernelStatuses(ICalledFunction function, Collection<Long> times) { IHostModel model = ModelManager.getModelFor(getHostId(function.getStart())); int resolution = 1; if (!times.isEmpty()) { List<Long> filtered = new ArrayList<>(); times.forEach(t -> { if (t >= function.getStart() && t <= function.getEnd()) { filtered.add(t); } }); Collections.sort(filtered); resolution = filtered.size() > 0 ? (int) (filtered.get(filtered.size() - 1) - filtered.get(0) / filtered.size()) : resolution; return model.getThreadStatusIntervals(function.getThreadId(), function.getStart(), function.getEnd(), resolution); } return model.getThreadStatusIntervals(function.getThreadId(), function.getStart(), function.getEnd(), resolution); }

Target:
public Iterable<ProcessStatusInterval> getKernelStatuses(ICalledFunction function, Collection<Long> times) { IHostModel model = ModelManager.getModelFor(getHostId(function.getStart())); int resolution = 1; if (!times.isEmpty()) { List<Long> filtered = new ArrayList<>(); for (Long time : times) { if (function.intersects(time)) { filtered.add(time); } } Collections.sort(filtered); resolution = !filtered.isEmpty() ? (int) (filtered.get(filtered.size() - 1) - filtered.get(0) / filtered.size()) : resolution; return model.getThreadStatusIntervals(function.getThreadId(), function.getStart(), function.getEnd(), resolution); } return model.getThreadStatusIntervals(function.getThreadId(), function.getStart(), function.getEnd(), resolution); }
Source:
public boolean canEnable() throws JavaModelException { if (!super.canEnable() || fJavaElements.length == 0) return false; for (IJavaElement fJavaElement : fJavaElements) { if (fJavaElement instanceof IMember) { IMember member= (IMember) fJavaElement; if (member.isBinary() && member.getSourceRange() == null) return false; } } return true; }

Target:
public boolean canEnable() throws JavaModelException { if (!super.canEnable() || fJavaElements.length == 0) return false; for (IJavaElement javaElement : fJavaElements) { if (javaElement instanceof IMember) { IMember member= (IMember) javaElement; if (member.isBinary() && member.getSourceRange() == null) return false; } } return true; }
Source:
public String render(final GetTapeFailureResult obj) { final DetailedTapeFailureList result = obj.getResult(); if( (result == null) || (null == result.getDetailedTapeFailures()) || (result.getDetailedTapeFailures().size() == 0) ) { return "No taoe failures on remote appliance"; } return "" + result.getDetailedTapeFailures().size() + " Tape Failures:\n" + ASCIITable.getInstance().getTable(getHeaders(), formatBucketList(result)); }

Target:
public String render(final GetTapeFailureResult obj) { final DetailedTapeFailureList result = obj.getResult(); if( (result == null) || (null == result.getDetailedTapeFailures()) || (result.getDetailedTapeFailures().size() == 0) ) { return "No tape failures on remote appliance"; } return "" + result.getDetailedTapeFailures().size() + " Tape Failures:\n" + ASCIITable.getInstance().getTable(getHeaders(), formatBucketList(result)); }
Source:
public void removeQuotaFromCache(Guid storagePoolId, Guid quotaId) { if (!storagePoolQuotaMap.containsKey(storagePoolId)) { return; } synchronized (storagePoolQuotaMap.get(storagePoolId)) { storagePoolQuotaMap.get(storagePoolId).remove(quotaId); } }

Target:
public void removeQuotaFromCache(Guid storagePoolId, Guid quotaId) { lock.readLock().lock(); try { if (!storagePoolQuotaMap.containsKey(storagePoolId)) { return; } synchronized (storagePoolQuotaMap.get(storagePoolId)) { storagePoolQuotaMap.get(storagePoolId).remove(quotaId); } } finally { lock.readLock().unlock(); } }
Source:
public void setOwner(PagingStore owner) { new Exception("Owner - " + owner).printStackTrace(); this.owner = owner; }

Target:
public void setOwner(PagingStore owner) { this.owner = owner; }
Source:
public void unsubscribe(StompConnection connection, String subscriptionID, String durableSubscriberName) throws Exception { StompSession stompSession = getSession(connection); String clientID = (connection.getClientID() != null) ? connection.getClientID() : null; boolean unsubscribed = stompSession.unsubscribe(subscriptionID, durableSubscriberName, clientID); if (!unsubscribed) { throw new ActiveMQStompException(connection, "Cannot unsubscribe as no subscription exists for id: " + subscriptionID); } }

Target:
public void unsubscribe(StompConnection connection, String subscriptionID, String durableSubscriberName) throws Exception { StompSession stompSession = getSession(connection); boolean unsubscribed = stompSession.unsubscribe(subscriptionID, durableSubscriberName, connection.getClientID()); if (!unsubscribed) { throw new ActiveMQStompException(connection, "Cannot unsubscribe as no subscription exists for id: " + subscriptionID); } }
Source:
public ChassisMinimumDistance(Chassis chassis, double distance, double speed, ChassisConstant fallbackCommand, CustomEncoder... encoders) { super(chassis, 0.0, speed, 0.0, Double.MAX_VALUE); this.encoders = encoders; this.distance = distance; this.fallbackCommand = fallbackCommand; initialDistances = new double[encoders.length]; }

Target:
public ChassisMinimumDistance(Chassis chassis, double distance, double speed, ChassisConstant fallbackCommand, CustomEncoder... encoders) { this("Chassis Minimum Distance", chassis, distance, speed, fallbackCommand, encoders); }
Source:
public boolean addAll(Collection<? extends TileEntity> tileEntities) { for (Iterator<? extends TileEntity> iterator = tileEntities.iterator(); iterator.hasNext();) { add(iterator.next()); } return true; }

Target:
public boolean addAll(Collection<? extends TileEntity> tileEntities) { for (TileEntity tileEntity : tileEntities) { add(tileEntity); } return true; }
Source:
private void cleanupFailedImportVM(final UserVm userVm) { if (userVm == null) { return; } VirtualMachineProfile profile = new VirtualMachineProfileImpl(userVm); volumeDao.deleteVolumesByInstance(userVm.getId()); try { networkOrchestrationService.release(profile, true); } catch (Exception e) { nicDao.removeNicsForInstance(userVm.getId()); } vmDao.remove(userVm.getId()); }

Target:
private void cleanupFailedImportVM(final UserVm userVm) { if (userVm == null) { return; } VirtualMachineProfile profile = new VirtualMachineProfileImpl(userVm); volumeDao.deleteVolumesByInstance(userVm.getId()); try { networkOrchestrationService.release(profile, true); } catch (Exception e) { LOGGER.error(String.format("Unable to release NICs for unsuccessful import unmanaged VM: %s", userVm.getInstanceName()), e); nicDao.removeNicsForInstance(userVm.getId()); } vmDao.remove(userVm.getId()); }
Source:
public void scan() throws IOException { if (!rowGroupOpen) { openRowGroup(); } beginScan(presentStream, null); QualifyingSet input = inputQualifyingSet; QualifyingSet output = outputQualifyingSet; int end = input.getEnd(); int rowsInRange = end - posInRowGroup; int[] inputPositions = input.getPositions(); if (filter != null) { output.reset(rowsInRange); } ensureValuesCapacity(end, false); if (dataStream == null) { processAllNulls(); endScan(presentStream); return; } int nextActive = inputPositions[0]; int activeIdx = 0; int toSkip = 0; for (int i = 0; i < rowsInRange; i++) { if (i + posInRowGroup == nextActive) { if (presentStream != null && !present[i]) { if (filter == null || filter.testNull()) { if (filter != null) { output.append(i + posInRowGroup, activeIdx); } addNullResult(); } } else { if (toSkip > 0) { dataStream.skip(toSkip); } byte value = dataStream.next(); if (filter != null) { if (filter.testLong(value)) { output.append(i + posInRowGroup, activeIdx); addResult(value); } } else { addResult(value); } } if (++activeIdx == input.getPositionCount()) { toSkip = countPresent(i + 1, end - posInRowGroup); break; } nextActive = inputPositions[activeIdx]; if (outputChannelSet && numResults > resultSizeBudget) { batchTooLarge(activeIdx); } continue; } else { if (presentStream == null || present[i]) { toSkip++; } } } if (toSkip > 0) { dataStream.skip(toSkip); } endScan(presentStream); }

Target:
public void scan() throws IOException { if (!rowGroupOpen) { openRowGroup(); } beginScan(presentStream, null); QualifyingSet input = inputQualifyingSet; QualifyingSet output = outputQualifyingSet; int end = input.getEnd(); int rowsInRange = end - posInRowGroup; int[] inputPositions = input.getPositions(); if (filter != null) { output.reset(rowsInRange); } ensureValuesCapacity(end, false); if (dataStream == null) { processAllNulls(); endScan(presentStream); return; } int nextActive = inputPositions[0]; int activeIdx = 0; int toSkip = 0; for (int i = 0; i < rowsInRange; i++) { if (i + posInRowGroup == nextActive) { if (presentStream != null && !present[i]) { if (filter == null || filter.testNull()) { if (filter != null) { output.append(i + posInRowGroup, activeIdx); } addNullResult(); } } else { if (toSkip > 0) { dataStream.skip(toSkip); } byte value = dataStream.next(); if (filter != null) { if (filter.testLong(value)) { output.append(i + posInRowGroup, activeIdx); addResult(value); } } else { addResult(value); } } if (++activeIdx == input.getPositionCount()) { toSkip = countPresent(i + 1, end - posInRowGroup); break; } nextActive = inputPositions[activeIdx]; if (outputChannelSet && numResults > resultSizeBudget) { throw batchTooLarge(); } continue; } else { if (presentStream == null || present[i]) { toSkip++; } } } if (toSkip > 0) { dataStream.skip(toSkip); } endScan(presentStream); }
Source:
public int hashCode() { return Arrays.hashCode(new Object[] {errorCode, message, fields}); }

Target:
public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((errorCode == null) ? 0 : errorCode.hashCode()); result = prime * result + ((fields == null) ? 0 : fields.hashCode()); result = prime * result + ((message == null) ? 0 : message.hashCode()); return result; }
Source:
private void verifyCachesAndGroups(IgniteEx ignite, Collection<String> cacheNames) { Map<String, DynamicCacheDescriptor> caches = ignite.context().cache().cacheDescriptors(); assertEquals(3, caches.size()); assertTrue(caches.keySet().contains(GridCacheUtils.UTILITY_CACHE_NAME)); assertTrue(caches.keySet().containsAll(cacheNames)); Map<Integer, CacheGroupDescriptor> groups = ignite.context().cache().cacheGroupDescriptors(); assertEquals(2, groups.size()); boolean defaultGroupFound = false; boolean staticCachesGroupFound = false; for (CacheGroupDescriptor grpDesc : groups.values()) { if (grpDesc.cacheOrGroupName().equals(GridCacheUtils.UTILITY_CACHE_NAME)) defaultGroupFound = true; else if (grpDesc.cacheOrGroupName().equals(GROUP_WITH_STATIC_CACHES)) staticCachesGroupFound = true; } assertTrue(String.format("Default group found: %b, static group found: %b", defaultGroupFound, staticCachesGroupFound), defaultGroupFound && staticCachesGroupFound); }

Target:
private void verifyCachesAndGroups(IgniteEx ignite, Collection<String> cacheNames) { Map<String, DynamicCacheDescriptor> caches = ignite.context().cache().cacheDescriptors(); assertEquals(cacheNames.size() + 1, caches.size()); assertTrue(caches.keySet().contains(GridCacheUtils.UTILITY_CACHE_NAME)); assertTrue(caches.keySet().containsAll(cacheNames)); Map<Integer, CacheGroupDescriptor> groups = ignite.context().cache().cacheGroupDescriptors(); assertEquals(2, groups.size()); boolean defaultGroupFound = false; boolean staticCachesGroupFound = false; for (CacheGroupDescriptor grpDesc : groups.values()) { if (grpDesc.cacheOrGroupName().equals(GridCacheUtils.UTILITY_CACHE_NAME)) defaultGroupFound = true; else if (grpDesc.cacheOrGroupName().equals(GROUP_WITH_STATIC_CACHES)) staticCachesGroupFound = true; } assertTrue(String.format("Default group found: %b, static group found: %b", defaultGroupFound, staticCachesGroupFound), defaultGroupFound && staticCachesGroupFound); }
Source:
public void testInputCustomVariable() { VariableDeclaration declaration = mock(VariableDeclaration.class); org.eclipse.bpmn2.Property property = mock(org.eclipse.bpmn2.Property.class); when(declaration.getTypedIdentifier()).thenReturn(property); InitializedVariable.InitializedInputVariable input = InitializedVariable.createCustomInput("parent", declaration, "#{expression}"); assertTrue(input instanceof InitializedVariable.InputExpression); input = InitializedVariable.createCustomInput("parent", declaration, "constant"); assertTrue(input instanceof InitializedVariable.InputConstant); }

Target:
public void testInputCustomVariable() { VariableDeclaration declaration = new VariableDeclaration("Identifier", "type"); InitializedVariable.InitializedInputVariable input = createCustomInput("parent", declaration, "#{expression}"); assertTrue(input instanceof InitializedVariable.InputExpression); input = createCustomInput("parent", declaration, "constant"); assertTrue(input instanceof InitializedVariable.InputConstant); }
Source:
protected void removeDoneFileQuietly(String dataFileName) { try { String doneFileName = StringUtils.substringBeforeLast(dataFileName, CuFPConstants.XML_FILE_EXTENSION) + GeneralLedgerConstants.BatchFileSystem.DONE_FILE_EXTENSION; if (!FileUtils.deleteQuietly(new File(doneFileName))) { LOG.error("removeDoneFileQuietly: Could not delete .done file: " + doneFileName); } } catch (RuntimeException e) { LOG.error("removeDoneFileQuietly: Could not delete .done file for accounting document XML", e); } }

Target:
protected void removeDoneFileQuietly(String dataFileName) { try { fileStorageService.removeDoneFiles(Collections.singletonList(dataFileName)); } catch (RuntimeException e) { LOG.error("removeDoneFileQuietly: Could not delete .done file for accounting document XML", e); } }
Source:
protected void testAccessControl_giverNotModeratedStudent_inaccessible() { ______TS("Instructor moderates student's response, but response not given by moderated student, " + "should not be accessible"); loginAsInstructor(instructor1OfCourse1.googleId); assertEquals(FeedbackParticipantType.STUDENTS, logic.getFeedbackQuestion(testModerateResponse.getFeedbackQuestionId()).getGiverType()); assertNotEquals(student1InCourse1.getEmail(), testModerateResponse.getGiver()); FeedbackResponseUpdateRequest updateRequest = getUpdateRequest(instructor1OfCourse1.getEmail()); String[] moderatedStudentSubmissionParams = new String[] { Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), Const.ParamsNames.FEEDBACK_RESPONSE_ID, testModerateResponse.getId(), Const.ParamsNames.FEEDBACK_SESSION_MODERATED_PERSON, student1InCourse1.getEmail(), }; verifyCannotAccess(updateRequest, moderatedStudentSubmissionParams); }

Target:
protected void testAccessControl_giverNotModeratedStudent_inaccessible() { ______TS("Instructor moderates student's response, but response not given by moderated student, " + "should not be accessible"); StudentAttributes student2InCourse1 = typicalBundle.students.get("student2InCourse1"); StudentAttributes student5InCourse1 = typicalBundle.students.get("student5InCourse1"); FeedbackSessionAttributes session = typicalBundle.feedbackSessions.get("session1InCourse1"); FeedbackQuestionAttributes testModerateQuestion = logic.getFeedbackQuestion( session.getFeedbackSessionName(), session.getCourseId(), 2); FeedbackResponseAttributes testModerateResponse = logic.getFeedbackResponse(testModerateQuestion.getId(), student2InCourse1.getEmail(), student5InCourse1.getEmail()); loginAsInstructor(instructor1OfCourse1.googleId); assertEquals(FeedbackParticipantType.STUDENTS, logic.getFeedbackQuestion(testModerateResponse.getFeedbackQuestionId()).getGiverType()); assertNotEquals(student1InCourse1.getEmail(), testModerateResponse.getGiver()); FeedbackResponseUpdateRequest updateRequest = getUpdateRequest(instructor1OfCourse1.getEmail()); String[] moderatedStudentSubmissionParams = new String[] { Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), Const.ParamsNames.FEEDBACK_RESPONSE_ID, testModerateResponse.getId(), Const.ParamsNames.FEEDBACK_SESSION_MODERATED_PERSON, student1InCourse1.getEmail(), }; verifyCannotAccess(updateRequest, moderatedStudentSubmissionParams); }
Source:
public SendEventBatchTest(EventHubsPerfStressOptions options) throws IllegalStateException { super(options); CreateBatchOptions createBatchOptions = getBatchOptions(options); if (createBatchOptions != null) { eventDataBatch = eventHubProducerClient.createBatch(createBatchOptions); } else { eventDataBatch = eventHubProducerClient.createBatch(); } for (int i = 0; i < options.getEvents(); i++) { if (!eventDataBatch.tryAdd(new EventData("static event"))) { throw new IllegalStateException(String.format( "Batch can only fit %d number of messages with batch size of %d ", options.getCount(), options.getSize())); } } }

Target:
public SendEventBatchTest(EventHubsPerfStressOptions options) throws IllegalStateException { super(options); createBatchOptions = getBatchOptions(options); }
Source:
public void stop() { logApplicationLifecycle("Stopping"); ServiceStateLogic.ServiceNotUpLogic.updateNotUpIndicator(this, Attributes.SERVICE_STATE_ACTUAL, "Application stopping"); sensors().set(SERVICE_UP, false); setExpectedStateAndRecordLifecycleEvent(Lifecycle.STOPPING); try { doStop(); } catch (Exception e) { setExpectedStateAndRecordLifecycleEvent(Lifecycle.ON_FIRE); log.warn("Error stopping application " + this + " (rethrowing): "+e); throw Exceptions.propagate(e); } ServiceStateLogic.ServiceNotUpLogic.updateNotUpIndicator(this, Attributes.SERVICE_STATE_ACTUAL, "Application stopped"); setExpectedStateAndRecordLifecycleEvent(Lifecycle.STOPPED); if (getParent()==null) { synchronized (this) { Location location = Iterables.getFirst(getLocations(), null); getEntityManager().unmanage(this); unmanageProvisionerIfNotUsed(location); } } logApplicationLifecycle("Stopped"); }

Target:
public void stop() { logApplicationLifecycle("Stopping"); ServiceStateLogic.ServiceNotUpLogic.updateNotUpIndicator(this, Attributes.SERVICE_STATE_ACTUAL, "Application stopping"); sensors().set(SERVICE_UP, false); setExpectedStateAndRecordLifecycleEvent(Lifecycle.STOPPING); try { doStop(); } catch (Exception e) { setExpectedStateAndRecordLifecycleEvent(Lifecycle.ON_FIRE); log.warn("Error stopping application " + this + " (rethrowing): "+e); throw Exceptions.propagate(e); } ServiceStateLogic.ServiceNotUpLogic.updateNotUpIndicator(this, Attributes.SERVICE_STATE_ACTUAL, "Application stopped"); setExpectedStateAndRecordLifecycleEvent(Lifecycle.STOPPED); if (getParent()==null) { synchronized (this) { Location machineProvisioningLocation = Iterables.getFirst(getLocations(), null); getEntityManager().unmanage(this); if (machineProvisioningLocation != null) { unmanageProvisionerIfNotUsed(machineProvisioningLocation); } } } logApplicationLifecycle("Stopped"); }
Source:
public ServerImpl(Server server) { this(server.getRef(), server.getProtocol(), server.getAddress(), server.getUrl(), server.getPort(), (ServerPropertiesImpl) server.getProperties()); }

Target:
public ServerImpl(Server server) { this(server.getRef(), server.getProtocol(), server.getAddress(), server.getUrl(), server.getProperties()); }