auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void waitForState( ScheduledServiceListResource task, String state ) throws Exception { final long start = System.currentTimeMillis(); final String name = task.getName(); String actualState; while ( !( actualState = task.getStatus() ).equals( state ) ) { log.info( String.format( "Seeing state '%s' for task '%s', waiting for '%s'", actualState, name, state ) ); if ( System.currentTimeMillis() - start > 15000 ) { throw new IllegalStateException( String.format( "Task '%s' was not in expected state '%s' after waiting for 15s (actual state: '%s')", name, state, actualState ) ); } Time.millis( 500 ).sleep(); task = TaskScheduleUtil.getTask( name ); checkNotNull( task, "Task not found!" ); } }

Target:
private void waitForState( ScheduledServiceListResource task, String state ) throws Exception { final long start = System.currentTimeMillis(); final String name = task.getName(); String actualState; while ( !( actualState = task.getStatus() ).equals( state ) ) { log.info( "Seeing state '{}' for task '{}', waiting for '{}'", new String[] { actualState, name, state } ); if ( System.currentTimeMillis() - start > 15000 ) { throw new IllegalStateException( String.format( "Task '%s' was not in expected state '%s' after waiting for 15s (actual state: '%s')", name, state, actualState ) ); } Time.millis( 500 ).sleep(); task = TaskScheduleUtil.getTask( name ); checkNotNull( task, "Task not found!" ); } }
Source:
public boolean isAllowed(List<String> idList, Set<Identity> identities) { switch (accessMode()) { case "required": if (isWhitelisted(idList)) { break; } throw new ClientVisibleException(ResponseCodes.UNAUTHORIZED); case "restricted": boolean hasAccessToAProject = authDao.hasAccessToAnyProject(identities, false, null); if (hasAccessToAProject || isWhitelisted(idList)) { break; } throw new ClientVisibleException(ResponseCodes.UNAUTHORIZED); case "unrestricted": break; default: throw new ClientVisibleException(ResponseCodes.UNAUTHORIZED); } return true; }

Target:
public boolean isAllowed(List<String> idList, Set<Identity> identities) { switch (accessMode()) { case REQUIRED_ACCESSMODE: if (isWhitelisted(idList)) { break; } throw new ClientVisibleException(ResponseCodes.UNAUTHORIZED); case RESTRICTED_ACCESSMODE: boolean hasAccessToAProject = authDao.hasAccessToAnyProject(identities, false, null); if (hasAccessToAProject || isWhitelisted(idList)) { break; } throw new ClientVisibleException(ResponseCodes.UNAUTHORIZED); case UNRESTRICTED_ACCESSMODE: break; default: throw new ClientVisibleException(ResponseCodes.UNAUTHORIZED); } return true; }
Source:
protected void launchJavaElements(List<IJavaElement> elements, String mode) throws CoreException { launch(elements.iterator().next().getJavaProject().getProject().getFullPath(), mode); }

Target:
protected void launchJavaElements(List<IJavaElement> elements, String mode) throws CoreException { launch(elements.get(0).getJavaProject().getProject().getFullPath(), mode); }
Source:
public void setup() { PowerMockito.mockStatic(GraphDatabase.class); Driver driverMock = Mockito.mock(Driver.class); Mockito.when(GraphDatabase.routingDriver(Mockito.any(), Mockito.any(), Mockito.any())).thenReturn(driverMock); }

Target:
public void setup() { PowerMockito.mockStatic(GraphDatabase.class); Mockito .when(GraphDatabase.routingDriver(Mockito.any(), Mockito.any(), Mockito.any())) .thenAnswer(Answers.RETURNS_MOCKS); }
Source:
public void onStart(Intent intent, int startId) { super.onStart(intent, startId); final int commandType = intent.getIntExtra(SERVICE_COMMAND_KEY, COMMAND_BLANK); final Intent executeParamIntent = intent; new AsyncTask(){ @Override protected ArrayList doInBackground(Object... objs) { try { executeCommand(commandType, executeParamIntent); } catch (Exception e) { LogUtils.logD(e.getMessage()); } return null; } }.execute(null); }

Target:
public void onStart(Intent intent, int startId) { super.onStart(intent, startId); Bundle taskParams = new Bundle(); taskParams.putParcelable(PARAM_INTENT_KEY, intent); new AsyncTask<Bundle, Void, Void>(){ @Override protected Void doInBackground(Bundle... objs) { try { Intent executeParamIntent = objs[0].getParcelable(PARAM_INTENT_KEY); int commandType = executeParamIntent.getIntExtra(SERVICE_COMMAND_KEY, COMMAND_BLANK); executeCommand(commandType, executeParamIntent); } catch (Exception e) { LogUtils.logD(e.getMessage()); } return null; } }.execute(new Bundle[]{taskParams}); }
Source:
private void doStartThread() { assert thread == null; executor.execute(new Runnable() { @Override public void run() { thread = nonVolatileThread = Thread.currentThread(); if (interrupted) { nonVolatileThread.interrupt(); } boolean success = false; updateLastExecutionTime(); try { SingleThreadEventExecutor.this.run(); success = true; } catch (Throwable t) { logger.warn("Unexpected exception from an event executor: ", t); } finally { for (;;) { int oldState = state; if (oldState >= ST_SHUTTING_DOWN || STATE_UPDATER.compareAndSet( SingleThreadEventExecutor.this, oldState, ST_SHUTTING_DOWN)) { break; } } if (success && gracefulShutdownStartTime == 0) { if (logger.isErrorEnabled()) { logger.error("Buggy " + EventExecutor.class.getSimpleName() + " implementation; " + SingleThreadEventExecutor.class.getSimpleName() + ".confirmShutdown() must " + "be called before run() implementation terminates."); } } try { for (;;) { if (confirmShutdown()) { break; } } } finally { try { cleanup(); } finally { FastThreadLocal.removeAll(); thread = nonVolatileThread = null; synchronized (threadLock) { STATE_UPDATER.set(SingleThreadEventExecutor.this, ST_TERMINATED); threadLock.notifyAll(); } if (logger.isWarnEnabled() && !taskQueue.isEmpty()) { logger.warn("An event executor terminated with " + "non-empty task queue (" + taskQueue.size() + ')'); } terminationFuture.setSuccess(null); } } } } }); }

