auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void updateCollectorBatchWithOriginEntries() { Integer fiscalYear = Integer.valueOf(collectorBatch.getUniversityFiscalYear()); SystemOptions options = optionsService.getOptions(fiscalYear); String actualFinancialBalanceTypeCode = options.getActualFinancialBalanceTypeCd(); for (ConcurDetailLineGroupForCollector lineGroup : lineGroups.values()) { for (OriginEntryFull originEntry : lineGroup.buildOriginEntries()) { originEntry.setFinancialBalanceTypeCode(actualFinancialBalanceTypeCode); originEntry.setTransactionLedgerEntrySequenceNumber( getNextTransactionSequenceNumber(lineGroup.getReportId())); collectorBatch.addOriginEntry(originEntry); } } Integer totalRecords = Integer.valueOf(collectorBatch.getOriginEntries().size()); KualiDecimal totalDebitAmount = collectorBatch.getOriginEntries() .stream() .filter(this::isDebitEntry) .map(OriginEntryFull::getTransactionLedgerEntryAmount) .reduce(KualiDecimal.ZERO, KualiDecimal::add); collectorBatch.setTotalRecords(totalRecords); collectorBatch.setTotalAmount(totalDebitAmount); }

Target:
protected void updateCollectorBatchWithOriginEntries() { Integer fiscalYear = Integer.valueOf(collectorBatch.getUniversityFiscalYear()); SystemOptions fiscalYearOptions = optionsService.getOptions(fiscalYear); String actualFinancialBalanceTypeCode = fiscalYearOptions.getActualFinancialBalanceTypeCd(); for (ConcurDetailLineGroupForCollector lineGroup : lineGroups.values()) { for (OriginEntryFull originEntry : lineGroup.buildOriginEntries()) { originEntry.setFinancialBalanceTypeCode(actualFinancialBalanceTypeCode); originEntry.setTransactionLedgerEntrySequenceNumber( getNextTransactionSequenceNumber(lineGroup.getReportId())); collectorBatch.addOriginEntry(originEntry); } } Integer totalRecords = Integer.valueOf(collectorBatch.getOriginEntries().size()); KualiDecimal totalDebitAmount = collectorBatch.getOriginEntries() .stream() .filter(this::isDebitEntry) .map(OriginEntryFull::getTransactionLedgerEntryAmount) .reduce(KualiDecimal.ZERO, KualiDecimal::add); collectorBatch.setTotalRecords(totalRecords); collectorBatch.setTotalAmount(totalDebitAmount); }
Source:
private SafeHtml getLineNumbers(final Set<Integer> rowNumbers) { return new SafeHtml() { @Override public String asString() { StringBuilder builder = new StringBuilder(); Iterator<Integer> iterator = rowNumbers.iterator(); while (iterator.hasNext()) { builder.append(iterator.next()); if (iterator.hasNext()) { builder.append(", "); } } return builder.toString(); } }; }

Target:
private SafeHtml getLineNumbers(final Set<Integer> rowNumbers) { return (SafeHtml) () -> rowNumbers .stream() .map(Object::toString) .collect(Collectors.joining(", ")); }
Source:
public GraphQLType getWrappedType() { if (replacedWrappedType != null) { return replacedWrappedType; } return originalWrappedType; }

Target:
public GraphQLType getWrappedType() { return replacedWrappedType != null ? replacedWrappedType : originalWrappedType; }
Source:
protected void doStop() { if(getDistributedObject() instanceof IMap) { ((IMap<?, ?>)getDistributedObject()).removeEntryListener(getHazelcastRegisteredEventListenerId()); } else if(getDistributedObject() instanceof MultiMap) { ((MultiMap<?, ?>)getDistributedObject()).removeEntryListener(getHazelcastRegisteredEventListenerId()); } else if(getDistributedObject() instanceof ReplicatedMap) { ((ReplicatedMap<?, ?>)getDistributedObject()).removeEntryListener(getHazelcastRegisteredEventListenerId()); } else if(getDistributedObject() instanceof IList) { ((IList<?>)getDistributedObject()).removeItemListener(getHazelcastRegisteredEventListenerId()); } else if(getDistributedObject() instanceof ISet) { ((ISet<?>)getDistributedObject()).removeItemListener(getHazelcastRegisteredEventListenerId()); } else if(getDistributedObject() instanceof IQueue) { ((IQueue<?>)getDistributedObject()).removeItemListener(getHazelcastRegisteredEventListenerId()); } else if(getDistributedObject() instanceof ITopic) { ((ITopic<?>)getDistributedObject()).removeMessageListener(getHazelcastRegisteredEventListenerId()); } }

Target:
protected void doStop() { if(this.distributedObject instanceof IMap) { ((IMap<?, ?>) this.distributedObject).removeEntryListener(getHazelcastRegisteredEventListenerId()); } else if(this.distributedObject instanceof MultiMap) { ((MultiMap<?, ?>) this.distributedObject).removeEntryListener(getHazelcastRegisteredEventListenerId()); } else if(this.distributedObject instanceof ReplicatedMap) { ((ReplicatedMap<?, ?>) this.distributedObject).removeEntryListener(getHazelcastRegisteredEventListenerId()); } else if(this.distributedObject instanceof IList) { ((IList<?>) this.distributedObject).removeItemListener(getHazelcastRegisteredEventListenerId()); } else if(this.distributedObject instanceof ISet) { ((ISet<?>) this.distributedObject).removeItemListener(getHazelcastRegisteredEventListenerId()); } else if(this.distributedObject instanceof IQueue) { ((IQueue<?>) this.distributedObject).removeItemListener(getHazelcastRegisteredEventListenerId()); } else if(this.distributedObject instanceof ITopic) { ((ITopic<?>) this.distributedObject).removeMessageListener(getHazelcastRegisteredEventListenerId()); } }
Source:
protected List<String> run() throws Exception { Run run = getContext().get(Run.class); BuildScanLogScanner scanner = new BuildScanLogScanner(new DefaultBuildScanPublishedListener(run)); try ( BufferedReader logReader = new BufferedReader(run.getLogReader()); Stream<String> lines = logReader.lines() ) { lines.forEach(scanner::scanLine); } return run.getAction(BuildScanAction.class).getScanUrls(); }

