auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void should_get_answer_from_server_for_ts_request() throws Exception { eslintBridgeServer = createEslintBridgeServer(START_SERVER_SCRIPT); eslintBridgeServer.deploy(); eslintBridgeServer.startServer(context); DefaultInputFile inputFile = TestInputFileBuilder.create("foo", "foo.js") .setContents("alert('Fly, you fools!')") .build(); DefaultInputFile tsConfig = TestInputFileBuilder.create("foo", "tsconfig.json") .setContents("{\"compilerOptions\": {\"target\": \"es6\", \"allowJs\": true }}") .build(); EslintBridgeServer.TypeScriptAnalysisRequest request = new EslintBridgeServer.TypeScriptAnalysisRequest(inputFile, new EslintBridgeServer.Rule[0], Collections.singletonList(tsConfig.absolutePath())); assertThat(eslintBridgeServer.analyzeTypeScript(request)).isEqualTo(new EslintBridgeServer.AnalysisResponseIssue[0]); }

Target:
public void should_get_answer_from_server_for_ts_request() throws Exception { eslintBridgeServer = createEslintBridgeServer(START_SERVER_SCRIPT); eslintBridgeServer.deploy(); eslintBridgeServer.startServer(context); DefaultInputFile inputFile = TestInputFileBuilder.create("foo", "foo.ts") .setContents("alert('Fly, you fools!')") .build(); DefaultInputFile tsConfig = TestInputFileBuilder.create("foo", "tsconfig.json") .setContents("{\"compilerOptions\": {\"target\": \"es6\", \"allowJs\": true }}") .build(); TypeScriptAnalysisRequest request = new TypeScriptAnalysisRequest(inputFile, new Rule[0], singletonList(tsConfig.absolutePath())); assertThat(eslintBridgeServer.analyzeTypeScript(request).issues).isEmpty(); }
Source:
private boolean hasScopeAnnotation(Class<?> clazz) { Annotation scopeAnnotation = null; for (Annotation annot : clazz.getAnnotations()) { if (annot.annotationType().isAnnotationPresent(ScopeAnnotation.class)) { Preconditions.checkState(scopeAnnotation == null, "Multiple scopes not allowed"); scopeAnnotation = annot; } } return scopeAnnotation != null; }

Target:
private boolean hasScopeAnnotation(Class<?> clazz) { Annotation scopeAnnotation = null; for (Annotation annot : clazz.getAnnotations()) { if (annot.annotationType().isAnnotationPresent(ScopeAnnotation.class) || annot.annotationType().isAnnotationPresent(Scope.class)) { Preconditions.checkState(scopeAnnotation == null, "Multiple scopes not allowed"); scopeAnnotation = annot; } } return scopeAnnotation != null; }
Source:
if (FMLCommonHandler.instance().getSide() == Side.CLIENT) { EsteemedInnovation.logger.info("[EI] Getting some fields from reflection for Tick Handling."); itemInMainHandField = ReflectionHelper.getField("itemStackMainHand", "field_187467_d", ItemRenderer.class); itemInOffHandField = ReflectionHelper.getField("itemStackOffHand", "field_187468_e", ItemRenderer.class); if (itemInMainHandField != null) { itemInMainHandField.setAccessible(true); } if (itemInOffHandField != null) { itemInOffHandField.setAccessible(true); } }

Target:
if (FMLCommonHandler.instance().getSide() == Side.CLIENT) { EsteemedInnovation.logger.info("Getting some fields from reflection for Tick Handling."); itemInMainHandField = ReflectionHelper.getField("itemStackMainHand", "field_187467_d", ItemRenderer.class); itemInOffHandField = ReflectionHelper.getField("itemStackOffHand", "field_187468_e", ItemRenderer.class); if (itemInMainHandField != null) { itemInMainHandField.setAccessible(true); } if (itemInOffHandField != null) { itemInOffHandField.setAccessible(true); } }
Source:
public String entityNotFoundExceptionErrorHandler(EntityNotFoundException e) { e.printStackTrace(); return "judgmentNotFound"; }

Target:
public String entityNotFoundExceptionErrorHandler(EntityNotFoundException e) { e.printStackTrace(); return "entityNotFound"; }
Source:
private void insertOverflowEntryIfNeeded(long hash) { int zeros = numberOfLeadingZeros(hash, indexBitLength); if (zeros > (Short.SIZE - indexBitLength)) { int overflowZeros = zeros - (Short.SIZE - indexBitLength) - 1; int bucketIndex = computeIndex(hash, indexBitLength); short overflowEntry = (short) ((bucketIndex << (Short.SIZE - indexBitLength)) | (overflowZeros & valueMask(indexBitLength))); int position = searchOverflow(bucketIndex); if (position < 0) { if (numberOfOverflows + 1 > overflows.length) { overflows = Arrays.copyOf(overflows, overflows.length + 1); } int insertionPoint = -(position + 1); if (insertionPoint < numberOfOverflows) { System.arraycopy(overflows, insertionPoint, overflows, insertionPoint + 1, numberOfOverflows - insertionPoint); } overflows[insertionPoint] = overflowEntry; numberOfOverflows++; } else { int oldValue = extractValue(overflows[position]); if (overflowZeros > oldValue) { overflows[position] = overflowEntry; } } } }

Target:
private void insertOverflowEntryIfNeeded(long hash) { int zeros = numberOfLeadingZeros(hash, indexBitLength); int overflowBits = Short.SIZE - indexBitLength; if (zeros > overflowBits) { int overflowZeros = zeros - overflowBits - 1; int bucketIndex = computeIndex(hash, indexBitLength); short overflowEntry = (short) ((bucketIndex << overflowBits) | (overflowZeros & valueMask(indexBitLength))); int position = searchOverflow(bucketIndex); if (position < 0) { if (numberOfOverflows + 1 > overflows.length) { overflows = Arrays.copyOf(overflows, overflows.length + 1); } int insertionPoint = -(position + 1); if (insertionPoint < numberOfOverflows) { System.arraycopy(overflows, insertionPoint, overflows, insertionPoint + 1, numberOfOverflows - insertionPoint); } overflows[insertionPoint] = overflowEntry; numberOfOverflows++; } else { int oldValue = extractValue(overflows[position]); if (overflowZeros > oldValue) { overflows[position] = overflowEntry; } } } }
Source:
public Builder withRole(String role) { instructorAttributes.role = (role == null) ? Const.InstructorPermissionRoleNames.INSTRUCTOR_PERMISSION_ROLE_COOWNER : SanitizationHelper.sanitizeName(role); return this; }