Target:
private void doStartThread() { assert thread == null; executor.execute(new Runnable() { @Override public void run() { thread = nonVolatileThread = Thread.currentThread(); if (interrupted) { nonVolatileThread.interrupt(); } boolean success = false; updateLastExecutionTime(); try { SingleThreadEventExecutor.this.run(); success = true; } catch (Throwable t) { logger.warn("Unexpected exception from an event executor: ", t); } finally { for (;;) { int oldState = state; if (oldState >= ST_SHUTTING_DOWN || STATE_UPDATER.compareAndSet( SingleThreadEventExecutor.this, oldState, ST_SHUTTING_DOWN)) { break; } } if (success && gracefulShutdownStartTime == 0) { if (logger.isErrorEnabled()) { logger.error("Buggy " + EventExecutor.class.getSimpleName() + " implementation; " + SingleThreadEventExecutor.class.getSimpleName() + ".confirmShutdown() must " + "be called before run() implementation terminates."); } } try { for (;;) { if (confirmShutdown()) { break; } } } finally { try { cleanup(); } finally { FastThreadLocal.removeAll(); thread = nonVolatileThread = null; STATE_UPDATER.set(SingleThreadEventExecutor.this, ST_TERMINATED); synchronized (threadLock) { threadLock.notifyAll(); } if (logger.isWarnEnabled() && !taskQueue.isEmpty()) { logger.warn("An event executor terminated with " + "non-empty task queue (" + taskQueue.size() + ')'); } terminationFuture.setSuccess(null); } } } } }); }
Source:
public FixedRequestAttributes toFixedRequestAttributes() { if (isOverrideWorkspaceSettings()) { FixedRequestAttributesBuilder builder = FixedRequestAttributesBuilder.fromEmptySettings(getWorkingDir()) .gradleUserHome(getGradleUserHome()) .gradleDistribution(getGradleDistribution()) .javaHome(getJavaHome()) .jvmArguments(getJvmArguments()) .arguments(getArguments()); if (isOverriddenOffline()) { builder.arguments(Arrays.asList("--offline")); } if (isOverriddenBuildScansEnabled()) { builder.jvmArguments(Arrays.asList("-Dscan")); } return builder.build(); } else { return FixedRequestAttributesBuilder.fromWorkspaceSettings(getWorkingDir()) .gradleUserHome(getGradleUserHome()) .gradleDistribution(getGradleDistribution()) .javaHome(getJavaHome()) .jvmArguments(getJvmArguments()) .arguments(getArguments()) .build(); } }

Target:
public FixedRequestAttributes toFixedRequestAttributes() { FixedRequestAttributesBuilder builder = FixedRequestAttributesBuilder.fromWorkspaceSettings(getWorkingDir()) .gradleUserHome(getGradleUserHome()) .gradleDistribution(getGradleDistribution()) .javaHome(getJavaHome()) .jvmArguments(getJvmArguments()) .arguments(getArguments()); if (isOverrideWorkspaceSettings()) { builder.buildScansEnabled(isBuildScansEnabled()); builder.offlineMode(isOffline()); } return builder.build(); }
Source:
protected void eventHandle(@NonNull ITmfEvent event) { ITmfStateSystemBuilder ss = getStateSystemBuilder(); if (ss == null) { return; } long timestamp = event.getTimestamp().toNanos(); Long duration = event.getContent().getFieldValue(Long.class, IOpenTracingConstants.DURATION); if (duration == null) { return; } int quark; String name = String.valueOf(TmfTraceUtils.resolveAspectOfNameForEvent(event.getTrace(), "Name", event)); String spanId = event.getContent().getFieldValue(String.class, IOpenTracingConstants.SPAN_ID); String refId = event.getContent().getFieldValue(String.class, IOpenTracingConstants.REFERENCES + "/CHILD_OF"); if (refId == null) { quark = ss.getQuarkAbsoluteAndAdd(name + "/" + spanId); } else { Integer parentQuark = spanMap.get(refId); if (parentQuark == null) { return; } quark = ss.getQuarkRelativeAndAdd(parentQuark, name + "/" + spanId); } ss.modifyAttribute(timestamp, name, quark); ss.modifyAttribute(timestamp + duration, (Object) null, quark); spanMap.put(event.getContent().getFieldValue(String.class, IOpenTracingConstants.SPAN_ID), quark); }

Target:
protected void eventHandle(@NonNull ITmfEvent event) { ITmfStateSystemBuilder ss = getStateSystemBuilder(); if (ss == null) { return; } long timestamp = event.getTimestamp().toNanos(); Long duration = event.getContent().getFieldValue(Long.class, IOpenTracingConstants.DURATION); if (duration == null) { return; } int quark; String name = String.valueOf(TmfTraceUtils.resolveAspectOfNameForEvent(event.getTrace(), "Name", event)); String spanId = event.getContent().getFieldValue(String.class, IOpenTracingConstants.SPAN_ID); String refId = event.getContent().getFieldValue(String.class, IOpenTracingConstants.REFERENCES + "/CHILD_OF"); if (refId == null) { quark = ss.getQuarkAbsoluteAndAdd(name + '/' + spanId); } else { Integer parentQuark = spanMap.get(refId); if (parentQuark == null) { return; } quark = ss.getQuarkRelativeAndAdd(parentQuark, name + '/' + spanId); } ss.modifyAttribute(timestamp, name, quark); ss.modifyAttribute(timestamp + duration, (Object) null, quark); spanMap.put(event.getContent().getFieldValue(String.class, IOpenTracingConstants.SPAN_ID), quark); }
Source:
private LocationHandle createLocationHandle(HdfsContext context, ConnectorSession session, Path targetPath, boolean isExistingTable) { if (shouldUseTemporaryDirectory(session, context, targetPath)) { Path writePath = createTemporaryPath(session, context, hdfsEnvironment, targetPath); return new LocationHandle(targetPath, writePath, isExistingTable, STAGE_AND_MOVE_TO_TARGET_DIRECTORY); } else { return new LocationHandle(targetPath, targetPath, isExistingTable, DIRECT_TO_TARGET_NEW_DIRECTORY); } }

Target:
private LocationHandle createLocationHandle(HdfsContext context, ConnectorSession session, Path targetPath, boolean isExistingTable) { if (shouldUseTemporaryDirectory(session, context, targetPath)) { Path writePath = createTemporaryPath(session, context, hdfsEnvironment, targetPath); return new LocationHandle(targetPath, writePath, isExistingTable, STAGE_AND_MOVE_TO_TARGET_DIRECTORY); } if (isExistingTable) { return new LocationHandle(targetPath, targetPath, true, DIRECT_TO_TARGET_EXISTING_DIRECTORY); } return new LocationHandle(targetPath, targetPath, false, DIRECT_TO_TARGET_NEW_DIRECTORY); }
Source:
public String getTableName() { return tableName; }