Target:
protected List<String> run() throws Exception { Run run = getContext().get(Run.class); BuildScanLogScanner scanner = new BuildScanLogScanner(new DefaultBuildScanPublishedListener(run)); try ( BufferedReader logReader = new BufferedReader(run.getLogReader()); Stream<String> lines = logReader.lines() ) { lines.forEach(scanner::scanLine); } BuildScanAction action = run.getAction(BuildScanAction.class); if (action != null) { return action.getScanUrls(); } return Collections.emptyList(); }
Source:
private static void compareINDArrays(String label, INDArray a, INDArray b, double eps) { INDArray diff = a.sub(b); double min = diff.minNumber().doubleValue(); double max = diff.maxNumber().doubleValue(); log.info(label + ": " + a.equalsWithEps(b, eps) + ", " + min + ", " + max); double threshold = 1e-7; double aAbsMax = Math.max(Math.abs(a.minNumber().doubleValue()), Math.abs(a.maxNumber().doubleValue())); double bAbsMax = Math.max(Math.abs(b.minNumber().doubleValue()), Math.abs(b.maxNumber().doubleValue())); if (Math.abs(aAbsMax) > threshold && Math.abs(bAbsMax) > threshold) { assert (a.equalsWithEps(b, eps)); } }

Target:
private static void compareINDArrays(String label, INDArray a, INDArray b, double eps) { INDArray diff = a.sub(b); double min = diff.minNumber().doubleValue(); double max = diff.maxNumber().doubleValue(); log.info(label + ": " + a.equalsWithEps(b, eps) + ", " + min + ", " + max); double threshold = 1e-7; double aAbsMax = Math.max(Math.abs(a.minNumber().doubleValue()), Math.abs(a.maxNumber().doubleValue())); double bAbsMax = Math.max(Math.abs(b.minNumber().doubleValue()), Math.abs(b.maxNumber().doubleValue())); if (Math.abs(aAbsMax) > threshold && Math.abs(bAbsMax) > threshold) { assertTrue(a.equalsWithEps(b, eps)); } }
Source:
public void executeCommand() { Boolean tranRetVal = TransactionSupport.executeInNewTransaction(new TransactionMethod<Boolean>() { @Override public Boolean runInTransaction() { if (georepSessions != null) { for (GlusterGeoRepSession session : georepSessions) { GlusterVolumeEntity slaveVolume = getDbFacade().getGlusterVolumeDao().getById(session.getSlaveVolumeId()); if (slaveVolume == null) { continue; } VDS slaveUpServer = ClusterUtils.getInstance().getRandomUpServer(slaveVolume.getClusterId()); if (slaveUpServer == null) { handleVdsError(AuditLogType.GLUSTER_VOLUME_SNAPSHOT_RESTORE_FAILED, VdcBllErrors.NoUpServerFoundInRemoteCluster.name()); setSucceeded(false); return false; } if (!deleteGlusterVolumeSnapshot(slaveUpServer.getId(), slaveVolume.getId(), getSnapshot().getSnapshotName())) { return false; } } } return true; } }); if (!tranRetVal) { return; } deleteGlusterVolumeSnapshot(getUpServer().getId(), getGlusterVolumeId(), getSnapshot().getSnapshotName()); }

Target:
public void executeCommand() { if (georepSessions != null) { for (GlusterGeoRepSession session : georepSessions) { GlusterVolumeEntity slaveVolume = getDbFacade().getGlusterVolumeDao().getById(session.getSlaveVolumeId()); if (slaveVolume == null) { continue; } VDS slaveUpServer = ClusterUtils.getInstance().getRandomUpServer(slaveVolume.getClusterId()); if (slaveUpServer == null) { handleVdsError(AuditLogType.GLUSTER_VOLUME_SNAPSHOT_DELETE_FAILED, VdcBllErrors.NoUpServerFoundInRemoteCluster.name()); setSucceeded(false); return; } if (!deleteGlusterVolumeSnapshot(slaveUpServer.getId(), slaveVolume.getId(), getSnapshot().getSnapshotName())) { return; } } } deleteGlusterVolumeSnapshot(getUpServer().getId(), getGlusterVolumeId(), getSnapshot().getSnapshotName()); }
Source:
private static String[] args( String... args ) { List<String> cleanedArgs = Stream.of( args ) .filter( Objects::nonNull ) .filter( not( String::isEmpty ) ) .collect( Collectors.toList() ); String[] returnArgs = new String[cleanedArgs.size()]; cleanedArgs.toArray( returnArgs ); return returnArgs; }

Target:
private static String[] args( String... args ) { return Stream.of( args ) .filter( StringUtils::isNoneEmpty ) .toArray( String[]::new ); }
Source:
private List<SnoozeTime> getTimes() { List<SnoozeTime> times = new LinkedList<>(); long now = System.currentTimeMillis(); Calendar cal = new GregorianCalendar(); if (DEBUG) { times.add(new SnoozeTime(now + TimeUnit.MINUTES.toMillis(1))); } times.add(new SnoozeTime(now + TimeUnit.HOURS.toMillis(1))); cal.add(Calendar.DAY_OF_YEAR, 1); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); cal.set(Calendar.HOUR_OF_DAY, 9); times.add(new SnoozeTime(formatTimeLabel(cal, R.string.time_tomorrow_morning), cal.getTimeInMillis())); cal.set(Calendar.HOUR_OF_DAY, 13); times.add(new SnoozeTime(formatTimeLabel(cal, R.string.time_tomorrow_afternoon), cal.getTimeInMillis())); cal.set(Calendar.HOUR_OF_DAY, 20); times.add(new SnoozeTime(formatTimeLabel(cal, R.string.time_tomorrow_night), cal.getTimeInMillis())); cal.setTimeInMillis(now); int monday = Calendar.MONDAY; cal.add(Calendar.WEEK_OF_YEAR, 1); cal.set(Calendar.DAY_OF_WEEK, monday); cal.set(Calendar.HOUR_OF_DAY, 9); cal.set(Calendar.MINUTE, 0); times.add(new SnoozeTime(formatTimeLabel(cal, R.string.time_next_week), cal.getTimeInMillis())); times.add(new SnoozeTime(mRes.getString(R.string.pick_a_time), 0)); return times; }