Target:
public Builder withRole(String role) { if (role != null) { instructorAttributes.role = SanitizationHelper.sanitizeName(role); } return this; }
Source:
protected void addStockIdColumn(final List<MeasurementVariable> plotDataSetColumns) { final Optional<MeasurementVariable> designationColumn = plotDataSetColumns.stream().filter(measurementVariable -> measurementVariable.getName().equals("DESIGNATION")).findFirst(); plotDataSetColumns.add(plotDataSetColumns.indexOf(designationColumn.get()) + 1, buildStockIdColumn()); }

Target:
protected void addStockIdColumn(final List<MeasurementVariable> plotDataSetColumns) { final Optional<MeasurementVariable> designationColumn = plotDataSetColumns.stream().filter(measurementVariable -> measurementVariable.getTermId() == TermId.DESIG.getId()).findFirst(); plotDataSetColumns.add(plotDataSetColumns.indexOf(designationColumn.get()) + 1, addTermIdColumn(TermId.STOCK_ID, VariableType.GERMPLASM_DESCRIPTOR,null, true)); }
Source:
public Set<Type> getTypes() { return Collections.singleton( BeanMetaDataClassNormalizer.class ); }

Target:
public Set<Type> getTypes() { return TYPES; }
Source:
public Future<Object> replicate( ReplicatedContent command, boolean trackResult ) throws InterruptedException, NoLeaderFoundException { OperationContext session = sessionPool.acquireSession(); DistributedOperation operation = new DistributedOperation( command, session.globalSession(), session.localOperationId() ); Progress progress = progressTracker.start( operation ); RetryStrategy.Timeout progressTimeout = progressRetryStrategy.newTimeout(); RetryStrategy.Timeout leaderTimeout = leaderRetryStrategy.newTimeout(); do { assertDatabaseNotShutdown(); try { outbound.send( leaderLocator.getLeader(), new RaftMessages.NewEntry.Request( me, operation ) ); leaderTimeout = leaderRetryStrategy.newTimeout(); progress.awaitReplication( progressTimeout.getMillis() ); progressTimeout.increment(); } catch ( InterruptedException e ) { progressTracker.abort( operation ); throw e; } catch ( NoLeaderFoundException e ) { log.debug( "Could not replicate operation " + operation + " because no leader was found. Retrying.", e ); wait( leaderTimeout.getMillis() ); leaderTimeout.increment(); } } while( !progress.isReplicated() ); BiConsumer<Object,Throwable> cleanup = ( ignored1, ignored2 ) -> sessionPool.releaseSession( session ); if( trackResult ) { progress.futureResult().whenComplete( cleanup ); } else { cleanup.accept( null, null ); } return progress.futureResult(); }

Target:
public Future<Object> replicate( ReplicatedContent command, boolean trackResult ) throws InterruptedException { OperationContext session = sessionPool.acquireSession(); DistributedOperation operation = new DistributedOperation( command, session.globalSession(), session.localOperationId() ); Progress progress = progressTracker.start( operation ); RetryStrategy.Timeout progressTimeout = progressRetryStrategy.newTimeout(); RetryStrategy.Timeout leaderTimeout = leaderRetryStrategy.newTimeout(); do { assertDatabaseNotShutdown(); try { outbound.send( leaderLocator.getLeader(), new RaftMessages.NewEntry.Request( me, operation ) ); leaderTimeout = leaderRetryStrategy.newTimeout(); progress.awaitReplication( progressTimeout.getMillis() ); progressTimeout.increment(); } catch ( InterruptedException e ) { progressTracker.abort( operation ); throw e; } catch ( NoLeaderFoundException e ) { log.debug( "Could not replicate operation " + operation + " because no leader was found. Retrying.", e ); Thread.sleep( leaderTimeout.getMillis() ); leaderTimeout.increment(); } } while( !progress.isReplicated() ); BiConsumer<Object,Throwable> cleanup = ( ignored1, ignored2 ) -> sessionPool.releaseSession( session ); if( trackResult ) { progress.futureResult().whenComplete( cleanup ); } else { cleanup.accept( null, null ); } return progress.futureResult(); }
Source:
protected Text getNext() { try { if (sequenceReader==null) { return null; } Writable key = (Writable) ReflectionUtils.newInstance( sequenceReader.getKeyClass(), fs.getConf()); Writable value = (Writable) ReflectionUtils.newInstance( sequenceReader.getValueClass(), fs.getConf()); if (sequenceReader.next(key, value)) { return (Text) value; } else { sequenceReader.close(); sequenceReader = getNextSequenceReader(); if (sequenceReader!=null) { return getNext(); } } return null; } catch (IOException e) { throw new RuntimeException(e); } }

Target:
private Text getNext() { try { if (sequenceReader == null) { return null; } Writable key = (Writable) ReflectionUtils.newInstance(sequenceReader.getKeyClass(), fs.getConf()); Writable value = (Writable) ReflectionUtils.newInstance(sequenceReader.getValueClass(), fs.getConf()); if (sequenceReader.next(key, value)) { return (Text) value; } else { sequenceReader.close(); sequenceReader = getNextSequenceReader(); if (sequenceReader != null) { return getNext(); } } return null; } catch (IOException e) { throw new RuntimeException(e); } }
Source:
public void execute(RevWalk walk, ProgressMonitor monitor, List<String> options) throws IOException { if (!isAtomic()) { super.execute(walk, monitor, options); return; } List<ReceiveCommand> pending = ReceiveCommand.filter(getCommands(), NOT_ATTEMPTED); if (pending.isEmpty()) { return; } if (pending.size() == 1) { super.execute(walk, monitor, options); return; } if (!blockUntilTimestamps(MAX_WAIT)) { return; } if (options != null) { setPushOptions(options); } if (!checkConflictingNames(pending)) { return; } if (!checkObjectExistence(walk, pending)) { return; } if (!checkNonFastForwards(walk, pending)) { return; } try { refdb.pack( pending.stream().map(ReceiveCommand::getRefName).collect(toList())); } catch (LockFailedException e) { lockFailure(pending.get(0), pending); return; } Map<String, LockFile> locks = null; refdb.inProcessPackedRefsLock.lock(); try { if (!refdb.isInClone()) { locks = lockLooseRefs(pending); if (locks == null) { return; } } PackedRefList oldPackedList = locks != null ? refdb.pack(locks) : refdb.getPackedRefs(); RefList<Ref> newRefs = applyUpdates(walk, oldPackedList, pending); if (newRefs == null) { return; } LockFile packedRefsLock = refdb.lockPackedRefs(); if (packedRefsLock == null) { lockFailure(pending.get(0), pending); return; } refdb.commitPackedRefs(packedRefsLock, newRefs, oldPackedList, true); } finally { try { unlockAll(locks); } finally { refdb.inProcessPackedRefsLock.unlock(); } } refdb.fireRefsChanged(); pending.forEach(c -> c.setResult(ReceiveCommand.Result.OK)); writeReflog(pending); }