Target:
private String getTableName() { return tableName; }
Source:
protected void annex(final T oldStorage) { getStorage().annex(oldStorage); logv("annexed " + oldStorage + " to " + this); }

Target:
protected void annex(final T oldStorage) { getStorage().annex(oldStorage); TrayLog.v("annexed " + oldStorage + " to " + this); }
Source:
public PongCommandHandler() { this.rand = new Random(); this.messages = new ArrayList<>(); this.messages.add("Come at me {u}! I will smash you at ping-pong"); this.messages.add("{u} can't play ping-pong"); this.messages.add("Who wants to challenge {u} to a game of ping-pong?"); this.messages.add("Taking all bets - Willie vs {u} at ping-pong. First to 11."); this.messages.add("{u} has uber ping-pong hacks. Like a bionic hand or something..."); this.messages.add("Grab your bats is time to play ping-pong! Come at me {u}"); }

Target:
public PongCommandHandler() { this.rand = new Random(); this.messages = new ArrayList<>(); this.messages.add("Come at me {u}! I will smash you at ping-pong"); this.messages.add("{u} can't play ping-pong"); this.messages.add("Who wants to challenge {u} to a game of ping-pong?"); this.messages.add("Taking all bets - Willie vs {u} at ping-pong. First to 11."); this.messages.add("{u} has uber ping-pong hacks. Like a bionic hand or something..."); this.messages.add("Who wants to pong {u} with me?"); this.messages.add("Grab your bats is time to play ping-pong! Come at me {u}"); }
Source:
public void setShouldScanBarCodes(boolean shouldScanBarCodes) { if (shouldScanBarCodes && !mBarcodeDetector) { setupBarcodeDetector(); } this.mShouldScanBarCodes = shouldScanBarCodes; setScanning(mShouldDetectFaces || mShouldDetectBarcodes || mShouldScanBarCodes || mShouldRecognizeText); }

Target:
public void setShouldScanBarCodes(boolean shouldScanBarCodes) { if (shouldScanBarCodes && mBarcodeDetector == null) { setupBarcodeDetector(); } this.mShouldScanBarCodes = shouldScanBarCodes; setScanning(mShouldDetectFaces || mShouldDetectBarcodes || mShouldScanBarCodes || mShouldRecognizeText); }
Source:
public JobEntity(final Injector jobInjector, final String jobId, final int numServers, final ExecutorConfiguration serverExecutorConf, final TableConfiguration serverTableConf, final int numWorkers, final ExecutorConfiguration workerExecutorConf, final TableConfiguration workerTableConf, final String inputPath) { this.jobInjector = jobInjector; this.jobId = jobId; this.numServers = numServers; this.serverExecutorConf = serverExecutorConf; this.serverTableConf = serverTableConf; this.numWorkers = numWorkers; this.workerExecutorConf = workerExecutorConf; this.workerTableConf = workerTableConf; this.inputPath = inputPath; }

Target:
private JobEntity(final Injector jobInjector, final String jobId, final int numServers, final ExecutorConfiguration serverExecutorConf, final TableConfiguration serverTableConf, final int numWorkers, final ExecutorConfiguration workerExecutorConf, final TableConfiguration workerTableConf, final String inputPath) { this.jobInjector = jobInjector; this.jobId = jobId; this.numServers = numServers; this.serverExecutorConf = serverExecutorConf; this.serverTableConf = serverTableConf; this.numWorkers = numWorkers; this.workerExecutorConf = workerExecutorConf; this.workerTableConf = workerTableConf; this.inputPath = inputPath; }
Source:
public void asyncGetCube(int cubeX, int cubeY, int cubeZ, Requirement req, Consumer<Cube> callback) { Cube cube = cubeMap.get(cubeX, cubeY, cubeZ); if (req == Requirement.GET_CACHED || (cube != null && req.compareTo(Requirement.GENERATE) <= 0)) { callback.accept(cube); return; } if (cube == null) { AsyncWorldIOExecutor.queueCubeLoad(worldServer, cubeIO, this, cubeX, cubeY, cubeZ, loaded -> { IColumn col = getLoadedColumn(cubeX, cubeZ); if (col != null) { onCubeLoaded(loaded, col); loaded = postCubeLoadAttempt(cubeX, cubeY, cubeZ, loaded, col, req); } callback.accept(loaded); }); } }

Target:
public void asyncGetCube(int cubeX, int cubeY, int cubeZ, Requirement req, Consumer<Cube> callback) { Cube cube = getLoadedCube(cubeX, cubeY, cubeZ); if (req == Requirement.GET_CACHED || (cube != null && req.compareTo(Requirement.GENERATE) <= 0)) { callback.accept(cube); return; } if (cube == null) { AsyncWorldIOExecutor.queueCubeLoad(worldServer, cubeIO, this, cubeX, cubeY, cubeZ, loaded -> { IColumn col = getLoadedColumn(cubeX, cubeZ); if (col != null) { onCubeLoaded(loaded, col); loaded = postCubeLoadAttempt(cubeX, cubeY, cubeZ, loaded, col, req); } callback.accept(loaded); }); } }
Source:
public Event(CompletionTime completionTime, String eventSource) { if (null == eventSource || eventSource.isEmpty()) { throw new IllegalStateException("Cannot determine the event source"); } this.context = new HashMap<>(1); this.context.put("id", completionTime.getId()); this.tags = new HashMap<>(); this.tags.put("uri", completionTime.getUri()); this.tags.put("operation", completionTime.getOperation()); Set<Property> properties = completionTime.getProperties(); if (properties != null && properties.size() > 0) { properties.forEach(p -> this.tags.put(p.getName(), p.getValue())); } if (completionTime.getFault() != null && !completionTime.getFault().isEmpty()) { this.tags.put("fault", completionTime.getFault()); } this.category = eventSource; this.dataSource = "APM"; this.id = String.format("%s-%s", eventSource, completionTime.getId()); this.ctime = completionTime.getTimestamp(); this.text = Long.toString(completionTime.getDuration()); }