Target:
private List<SnoozeTime> getTimes() { List<SnoozeTime> times = new LinkedList<>(); long now = System.currentTimeMillis(); Calendar cal = new GregorianCalendar(); if (DEBUG) { times.add(new SnoozeTime(now + TimeUnit.MINUTES.toMillis(1))); } times.add(new SnoozeTime(now + TimeUnit.HOURS.toMillis(1))); cal.add(Calendar.DAY_OF_YEAR, 1); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); cal.set(Calendar.HOUR_OF_DAY, 9); times.add(new SnoozeTime(formatTimeLabel(cal, R.string.time_tomorrow_morning), cal.getTimeInMillis())); cal.set(Calendar.HOUR_OF_DAY, 13); times.add(new SnoozeTime(formatTimeLabel(cal, R.string.time_tomorrow_afternoon), cal.getTimeInMillis())); cal.set(Calendar.HOUR_OF_DAY, 20); times.add(new SnoozeTime(formatTimeLabel(cal, R.string.time_tomorrow_night), cal.getTimeInMillis())); cal.setTimeInMillis(now); cal.add(Calendar.WEEK_OF_YEAR, 1); cal.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY); cal.set(Calendar.HOUR_OF_DAY, 9); cal.set(Calendar.MINUTE, 0); times.add(new SnoozeTime(formatTimeLabel(cal, R.string.time_next_week), cal.getTimeInMillis())); times.add(new SnoozeTime(mRes.getString(R.string.pick_a_time), SNOOZE_TIMESTAMP_CHOOSE_CUSTOM_TIME)); return times; }
Source:
public static ThemeSearchFragment newInstance() { ThemeSearchFragment fragment = new ThemeSearchFragment(); return fragment; }

Target:
public static ThemeSearchFragment newInstance() { return new ThemeSearchFragment(); }
Source:
public void update(Observable arg0, Object argN) { final String arg1 = OoyalaNotification.getNameOrUnknown(argN); if (arg1 == OoyalaPlayer.TIME_CHANGED_NOTIFICATION_NAME) { return; } String text="Notification Received: " + arg1 + " - state: " + player.getState(); playbacklog.writeToSdcardLog(text); Log.d(TAG, "Notification Received: " + arg1 + " - state: " + player.getState()); }

Target:
public void update(Observable arg0, Object argN) { final String arg1 = OoyalaNotification.getNameOrUnknown(argN); if (arg1 == OoyalaPlayer.TIME_CHANGED_NOTIFICATION_NAME) { return; } String text="Notification Received: " + arg1 + " - state: " + player.getState(); playbacklog.writeToSdcardLog(text); Log.d(TAG, text); }
Source:
public void initialise() { playerCamera = worldRenderer.getActiveCamera(); addDesiredStateChange(new LookThroughNormalized(playerCamera)); initSkysphere(playerCamera.getzFar() < RADIUS ? playerCamera.getzFar() : RADIUS); wireframeStateChange = new SetWireframe(true); RenderingDebugConfig renderingDebugConfig = config.getRendering().getDebug(); new WireframeTrigger(renderingDebugConfig, this); addDesiredStateChange(new SetViewportToSizeOf(WRITEONLY_GBUFFER, displayResolutionDependentFBOs)); addDesiredStateChange(new BindFBO(READONLY_GBUFFER, displayResolutionDependentFBOs)); update(); addDesiredStateChange(new EnableMaterial("engine:prog.sky")); addDesiredStateChange(new DisableDepthWriting()); addDesiredStateChange(new EnableFaceCulling()); addDesiredStateChange(new SetFacesToCull(GL_FRONT)); displayResolutionDependentFBOs.subscribe(this); }

Target:
public void initialise() { playerCamera = worldRenderer.getActiveCamera(); addDesiredStateChange(new LookThroughNormalized(playerCamera)); initSkysphere(playerCamera.getzFar() < RADIUS ? playerCamera.getzFar() : RADIUS); wireframeStateChange = new SetWireframe(true); RenderingDebugConfig renderingDebugConfig = config.getRendering().getDebug(); new WireframeTrigger(renderingDebugConfig, this); addDesiredStateChange(new BindFBO(READONLY_GBUFFER, displayResolutionDependentFBOs)); update(); displayResolutionDependentFBOs.subscribe(this); addDesiredStateChange(new EnableMaterial("engine:prog.sky")); addDesiredStateChange(new DisableDepthWriting()); addDesiredStateChange(new EnableFaceCulling()); addDesiredStateChange(new SetFacesToCull(GL_FRONT)); }
Source:
public void deleteSilentAfterCancel() { try { if (!Files.deleteIfExists(downloadZipFile)) { logger.error("Could not delete downloaded ZIP file '{}'!", downloadZipFile); } } catch (IOException e) { logger.error("Could not delete downloaded ZIP file '{}'!", downloadZipFile, e); } }

Target:
public void deleteSilentAfterCancel() { FileUtils.deleteFileSilently(downloadZipFile); }
Source:
public void execute() { final long startTime = System.currentTimeMillis(); try { final ResourceBundle compilationProperties = ResourceBundle .getBundle("checkstylecompilation", Locale.ROOT); final String version = compilationProperties .getString("checkstyle.compile.version"); final String compileTimestamp = compilationProperties .getString("checkstyle.compile.timestamp"); log("checkstyle version " + version, Project.MSG_VERBOSE); log("compiled on " + compileTimestamp, Project.MSG_VERBOSE); if (fileName == null && fileSets.isEmpty() && sourcePaths.isEmpty()) { throw new BuildException( "Must specify at least one of 'file' or nested 'fileset' or 'sourcepath'.", getLocation()); } if (configLocation == null) { throw new BuildException("Must specify 'config'.", getLocation()); } realExecute(version); } finally { final long endTime = System.currentTimeMillis(); log("Total execution took " + (endTime - startTime) + TIME_SUFFIX, Project.MSG_VERBOSE); } }

Target:
public void execute() { final long startTime = System.currentTimeMillis(); try { final ResourceBundle compilationProperties = ResourceBundle .getBundle("checkstylecompilation", Locale.ROOT); final String version = compilationProperties .getString("checkstyle.compile.version"); final String compileTimestamp = compilationProperties .getString("checkstyle.compile.timestamp"); log("checkstyle version " + version, Project.MSG_VERBOSE); log("compiled on " + compileTimestamp, Project.MSG_VERBOSE); if (fileName == null && fileSets.isEmpty() && paths.isEmpty()) { throw new BuildException( "Must specify at least one of 'file' or nested 'fileset' or 'path'.", getLocation()); } if (configLocation == null) { throw new BuildException("Must specify 'config'.", getLocation()); } realExecute(version); } finally { final long endTime = System.currentTimeMillis(); log("Total execution took " + (endTime - startTime) + TIME_SUFFIX, Project.MSG_VERBOSE); } }
Source:
public void testConnectorAbortsHandshakeOnUnknownPskIdentity() throws Exception { final CountDownLatch latch = new CountDownLatch(1); clientConfig = new DtlsConnectorConfig.Builder() .setAddress(clientEndpoint) .setPskStore(new StaticPskStore("unknownIdentity", CLIENT_IDENTITY_SECRET.getBytes())) .build(); client = new DTLSConnector(clientConfig); client.start(); final AtomicReference<AlertMessage> alert = new AtomicReference<>(); MessageCallback callback = new MessageCallback() { @Override public void onSent() { } @Override public void onError(Throwable error) { if (HandshakeException.class.isInstance(error)) { alert.set(((HandshakeException) error).getAlert()); latch.countDown(); } } @Override public void onContextEstablished(EndpointContext context) { } }; RawData data = RawData.outbound("Hello".getBytes(), new AddressEndpointContext(serverEndpoint), callback, false); client.send(data); assertTrue(latch.await(MAX_TIME_TO_WAIT_SECS, TimeUnit.SECONDS)); assertThat(alert.get().getLevel(), is(AlertLevel.FATAL)); }