Target:
public void execute(RevWalk walk, ProgressMonitor monitor, List<String> options) throws IOException { if (!isAtomic()) { super.execute(walk, monitor, options); return; } List<ReceiveCommand> pending = ReceiveCommand.filter(getCommands(), NOT_ATTEMPTED); if (pending.isEmpty()) { return; } if (pending.size() == 1) { super.execute(walk, monitor, options); return; } if (!blockUntilTimestamps(MAX_WAIT)) { return; } if (options != null) { setPushOptions(options); } if (!checkConflictingNames(pending)) { return; } if (!checkObjectExistence(walk, pending)) { return; } if (!checkNonFastForwards(walk, pending)) { return; } try { refdb.pack( pending.stream().map(ReceiveCommand::getRefName).collect(toList())); } catch (LockFailedException e) { lockFailure(pending.get(0), pending); return; } Map<String, LockFile> locks = null; refdb.inProcessPackedRefsLock.lock(); try { PackedRefList oldPackedList; if (!refdb.isInClone()) { locks = lockLooseRefs(pending); if (locks == null) { return; } oldPackedList = refdb.pack(locks); } else { oldPackedList = refdb.getPackedRefs(); } RefList<Ref> newRefs = applyUpdates(walk, oldPackedList, pending); if (newRefs == null) { return; } LockFile packedRefsLock = refdb.lockPackedRefs(); if (packedRefsLock == null) { lockFailure(pending.get(0), pending); return; } refdb.commitPackedRefs(packedRefsLock, newRefs, oldPackedList, true); } finally { try { unlockAll(locks); } finally { refdb.inProcessPackedRefsLock.unlock(); } } refdb.fireRefsChanged(); pending.forEach(c -> c.setResult(ReceiveCommand.Result.OK)); writeReflog(pending); }
Source:
void testNoQuestionColumns() throws IOException { DataImporter dimp = new RawDataSpreadsheetImporter(); File file = createNoQuestionsSpreadsheet("/tmp/invalid1.xlsx"); Map<Integer,String> errors = dimp.validate(file); assertEquals(1, errors.size()); String err1 = errors.get(-11); assertNotEquals(err1, null); }

Target:
public void testNoQuestionColumns() throws IOException { DataImporter dimp = new RawDataSpreadsheetImporter(); File file = createNoQuestionsSpreadsheet("/tmp/invalid1.xlsx"); Map<Integer,String> errors = dimp.validate(file); assertEquals(1, errors.size()); String err1 = errors.get(-11); assertEquals("No question columns found on any sheet.", err1); }
Source:
public static String getDataColumn(Context context, Uri uri, String selection, String[] selectionArgs) { Cursor cursor = null; final String column = "_data"; final String[] projection = { column }; try { cursor = context.getContentResolver().query(uri, projection, selection, selectionArgs, null); if (cursor != null && cursor.moveToFirst()) { final int column_index = cursor.getColumnIndex(column); if (column_index != -1) { return cursor.getString(column_index); } } } finally { if (cursor != null) { cursor.close(); } } return null; }

Target:
public static String getDataColumn(Context context, Uri uri, String selection, String[] selectionArgs) { Cursor cursor = null; final String column = MediaStore.MediaColumns.DATA; final String[] projection = { column }; try { cursor = context.getContentResolver().query(uri, projection, selection, selectionArgs, null); if (cursor != null && cursor.moveToFirst()) { final int column_index = cursor.getColumnIndex(column); if (column_index != -1) { return cursor.getString(column_index); } } } finally { if (cursor != null) { cursor.close(); } } return null; }
Source:
private boolean createRepository(Attributes attributes) { String kind = org.eclipse.mylyn.internal.commons.core.XmlStringConverter.convertXmlToString(attributes.getValue(IRepositoryConstants.PROPERTY_CONNECTOR_KIND)); String url = org.eclipse.mylyn.internal.commons.core.XmlStringConverter.convertXmlToString(attributes.getValue(IRepositoryConstants.PROPERTY_URL)); if (kind != null && kind.length() > 0 && url != null && url.length() > 0) { currentRepository = new TaskRepository(kind, url); return true; } return false; }

Target:
private TaskRepository createRepository(Attributes attributes) { String kind = org.eclipse.mylyn.internal.commons.core.XmlStringConverter.convertXmlToString(attributes.getValue(IRepositoryConstants.PROPERTY_CONNECTOR_KIND)); String url = org.eclipse.mylyn.internal.commons.core.XmlStringConverter.convertXmlToString(attributes.getValue(IRepositoryConstants.PROPERTY_URL)); if (kind != null && kind.length() > 0 && url != null && url.length() > 0) { return new TaskRepository(kind, url); } return null; }
Source:
private Adjacents updateAdjacents(Adjacents adj, ResourceRef subject, Set<ResourceRef> assertedAdjacents, Set<Publisher> sources) { Adjacents result = adj; if (subject.getId().equals(adj.getRef().getId())) { result = updateSubjectAdjacents(adj, assertedAdjacents, sources); } else if (sources.contains(adj.getSource())) { Set<Id> ids = assertedAdjacents .stream() .map(ResourceRef::getId) .distinct() .collect(Collectors.toSet()); if (ids.contains(adj.getRef().getId())) { result = adj.copyWithAfferent(subject); } else if (adj.hasAfferentAdjacent(subject)) { result = adj.copyWithoutAfferent(subject); } } return result; }

Target:
private Adjacents updateAdjacents(Adjacents adj, ResourceRef subject, Set<ResourceRef> assertedAdjacents, Set<Publisher> sources) { Adjacents result = adj; if (subject.getId().equals(adj.getRef().getId())) { result = updateSubjectAdjacents(adj, assertedAdjacents, sources); } else if (sources.contains(adj.getSource())) { Set<Id> ids = assertedAdjacents .stream() .map(ResourceRef::getId) .distinct() .collect(MoreCollectors.toImmutableSet()); if (ids.contains(adj.getRef().getId())) { result = adj.copyWithAfferent(subject); } else if (adj.hasAfferentAdjacent(subject)) { result = adj.copyWithoutAfferent(subject); } } return result; }
Source:
public Properties getAdditionalProps() { Properties props = new Properties(); for (Entry<String, String> prop : this.additionalProperties.entrySet()) { props.put(prop.getKey(), prop.getValue()); } return props; }