Target:
public Event(CompletionTime completionTime, String eventSource) { if (null == eventSource || eventSource.isEmpty()) { throw new IllegalStateException("Cannot determine the event source"); } this.context = new HashMap<>(1); this.context.put("id", completionTime.getId()); this.tags = new HashMap<>(); this.tags.put("uri", completionTime.getUri()); this.tags.put("operation", completionTime.getOperation()); Set<Property> properties = completionTime.getProperties(); if (properties != null && properties.size() > 0) { properties.forEach(p -> this.tags.put(p.getName(), p.getValue())); } if (completionTime.getFault() != null && !completionTime.getFault().isEmpty()) { this.tags.put("fault", completionTime.getFault()); } this.category = eventSource; this.dataSource = "APM"; this.id = UUID.randomUUID().toString(); this.ctime = completionTime.getTimestamp(); this.text = Long.toString(completionTime.getDuration()); }
Source:
protected void onProgressUpdate(IOException... values) { super.onProgressUpdate(values); if(values.length < 1) return; IOException result = values[0]; ArchivePasswordCache.getInstance().remove(compressedPath); GeneralDialogCreation.showPasswordDialog(AppConfig.getInstance().getMainActivityContext(), (MainActivity)AppConfig.getInstance().getMainActivityContext(), AppConfig.getInstance().getUtilsProvider().getAppTheme(), R.string.archive_password_prompt, R.string.authenticate_password, (dialog, which) -> { EditText editText = dialog.getView().findViewById(R.id.singleedittext_input); ArchivePasswordCache.getInstance().put(compressedPath, editText.getText().toString()); this.extractService.get().getDataPackages().clear(); this.paused = false; dialog.dismiss(); }, ((dialog, which) -> { dialog.dismiss(); toastOnParseError(result); cancel(true); progressHandler.setCancelled(true); stopSelf(); this.paused = false; })); }

Target:
protected void onProgressUpdate(IOException... values) { super.onProgressUpdate(values); if(values.length < 1 || !passwordProtected) return; IOException result = values[0]; ArchivePasswordCache.getInstance().remove(compressedPath); GeneralDialogCreation.showPasswordDialog(AppConfig.getInstance().getMainActivityContext(), (MainActivity)AppConfig.getInstance().getMainActivityContext(), AppConfig.getInstance().getUtilsProvider().getAppTheme(), R.string.archive_password_prompt, R.string.authenticate_password, (dialog, which) -> { EditText editText = dialog.getView().findViewById(R.id.singleedittext_input); ArchivePasswordCache.getInstance().put(compressedPath, editText.getText().toString()); this.extractService.get().getDataPackages().clear(); this.paused = false; dialog.dismiss(); }, ((dialog, which) -> { dialog.dismiss(); toastOnParseError(result); cancel(true); progressHandler.setCancelled(true); stopSelf(); this.paused = false; })); }
Source:
public static ByteBuffer marshall(StreamingMarshaller marshaller, Object obj) throws CacheLoaderException, InterruptedException { try { return marshaller.objectToBuffer(obj); } catch (IOException e) { log.errorMarshallingBucket(e, obj); throw new CacheLoaderException("I/O failure while marshalling object: " + obj, e); } }

Target:
public static ByteBuffer marshall(StreamingMarshaller marshaller, Object obj) throws CacheLoaderException, InterruptedException { try { return marshaller.objectToBuffer(obj); } catch (IOException e) { log.errorMarshallingObject(e, obj); throw new CacheLoaderException("I/O failure while marshalling object: " + obj, e); } }
Source:
public void test(){ doInJPA( this::entityManagerFactory, entityManager -> { try { entityManager.createNativeQuery( "select 1 " + "from pg_sleep(2) " ) .getResultList(); fail("Should have thrown lock timeout exception!"); } catch (Exception expected) { expected.printStackTrace(); assertTrue( ExceptionUtil.rootCause(expected) .getMessage().contains("csanceling statement due to user request") ); } } ); }

Target:
public void test(){ doInJPA( this::entityManagerFactory, entityManager -> { try { entityManager.createNativeQuery( "select 1 " + "from pg_sleep(2) " ) .getResultList(); fail("Should have thrown lock timeout exception!"); } catch (Exception expected) { expected.printStackTrace(); assertTrue( ExceptionUtil.rootCause(expected) .getMessage().contains("canceling statement due to user request") ); } } ); }
Source:
public void writeTo(WritableByteChannel channel) throws IOException { if (bufferToSend == null) { bufferToSend = ByteBuffer.allocate((int) sizeInBytes()); writeHeader(); bufferToSend.putLong(partitionId); bufferToSend.putShort((short)blobId.length()); bufferToSend.put(blobId.getBytes()); bufferToSend.flip(); } if (bufferToSend.remaining() > 0) { int written = channel.write(bufferToSend); sizeSent += written; } }

Target:
public void writeTo(WritableByteChannel channel) throws IOException { if (bufferToSend == null) { bufferToSend = ByteBuffer.allocate((int) sizeInBytes()); writeHeader(); bufferToSend.putLong(partitionId); bufferToSend.putShort(blobId.sizeInBytes()); bufferToSend.put(blobId.toBytes()); bufferToSend.flip(); } if (bufferToSend.remaining() > 0) { int written = channel.write(bufferToSend); sizeSent += written; } }
Source:
public synchronized void scheduled(ChangeBasedEvent event, ParametersAction parameters, String projectName) { IGerritHudsonTriggerConfig serverConfig = getServerConfig(event); if (serverConfig != null && !serverConfig.isGerritBuildCurrentPatchesOnly() || event instanceof ManualPatchsetCreated) { return; } Iterator<Entry<GerritTriggeredEvent, ParametersAction>> it = runningJobs.entrySet().iterator(); while (it.hasNext()) { Entry<GerritTriggeredEvent, ParametersAction> pairs = it.next(); if (pairs.getKey() instanceof ChangeBasedEvent) { ChangeBasedEvent runningChangeBasedEvent = ((ChangeBasedEvent)pairs.getKey()); if (!(runningChangeBasedEvent instanceof ManualPatchsetCreated) && runningChangeBasedEvent.getChange().equals(event.getChange()) && Integer.parseInt(runningChangeBasedEvent.getPatchSet().getNumber()) < Integer.parseInt(event.getPatchSet().getNumber())) { logger.debug("Cancelling build for " + pairs.getKey()); try { cancelJob(pairs.getKey()); } catch (Exception e) { logger.error("Error canceling job", e); } it.remove(); } } } runningJobs.put(event, parameters); }