Target:
public void testConnectorAbortsHandshakeOnUnknownPskIdentity() throws Exception { final CountDownLatch latch = new CountDownLatch(1); clientConfig = new DtlsConnectorConfig.Builder() .setAddress(clientEndpoint) .setPskStore(new StaticPskStore("unknownIdentity", CLIENT_IDENTITY_SECRET.getBytes())) .build(); client = new DTLSConnector(clientConfig); client.start(); final AtomicReference<AlertMessage> alert = new AtomicReference<>(); MessageCallback callback = new MessageCallback() { @Override public void onSent() { } @Override public void onError(Throwable error) { if (error instanceof HandshakeException) { alert.set(((HandshakeException) error).getAlert()); latch.countDown(); } } @Override public void onContextEstablished(EndpointContext context) { } }; RawData data = RawData.outbound("Hello".getBytes(), new AddressEndpointContext(serverEndpoint), callback, false); client.send(data); assertTrue(latch.await(MAX_TIME_TO_WAIT_SECS, TimeUnit.SECONDS)); assertThat(alert.get().getLevel(), is(AlertLevel.FATAL)); }
Source:
protected boolean validateDestStorage() { StorageDomainValidator validator = new StorageDomainValidator(getStorageDomain()); if (!validate(validator.isDomainExistAndActive()) || !validate(validator.domainIsValidDestination())) { return false; } boolean moveOrCopy = isMoveOperation() || isCopyOperation(); if (moveOrCopy && getImage().isShareable() && getStorageDomain().getStorageType() == StorageType.GLUSTERFS ) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_CANT_MOVE_SHAREABLE_DISK_TO_GLUSTERFS, String.format("$%1$s %2$s", "diskAlias", getImage().getDiskAlias())); } if (isMoveOperation()) { if (getImage().getStorageIds().contains(getStorageDomain().getId())) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_DESTINATION_STORAGE_DOMAIN_IS_NOT_VALID); } } return true; }

Target:
protected boolean validateDestStorage() { StorageDomainValidator validator = new StorageDomainValidator(getStorageDomain()); if (!validate(validator.isDomainExistAndActive()) || !validate(validator.domainIsValidDestination())) { return false; } boolean moveOrCopy = isMoveOperation() || isCopyOperation(); if (moveOrCopy && getImage().isShareable() && getStorageDomain().getStorageType() == StorageType.GLUSTERFS ) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_CANT_MOVE_SHAREABLE_DISK_TO_GLUSTERFS, String.format("$%1$s %2$s", "diskAlias", getImage().getDiskAlias())); } if (isMoveOperation()) { if (getImage().getStorageIds().contains(getStorageDomainId())) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_DESTINATION_STORAGE_DOMAIN_ALREADY_CONTAINS_THE_DISK); } } return true; }
Source:
public static String finishMeasure() { final LogCollector[] threadCollectors = THREAD_COLLECTORS.get(); if (null != threadCollectors) { int idx = -1; for (int i = 0; i < threadCollectors.length; ++i) { if (null != threadCollectors[i]) { idx = i; } else { break; } } final LogCollector collector = idx >= 0 ? threadCollectors[idx] : null; threadCollectors[idx] = null; if (null != collector) { collector.addRecord("finish"); final String result = collector.describe(); collector.reset(); synchronized (threadCollectors) { COLLECTOR_POOL.add(collector); } return result; } } return null; }

Target:
public static String finishMeasure() { final List<LogCollector> threadCollectors = THREAD_COLLECTORS.get(); if (null != threadCollectors && !threadCollectors.isEmpty()) { final LogCollector lastCollector = threadCollectors.remove(threadCollectors.size() - 1); lastCollector.addRecord("finish"); return lastCollector.describe(); } return null; }
Source:
private boolean isUserReferringPhysician() { if (Context.isAuthenticated()) { return Context.getAuthenticatedUser().hasRole(REFERRRING_PHYSICIAN, true); } return false; }

Target:
private boolean isUserReferringPhysician() { if (!Context.isAuthenticated()) { String[] args = { OpenmrsConstants.PRIV_EDIT_ORDERS }; String message = messageSourceService.getMessage("radiology.privilegesRequired", args, Context.getLocale()); throw new APIAuthenticationException(message); } return Context.getAuthenticatedUser().hasRole(REFERRRING_PHYSICIAN, true); }
Source:
public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof ApplicationEvent)) return false; ApplicationEvent that = (ApplicationEvent) o; return getApplicationId() == that.getApplicationId() && getApplicationName().equals(that.getApplicationName()) && getTokenType().equals(that.getTokenType()) && getApplicationPolicy().equals(that.getApplicationPolicy()); }

Target:
public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof ApplicationEvent)) return false; ApplicationEvent that = (ApplicationEvent) o; return getApplicationId() == that.getApplicationId() && getApplicationName().equals(that.getApplicationName()) && getTokenType().equals(that.getTokenType()) && getGroupId().equals(that.getGroupId()) && getApplicationPolicy().equals(that.getApplicationPolicy()); }
Source:
private String getActionNameFromUrl(String requestUrl) { Matcher m = PATTERN_ACTION_NAME.matcher(requestUrl); if (m.find()) { return m.group(PATTERN_ACTION_NAME_GROUP); } else { return String.format(Const.ActivityLog.MESSAGE_ERROR_ACTION_NAME, requestUrl); } }

Target:
private String getActionNameFromUrl(String requestUrl) { Matcher m = PATTERN_ACTION_NAME.matcher(requestUrl); return m.find() ? m.group(PATTERN_ACTION_NAME_GROUP) : String.format(Const.ActivityLog.MESSAGE_ERROR_ACTION_NAME, requestUrl); }
Source:
public long getOffset() { if (currentOpIndex < 0) { return forwardOffsets.get(0); } return backwardsOffsets.get(currentOpIndex); }