Target:
public Properties getAdditionalProps() { Properties props = new Properties(); props.putAll(this.additionalProperties); return props; }
Source:
public void visit(Edge edge) { for (StreamGrouping streamGrouping : edge.getStreamGroupings()) { try { StreamInfo streamInfo = streamCatalogService.getStreamInfo( Long.parseLong(streamGrouping.getStream().getId())); topologyReprBuilder.addStreamInfo(streamInfo); } catch (Exception e) { throw new RuntimeException( String.format("Unexpected exception thrown while trying to add the stream %d", streamGrouping.getStream().getId()), e); } } List<QueryParam> queryParams = new ArrayList<>(); queryParams.add(new QueryParam("fromId", edge.getFrom().getId())); queryParams.add(new QueryParam("toId", edge.getTo().getId())); try { Collection<TopologyEdge> topologyEdges = streamCatalogService.listTopologyEdges(queryParams); topologyReprBuilder.addEdge(topologyEdges.iterator().next()); } catch (Exception e) { throw new RuntimeException( String.format( "Unexpected exception while trying to retrieve topology edge from %s to %s", edge.getFrom().getId(), edge.getTo().getId()), e); } }

Target:
public void visit(Edge edge) { List<QueryParam> queryParams = new ArrayList<>(); queryParams.add(new QueryParam("fromId", edge.getFrom().getId())); queryParams.add(new QueryParam("toId", edge.getTo().getId())); try { Collection<TopologyEdge> topologyEdges = streamCatalogService.listTopologyEdges(queryParams); topologyData.addEdge(topologyEdges.iterator().next()); } catch (Exception e) { throw new RuntimeException( String.format( "Unexpected exception while trying to retrieve topology edge from %s to %s", edge.getFrom().getId(), edge.getTo().getId()), e); } }
Source:
protected MeasurementDetails doInBackground(Object... params) { Context context = (Context) params[0]; String measurementId = (String) params[1]; String ministryId = (String) params[2]; String mcc = (String) params[3]; String period = (String) params[4]; if(measurementId != null && ministryId != null && mcc != null && period != null) { try { GmaApiClient apiClient = GmaApiClient.getInstance(context); JSONObject results = apiClient.getDetailsForMeasurement(measurementId, ministryId, mcc, period); if(results == null) { Log.w(TAG, "No measurement details!"); return null; } MeasurementDetails measurementDetails = MeasurementsJsonParser.parseMeasurementDetails(results); measurementDetails.setMeasurementId(measurementId); measurementDetails.setMinistryId(ministryId); measurementDetails.setMcc(mcc); measurementDetails.setPeriod(period); return measurementDetails; } catch(ApiException e) { Log.e(TAG, "Failed to retrieve measurement details from API", e); return null; } } return null; }

Target:
protected MeasurementDetails doInBackground(Object... params) { String measurementId = (String) params[0]; String ministryId = (String) params[1]; String mcc = (String) params[2]; String period = (String) params[3]; if(measurementId != null && ministryId != null && mcc != null && period != null) { try { GmaApiClient apiClient = GmaApiClient.getInstance(MeasurementDetailsActivity.this); JSONObject results = apiClient.getDetailsForMeasurement(measurementId, ministryId, mcc, period); if(results == null) { Log.w(TAG, "No measurement details!"); return null; } MeasurementDetails measurementDetails = MeasurementsJsonParser.parseMeasurementDetails(results); measurementDetails.setMeasurementId(measurementId); measurementDetails.setMinistryId(ministryId); measurementDetails.setMcc(mcc); measurementDetails.setPeriod(period); return measurementDetails; } catch(ApiException e) { Log.e(TAG, "Failed to retrieve measurement details from API", e); return null; } } return null; }
Source:
public Map<String, String> getJobMessageProperties() { if (volume != null) { if (jobProperties == null) { jobProperties = super.getJobMessageProperties(); } jobProperties.put(GlusterConstants.VOLUME, volume.getName()); } return jobProperties; }

Target:
public Map<String, String> getJobMessageProperties() { if(volume == null) { return super.getJobMessageProperties(); } if (jobProperties == null) { jobProperties = super.getJobMessageProperties(); } jobProperties.put(GlusterConstants.VOLUME, volume.getName()); return jobProperties; }
Source:
private Map<String, Object> buildVmGraphicsSpecParamsFromVm(Map<GraphicsType, GraphicsInfo> infos) { Map<String, Object> specParamsFromVm = null; if (infos.containsKey(GraphicsType.SPICE)) { specParamsFromVm = new HashMap(); specParamsFromVm.put(VdsProperties.spiceFileTransferEnable, Boolean.toString(vm.isSpiceFileTransferEnabled())); specParamsFromVm.put(VdsProperties.spiceCopyPasteEnable, Boolean.toString(vm.isSpiceCopyPasteEnabled())); } return specParamsFromVm; }

Target:
private Map<String, Object> buildVmGraphicsSpecParamsFromVm(Map<GraphicsType, GraphicsInfo> infos) { Map<String, Object> specParamsFromVm = null; if (infos != null && infos.containsKey(GraphicsType.SPICE)) { specParamsFromVm = new HashMap(); specParamsFromVm.put(VdsProperties.spiceFileTransferEnable, Boolean.toString(vm.isSpiceFileTransferEnabled())); specParamsFromVm.put(VdsProperties.spiceCopyPasteEnable, Boolean.toString(vm.isSpiceCopyPasteEnabled())); } return specParamsFromVm; }
Source:
public void saveNewSanStorage() { StorageModel storageModel = (StorageModel) getWindow(); final SanStorageModel sanStorageModel = (SanStorageModel) storageModel.getCurrentStorageItem(); List<String> unkownStatusLuns = new ArrayList<>(); List<LUNs> usedStatusLuns = new ArrayList<>(); for (LunModel lunModel : sanStorageModel.getAddedLuns()) { if (lunModel.getStatus() == LunStatus.Used) { usedStatusLuns.add((LUNs) lunModel.getEntity()); } else if (lunModel.getStatus() == LunStatus.Unknown) { unkownStatusLuns.add(lunModel.getLunId()); } } if (!unkownStatusLuns.isEmpty()) { Guid hostId = sanStorageModel.getContainer().getHost().getSelectedItem().getId(); Model target = getWidgetModel() != null ? getWidgetModel() : sanStorageModel.getContainer(); Frontend.getInstance() .runQuery(VdcQueryType.GetDeviceList, new GetDeviceListQueryParameters(hostId, sanStorageModel.getType(), true, unkownStatusLuns), new AsyncQuery(target, new INewAsyncCallback() { @Override public void onSuccess(Object target, Object returnValue) { VdcQueryReturnValue response = (VdcQueryReturnValue) returnValue; if (response.getSucceeded()) { List<LUNs> checkedLuns = (ArrayList<LUNs>) response.getReturnValue(); postGetLunsMessages(sanStorageModel.getUsedLunsMessages(checkedLuns)); } else { sanStorageModel.setGetLUNsFailure( ConstantsManager.getInstance() .getConstants() .couldNotRetrieveLUNsLunsFailure()); } } }, true)); } else { postGetLunsMessages(sanStorageModel.getUsedLunsMessages(usedStatusLuns)); } }