Target:
public synchronized void scheduled(ChangeBasedEvent event, ParametersAction parameters, String projectName) { IGerritHudsonTriggerConfig serverConfig = getServerConfig(event); if (serverConfig == null) { runningJobs.put(event, parameters); return; } BuildCancellationPolicy buildCurrentPatchesOnly = serverConfig.getBuildCurrentPatchesOnly(); if (!buildCurrentPatchesOnly.isEnabled() || (event instanceof ManualPatchsetCreated && !buildCurrentPatchesOnly.isAbortManualPatchsets())) { runningJobs.put(event, parameters); return; } Iterator<Entry<GerritTriggeredEvent, ParametersAction>> it = runningJobs.entrySet().iterator(); while (it.hasNext()) { Entry<GerritTriggeredEvent, ParametersAction> pairs = it.next(); if (pairs.getKey() instanceof ChangeBasedEvent) { ChangeBasedEvent runningChangeBasedEvent = ((ChangeBasedEvent)pairs.getKey()); boolean shouldCancelManual = (runningChangeBasedEvent instanceof ManualPatchsetCreated && buildCurrentPatchesOnly.isAbortManualPatchsets() || !(runningChangeBasedEvent instanceof ManualPatchsetCreated)); boolean shouldCancelPatchsetNumber = buildCurrentPatchesOnly.isAbortNewPatchsets() || Integer.parseInt(runningChangeBasedEvent.getPatchSet().getNumber()) < Integer.parseInt(event.getPatchSet().getNumber()); if (shouldCancelManual && shouldCancelPatchsetNumber) { logger.debug("Cancelling build for " + pairs.getKey()); try { cancelJob(pairs.getKey()); } catch (Exception e) { logger.error("Error canceling job", e); } it.remove(); } } } runningJobs.put(event, parameters); }
Source:
public ValidationResult checkAccountingString(String chartOfAccountsCode, String accountNumber, String subAccountNumber, String objectCode, String subObjectCode, String projectCode) { ValidationResult requiredFieldsValidationResult = checkRequiredAccountInfo(chartOfAccountsCode, accountNumber, objectCode); if (requiredFieldsValidationResult.isNotValid()) { return requiredFieldsValidationResult; } else { ValidationResult accountValidationResult = checkAccount(chartOfAccountsCode, accountNumber); if (accountValidationResult.isNotValid()) { return accountValidationResult; } else { ValidationResult objectCodeValidationResult = checkObjectCode(chartOfAccountsCode, objectCode); ValidationResult subAccountValidationResult = checkSubAccount(chartOfAccountsCode, accountNumber, subAccountNumber); ValidationResult subObjectCodeValidationResult = checkSubObjectCode(chartOfAccountsCode, accountNumber, objectCode, subObjectCode); ValidationResult projectCodeValidationResult = checkProjectCode(projectCode); ValidationResult validationResult = new ValidationResult(true, new ArrayList<String>()); if (objectCodeValidationResult.isNotValid()) { validationResult.setValid(false); validationResult.addMessages(objectCodeValidationResult.getMessages()); } if (subAccountValidationResult.isNotValid()) { validationResult.setValid(false); validationResult.addMessages(subAccountValidationResult.getMessages()); } if (subObjectCodeValidationResult.isNotValid()) { validationResult.setValid(false); validationResult.addMessages(subObjectCodeValidationResult.getMessages()); } if (projectCodeValidationResult.isNotValid()) { validationResult.setValid(false); validationResult.addMessages(projectCodeValidationResult.getMessages()); } return validationResult; } } }

Target:
public ValidationResult checkAccountingString(String chartOfAccountsCode, String accountNumber, String subAccountNumber, String objectCode, String subObjectCode, String projectCode) { ValidationResult requiredFieldsValidationResult = checkRequiredAccountInfo(chartOfAccountsCode, accountNumber, objectCode); if (requiredFieldsValidationResult.isNotValid()) { return requiredFieldsValidationResult; } else { return checkValuesAreValid(chartOfAccountsCode, accountNumber, subAccountNumber, objectCode, subObjectCode, projectCode); } }
Source:
public List<TablePartitionProto> getAllPartitions() throws CatalogException { Connection conn = null; Statement stmt = null; ResultSet resultSet = null; List<TablePartitionProto> partitions = new ArrayList<TablePartitionProto>(); try { String sql = "SELECT A." + COL_PARTITIONS_PK + ", A." + COL_TABLES_PK + ", A.PARTITION_NAME, " + " A.PATH FROM " + TB_PARTTIONS + " A JOIN " + TB_TABLES + " B " + " ON A." + COL_TABLES_PK + " = B." + COL_TABLES_PK + " WHERE A." + COL_PARTITIONS_PK + " > 0 "; conn = getConnection(); stmt = conn.createStatement(); resultSet = stmt.executeQuery(sql); while (resultSet.next()) { TablePartitionProto.Builder builder = TablePartitionProto.newBuilder(); builder.setPartitionId(resultSet.getInt(COL_PARTITIONS_PK)); builder.setTid(resultSet.getInt(COL_TABLES_PK)); builder.setPartitionName(resultSet.getString("PARTITION_NAME")); builder.setPath(resultSet.getString("PATH")); partitions.add(builder.build()); } } catch (SQLException se) { throw new TajoInternalError(se); } finally { CatalogUtil.closeQuietly(stmt, resultSet); } return partitions; }

Target:
public List<TablePartitionProto> getAllPartitions() { Connection conn = null; Statement stmt = null; ResultSet resultSet = null; List<TablePartitionProto> partitions = new ArrayList<TablePartitionProto>(); try { String sql = "SELECT " + COL_PARTITIONS_PK + ", " + COL_TABLES_PK + ", PARTITION_NAME, " + " PATH FROM " + TB_PARTTIONS; conn = getConnection(); stmt = conn.createStatement(); resultSet = stmt.executeQuery(sql); while (resultSet.next()) { TablePartitionProto.Builder builder = TablePartitionProto.newBuilder(); builder.setPartitionId(resultSet.getInt(COL_PARTITIONS_PK)); builder.setTid(resultSet.getInt(COL_TABLES_PK)); builder.setPartitionName(resultSet.getString("PARTITION_NAME")); builder.setPath(resultSet.getString("PATH")); partitions.add(builder.build()); } } catch (SQLException se) { throw new TajoInternalError(se); } finally { CatalogUtil.closeQuietly(stmt, resultSet); } return partitions; }
Source:
private static Entry parseEntry(String line) throws IOException { String pattern = null; final List<Attribute> attributes = new ArrayList<Attribute>(); final String[] tokens = line.replace('\t', ' ').split(" "); for (int index = 0; index < tokens.length; index++) { String token = tokens[index].trim(); if (index == tokens.length - 1) token = token.trim(); if (token.length() == 0) continue; if (pattern == null) { if (token.startsWith("#") || token.startsWith("<<<<<<<") || token.startsWith("=======") || token.startsWith(">>>>>>>")) return null; pattern = token; continue; } final Attribute attribute = parseAttribute(token); if (attribute == null) return null; attributes.add(attribute); } if (pattern == null) return null; try { return new Entry(pattern, attributes.toArray(new Attribute[attributes.size()]), line); } catch (InvalidPatternException ex) { throw new IOException(ex.getMessage()); } }