Target:
public long getOffset() { if (currentOpIndex < 0) { return startOffset; } return backwardsOffsets.get(currentOpIndex); }
Source:
public void testEdit() { PageTitle title = new PageTitle(null, "Test_page_for_app_testing/Section1", TEST_WIKI_SITE); String wikitext = "== Section 2 ==\n\nEditing section INSERT RANDOM & HERE test at " + System.currentTimeMillis(); final int sectionId = 3; service.edit(TEST_WIKI_SITE, title, sectionId, wikitext, ANONYMOUS_TOKEN, DEFAULT_SUMMARY, false, null, null, new Edit.Callback() { @Override public void success(@NonNull EditingResult result) { assertThat(result, instanceOf(SuccessEditResult.class)); } @Override public void failure(@NonNull Throwable caught) { throw new RuntimeException(caught); } }); }

Target:
public void testEdit() { PageTitle title = new PageTitle(null, "Test_page_for_app_testing/Section1", TEST_WIKI_SITE); String wikitext = "== Section 2 ==\n\nEditing section INSERT RANDOM & HERE test at " + System.currentTimeMillis(); final int sectionId = 3; final TestLatch latch = new TestLatch(); client.request(TEST_WIKI_SITE, title, sectionId, wikitext, ANONYMOUS_TOKEN, DEFAULT_SUMMARY, false, null, null, new EditClient.Callback() { @Override public void success(@NonNull Call<Edit> call, @NonNull EditingResult result) { assertThat(result, instanceOf(SuccessEditResult.class)); latch.countDown(); } @Override public void failure(@NonNull Call<Edit> call, @NonNull Throwable caught) { throw new RuntimeException(caught); } }); latch.await(); }
Source:
public void requestHandleWithHealthCheckRequestTest() throws IOException { testHealthCheckRequest(HttpMethod.POST, healthCheckUri, true); testHealthCheckRequest(HttpMethod.POST, healthCheckUri, false); }

Target:
public void requestHandleWithHealthCheckRequestTest() throws IOException { testHealthCheckRequest(HttpMethod.GET, true, true); testHealthCheckRequest(HttpMethod.GET, false, true); testHealthCheckRequest(HttpMethod.GET, true, false); testHealthCheckRequest(HttpMethod.GET, false, false); }
Source:
protected WebSocketAlertBuilder setMessage(WebSocketMessageDTO webSocketMessageDTO) { HttpMessage handshakeMessage; try { handshakeMessage = webSocketMessageDTO.channel.getHandshakeReference().getHttpMessage(); } catch (Exception e) { LOGGER.info( "Couldn't get the Handshake Http Message for this specific channel. " + "Channel ID:" + webSocketMessageDTO.channel.id, e); return null; } alert.setMessage(handshakeMessage); alert.setUri(handshakeMessage.getRequestHeader().getURI().toString()); this.webSocketMessageDTO = webSocketMessageDTO; try { alert.setOtherInfo(OTHER_INFO_LABEL + webSocketMessageDTO.getReadablePayload()); } catch (InvalidUtf8Exception e) { alert.setOtherInfo( OTHER_INFO_LABEL + Constant.messages.getString("websocket.payload.invalid_utf8")); } return this; }

Target:
protected WebSocketAlertBuilder setMessage(WebSocketMessageDTO webSocketMessageDTO) { HttpMessage handshakeMessage; try { handshakeMessage = webSocketMessageDTO.channel.getHandshakeReference().getHttpMessage(); } catch (Exception e) { LOGGER.info( "Couldn't get the Handshake Http Message for this specific channel. " + "Channel ID:" + webSocketMessageDTO.channel.id, e); return this; } alert.setMessage(handshakeMessage); alert.setUri(handshakeMessage.getRequestHeader().getURI().toString()); this.webSocketMessageDTO = webSocketMessageDTO; try { alert.setOtherInfo(OTHER_INFO_LABEL + webSocketMessageDTO.getReadablePayload()); } catch (InvalidUtf8Exception e) { alert.setOtherInfo( OTHER_INFO_LABEL + Constant.messages.getString("websocket.payload.invalid_utf8")); } return this; }
Source:
public void bulkImport() throws Exception { MiniAccumuloClusterImpl cluster = SharedMiniClusterBase.getCluster(); FileSystem fs = cluster.getFileSystem(); Path base = cluster.getTemporaryPath(); Path dir = new Path(base, "test"); assertTrue(fs.mkdirs(dir)); String filename = dir + "/bulk/import/rfile.rf"; FileSKVWriter writer = FileOperations.getInstance().openWriter().ofFile(filename, fs, fs.getConf()) .withTableConfiguration(DefaultConfiguration.getInstance()).execute(); writer.startDefaultLocalityGroup(); writer.append(new org.apache.accumulo.core.data.Key(new Text("a"), new Text("b"), new Text("c")), new Value("value".getBytes(UTF_8))); writer.close(); fs.mkdirs(new Path(dir + "/bulk/fail")); client.importDirectory(creds, tableName, dir + "/bulk/import", dir + "/bulk/fail", true); String scanner = client.createScanner(creds, tableName, null); ScanResult more = client.nextK(scanner, 100); client.closeScanner(scanner); assertEquals(1, more.results.size()); ByteBuffer maxRow = client.getMaxRow(creds, tableName, null, null, false, null, false); assertEquals(s2bb("a"), maxRow); }

Target:
public void bulkImport() throws Exception { MiniAccumuloClusterImpl cluster = SharedMiniClusterBase.getCluster(); FileSystem fs = cluster.getFileSystem(); Path base = cluster.getTemporaryPath(); Path dir = new Path(base, "test"); assertTrue(fs.mkdirs(dir)); String filename = dir + "/bulk/import/rfile.rf"; FileSKVWriter writer = FileOperations.getInstance().newWriterBuilder().forFile(filename, fs, fs.getConf()) .withTableConfiguration(DefaultConfiguration.getInstance()).build(); writer.startDefaultLocalityGroup(); writer.append(new org.apache.accumulo.core.data.Key(new Text("a"), new Text("b"), new Text("c")), new Value("value".getBytes(UTF_8))); writer.close(); fs.mkdirs(new Path(dir + "/bulk/fail")); client.importDirectory(creds, tableName, dir + "/bulk/import", dir + "/bulk/fail", true); String scanner = client.createScanner(creds, tableName, null); ScanResult more = client.nextK(scanner, 100); client.closeScanner(scanner); assertEquals(1, more.results.size()); ByteBuffer maxRow = client.getMaxRow(creds, tableName, null, null, false, null, false); assertEquals(s2bb("a"), maxRow); }
Source:
public BinaryBlockWriter(OutputStream out, Class<M> protoClass, BinaryConverter<M> binaryConverter, int numRecordsPerBlock) { out_ = out; numRecordsPerBlock_ = numRecordsPerBlock; innerClass_ = protoClass; binaryConverter_ = binaryConverter; protoBlobs_ = new ArrayList<ByteString>(numRecordsPerBlock_); }