Target:
public void saveNewSanStorage() { StorageModel storageModel = (StorageModel) getWindow(); final SanStorageModel sanStorageModel = (SanStorageModel) storageModel.getCurrentStorageItem(); Map<LunStatus, List<LUNs>> lunsMapByStatus = getLunsMapByStatus(sanStorageModel.getAddedLuns()); if (!lunsMapByStatus.get(LunStatus.Unknown).isEmpty()) { Guid hostId = sanStorageModel.getContainer().getHost().getSelectedItem().getId(); Model target = getWidgetModel() != null ? getWidgetModel() : sanStorageModel.getContainer(); List<String> unkownStatusLuns = new ArrayList<>(); for (LUNs lun : lunsMapByStatus.get(LunStatus.Unknown)) { unkownStatusLuns.add(lun.getLUN_id()); } Frontend.getInstance() .runQuery(VdcQueryType.GetDeviceList, new GetDeviceListQueryParameters(hostId, sanStorageModel.getType(), true, unkownStatusLuns), new AsyncQuery(target, new INewAsyncCallback() { @Override public void onSuccess(Object target, Object returnValue) { VdcQueryReturnValue response = (VdcQueryReturnValue) returnValue; if (response.getSucceeded()) { List<LUNs> checkedLuns = (ArrayList<LUNs>) response.getReturnValue(); postGetLunsMessages(sanStorageModel.getUsedLunsMessages(checkedLuns)); } else { sanStorageModel.setGetLUNsFailure( ConstantsManager.getInstance() .getConstants() .couldNotRetrieveLUNsLunsFailure()); } } }, true)); } else { postGetLunsMessages(sanStorageModel.getUsedLunsMessages(lunsMapByStatus.get(LunStatus.Used))); } }
Source:
public void testConcurrency() throws Exception { conn.tableOperations().setProperty(table, "table.compaction.major.ratio", "1"); conn.tableOperations().setProperty(table, "table.cache.block.enable", "true"); int numAccounts = 5000; TreeSet<Text> splits = new TreeSet<>(); splits.add(new Text(fmtAcct(numAccounts / 4))); splits.add(new Text(fmtAcct(numAccounts / 2))); splits.add(new Text(fmtAcct(3 * numAccounts / 4))); conn.tableOperations().addSplits(table, splits); AtomicBoolean runFlag = new AtomicBoolean(true); populate(env, numAccounts); Random rand = new Random(); Environment tenv = env; if (rand.nextBoolean()) { tenv = new FaultyConfig(env, (rand.nextDouble() * .4) + .1, .50); } List<Thread> threads = startTransfers(tenv, numAccounts, 20, runFlag); runVerifier(env, numAccounts, 100); runFlag.set(false); for (Thread thread : threads) { thread.join(); } log.debug("txCount : " + txCount.get()); Assert.assertTrue("txCount : " + txCount.get(), txCount.get() > 0); runVerifier(env, numAccounts, 1); }

Target:
public void testConcurrency() throws Exception { conn.tableOperations().setProperty(table, AccumuloProps.TABLE_MAJC_RATIO, "1"); conn.tableOperations().setProperty(table, AccumuloProps.TABLE_BLOCKCACHE_ENABLED, "true"); int numAccounts = 5000; TreeSet<Text> splits = new TreeSet<>(); splits.add(new Text(fmtAcct(numAccounts / 4))); splits.add(new Text(fmtAcct(numAccounts / 2))); splits.add(new Text(fmtAcct(3 * numAccounts / 4))); conn.tableOperations().addSplits(table, splits); AtomicBoolean runFlag = new AtomicBoolean(true); populate(env, numAccounts); Random rand = new Random(); Environment tenv = env; if (rand.nextBoolean()) { tenv = new FaultyConfig(env, (rand.nextDouble() * .4) + .1, .50); } List<Thread> threads = startTransfers(tenv, numAccounts, 20, runFlag); runVerifier(env, numAccounts, 100); runFlag.set(false); for (Thread thread : threads) { thread.join(); } log.debug("txCount : " + txCount.get()); Assert.assertTrue("txCount : " + txCount.get(), txCount.get() > 0); runVerifier(env, numAccounts, 1); }
Source:
private static FenixDepartment getFenixDepartment(Department department, AcademicInterval interval) { String name = department.getNameI18n().getContent(); String acronym = department.getAcronym(); List<Employee> employees = Employee.getAllWorkingEmployees(department, interval.getBeginYearMonthDayWithoutChronology(), interval.getEndYearMonthDayWithoutChronology()); Set<Person> employeePeople = employees.stream().filter(employee -> employee != null).map(Employee::getPerson).collect(Collectors.toSet()); List<Teacher> teachers = department.getAllTeachers(interval); Set<Person> teacherPeople = teachers.stream().map(Teacher::getPerson).collect(Collectors.toSet()); employeePeople.removeAll(teacherPeople); List<FenixDepartment.FenixDepartmentMember> members = new ArrayList<>(); teacherPeople.stream().map(p -> getFenixDepartmentTeacher(department, p, interval)).forEach(members::add); employeePeople.stream().map(p -> getFenixDepartmentEmployee(department, p, interval)).forEach(members::add); return new FenixDepartment(name, acronym, members); }