Target:
private static Entry parseEntry(String line) throws IOException { line = line.trim(); if (line.startsWith("#") || line.startsWith("<<<<<<<") || line.startsWith("========") || line.startsWith(">>>>>>>>")) return null; String pattern = null; final List<Attribute> attributes = new ArrayList<Attribute>(); final String[] tokens = line.replace('\t', ' ').split(" "); for (int index = 0; index < tokens.length; index++) { String token = tokens[index].trim(); if (index == tokens.length - 1) token = token.trim(); if (token.length() == 0) continue; if (pattern == null) { pattern = token; continue; } final Attribute attribute = parseAttribute(token); if (attribute == null) return null; attributes.add(attribute); } if (pattern == null) return null; try { return new Entry(pattern, attributes.toArray(new Attribute[attributes.size()]), line); } catch (InvalidPatternException ex) { throw new IOException(ex.getMessage()); } }
Source:
public static void addImages(Described content, String anImage) { if (! Strings.isNullOrEmpty(anImage)) { Matcher matcher = IMAGE_PATTERN.matcher(anImage); if (matcher.matches()) { Matcher genericMatcher = GENERIC_PATTERN.matcher(anImage); if(genericMatcher.matches()){ content.setThumbnail(matcher.group(1) + THUMBNAIL_SIZE + matcher.group(2)); content.setImage((matcher.group(1) + IMAGE_SIZE + matcher.group(2))); Image image = new Image(anImage); image.setType(ImageType.GENERIC); content.setImages(ImmutableSet.of(image)); } content.setThumbnail(matcher.group(1) + THUMBNAIL_SIZE + matcher.group(2)); content.setImage((matcher.group(1) + IMAGE_SIZE + matcher.group(2))); } } }

Target:
public static void addImages(Described content, String anImage) { if (! Strings.isNullOrEmpty(anImage)) { Matcher matcher = IMAGE_PATTERN.matcher(anImage); if (matcher.matches()) { String url = matcher.group(1) + IMAGE_SIZE + matcher.group(2); Image image = new Image(url); List<String> genericImageUrlList = createGenerateImageUrlList(); if(genericImageUrlList.contains(url)){ image.setType(ImageType.GENERIC_IMAGE_CONTENT_PLAYER); } content.setThumbnail(matcher.group(1) + THUMBNAIL_SIZE + matcher.group(2)); content.setImages(ImmutableSet.of(image)); } } for(Image image : content.getImages()) { if(image.getType() != ImageType.GENERIC_IMAGE_CONTENT_PLAYER) { content.setImage(image.getCanonicalUri()); return; } } }
Source:
public static void onEnemyKill(int level) { System.out.println("OnEnemyKill reached"); if (level == 1) { smallachieve21.setOpacity(1); System.out.println("OnEnemyKill lvl1 reached"); } if (level == 2) { smallachieve22.setOpacity(1); } if (level == 3) { smallachieve23.setOpacity(1); } if (level == 4) { smallachieve24.setOpacity(1); } if (level == 5) { smallachieve25.setOpacity(1); } }

Target:
public void onEnemyKill(int level) { if (level >= 1) { smallachieve21.setOpacity(1); } if (level >= 2) { smallachieve22.setOpacity(1); } if (level >= 3) { smallachieve23.setOpacity(1); } if (level >= 4) { smallachieve24.setOpacity(1); } if (level >= 5) { smallachieve25.setOpacity(1); } }
Source:
private FactoryMethod getFactoryMethod(List<MapperReference> mapperReferences, List<Method> methods, Type returnType) { FactoryMethod result = null; for ( Method method : methods ) { if ( !method.requiresImplementation() && !method.isIterableMapping() && !method.isMapMapping() && method.getMappings().isEmpty() && method.getParameters().isEmpty() ) { if ( method.getReturnType().equals( returnType ) ) { if ( result == null ) { MapperReference mapperReference = null; for ( MapperReference ref : mapperReferences ) { if ( ref.getMapperType().equals( method.getDeclaringMapper() ) ) { mapperReference = ref; break; } } result = new FactoryMethod(method, mapperReference); } else { messager.printMessage( Kind.ERROR, String.format( "Ambigious factory method: \"%s\" conflicts with \"%s\".", result.getName(), method.getName() ), method.getExecutable() ); } } } } return result; }

Target:
private MethodReference getFactoryMethod(List<MapperReference> mapperReferences, List<Method> methods, Type returnType) { MethodReference result = null; for ( Method method : methods ) { if ( !method.requiresImplementation() && !method.isIterableMapping() && !method.isMapMapping() && method.getMappings().isEmpty() && method.getParameters().isEmpty() ) { if ( method.getReturnType().equals( returnType ) ) { if ( result == null ) { MapperReference mapperReference = null; for ( MapperReference ref : mapperReferences ) { if ( ref.getMapperType().equals( method.getDeclaringMapper() ) ) { mapperReference = ref; break; } } result = new MethodReference(method, mapperReference); } else { messager.printMessage( Kind.ERROR, String.format( "Ambigious factory method: \"%s\" conflicts with \"%s\".", result, method ), method.getExecutable() ); } } } } return result; }
Source:
public void randomTestFilterMetaData() { Random random = new Random(System.currentTimeMillis()); for (int j = 0; j < 100; j++) { long[] rgs = new long[random.nextInt(50)]; for (int i = 0; i < rgs.length; i++) { rgs[i] = random.nextInt(10000) + 1; } int splitSize = random.nextInt(10000); try { verifyAllFilters(metadata(rgs), splitSize); } catch (AssertionError e) { AssertionError e2 = new AssertionError("fail verifyAllFilters(metadata(" + Arrays.toString(rgs) + "), " + splitSize + ")"); e2.initCause(e); } } }

Target:
public void randomTestFilterMetaData() { Random random = new Random(System.currentTimeMillis()); for (int j = 0; j < 100; j++) { long[] rgs = new long[random.nextInt(50)]; for (int i = 0; i < rgs.length; i++) { rgs[i] = random.nextInt(10000) + 1; } int splitSize = random.nextInt(10000); try { verifyAllFilters(metadata(rgs), splitSize); } catch (AssertionError e) { AssertionError aException = new AssertionError("fail verifyAllFilters(metadata(" + Arrays.toString(rgs) + "), " + splitSize + ")"); aException.initCause(e); throw aException; } } }
Source:
public boolean isSniEnabled() { return sniEnabled; }