Target:
protected BinaryBlockWriter(OutputStream out, Class<M> protoClass, BinaryConverter<M> binaryConverter, int numRecordsPerBlock) { out_ = out; numRecordsPerBlock_ = numRecordsPerBlock; innerClass_ = protoClass; binaryConverter_ = binaryConverter; protoBlobs_ = new ArrayList<ByteString>(numRecordsPerBlock_); }
Source:
protected void setDevMode(String mode) { this.devMode = BooleanUtils.toBoolean(mode); if (this.devMode) { int devModeWarnCount = DEVMODESET_WARNCOUNT.get(); if (devModeWarnCount < MAX_DEVMODESET_WARNCOUNT) { devModeWarnCount = DEVMODESET_WARNCOUNT.incrementAndGet(); LOG.warn("Setting development mode affects the safety of your application!", this.devMode); if (devModeWarnCount >= MAX_DEVMODESET_WARNCOUNT) { LOG.warn("Last warning concerning development mode [{}]! These messages will now be trace level only!", this.devMode); } } else { LOG.trace("Setting development mode affects the safety of your application!", this.devMode); } } }

Target:
protected void setDevMode(String mode) { this.devMode = BooleanUtils.toBoolean(mode); }
Source:
private void packetReceived(XBeePacket packet) { notifyPacketReceived(packet); if (!(packet instanceof XBeeAPIPacket)) return; XBeeAPIPacket apiPacket = (XBeeAPIPacket)packet; XBeeAPIType apiType = apiPacket.getAPIID(); if (apiType == null) return; String address; byte[] data; switch(apiType) { case RECEIVE_PACKET: address = ((ReceivePacket)apiPacket).get64bitAddress().toString(); data = ((ReceivePacket)apiPacket).getReceivedData(); notifySerialDataReceived(address, data); break; case RX_64: address = ((RX64Packet)apiPacket).getSourceAddress().toString(); data = ((RX64Packet)apiPacket).getReceivedData(); notifySerialDataReceived(address, data); break; case RX_16: address = ((RX16Packet)apiPacket).getSourceAddress().toString(); data = ((RX16Packet)apiPacket).getReceivedData(); notifySerialDataReceived(address, data); break; default: break; } }

Target:
private void packetReceived(XBeePacket packet) { notifyPacketReceived(packet); if (!(packet instanceof XBeeAPIPacket)) return; XBeeAPIPacket apiPacket = (XBeeAPIPacket)packet; APIFrameType apiType = apiPacket.getFrameType(); if (apiType == null) return; String address = null; byte[] data = null; switch(apiType) { case RECEIVE_PACKET: address = ((ReceivePacket)apiPacket).get64bitAddress().toString(); data = ((ReceivePacket)apiPacket).getReceivedData(); break; case RX_64: address = ((RX64Packet)apiPacket).getSourceAddress().toString(); data = ((RX64Packet)apiPacket).getReceivedData(); break; case RX_16: address = ((RX16Packet)apiPacket).getSourceAddress().toString(); data = ((RX16Packet)apiPacket).getReceivedData(); break; default: break; } if (address != null && data != null) notifySerialDataReceived(address, data); }
Source:
protected void begin() { super.begin(); controller = JumpingSumoDeviceController.getInstance(); deviceController = controller.getDeviceController(); if (deviceController != null) { deviceController.getFeatureJumpingSumo().sendAnimationsJump(ARCOMMANDS_JUMPINGSUMO_ANIMATIONS_JUMP_TYPE_ENUM.ARCOMMANDS_JUMPINGSUMO_ANIMATIONS_JUMP_TYPE_LONG); Log.d(TAG, "send jump long command JS down"); } else { Log.d(TAG, "error: send jump long command JS"); } }

Target:
protected void begin() { super.begin(); controller = JumpingSumoDeviceController.getInstance(); deviceController = controller.getDeviceController(); if (deviceController != null) { deviceController.getFeatureJumpingSumo().sendAnimationsJump(ARCOMMANDS_JUMPINGSUMO_ANIMATIONS_JUMP_TYPE_ENUM.ARCOMMANDS_JUMPINGSUMO_ANIMATIONS_JUMP_TYPE_LONG); Log.d(TAG, "send jump long command JS down"); } }
Source:
private void initialize () { viewModel = new PreferencesDialogViewModel(dialogService, taskExecutor, frame, this); getDialogPane().getScene().getStylesheets().add(this.getClass().getResource("PreferencesDialog.css").toExternalForm()); preferencePaneContainer.getStyleClass().add("preferencePaneContainer"); preferenceTabList.itemsProperty().setValue(viewModel.getPreferenceTabs()); PreferencesSearchHandler searchHandler = new PreferencesSearchHandler(viewModel.getPreferenceTabs()); preferenceTabList.itemsProperty().bindBidirectional(searchHandler.filteredPreferenceTabsProperty()); searchBox.textProperty().addListener((observable, previousText, newText) -> { searchHandler.filterTabs(newText.toLowerCase(Locale.ROOT)); preferenceTabList.getSelectionModel().clearSelection(); preferenceTabList.getSelectionModel().selectFirst(); }); searchBox.setPromptText(Localization.lang("Search") + "..."); searchBox.setLeft(IconTheme.JabRefIcons.SEARCH.getGraphicNode()); EasyBind.subscribe(preferenceTabList.getSelectionModel().selectedItemProperty(), tab -> { if (tab != null) { preferencePaneContainer.setContent(tab.getBuilder()); } else { preferencePaneContainer.setContent(null); } }); preferenceTabList.getSelectionModel().selectFirst(); new ViewModelListCellFactory<PrefsTab>() .withText(PrefsTab::getTabName) .install(preferenceTabList); setValues(); }