Target:
private static FenixDepartment getFenixDepartment(Department department, AcademicInterval interval) { String name = department.getNameI18n().getContent(); String acronym = department.getAcronym(); List<Employee> employees = Employee.getAllWorkingEmployees(department, interval.getBeginYearMonthDayWithoutChronology(), interval.getEndYearMonthDayWithoutChronology()); Set<Person> employeePeople = employees.stream().filter(Objects::nonNull).map(Employee::getPerson).collect(Collectors.toSet()); List<Teacher> teachers = department.getAllTeachers(interval); Set<Person> teacherPeople = teachers.stream().map(Teacher::getPerson).collect(Collectors.toSet()); employeePeople.removeAll(teacherPeople); List<FenixDepartment.FenixDepartmentMember> members = new ArrayList<>(); teacherPeople.stream().map(p -> getFenixDepartmentTeacher(department, p, interval)).forEach(members::add); employeePeople.stream().map(p -> getFenixDepartmentEmployee(department, p, interval)).forEach(members::add); return new FenixDepartment(name, acronym, members); }
Source:
public IndexEntry next() { try { StoreKey key = getKeyAt(mmap, currentIdx); mmap.get(valueBuf); return new IndexEntry(key, new IndexValue(startOffset.getName(), ByteBuffer.wrap(valueBuf), getVersion())); } catch (Exception e) { logger.error("Failed to read index entry at " + currentIdx, e); } finally { currentIdx++; } return null; }

Target:
public IndexEntry next() { try { StoreKey key = getKeyAt(mmap, currentIdx); mmap.get(valueBuf); return new IndexEntry(key, new IndexValue(startOffset.getName(), ByteBuffer.wrap(valueBuf), getVersion())); } catch (Exception e) { String message = "Failed to read index entry at " + currentIdx; logger.error(message, e); throw new IllegalStateException(message, e); } finally { currentIdx++; } }
Source:
private boolean isExcluded(Path file) { if (excludes == null && excludes.length < 1) { return false; } for (String exclude : excludes) { if (repoDir.toPath().relativize(file).toString().matches(exclude)) { getLog().info("Excluding " + file); return true; } } return false; }

Target:
private boolean isExcluded(Path file) { if (excludes == null || excludes.length < 1) { return false; } for (String exclude : excludes) { if (repoDir.toPath().relativize(file).toString().matches(exclude)) { getLog().info("Excluding " + file); return true; } } return false; }
Source:
public boolean isInstanceOf(Object obj, Class<?> clz) { if (obj == null || clz == null) { if (log.isLoggable(Level.FINEST)) { log.finest("isInstanceOf error: obj=" + obj + " clz=" + clz); } return false; } return clz.isAssignableFrom(obj.getClass()); }

Target:
public boolean isInstanceOf(Object obj, Class<?> clz) { if (obj == null || clz == null) { if (log.isLoggable(Level.FINEST)) { log.finest("isInstanceOf error: obj=" + obj + " clz=" + clz); } return false; } return clz.isInstance(obj); }
Source:
public String getFileTypeIdentifer() { return "corpoateBilledCorporatePaidFlatInputFileType"; }

Target:
public String getFileTypeIdentifer() { return CuFPConstants.CORPORATE_BILLED_CORPORATE_PAID_FLAT_INPUT_FILE_TYPE; }
Source:
public PlanNode visitTableFinish(TableFinishNode node, RewriteContext<Void> context) { Optional<DeleteNode> delete = findNode(node.getSource(), DeleteNode.class); if (!delete.isPresent()) { return context.defaultRewrite(node); } Optional<TableScanNode> tableScan = findNode(delete.get().getSource(), TableScanNode.class); if (!tableScan.isPresent()) { return context.defaultRewrite(node); } TableScanNode tableScanNode = tableScan.get(); if (!metadata.supportsMetadataDelete(session, tableScanNode.getTable())) { return context.defaultRewrite(node); } DeleteHandle currentDeleteHandle = delete.get().getTarget(); return new MetadataDeleteNode( idAllocator.getNextId(), new DeleteHandle( new TableHandle( currentDeleteHandle.getHandle().getConnectorId(), currentDeleteHandle.getHandle().getConnectorHandle(), currentDeleteHandle.getHandle().getTransaction(), tableScan.get().getTable().getLayout()), currentDeleteHandle.getSchemaTableName()), Iterables.getOnlyElement(node.getOutputSymbols())); }