Target:
public Boolean isSniEnabled() { return sniEnabled; }
Source:
private void doBackupCheck() { AuditLogableBase alert = new AuditLogableBase(); EngineBackupLog lastDbBackup = engineBackupLogDao.getLastSuccessfulEngineBackup(DB_SCOPE); EngineBackupLog lastFilesBackup = engineBackupLogDao.getLastSuccessfulEngineBackup(FILES_SCOPE); if (lastDbBackup == null || lastFilesBackup == null) { auditLogDirector.log(alert, AuditLogType.ENGINE_NO_FULL_BACKUP); } else { Integer backupAlertPeriodInDays = Config.<Integer>getValue(ConfigValues.BackupAlertPeriodInDays); Date lastDbBackupDate = lastDbBackup.getDoneAt(); Date lastFilesBackupDate = lastFilesBackup.getDoneAt(); Date lastFullBackupDate = lastDbBackupDate.compareTo(lastFilesBackupDate) < 0 ? lastDbBackupDate : lastFilesBackupDate; long diffInDays = (Calendar.getInstance().getTimeInMillis() - lastFullBackupDate.getTime()) / TimeUnit.DAYS.toMillis(1); if (diffInDays > backupAlertPeriodInDays) { alert.addCustomValue("Date", lastFullBackupDate.toString()); auditLogDirector.log(alert, AuditLogType.ENGINE_NO_WARM_BACKUP); } } }

Target:
private void doBackupCheck() { AuditLogableBase alert = new AuditLogableBase(); EngineBackupLog lastDbBackup = getLastBackupByScope(BACKUP_SCOPE.DB); EngineBackupLog lastFilesBackup = getLastBackupByScope(BACKUP_SCOPE.FILES); if (lastDbBackup == null || lastFilesBackup == null) { auditLogDirector.log(alert, AuditLogType.ENGINE_NO_FULL_BACKUP); } else { Integer backupAlertPeriodInDays = Config.<Integer>getValue(ConfigValues.BackupAlertPeriodInDays); Date lastDbBackupDate = lastDbBackup.getDoneAt(); Date lastFilesBackupDate = lastFilesBackup.getDoneAt(); Date lastFullBackupDate = lastDbBackupDate.compareTo(lastFilesBackupDate) < 0 ? lastDbBackupDate : lastFilesBackupDate; long diffInDays = (Calendar.getInstance().getTimeInMillis() - lastFullBackupDate.getTime()) / TimeUnit.DAYS.toMillis(1); if (diffInDays > backupAlertPeriodInDays) { alert.addCustomValue("Date", lastFullBackupDate.toString()); auditLogDirector.log(alert, AuditLogType.ENGINE_NO_WARM_BACKUP); } } }
Source:
public synchronized void onClosedSource(String tableName, int partition) { boolean removed = m_dataSourcesClosing.remove(tableName, partition); if (exportLog.isDebugEnabled()) { if (removed) { exportLog.debug("Closed " + tableName + ", partition " + partition); } else { exportLog.info("Closed untracked " + tableName + ", partition " + partition + " (ok on shutdown)"); } } }

Target:
public synchronized void onClosedSource(String tableName, int partition) { boolean removed = m_dataSourcesClosing.remove(tableName, partition); if (exportLog.isDebugEnabled()) { if (removed) { exportLog.debug("Closed " + tableName + ", partition " + partition); } else { exportLog.debug("Closed untracked " + tableName + ", partition " + partition + " (ok on shutdown)"); } } }
Source:
public void testDefaultAcl() throws Exception { Configuration config = new Configuration(); try (PrestoS3FileSystem fs = new PrestoS3FileSystem()) { MockAmazonS3 s3 = new MockAmazonS3(); String expectedBucketName = "test-bucket"; fs.initialize(new URI("s3n://" + expectedBucketName + "/"), config); fs.setS3Client(s3); FSDataOutputStream stream = fs.create(new Path("s3n://test-bucket/test")); stream.close(); assertEquals(CannedAccessControlList.Private, s3.getAcl()); } }

Target:
public void testDefaultAcl() throws Exception { Configuration config = new Configuration(); try (PrestoS3FileSystem fs = new PrestoS3FileSystem()) { MockAmazonS3 s3 = new MockAmazonS3(); String expectedBucketName = "test-bucket"; fs.initialize(new URI("s3n://" + expectedBucketName + "/"), config); fs.setS3Client(s3); try (FSDataOutputStream stream = fs.create(new Path("s3n://test-bucket/test"))) { } assertEquals(CannedAccessControlList.Private, s3.getAcl()); } }
Source:
private Guid getPrestartedVmToAttach(Guid vmPoolId) { VmPool vmPool = getVmPoolDao().get(vmPoolId); List<VmPoolMap> vmPoolMaps = getVmPoolDao().getVmMapsInVmPoolByVmPoolIdAndStatus(vmPoolId, VMStatus.Up); if (vmPoolMaps != null) { for (VmPoolMap map : vmPoolMaps) { if (canAttachPrestartedVmToUser(map.getVmId(), vmPool.isStateful(), getReturnValue().getValidationMessages())) { return map.getVmId(); } } } return Guid.Empty; }

Target:
private Guid getPrestartedVmToAttach(Guid vmPoolId) { List<VmPoolMap> vmPoolMaps = getVmPoolDao().getVmMapsInVmPoolByVmPoolIdAndStatus(vmPoolId, VMStatus.Up); if (vmPoolMaps != null) { for (VmPoolMap map : vmPoolMaps) { if (canAttachPrestartedVmToUser(map.getVmId(), getVmPool().isStateful(), getReturnValue().getValidationMessages())) { return map.getVmId(); } } } return Guid.Empty; }
Source:
public void testSimpleWritable() throws IOException { Range[] ranges = {new Range(new Key("a"), new Key("b"))}; BatchInputSplit split = new BatchInputSplit("table", Table.ID.of("1"), Arrays.asList(ranges), new String[] {"localhost"}); ByteArrayOutputStream baos = new ByteArrayOutputStream(); DataOutputStream dos = new DataOutputStream(baos); split.write(dos); BatchInputSplit newSplit = new BatchInputSplit(); ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); DataInputStream dis = new DataInputStream(bais); newSplit.readFields(dis); Assert.assertEquals(split.getTableName(), newSplit.getTableName()); Assert.assertEquals(split.getTableId(), newSplit.getTableId()); Assert.assertEquals(split.getRanges(), newSplit.getRanges()); Assert.assertTrue(Arrays.equals(split.getLocations(), newSplit.getLocations())); }