Target:
private void initialize() { viewModel = new PreferencesDialogViewModel(dialogService, taskExecutor, frame); preferenceTabList.itemsProperty().setValue(viewModel.getPreferenceTabs()); PreferencesSearchHandler searchHandler = new PreferencesSearchHandler(viewModel.getPreferenceTabs()); preferenceTabList.itemsProperty().bindBidirectional(searchHandler.filteredPreferenceTabsProperty()); searchBox.textProperty().addListener((observable, previousText, newText) -> { searchHandler.filterTabs(newText.toLowerCase(Locale.ROOT)); preferenceTabList.getSelectionModel().clearSelection(); preferenceTabList.getSelectionModel().selectFirst(); }); searchBox.setPromptText(Localization.lang("Search") + "..."); searchBox.setLeft(IconTheme.JabRefIcons.SEARCH.getGraphicNode()); EasyBind.subscribe(preferenceTabList.getSelectionModel().selectedItemProperty(), tab -> { if (tab != null) { preferencePaneContainer.setContent(tab.getBuilder()); } else { preferencePaneContainer.setContent(null); } }); preferenceTabList.getSelectionModel().selectFirst(); new ViewModelListCellFactory<PrefsTab>() .withText(PrefsTab::getTabName) .install(preferenceTabList); viewModel.setValues(); }
Source:
public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { HashSet<BuildTriggerConfig> alreadyFired = new HashSet<BuildTriggerConfig>(); for (BuildTriggerConfig config : configs) { boolean hasNonAbstractProject = false; List<Job> jobs = config.getProjectList(build.getRootBuild().getProject().getParent(), build.getEnvironment(listener)); for (Job j : jobs) { if (!(j instanceof AbstractProject)) { hasNonAbstractProject = true; } } if (hasNonAbstractProject) { config.perform(build, launcher, listener); alreadyFired.add(config); } } if (canDeclare(build.getProject())) { EnvVars env = build.getEnvironment(listener); build.addAction(new CapturedEnvironmentAction(env)); } else { for (BuildTriggerConfig config : configs) { if (!alreadyFired.contains(config)) { config.perform(build, launcher, listener); } } } return true; }

Target:
public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException { HashSet<BuildTriggerConfig> alreadyFired = new HashSet<BuildTriggerConfig>(); for (BuildTriggerConfig config : configs) { boolean hasNonAbstractProject = false; List<Job> jobs = config.getJobs(build.getRootBuild().getProject().getParent(), build.getEnvironment(listener)); for (Job j : jobs) { if (!(j instanceof AbstractProject)) { hasNonAbstractProject = true; break; } } if (hasNonAbstractProject) { config.perform(build, launcher, listener); alreadyFired.add(config); } } if (canDeclare(build.getProject())) { EnvVars env = build.getEnvironment(listener); build.addAction(new CapturedEnvironmentAction(env)); } else { for (BuildTriggerConfig config : configs) { if (!alreadyFired.contains(config)) { config.perform(build, launcher, listener); } } } return true; }
Source:
public ZKHelixManager(String clusterName, String instanceName, InstanceType instanceType, String zkAddress, HelixManagerStateListener stateListener) { this(clusterName, instanceName, instanceType, zkAddress,stateListener, null); }

Target:
public ZKHelixManager(String clusterName, String instanceName, InstanceType instanceType, String zkAddress, HelixManagerStateListener stateListener) { this(clusterName, instanceName, instanceType, zkAddress, stateListener, HelixPropertyFactory.getInstance().getHelixManagerProperty(zkAddress, clusterName)); }
Source:
public GlobalVariableNames(@Nullable Settings settings) { ImmutableSet.Builder<String> namesBuilder = ImmutableSet.builder(); namesBuilder.addAll(globalsFromEnvironment("builtin").get()); if (settings != null) { namesBuilder.add(settings.getStringArray(GLOBALS_PROPERTY_KEY)); for (String environmentName : settings.getStringArray(ENVIRONMENTS_PROPERTY_KEY)) { String normalizedEnvName = environmentName.toLowerCase(Locale.ENGLISH); Optional<Set<String>> namesFromCurrentEnvironment = globalsFromEnvironment(normalizedEnvName); if (namesFromCurrentEnvironment.isPresent()) { namesBuilder.addAll(namesFromCurrentEnvironment.get()); } else { LOGGER.warn(ENVIRONMENTS_PROPERTY_KEY + " contains an unknown environment: " + environmentName); } } } this.names = namesBuilder.build(); }

Target:
public GlobalVariableNames(@Nullable Settings settings) { ImmutableSet.Builder<String> namesBuilder = ImmutableSet.builder(); namesBuilder.addAll(globalsFromEnvironment("builtin").get()); if (settings != null) { namesBuilder.add(settings.getStringArray(GLOBALS_PROPERTY_KEY)); for (String environmentName : settings.getStringArray(ENVIRONMENTS_PROPERTY_KEY)) { Optional<Set<String>> namesFromCurrentEnvironment = globalsFromEnvironment(environmentName); if (namesFromCurrentEnvironment.isPresent()) { namesBuilder.addAll(namesFromCurrentEnvironment.get()); } else { LOGGER.warn(ENVIRONMENTS_PROPERTY_KEY + " contains an unknown environment: " + environmentName); } } } this.names = namesBuilder.build(); }
Source:
public void init(final ImmutableMap<String, Object> execEnvVars) throws DbException { tupleIndices = new TIntObjectHashMap<TIntList>(); tuplesToRemove = new TupleBuffer(getSchema()); }

Target:
public void init(final ImmutableMap<String, Object> execEnvVars) throws DbException { if (!getLeft().getSchema().compatible(getRight().getSchema())) { throw new DbException("Incompatible input schemas"); } tupleIndices = new TIntObjectHashMap<TIntList>(); tuplesToRemove = new TupleBuffer(getSchema()); }
Source:
public void newDoc(EditableFileType fileType, final String contents, final ResultCallback<EditingTarget, ServerError> resultCallback) { ensureVisible(false); server_.newDocument( fileType.getTypeId(), contents, JsObject.createJsObject(), new SimpleRequestCallback<SourceDocument>( "Error Creating New Document") { @Override public void onResponseReceived(SourceDocument newDoc) { SourceColumn.applyDocPropertyDefaults(newDoc, true, userPrefs_); EditingTarget target = addTab(newDoc, Source.OPEN_INTERACTIVE); if (activeEditor_ != null) { target.forceSaveCommandActive(); manageSaveCommands(true); } if (resultCallback != null) resultCallback.onSuccess(target); } @Override public void onError(ServerError error) { if (resultCallback != null) resultCallback.onFailure(error); } }); }

Target:
public void newDoc(EditableFileType fileType, final String contents, final ResultCallback<EditingTarget, ServerError> resultCallback) { ensureVisible(false); server_.newDocument( fileType.getTypeId(), contents, JsObject.createJsObject(), new SimpleRequestCallback<SourceDocument>( "Error Creating New Document") { @Override public void onResponseReceived(SourceDocument newDoc) { SourceColumn.applyDocPropertyDefaults(newDoc, true, userPrefs_); EditingTarget target = addTab(newDoc, Source.OPEN_INTERACTIVE); if (SourceColumn.this == manager_.getActive()) { target.forceSaveCommandActive(); manageSaveCommands(true); } if (resultCallback != null) resultCallback.onSuccess(target); } @Override public void onError(ServerError error) { if (resultCallback != null) resultCallback.onFailure(error); } }); }
Source:
public Object call() throws IOException { try (InputStream toClose = pipeSource) { return doResumableUpload(); } catch (IOException e) { throw e; } catch (Exception e) { throw new IOException( String.format("Caught exception during upload for '%s'", resourceId), e); } }