Target:
public PlanNode visitTableFinish(TableFinishNode node, RewriteContext<Void> context) { Optional<DeleteNode> delete = findNode(node.getSource(), DeleteNode.class); if (!delete.isPresent()) { return context.defaultRewrite(node); } Optional<TableScanNode> tableScan = findNode(delete.get().getSource(), TableScanNode.class); if (!tableScan.isPresent()) { return context.defaultRewrite(node); } TableScanNode tableScanNode = tableScan.get(); if (!metadata.supportsMetadataDelete(session, tableScanNode.getTable())) { return context.defaultRewrite(node); } return new MetadataDeleteNode( idAllocator.getNextId(), new DeleteHandle(tableScanNode.getTable(), delete.get().getTarget().getSchemaTableName()), Iterables.getOnlyElement(node.getOutputSymbols())); }
Source:
public void serialize(JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { jgen.setCharacterEscapes(JsonpCharacterEscapes.instance()); jgen.writeRaw(_function); jgen.writeRaw('('); if (_value == null) { provider.defaultSerializeNull(jgen); } else if (_serializationType != null) { provider.findTypedValueSerializer(_serializationType, true, null).serialize(_value, jgen, provider); } else { Class<?> cls = _value.getClass(); provider.findTypedValueSerializer(cls, true, null).serialize(_value, jgen, provider); } jgen.writeRaw(')'); }

Target:
public void serialize(JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { CharacterEscapes currentCharacterEscapes = jgen.getCharacterEscapes(); if (currentCharacterEscapes == null) { jgen.setCharacterEscapes(JsonpCharacterEscapes.instance()); } try { jgen.writeRaw(_function); jgen.writeRaw('('); if (_value == null) { provider.defaultSerializeNull(jgen); } else if (_serializationType != null) { provider.findTypedValueSerializer(_serializationType, true, null).serialize(_value, jgen, provider); } else { Class<?> cls = _value.getClass(); provider.findTypedValueSerializer(cls, true, null).serialize(_value, jgen, provider); } jgen.writeRaw(')'); } finally { jgen.setCharacterEscapes(currentCharacterEscapes); } }
Source:
public String[] getBackendRoles() throws EventBrokerException { UserRealm userRealm = CarbonContext.getThreadLocalCarbonContext().getUserRealm(); String[] cleanedRoles = new String[0]; try { String adminRole = EventBrokerHolder.getInstance().getRealmService(). getBootstrapRealmConfiguration().getAdminRoleName(); String[] allRoles = userRealm.getUserStoreManager().getRoleNames(); if (allRoles != null && allRoles.length > 1) { List<String> allRolesArrayList = new ArrayList<>(); Collections.addAll(allRolesArrayList, allRoles); Iterator<String> it = allRolesArrayList.iterator(); while (it.hasNext()) { String nextRoles = it.next(); if (nextRoles.equals(adminRole) || CarbonConstants.REGISTRY_ANONNYMOUS_ROLE_NAME.equals(nextRoles)) { it.remove(); } } cleanedRoles = allRolesArrayList.toArray(new String[allRolesArrayList.size()]); } } catch (UserStoreException e) { throw new EventBrokerException("Unable to get Roles from user store", e); } return cleanedRoles; }

Target:
public String[] getBackendRoles() throws EventBrokerException { UserRealm userRealm = CarbonContext.getThreadLocalCarbonContext().getUserRealm(); String[] cleanedRoles = new String[0]; try { String adminRole = EventBrokerHolder.getInstance().getRealmService(). getBootstrapRealmConfiguration().getAdminRoleName(); String[] allRoles = userRealm.getUserStoreManager().getRoleNames(); if (allRoles != null && allRoles.length > 1) { List<String> allRolesArrayList = new ArrayList<>(); Collections.addAll(allRolesArrayList, allRoles); Iterator<String> it = allRolesArrayList.iterator(); while (it.hasNext()) { String nextRole = it.next(); if (nextRole.equals(adminRole) || nextRole.equals(CarbonConstants.REGISTRY_ANONNYMOUS_ROLE_NAME)) { it.remove(); } } cleanedRoles = allRolesArrayList.toArray(new String[allRolesArrayList.size()]); } } catch (UserStoreException e) { throw new EventBrokerException("Unable to get Roles from user store", e); } return cleanedRoles; }
Source:
public void initialize() { chassisMove.initialize(); try { motionController.resetSafely(); } catch (InvalidSensorException e) { LogKitten.w("Cancelling ChassisMoveDistance"); chassisMove.cancel(); cancel(); if (fallbackCommand != null) { fallbackCommand.initialize(); } return; } motionController.setSetpoint(motionController.getSensorValue() + distance); motionController.enable(); }

Target:
public void initialize() { chassisMove.schedule(); try { motionController.resetSafely(); } catch (InvalidSensorException e) { LogKitten.w("Cancelling ChassisMoveDistance with InvalidSensorException"); chassisMove.cancel(); cancel(); if (fallbackCommand != null) { fallbackCommand.schedule(); } return; } motionController.setSetpoint(motionController.getSensorValue() + distance); motionController.enable(); }
Source:
public Object[][] hammingDistance() { return new Object[][] { {"ATAC", "GCAT", 3}, {"ATAGC", "ATAGC", 0}, {"ATAC", "atac", 4}, {"", "", 0} }; }

Target:
public Object[][] hammingDistance() { return new Object[][] { {"ATAC" , "GCAT" , 3}, {"ATAGC", "ATAGC", 0}, {"ATAC" , "atac" , 4}, {"" , "" , 0}, {"nAGTN", "nAGTN", 0} }; }
Source:
public boolean equals(Object object) { if (object == null && object.getClass() != getClass()) { return false; } if (object == this) { return true; } Syntax rhs = (Syntax) object; return new EqualsBuilder().append(getType(), rhs.getType()).append(getVersion(), rhs.getVersion()) .append(getQualifier(), rhs.getQualifier()).isEquals(); }

Target:
public boolean equals(Object object) { if (object == this) { return true; } if (!(object instanceof Syntax)) { return false; } Syntax rhs = (Syntax) object; return new EqualsBuilder().append(getType(), rhs.getType()).append(getVersion(), rhs.getVersion()) .append(getQualifier(), rhs.getQualifier()).isEquals(); }
Source:
public Response createTokenForAccount(JsonNode payload) throws ValidationException { validatePayloadHasFields(payload, ACCOUNT_ID_FIELD, DESCRIPTION_FIELD, CREATED_BY_FIELD); Tokens token = tokenService.issueTokens(); TokenPaymentType tokenPaymentType = Optional.ofNullable(payload.get(TOKEN_TYPE_FIELD)) .map(tokenType -> TokenPaymentType.valueOf(tokenType.asText())) .orElse(CARD); TokenType tokenType = Optional.ofNullable(payload.get(TYPE_FIELD)) .map(type -> valueOf(type.asText())) .orElse(API); TokenLink tokenLink = TokenLink.of(randomUUID().toString()); authDao.storeToken(token.getHashedToken(), tokenLink, tokenType, payload.get(ACCOUNT_ID_FIELD).asText(), payload.get(DESCRIPTION_FIELD).asText(), payload.get(CREATED_BY_FIELD).asText(), tokenPaymentType); LOGGER.info("Created token with ", tokenLink); return ok(ImmutableMap.of("token", token.getApiKey())).build(); }

Target:
public Response createTokenForAccount(JsonNode payload) throws ValidationException { validatePayloadHasFields(payload, ACCOUNT_ID_FIELD, DESCRIPTION_FIELD, CREATED_BY_FIELD); Tokens token = tokenService.issueTokens(); TokenPaymentType tokenPaymentType = Optional.ofNullable(payload.get(TOKEN_TYPE_FIELD)) .map(paymentType -> TokenPaymentType.fromString(paymentType.asText())) .orElse(CARD); TokenSource tokenSource = Optional.ofNullable(payload.get(TYPE_FIELD)) .map(source -> TokenSource.fromString(source.asText())) .orElse(API); TokenLink tokenLink = TokenLink.of(randomUUID().toString()); authDao.storeToken(token.getHashedToken(), tokenLink, tokenSource, payload.get(ACCOUNT_ID_FIELD).asText(), payload.get(DESCRIPTION_FIELD).asText(), payload.get(CREATED_BY_FIELD).asText(), tokenPaymentType); LOGGER.info("Created token with ", tokenLink); return ok(ImmutableMap.of("token", token.getApiKey())).build(); }
Source:
StudyParticipant(@JsonProperty("firstName") String firstName, @JsonProperty("lastName") String lastName, @JsonProperty("email") String email, @JsonProperty("externalId") String externalId, @JsonProperty("password") String password, @JsonProperty("sharingScope") SharingScope sharingScope, @JsonProperty("notifyByEmail") Boolean notifyByEmail, @JsonProperty("dataGroups") Set<String> dataGroups, @JsonProperty("healthCode") String healthCode, @JsonProperty("attributes") Map<String,String> attributes, @JsonProperty("consentHistories") Map<String,List<UserConsentHistory>> consentHistories, @JsonProperty("roles") Set<Roles> roles, @JsonProperty("createdOn") DateTime createdOn, @JsonProperty("status") AccountStatus status, @JsonProperty("languages") LinkedHashSet<String> languages, @JsonProperty("id") String id) { this.firstName = firstName; this.lastName = lastName; this.externalId = externalId; this.password = password; this.sharingScope = sharingScope; this.notifyByEmail = notifyByEmail; this.email = email; this.dataGroups = dataGroups; this.healthCode = healthCode; this.consentHistories = consentHistories; this.roles = roles; this.createdOn = createdOn; this.status = status; this.id = id; this.languages = languages; this.attributes = attributes; }

Target:
StudyParticipant(@JsonProperty("firstName") String firstName, @JsonProperty("lastName") String lastName, @JsonProperty("email") String email, @JsonProperty("externalId") String externalId, @JsonProperty("password") String password, @JsonProperty("sharingScope") SharingScope sharingScope, @JsonProperty("notifyByEmail") Boolean notifyByEmail, @JsonProperty("dataGroups") Set<String> dataGroups, @JsonProperty("healthCode") String healthCode, @JsonProperty("attributes") Map<String,String> attributes, @JsonProperty("consentHistories") Map<String,List<UserConsentHistory>> consentHistories, @JsonProperty("roles") Set<Roles> roles, @JsonProperty("createdOn") DateTime createdOn, @JsonProperty("status") AccountStatus status, @JsonProperty("languages") LinkedHashSet<String> languages, @JsonProperty("id") String id) { ImmutableSet<String> finalDataGroups = (dataGroups == null) ? null : ImmutableSet.copyOf(dataGroups); ImmutableSet<Roles> finalRoles = (roles == null) ? null : ImmutableSet.copyOf(roles); ImmutableMap<String,String> finalAttributes = (attributes == null) ? null : ImmutableMap.copyOf(attributes); LinkedHashSet<String> finalLangs = (languages == null) ? null : new LinkedHashSet<>(languages); this.firstName = firstName; this.lastName = lastName; this.externalId = externalId; this.password = password; this.sharingScope = sharingScope; this.notifyByEmail = notifyByEmail; this.email = email; this.dataGroups = finalDataGroups; this.healthCode = healthCode; this.consentHistories = consentHistories; this.roles = finalRoles; this.createdOn = createdOn; this.status = status; this.id = id; this.languages = finalLangs; this.attributes = finalAttributes; }
Source:
public void enrich(final Optional<String> nodeUUID, final Optional<DecisionTable> expression) { expression.ifPresent(dtable -> { dtable.setHitPolicy(HitPolicy.ANY); dtable.setPreferredOrientation(DecisionTableOrientation.RULE_AS_ROW); final InputClause ic = new InputClause(); final LiteralExpression le = new LiteralExpression(); le.setText(DecisionTableDefaultValueUtilities.getNewInputClauseName(dtable)); ic.setInputExpression(le); dtable.getInput().add(ic); final OutputClause oc = new OutputClause(); oc.setName(DecisionTableDefaultValueUtilities.getNewOutputClauseName(dtable)); dtable.getOutput().add(oc); final DecisionRule dr = new DecisionRule(); final UnaryTests drut = new UnaryTests(); drut.setText(DecisionTableDefaultValueUtilities.INPUT_CLAUSE_UNARY_TEST_TEXT); dr.getInputEntry().add(drut); final LiteralExpression drle = new LiteralExpression(); drle.setText(DecisionTableDefaultValueUtilities.OUTPUT_CLAUSE_EXPRESSION_TEXT); dr.getOutputEntry().add(drle); final Description d = new Description(); d.setValue(DecisionTableDefaultValueUtilities.RULE_DESCRIPTION); dr.setDescription(d); dtable.getRule().add(dr); ic.setParent(dtable); oc.setParent(dtable); dr.setParent(dtable); le.setParent(ic); drut.setParent(dr); drle.setParent(dr); if (nodeUUID.isPresent()) { enrichInputClauses(nodeUUID.get(), dtable); } else { enrichOutputClauses(dtable); } }); }

Target:
public void enrich(final Optional<String> nodeUUID, final Optional<DecisionTable> expression) { expression.ifPresent(dtable -> { dtable.setHitPolicy(HitPolicy.ANY); dtable.setPreferredOrientation(DecisionTableOrientation.RULE_AS_ROW); final InputClause inputClause = new InputClause(); final LiteralExpression literalExpression = new LiteralExpression(); literalExpression.setText(DecisionTableDefaultValueUtilities.getNewInputClauseName(dtable)); inputClause.setInputExpression(literalExpression); dtable.getInput().add(inputClause); final OutputClause outputClause = new OutputClause(); outputClause.setName(DecisionTableDefaultValueUtilities.getNewOutputClauseName(dtable)); dtable.getOutput().add(outputClause); final DecisionRule decisionRule = new DecisionRule(); final UnaryTests decisionRuleUnaryTest = new UnaryTests(); decisionRuleUnaryTest.setText(DecisionTableDefaultValueUtilities.INPUT_CLAUSE_UNARY_TEST_TEXT); decisionRule.getInputEntry().add(decisionRuleUnaryTest); final LiteralExpression decisionRuleLiteralExpression = new LiteralExpression(); decisionRuleLiteralExpression.setText(DecisionTableDefaultValueUtilities.OUTPUT_CLAUSE_EXPRESSION_TEXT); decisionRule.getOutputEntry().add(decisionRuleLiteralExpression); final Description description = new Description(); description.setValue(DecisionTableDefaultValueUtilities.RULE_DESCRIPTION); decisionRule.setDescription(description); dtable.getRule().add(decisionRule); inputClause.setParent(dtable); outputClause.setParent(dtable); decisionRule.setParent(dtable); literalExpression.setParent(inputClause); decisionRuleUnaryTest.setParent(decisionRule); decisionRuleLiteralExpression.setParent(decisionRule); if (nodeUUID.isPresent()) { enrichInputClauses(nodeUUID.get(), dtable); } else { enrichOutputClauses(dtable); } }); }
Source:
public static boolean shouldRequeue(boolean defaultRequeueRejected, Throwable throwable, Log logger) { throw new UnsupportedOperationException("Use ContainerUtils"); }

Target:
public static boolean shouldRequeue(boolean defaultRequeueRejected, Throwable throwable, Log logger) { logger.warn("Use ContainerUtils.shouldRequeue()"); boolean shouldRequeue = defaultRequeueRejected || throwable.getClass().getName().equals( "org.springframework.amqp.rabbit.listener.MessageRejectedWhileStoppingException"); Throwable t = throwable; while (shouldRequeue && t != null) { if (t instanceof AmqpRejectAndDontRequeueException) { shouldRequeue = false; } t = t.getCause(); } if (logger.isDebugEnabled()) { logger.debug("Rejecting messages (requeue=" + shouldRequeue + ")"); } return shouldRequeue; }