Target:
public void testSimpleWritable() throws IOException { List<Range> ranges = Collections.singletonList(new Range(new Key("a"), new Key("b"))); BatchInputSplit split = new BatchInputSplit("table", Table.ID.of("1"), ranges, new String[] {"localhost"}); ByteArrayOutputStream baos = new ByteArrayOutputStream(); DataOutputStream dos = new DataOutputStream(baos); split.write(dos); BatchInputSplit newSplit = new BatchInputSplit(); ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); DataInputStream dis = new DataInputStream(bais); newSplit.readFields(dis); Assert.assertEquals(split.getTableName(), newSplit.getTableName()); Assert.assertEquals(split.getTableId(), newSplit.getTableId()); Assert.assertEquals(split.getRanges(), newSplit.getRanges()); Assert.assertTrue(Arrays.equals(split.getLocations(), newSplit.getLocations())); }
Source:
public Properties getKafkaProducerProperties() { final Properties producerProps = (Properties) kafkaProperties.clone(); producerProps.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringSerializer"); producerProps.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringSerializer"); producerProps.put(ProducerConfig.ACKS_CONFIG, "all"); producerProps.put(ProducerConfig.REQUEST_TIMEOUT_MS_CONFIG, kafkaSettings.getRequestTimeoutMs()); producerProps.put(ProducerConfig.BATCH_SIZE_CONFIG, kafkaSettings.getBatchSize()); producerProps.put(ProducerConfig.LINGER_MS_CONFIG, kafkaSettings.getLingerMs()); producerProps.put(ProducerConfig.COMPRESSION_TYPE_CONFIG, "lz4"); producerProps.put(ProducerConfig.MAX_REQUEST_SIZE_CONFIG, kafkaSettings.getMaxRequestSize()); producerProps.put(ProducerConfig.DELIVERY_TIMEOUT_MS_CONFIG, kafkaSettings.getDeliveryTimeoutMs()); producerProps.put(ProducerConfig.RETRIES_CONFIG, 0); return producerProps; }

Target:
public Properties getKafkaProducerProperties() { final Properties producerProps = (Properties) kafkaProperties.clone(); producerProps.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringSerializer"); producerProps.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringSerializer"); producerProps.put(ProducerConfig.ACKS_CONFIG, "all"); producerProps.put(ProducerConfig.REQUEST_TIMEOUT_MS_CONFIG, kafkaSettings.getRequestTimeoutMs()); producerProps.put(ProducerConfig.BATCH_SIZE_CONFIG, kafkaSettings.getBatchSize()); producerProps.put(ProducerConfig.LINGER_MS_CONFIG, kafkaSettings.getLingerMs()); producerProps.put(ProducerConfig.COMPRESSION_TYPE_CONFIG, "lz4"); producerProps.put(ProducerConfig.MAX_REQUEST_SIZE_CONFIG, kafkaSettings.getMaxRequestSize()); producerProps.put(ProducerConfig.DELIVERY_TIMEOUT_MS_CONFIG, kafkaSettings.getDeliveryTimeoutMs()); producerProps.put(ProducerConfig.RETRIES_CONFIG, 0); producerProps.put(ProducerConfig.MAX_BLOCK_MS_CONFIG, kafkaSettings.getMaxBlockMs()); return producerProps; }
Source:
private static void printComputerSystem(final ComputerSystem computerSystem) { System.out.println("manufacturer: " + computerSystem.getManufacturer()); System.out.println("model: " + computerSystem.getModel()); System.out.println("serialnumber: " + computerSystem.getSerialNumber()); final Firmware firmware = computerSystem.getFirmware(); System.out.println("firmware:"); System.out.println(" manufacturer: " + firmware.getManufacturer()); System.out.println(" name: " + firmware.getName()); System.out.println(" description: " + firmware.getDescription()); System.out.println(" version: " + firmware.getVersion()); System.out.println(" release date: " + (firmware.getReleaseDate() == null ? "unknown" : firmware.getReleaseDate() == null ? "unknown" : firmware.getReleaseDate())); final Baseboard baseboard = computerSystem.getBaseboard(); System.out.println("baseboard:"); System.out.println(" manufacturer: " + baseboard.getManufacturer()); System.out.println(" model: " + baseboard.getModel()); System.out.println(" version: " + baseboard.getVersion()); System.out.println(" serialnumber: " + baseboard.getSerialNumber()); }

Target:
private static void printComputerSystem(final ComputerSystem computerSystem) { System.out.println("manufacturer: " + computerSystem.getManufacturer()); System.out.println("model: " + computerSystem.getModel()); System.out.println("serialnumber: " + computerSystem.getSerialNumber()); final Firmware firmware = computerSystem.getFirmware(); System.out.println("firmware:"); System.out.println(" manufacturer: " + firmware.getManufacturer()); System.out.println(" name: " + firmware.getName()); System.out.println(" description: " + firmware.getDescription()); System.out.println(" version: " + firmware.getVersion()); System.out.println(" release date: " + (firmware.getReleaseDate() == null ? "unknown" : firmware.getReleaseDate() == null ? "unknown" : firmware.getReleaseDate())); final Baseboard baseboard = computerSystem.getBaseboard(); System.out.println("baseboard:"); System.out.println(" manufacturer: " + baseboard.getManufacturer()); System.out.println(" model: " + baseboard.getModel()); System.out.println(" version: " + baseboard.getVersion()); System.out.println(" serialnumber: " + baseboard.getSerialNumber()); if (Util.identifyVM().length() > 0) { System.out.println("virtualization: " + Util.identifyVM()); } }
Source:
public ImmutableSet<Object> read(Kryo kryo, Input input, Class<ImmutableSet<Object>> type) { final int size = input.readInt(true); final Object[] set = new Object[size]; for (int i = 0; i < size; ++i) { set[i] = kryo.readClassAndObject(input); } return ImmutableSet.copyOf(set); }

Target:
public ImmutableSet<Object> read(Kryo kryo, Input input, Class<ImmutableSet<Object>> type) { final int size = input.readInt(true); ImmutableSet.Builder<Object> builder = ImmutableSet.builder(); for (int i = 0; i < size; ++i) { builder.add(kryo.readClassAndObject(input)); } return builder.build(); }
Source:
protected void autoLoad() { if (SessionContext.isLoggedIn() && (entryId != 0 || (className != null && classPK != 0))) { load(); } else { loadBlogsEntry(); } }

Target:
protected void autoLoad() { if (SessionContext.isLoggedIn() && (entryId != 0 || (className != null && classPK != 0))) { load(); } else if (blogsEntry != null) { loadBlogsEntry(); } }