Target:
public Object call() throws IOException { try (InputStream toClose = pipeSource) { return doResumableUpload(); } }
Source:
public void onExperienceReceive(PlayerExpChangeEvent e) { if (e.getAmount() <= 0 || !Talisman.checkFor(e, SlimefunItems.TALISMAN_WISE)) return; e.setAmount(e.getAmount() * 2); }

Target:
public void onExperienceReceive(PlayerExpChangeEvent e) { if (e.getAmount() > 0 && Talisman.tryActivate(e, SlimefunItems.TALISMAN_WISE)) { e.setAmount(e.getAmount() * 2); } }
Source:
private void logConcurrentModification(I aggregateId, Message command, int newEventCount) { log().warn("Detected the concurrent modification of {}" + "New events detected while dispatching the command " + "The number of new events is {}. " + "Restarting the command dispatching.", getAggregateClass(), aggregateId, command, newEventCount); }

Target:
private void logConcurrentModification(I aggregateId, Message command, int newEventCount) { final String idStr = Stringifiers.idToString(aggregateId); final Class<? extends Aggregate<I, ?, ?>> aggregateClass = getAggregateClass(); log().warn("Detected the concurrent modification of ID: {}. " + "New events detected while dispatching the command " + "The number of new events is {}. " + "Restarting the command dispatching.", aggregateClass, idStr, command, newEventCount); }
Source:
private void addBooksToCase(EntityRef player, List<BlockRegion> absoluteRegions, int level) { logger.debug("Adding books to laboratory"); Vector3i bookcaseLocation = absoluteRegions.get(MooConstants.BOOKCASE_REGION_INDEX).getMax(new org.joml.Vector3i()); EntityRef bookcaseEntity = blockEntityRegistry.getBlockEntityAt(bookcaseLocation); for (EntityRef book : getBooksToAdd(player, level)) { inventoryManager.giveItem(bookcaseEntity, bookcaseEntity, book); } }

Target:
private void addBooksToCase(EntityRef player, List<BlockRegion> absoluteRegions, int level) { logger.debug("Adding books to laboratory"); Vector3i bookcaseLocation = absoluteRegions.get(MooConstants.BOOKCASE_REGION_INDEX).getMax(new Vector3i()); EntityRef bookcaseEntity = blockEntityRegistry.getBlockEntityAt(bookcaseLocation); for (EntityRef book : getBooksToAdd(player, level)) { inventoryManager.giveItem(bookcaseEntity, bookcaseEntity, book); } }
Source:
protected int doStartTagInternal() throws Exception { QualityControllable<?> item = (QualityControllable<?>) this.item; ObjectMapper mapper = new ObjectMapper(); pageContext.getOut().append(String.format( "<br/><h1>QCs</h1><table id='qc%1$d' class='display no-border ui-widget-content'></table><script type='text/javascript'>jQuery(document).ready(function () { ListUtils.createStaticTable('qc%1$d', ListTarget.qc('%2$s'), { ownerId : %3$d }, %4$s);});</script>", id++, item.getQcTarget(), item.getId(), mapper.writeValueAsString(item.getQCs().stream().map(Dtos::asDto).collect(Collectors.toList())))); return SKIP_BODY; }

Target:
protected int doStartTagInternal() throws Exception { QualityControllable<?> qcItem = (QualityControllable<?>) item; ObjectMapper mapper = new ObjectMapper(); pageContext.getOut().append(String.format( "<br/><h1>QCs</h1><table id='%1$s' class='display no-border ui-widget-content'></table><script type='text/javascript'>jQuery(document).ready(function () { ListUtils.createStaticTable('%1$s', ListTarget.qc('%2$s'), { ownerId : %3$d }, %4$s);});</script>", getId(), qcItem.getQcTarget(), qcItem.getId(), mapper.writeValueAsString(qcItem.getQCs().stream().map(Dtos::asDto).collect(Collectors.toList())))); return SKIP_BODY; }
Source:
protected Map<String, Object> getParams() { List<String> properties = new ArrayList<String>(); properties.add("System.ScreenSaverActive"); Map<String, Object> params = new HashMap<String, Object>(); params.put("booleans", properties); return params; }

Target:
protected Map<String, Object> getParams() { List<String> properties = new ArrayList<String>(); properties.add(SYSTEM_SCREEN_SAVER_ACTIVE); Map<String, Object> params = new HashMap<String, Object>(); params.put("booleans", properties); return params; }
Source:
private RowDataToJsonConverter createMapConverter( String typeSummary, LogicalType keyType, LogicalType valueType) { if (!LogicalTypeChecks.hasFamily(keyType, LogicalTypeFamily.CHARACTER_STRING)) { throw new UnsupportedOperationException( "JSON format doesn't support non-string as key type of map. " + "The map type is: " + typeSummary); } final RowDataToJsonConverter valueConverter = createConverter(valueType); return (mapper, reuse, object) -> { ObjectNode node; if (reuse == null || reuse.isNull()) { node = mapper.createObjectNode(); } else { node = (ObjectNode) reuse; } MapData map = (MapData) object; ArrayData keyArray = map.keyArray(); ArrayData valueArray = map.valueArray(); int numElements = map.size(); for (int i = 0; i < numElements; i++) { String fieldName = keyArray.getString(i).toString(); Object value = ArrayData.get(valueArray, i, valueType); node.set(fieldName, valueConverter.convert(mapper, node.get(fieldName), value)); } return node; }; }

Target:
private RowDataToJsonConverter createMapConverter( String typeSummary, LogicalType keyType, LogicalType valueType) { if (!LogicalTypeChecks.hasFamily(keyType, LogicalTypeFamily.CHARACTER_STRING)) { throw new UnsupportedOperationException( "JSON format doesn't support non-string as key type of map. " + "The type is: " + typeSummary); } final RowDataToJsonConverter valueConverter = createConverter(valueType); return (mapper, reuse, object) -> { ObjectNode node; if (reuse == null || reuse.isNull()) { node = mapper.createObjectNode(); } else { node = (ObjectNode) reuse; } MapData map = (MapData) object; ArrayData keyArray = map.keyArray(); ArrayData valueArray = map.valueArray(); int numElements = map.size(); for (int i = 0; i < numElements; i++) { String fieldName = keyArray.getString(i).toString(); Object value = ArrayData.get(valueArray, i, valueType); node.set(fieldName, valueConverter.convert(mapper, node.get(fieldName), value)); } return node; }; }