auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void parseAndReact(@NonNull Activity activity, @NonNull JSONObject paramsJson) throws JSONException { logger.debug("DeepLink received. JSON Details:\n" + paramsJson); final Router router = new Router(); final boolean isLoggedIn = new LoginPrefs(activity).getUsername() != null; if (!isLoggedIn) { activity.startActivity(router.getLogInIntent()); } else { final String screenName = paramsJson.getString(KEY_SCREEN_NAME); switch (screenName) { case Screen.COURSE_DASHBOARD: final String courseId = paramsJson.getString(KEY_COURSE_ID); router.showCourseDashboardTabs(activity, null, courseId, false); break; } } }

Target:
public static void parseAndReact(@NonNull Activity activity, @NonNull JSONObject paramsJson) throws JSONException { logger.debug("DeepLink received. JSON Details:\n" + paramsJson); final Router router = new Router(); final boolean isLoggedIn = new LoginPrefs(activity).getUsername() != null; if (!isLoggedIn) { activity.startActivity(router.getLogInIntent()); } else { @ScreenDef final String screenName = paramsJson.getString(KEY_SCREEN_NAME); switch (screenName) { case Screen.COURSE_DASHBOARD: final String courseId = paramsJson.getString(KEY_COURSE_ID); router.showCourseDashboardTabs(activity, null, courseId, false); break; } } }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_edit_profile); mFlowParameters = mActivityHelper.getFlowParams(); Button signOut = (Button) findViewById(R.id.sign_out_button); signOut.setOnClickListener(new SignOutClickListener()); ImageView profilePicture = (ImageView) findViewById(R.id.profile_image); Uri profilePhoto = mActivityHelper.getCurrentUser().getPhotoUrl(); Glide.with(this) .load(profilePhoto) .placeholder(R.drawable.ic_person_white_48dp) .transform(new CircleTransform(getApplicationContext())) .into(profilePicture); mDisplayName = (TextView) findViewById(R.id.display_name); ImageButton editDisplayName = (ImageButton) findViewById(R.id.edit_display_name); mEmail = (TextView) findViewById(R.id.email); ImageButton editEmail = (ImageButton) findViewById(R.id.edit_email); editDisplayName.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startActivityForResult( EditDisplayNameActivity.createIntent( getApplicationContext(), mFlowParameters), RC_EDIT_DISPLAY_NAME); } }); editEmail.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startActivityForResult(getReauthIntent(), RC_REAUTH_EDIT_EMAIL); } }); Button changePassword = (Button) findViewById(R.id.change_password); changePassword.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startActivityForResult(getReauthIntent(), RC_REAUTH_PASSWORD); } }); populateView(); }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_edit_profile); mFlowParameters = mActivityHelper.getFlowParams(); Button signOut = (Button) findViewById(R.id.sign_out_button); signOut.setOnClickListener(new SignOutClickListener()); ImageView profilePicture = (ImageView) findViewById(R.id.profile_image); Uri profilePhoto = mActivityHelper.getCurrentUser().getPhotoUrl(); if (profilePhoto != null) { Glide.with(this) .load(profilePhoto) .placeholder(R.drawable.ic_person_white_48dp) .transform(new CircleTransform(getApplicationContext())) .into(profilePicture); } mDisplayName = (TextView) findViewById(R.id.display_name); ImageButton editDisplayName = (ImageButton) findViewById(R.id.edit_display_name); mEmail = (TextView) findViewById(R.id.email); ImageButton editEmail = (ImageButton) findViewById(R.id.edit_email); editDisplayName.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startActivityForResult( EditDisplayNameActivity.createIntent( getApplicationContext(), mFlowParameters), RC_EDIT_DISPLAY_NAME); } }); editEmail.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startActivityForResult( getReauthIntent(ReauthActivity.REAUTAH_REASON_ADD_EMAIL), RC_REAUTH_EDIT_EMAIL); } }); Button changePassword = (Button) findViewById(R.id.change_password); changePassword.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startActivityForResult( getReauthIntent(ReauthActivity.REAUTAH_REASON_CHANGE_PASSWORD), RC_REAUTH_PASSWORD); } }); populateView(); }
Source:
private void applyService(ObjectEnhancementService service) throws EnhancementException { int backoffAttempts = 1; while (true) { LOG.info("Applying service to object {}", service.getClass().getName(), message.getTargetID()); long retryDelay; try { fedoraManagementClient.waitForRepositoryAvailable(); service.getEnhancement(message).call(); message.getCompletedServices().add(service.getClass().getName()); break; } catch (EnhancementException e) { if (backoffAttempts < MAX_RETRIES && e.getSeverity() == Severity.RECOVERABLE) { LOG.warn("Retrying service for recoverable exception {}, attempt {}: {}: ", new Object[] { service.getClass().getName(), backoffAttempts }, e); retryDelay = recoverableDelay; } else { throw e; } } catch (ServiceException e) { if (backoffAttempts < MAX_RETRIES && e.getCause() instanceof WebServiceIOException) { LOG.warn("Failed to persist changes for service {}, attempt {}", new Object[] { service.getClass().getName(), backoffAttempts }, e); retryDelay = BACKOFF_DELAY * backoffAttempts; } else { throw e; } } backoffAttempts++; message.setFoxml(null); try { Thread.sleep(retryDelay); } catch (InterruptedException e1) { LOG.warn("Thread interrupted while waiting to reattempt job {}", service.getClass().getName()); Thread.currentThread().interrupt(); break; } } }

Target:
private void applyService(ObjectEnhancementService service) throws EnhancementException { int backoffAttempts = 1; while (true) { LOG.info("Applying service to object {}", service.getClass().getName(), message.getTargetID()); long retryDelay; try { fedoraManagementClient.waitForRepositoryAvailable(); service.getEnhancement(message).call(); message.getCompletedServices().add(service.getClass().getName()); break; } catch (EnhancementException e) { if (backoffAttempts < MAX_RETRIES && e.getSeverity() == Severity.RECOVERABLE) { LOG.warn("Retrying service for recoverable exception {}, attempt {}.", new Object[] { service.getClass().getName(), backoffAttempts }, e); retryDelay = recoverableDelay; } else { throw e; } } catch (ServiceException e) { if (backoffAttempts < MAX_RETRIES && e.getCause() instanceof WebServiceIOException) { LOG.warn("Failed to persist changes for service {}, attempt {}", new Object[] { service.getClass().getName(), backoffAttempts }, e); retryDelay = BACKOFF_DELAY * backoffAttempts; } else { throw e; } } backoffAttempts++; message.setFoxml(null); try { Thread.sleep(retryDelay); } catch (InterruptedException e1) { LOG.warn("Thread interrupted while waiting to reattempt job {}", service.getClass().getName()); Thread.currentThread().interrupt(); break; } } }
Source:
public void signalReady() { ((FileSystemDataset<E>)dataset).signalReady(getConstraints()); }

Target:
public void signalReady() { if (signalManager != null) { signalManager.signalReady(getConstraints()); } }
Source:
public IngredientRecipe(String name, int attributes, Boolean swapped, List<IngredientRecipe> contents) { this.name = name; this.setAttributes(attributes); this.contents = contents; this.traits = new TreeSet<String>(); this.swapped = swapped; this.necessaryTraits = new HashMap<String, IngredientRecipe>(); this.useCount = 1; this.toolTraits = new TreeSet<String>(); this.toolAttributes = new TreeSet<String>(); }

Target:
public IngredientRecipe(String name, int attributes, Boolean swapped, List<IngredientRecipe> contents) { this.name = name; this.setAttributes(attributes); this.contents = contents; this.swapped = swapped; this.useCount = 1; this.traits = new HashSet<String>(); this.necessaryTraits = new HashMap<String, IngredientRecipe>(); this.toolTraits = new HashSet<String>(); this.toolAttributes = new HashSet<String>(); this.recipeToolAttributes = new HashSet<String>(); }
Source:
public synchronized void runAll() { String cronExecutingUser = (String) getConfig().get("cronExecutingUser"); if (null == cronExecutingUser) { cronExecutingUser = "anonymous"; } AuthenticationInfo authenticationInfo = new AuthenticationInfo(); authenticationInfo.setUser(cronExecutingUser); runAll(authenticationInfo, true); }

Target:
public synchronized void runAll() { String cronExecutingUser = (String) getConfig().get("cronExecutingUser"); String cronExecutingRoles = (String) getConfig().get("cronExecutingRoles"); if (null == cronExecutingUser) { cronExecutingUser = "anonymous"; } AuthenticationInfo authenticationInfo = new AuthenticationInfo( cronExecutingUser, StringUtils.isEmpty(cronExecutingRoles) ? null : cronExecutingRoles, null); runAll(authenticationInfo, true); }
Source:
public Object apply(MemberResource resource, PutMember.Input input) throws AuthException, MethodNotAllowedException, BadRequestException, OrmException { return Response.none(); }

Target:
public Object apply(MemberResource resource, PutMember.Input input) { return get.get().apply(resource); }
Source:
private ObjectNode processTProperties(Properties cProperties, String formName) { ObjectNode schema = JsonNodeFactory.instance.objectNode(); Form form = cProperties.getPreferredForm(formName); if (form != null) { schema.put(JsonSchemaConstants.TAG_TITLE, form.getTitle()); } schema.put(JsonSchemaConstants.TAG_TYPE, JsonSchemaConstants.TYPE_OBJECT); schema.putObject(JsonSchemaConstants.TAG_PROPERTIES); List<Property> propertyList = getSubProperty(cProperties); for (Property property : propertyList) { String name = property.getName(); if (property.isRequired()) { addToRequired(schema, name); } ((ObjectNode) schema.get(JsonSchemaConstants.TAG_PROPERTIES)).set(name, processTProperty(property)); } List<Properties> propertiesList = getSubProperties(cProperties); for (Properties properties : propertiesList) { String name = properties.getName(); if (properties instanceof ReferenceProperties<?>) { ReferenceProperties<?> referenceProperties = (ReferenceProperties<?>) properties; ((ObjectNode) schema.get(JsonSchemaConstants.TAG_PROPERTIES)).set(name, processReferenceProperties(referenceProperties)); } else { ((ObjectNode) schema.get(JsonSchemaConstants.TAG_PROPERTIES)).set(name, processTProperties(properties, formName)); } } return schema; }

Target:
private ObjectNode processTProperties(Properties cProperties, String formName) { ObjectNode schema = JsonNodeFactory.instance.objectNode(); Form form = null; if (formName != null) { form = cProperties.getPreferredForm(formName); } if (form != null) { schema.put(JsonSchemaConstants.TAG_TITLE, form.getTitle()); } schema.put(JsonSchemaConstants.TAG_TYPE, JsonSchemaConstants.TYPE_OBJECT); schema.putObject(JsonSchemaConstants.TAG_PROPERTIES); List<Property> propertyList = getSubProperty(cProperties); for (Property property : propertyList) { String name = property.getName(); if (property.isRequired()) { addToRequired(schema, name); } ((ObjectNode) schema.get(JsonSchemaConstants.TAG_PROPERTIES)).set(name, processTProperty(property)); } List<Properties> propertiesList = getSubProperties(cProperties); for (Properties properties : propertiesList) { String name = properties.getName(); if (properties instanceof ReferenceProperties<?>) { ReferenceProperties<?> referenceProperties = (ReferenceProperties<?>) properties; ((ObjectNode) schema.get(JsonSchemaConstants.TAG_PROPERTIES)).set(name, processReferenceProperties(referenceProperties)); } else { ((ObjectNode) schema.get(JsonSchemaConstants.TAG_PROPERTIES)).set(name, processTProperties(properties, formName)); } } return schema; }
Source:
private int runMove(final String srcId, final String destId) { final CountDownLatch finishedLatch = new CountDownLatch(1); final int initialSrcNumBlocks = getNumBlocks(srcId); final int initialDestNumBlocks = getNumBlocks(destId); final int numToMove = Math.max(1, RANDOM.nextInt(initialSrcNumBlocks)); LOG.log(Level.INFO, "Move {0} blocks from {1} to {2} (Initial number of blocks: {3} / {4} respectively)", new Object[]{numToMove, srcId, destId, initialSrcNumBlocks, initialDestNumBlocks}); final boolean[] moveSucceeded = {false}; final TraceScope moveTraceScope = Trace.startSpan(String.format("SimpleMove. srcId: %s, dstId: %s", srcId, destId), Sampler.ALWAYS); elasticMemory.move(numToMove, srcId, destId, new EventHandler<AvroElasticMemoryMessage>() { @Override public void onNext(final AvroElasticMemoryMessage emMsg) { moveSucceeded[0] = emMsg.getResultMsg().getResult().equals(Result.SUCCESS); LOG.log(Level.INFO, "Was Move {0} successful? {1}. The result: {2}", new Object[]{emMsg.getOperationId(), moveSucceeded[0], emMsg.getResultMsg() == null ? "" : emMsg.getResultMsg().getResult()}); finishedLatch.countDown(); moveTraceScope.close(); } } ); try { LOG.log(Level.INFO, "Waiting for move to finish"); finishedLatch.await(); checkNumBlocks(srcId, initialSrcNumBlocks - numToMove); checkNumBlocks(destId, initialDestNumBlocks + numToMove); if (moveSucceeded[0]) { LOG.log(Level.INFO, "Move finished successfully"); } else { throw new RuntimeException("Move failed"); } } catch (final InterruptedException e) { throw new RuntimeException("Interrupted while waiting Move", e); } return numToMove; }

Target:
private int runMove(final String srcId, final String destId) { final CountDownLatch finishedLatch = new CountDownLatch(1); final int initialSrcNumBlocks = getNumBlocks(srcId); final int initialDestNumBlocks = getNumBlocks(destId); final int numToMove = Math.max(1, RANDOM.nextInt(initialSrcNumBlocks)); LOG.log(Level.INFO, "Move {0} blocks from {1} to {2} (Initial number of blocks: {3} / {4} respectively)", new Object[]{numToMove, srcId, destId, initialSrcNumBlocks, initialDestNumBlocks}); final boolean[] moveSucceeded = {false}; elasticMemory.move(numToMove, srcId, destId, new EventHandler<AvroElasticMemoryMessage>() { @Override public void onNext(final AvroElasticMemoryMessage emMsg) { moveSucceeded[0] = emMsg.getResultMsg().getResult().equals(Result.SUCCESS); LOG.log(Level.INFO, "Was Move {0} successful? {1}. The result: {2}", new Object[]{emMsg.getOperationId(), moveSucceeded[0], emMsg.getResultMsg() == null ? "" : emMsg.getResultMsg().getResult()}); finishedLatch.countDown(); } } ); try { LOG.log(Level.INFO, "Waiting for move to finish"); finishedLatch.await(); checkNumBlocks(srcId, initialSrcNumBlocks - numToMove); checkNumBlocks(destId, initialDestNumBlocks + numToMove); if (moveSucceeded[0]) { LOG.log(Level.INFO, "Move finished successfully"); } else { throw new RuntimeException("Move failed"); } } catch (final InterruptedException e) { throw new RuntimeException("Interrupted while waiting Move", e); } return numToMove; }
Source:
public static FixedDoubleHistogram deserialize(SliceInput input) { int bucketCount = input.readInt(); double min = input.readDouble(); double max = input.readDouble(); verifyParameters(bucketCount, min, max); double[] weights = new double[bucketCount]; input.readBytes( Slices.wrappedDoubleArray(weights), bucketCount * SizeOf.SIZE_OF_DOUBLE); return new FixedDoubleHistogram(bucketCount, min, max, weights); }

Target:
public static FixedDoubleHistogram deserialize(SliceInput input) { int bucketCount = input.readInt(); double min = input.readDouble(); double max = input.readDouble(); validateParameters(bucketCount, min, max); double[] weights = new double[bucketCount]; input.readBytes(Slices.wrappedDoubleArray(weights), bucketCount * SizeOf.SIZE_OF_DOUBLE); return new FixedDoubleHistogram(bucketCount, min, max, weights); }
Source:
protected void doCreateOrUpdate(WorkspaceExpiration expiration) { final EntityManager manager = managerProvider.get(); if (manager.find(WorkspaceExpiration.class, expiration.getWorkspaceId()) == null) { manager.persist(expiration); } else { manager.merge(expiration); manager.flush(); } }

Target:
protected void doCreateOrUpdate(WorkspaceExpiration expiration) { final EntityManager manager = managerProvider.get(); if (manager.find(WorkspaceExpiration.class, expiration.getWorkspaceId()) == null) { manager.persist(expiration); } else { manager.merge(expiration); } manager.flush(); }
Source:
public int hashCode() { int hash = LangUtils.HASH_SEED; hash = LangUtils.hashCode(hash, this.convert(TimeUnit.NANOSECONDS)); hash = LangUtils.hashCode(hash, TimeUnit.NANOSECONDS); return hash; }

Target:
public int hashCode() { int hash = LangUtils.HASH_SEED; hash = LangUtils.hashCode(hash, this.convert(TimeUnit.NANOSECONDS)); return hash; }
Source:
public void testPublishPost() { String title = "Title"; String content = "Content"; wpLogin(); MasterbarComponent mb = new MasterbarComponent().goToMySitesTab(); sleep(); mb.clickBlogPosts(); new MySitesPage() .startNewPost(E2E_DEFAULT_USER_SITE_ADDRESS); new EditorPage() .enterTitle(title) .enterContent(content) .publishPost(); sleep(10000); new SnackbarComponent() .verifyPostPublished(); }

Target:
public void testPublishPost() { String title = "Title"; String content = "Content"; wpLogin(); MasterbarComponent mb = new MasterbarComponent().goToMySitesTab(); sleep(); mb.clickBlogPosts(); new MySitesPage() .startNewPost(E2E_WP_COM_USER_SITE_ADDRESS); boolean isPublished = new EditorPage() .enterTitle(title) .enterContent(content) .publishPost(); assertTrue(isPublished); }
Source:
private CompletableFuture<PhysicalSlotRequest.Result> allocatePhysicalSlot( final PhysicalSlotRequest physicalSlotRequest) { final SlotRequestId slotRequestId = physicalSlotRequest.getSlotRequestId(); final SlotProfile slotProfile = physicalSlotRequest.getSlotProfile(); final ResourceProfile resourceProfile = slotProfile.getPhysicalSlotResourceProfile(); LOG.debug("Received slot request with resource requirements: {}", slotRequestId, resourceProfile); final Optional<PhysicalSlot> availablePhysicalSlot = tryAllocateFromAvailable(slotRequestId, slotProfile); final CompletableFuture<PhysicalSlot> slotFuture; if (availablePhysicalSlot.isPresent()) { slotFuture = CompletableFuture.completedFuture(availablePhysicalSlot.get()); } else if (physicalSlotRequest.willSlotBeOccupiedIndefinitely()) { slotFuture = slotPool.requestNewAllocatedSlot( slotRequestId, resourceProfile, null); } else { slotFuture = slotPool.requestNewAllocatedBatchSlot( slotRequestId, resourceProfile); } return slotFuture.thenApply(physicalSlot -> new PhysicalSlotRequest.Result(slotRequestId, physicalSlot)); }

Target:
private CompletableFuture<PhysicalSlotRequest.Result> allocatePhysicalSlot( final PhysicalSlotRequest physicalSlotRequest) { final SlotRequestId slotRequestId = physicalSlotRequest.getSlotRequestId(); final SlotProfile slotProfile = physicalSlotRequest.getSlotProfile(); final ResourceProfile resourceProfile = slotProfile.getPhysicalSlotResourceProfile(); LOG.debug("Received slot request with resource requirements: {}", slotRequestId, resourceProfile); final Optional<PhysicalSlot> availablePhysicalSlot = tryAllocateFromAvailable(slotRequestId, slotProfile); final CompletableFuture<PhysicalSlot> slotFuture; if (availablePhysicalSlot.isPresent()) { slotFuture = CompletableFuture.completedFuture(availablePhysicalSlot.get()); } else { slotFuture = requestNewSlot( slotRequestId, resourceProfile, physicalSlotRequest.willSlotBeOccupiedIndefinitely()); } return slotFuture.thenApply(physicalSlot -> new PhysicalSlotRequest.Result(slotRequestId, physicalSlot)); }
Source:
public ValueRange range(ChronoField field) { switch (field) { case ALIGNED_WEEK_OF_MONTH: return alignedWeekOfMonthRange; case DAY_OF_MONTH: return dayOfMonthRange; case DAY_OF_YEAR: return DAY_OF_YEAR_RANGE; case MONTH_OF_YEAR: return division.getMonthsInYearRange(); case PROLEPTIC_MONTH: return division == THIRTEEN_EVEN_MONTHS_OF_4_WEEKS ? PROLEPTIC_MONTH_RANGE_13 : PROLEPTIC_MONTH_RANGE_12; default: break; } return field.range(); }

Target:
public ValueRange range(ChronoField field) { switch (field) { case ALIGNED_WEEK_OF_MONTH: return alignedWeekOfMonthRange; case ALIGNED_WEEK_OF_YEAR: return ALIGNED_WEEK_OF_YEAR_RANGE; case DAY_OF_MONTH: return dayOfMonthRange; case DAY_OF_YEAR: return DAY_OF_YEAR_RANGE; case MONTH_OF_YEAR: return division.getMonthsInYearRange(); case PROLEPTIC_MONTH: return division == THIRTEEN_EVEN_MONTHS_OF_4_WEEKS ? PROLEPTIC_MONTH_RANGE_13 : PROLEPTIC_MONTH_RANGE_12; default: break; } return field.range(); }
Source:
public CompletableFuture<Void> deleteTableSnapshots(Pattern tableNamePattern) { throw new UnsupportedOperationException("please use deleteSnapshot"); }

Target:
public CompletableFuture<Void> deleteTableSnapshots(Pattern tableNamePattern) { throw new UnsupportedOperationException("use deleteSnapshot instead"); }
Source:
private CompositeJobParametersValidator compositeJobParametersValidator() { final List<JobParametersValidator> jobParametersValidators = Arrays.asList( new ConfigRestartabilityAllowValidator(), new DbCollectionsVariantsNameValidator(), new DbNameValidator(), new InputStudyIdValidator(), new InputVcfIdValidator(), new OutputDirAnnotationValidator() ); CompositeJobParametersValidator compositeJobParametersValidator = new CompositeJobParametersValidator(); compositeJobParametersValidator.setValidators(jobParametersValidators); return compositeJobParametersValidator; }

Target:
private CompositeJobParametersValidator compositeJobParametersValidator() { final List<JobParametersValidator> jobParametersValidators = Arrays.asList( new OptionalValidator(new ConfigRestartabilityAllowValidator(), JobParametersNames.CONFIG_RESTARTABILITY_ALLOW), new DbCollectionsVariantsNameValidator(), new DbNameValidator(), new InputStudyIdValidator(), new InputVcfIdValidator(), new OutputDirAnnotationValidator() ); CompositeJobParametersValidator compositeJobParametersValidator = new CompositeJobParametersValidator(); compositeJobParametersValidator.setValidators(jobParametersValidators); return compositeJobParametersValidator; }
Source:
public void stopServices() throws ConflictException { if (!statusRef.compareAndSet(RUNNING, PREPARING_TO_SHUTDOWN)) { throw new ConflictException("System shutdown has been already called, system status: " + statusRef.get()); } ExecutorService exec = Executors.newSingleThreadExecutor( new ThreadFactoryBuilder().setDaemon(false) .setNameFormat("ShutdownSystemServicesPool-%s") .setUncaughtExceptionHandler(LoggingUncaughtExceptionHandler.getInstance()) .build()); exec.execute(ThreadLocalPropagateContext.wrap(this::doStopServices)); exec.shutdown(); }

Target:
public void stopServices() throws ConflictException { if (!statusRef.compareAndSet(RUNNING, PREPARING_TO_SHUTDOWN)) { throw new ConflictException("System shutdown has been already called, system status: " + statusRef.get()); } ExecutorService exec = Executors.newSingleThreadExecutor( new ThreadFactoryBuilder().setDaemon(false) .setNameFormat("ShutdownSystemServicesPool") .setUncaughtExceptionHandler(LoggingUncaughtExceptionHandler.getInstance()) .build()); exec.execute(ThreadLocalPropagateContext.wrap(this::doStopServices)); exec.shutdown(); }
Source:
public HostBricksListModel() { setTitle(ConstantsManager.getInstance().getConstants().hostBricksTitle()); setHashName("host_bricks"); setAvailableInModes(ApplicationMode.GlusterOnly); }

Target:
public HostBricksListModel() { setTitle(ConstantsManager.getInstance().getConstants().hostBricksTitle()); setHashName("gluster_bricks"); setAvailableInModes(ApplicationMode.GlusterOnly); }
Source:
public void analyze(Document doc, StreamSource src, Writer xrefOut) throws IOException { StringBuilder fout = new StringBuilder(); try (ZipInputStream zis = new ZipInputStream(src.getStream())) { ZipEntry entry; while ((entry = zis.getNextEntry()) != null) { String ename = entry.getName(); if (xrefOut != null) { xrefOut.append("<br/><b>"); Util.htmlize(ename, xrefOut); xrefOut.append("</b>"); } useExtantValue(fout, doc, QueryBuilder.FULL); fout.append(" fout.append(ename); fout.append("\n"); String fstr = fout.toString(); doc.add(new TextField(QueryBuilder.FULL, fstr, Store.YES)); fout.setLength(0); FileAnalyzerFactory fac = AnalyzerGuru.find(ename); if (fac instanceof JavaClassAnalyzerFactory) { if (xrefOut != null) { xrefOut.append("<br/>"); } JavaClassAnalyzer jca = (JavaClassAnalyzer) fac.getAnalyzer(); jca.analyze(doc, new BufferedInputStream(zis), xrefOut,ename); } } } }

Target:
public void analyze(Document doc, StreamSource src, Writer xrefOut) throws IOException { StringBuilder fout = new StringBuilder(); try (ZipInputStream zis = new ZipInputStream(src.getStream())) { ZipEntry entry; while ((entry = zis.getNextEntry()) != null) { String ename = entry.getName(); if (xrefOut != null) { xrefOut.append("<br/><b>"); Util.htmlize(ename, xrefOut); xrefOut.append("</b>"); } useExtantValue(fout, doc, QueryBuilder.FULL); fout.append(" fout.append(ename); fout.append("\n"); String fstr = fout.toString(); doc.add(new TextField(QueryBuilder.FULL, fstr, Store.YES)); fout.setLength(0); FileAnalyzerFactory fac = AnalyzerGuru.find(ename); if (fac instanceof JavaClassAnalyzerFactory) { if (xrefOut != null) { xrefOut.append("<br/>"); } JavaClassAnalyzer jca = (JavaClassAnalyzer) fac.getAnalyzer(); jca.analyze(doc, new BufferedInputStream(zis), xrefOut); } } } }
Source:
protected void configureTitleAndSidePanel() { if (!ForumController.get().hasForums()) return ; if (selectedForumId != null) selectedForum = ForumController.get().getForumById(selectedForumId); else { selectedForum = ForumController.get().getFirstForum(); selectedForumId = selectedForum.id; TopicController.get().getTopics(selectedForumId); } forumSummarySidePanel.selectItem(selectedForum); if (selectedForum != null) { titleText.setInnerText(selectedForum.title); } forumSummarySidePanel.redraw(); }

Target:
protected void configureTitleAndSidePanel() { if (ForumController.get().hasForums()) { if (selectedForumId != null) { selectedForum = ForumController.get().getForumById(selectedForumId); } else { selectedForum = ForumController.get().getFirstForum(); selectedForumId = selectedForum.id; TopicController.get().getTopics(selectedForumId); } forumSummarySidePanel.selectItem(selectedForum); if (selectedForum != null) { titleText.setInnerText(selectedForum.title); } forumSummarySidePanel.redraw(); } }
Source:
public void elasticsearchDefaultTest() throws IOException { container = new ElasticsearchContainer(); container.start(); Response response = getClient(container).performRequest(new Request("GET", "/")); assertThat(response.getStatusLine().getStatusCode(), is(200)); assertThat(EntityUtils.toString(response.getEntity()), containsString("6.4.1")); response = getClient(container).performRequest(new Request("GET", "/_xpack/")); assertThat(response.getStatusLine().getStatusCode(), is(200)); assertThat(EntityUtils.toString(response.getEntity()), containsString("monitoring")); }

Target:
public void elasticsearchDefaultTest() throws IOException { try (ElasticsearchContainer container = new ElasticsearchContainer()){ container.start(); Response response = getClient(container).performRequest(new Request("GET", "/")); assertThat(response.getStatusLine().getStatusCode(), is(200)); assertThat(EntityUtils.toString(response.getEntity()), containsString(ELASTICSEARCH_DEFAULT_VERSION)); response = getClient(container).performRequest(new Request("GET", "/_xpack/")); assertThat(response.getStatusLine().getStatusCode(), is(200)); assertThat(EntityUtils.toString(response.getEntity()), containsString("monitoring")); } }
Source:
public ByteBuffer newByteBuffer(byte[] b, int offset, int length) { return b == null || b.length == 0 || length == 0 ? ByteBufferImpl.EMPTY_INSTANCE : new ByteBufferImpl(b, offset, length); }

Target:
public ByteBuffer newByteBuffer(byte[] b, int offset, int length) { return ByteBufferImpl.create(b, offset, length); }
Source:
@Test public void getDeletedDateOf_returnsDeletedDate() { FormMapViewModel viewModel = new FormMapViewModel(TEST_FORM_1, testInstancesRepository); assertThat(viewModel.getDeletedDateOf(0L), is(1487782554846L)); }

Target:
@Test public void getDeletedDateOf_returnsDeletedDate() { FormMapViewModel viewModel = new FormMapViewModel(TEST_FORM_1, testInstancesRepository); assertThat(viewModel.getDeletedDateOf(0L), is(testInstances[0].getDeletedDate())); }
Source:
public int getViewTypeCount() { return 4; }

Target:
public int getViewTypeCount() { return SectionRow.NUM_OF_SECTION_ROWS; }
Source:
protected void executeQueryCommand() { List<OvfEntityData> entityList = unregisteredOVFDataDao.getByEntityIdAndStorageDomain(getParameters().getEntityId(), getParameters().getStorageDomainId()); VmTemplate vmTemplate = null; if (!entityList.isEmpty()) { OvfEntityData ovfEntityData = entityList.get(0); try { vmTemplate = ovfHelper.readVmTemplateFromOvf(ovfEntityData.getOvfData()).getVmTemplate(); } catch (OvfReaderException e) { log.debug("Failed to parse a given ovf configuration: \n" + ovfEntityData.getOvfData(), e); getQueryReturnValue().setExceptionString("Failed to parse a given ovf configuration: " + e.getMessage()); } } getQueryReturnValue().setSucceeded(true); getQueryReturnValue().setReturnValue(vmTemplate); }

Target:
protected void executeQueryCommand() { List<OvfEntityData> entityList = unregisteredOVFDataDao.getByEntityIdAndStorageDomain(getParameters().getEntityId(), getParameters().getStorageDomainId()); VmTemplate vmTemplate = null; if (!entityList.isEmpty()) { OvfEntityData ovfEntityData = entityList.get(0); try { vmTemplate = ovfHelper.readVmTemplateFromOvf(ovfEntityData.getOvfData()).getVmTemplate(); } catch (OvfReaderException e) { log.debug("Failed to parse a given ovf configuration: \n" + ovfEntityData.getOvfData(), e); getQueryReturnValue().setExceptionString("Failed to parse a given ovf configuration: " + e.getMessage()); } } getQueryReturnValue().setReturnValue(vmTemplate); }
Source:
public @Nonnull String getLabel() { try { return Messages.class.getMethod("ManagementLink_Category_" + this.toString()).invoke(null).toString(); } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e) { return Messages.ManagementLink_Category_UNCATEGORIZED(); } }

Target:
public @Nonnull String getLabel() { return label.toString(); }
Source:
public Node removeNode(SimpleUri nodeUri) { Preconditions.checkNotNull(nodeUri, "nodeUri cannot be null!"); Node node = findNode(nodeUri); if (!graph.nodes().contains(node)) { throw new RuntimeException("The node you specified is not present in the graph!"); } if (graph.adjacentNodes(node).size() != 0) { throw new RuntimeException("The node you are trying to remove is still connected to other nodes in the graph!"); } nodeMap.remove(nodeUri); return nodeMap.remove(nodeUri); }

Target:
public Node removeNode(SimpleUri nodeUri) { Preconditions.checkNotNull(nodeUri, "nodeUri cannot be null!"); Node node = findNode(nodeUri); if (node == null) { throw new RuntimeException("Node removal failure: there is no '" + nodeUri + "' in the render graph!"); } if (graph.adjacentNodes(node).size() != 0) { throw new RuntimeException("Node removal failure: node '" + nodeUri + "' is still connected to other nodes in the render graph!"); } nodeMap.remove(nodeUri); return nodeMap.remove(nodeUri); }
Source:
public LifecycleForkJoinPoolProvider getMergeProcessingPoolProvider(DruidProcessingConfig config) { return new LifecycleForkJoinPoolProvider( config.getNumThreadsMergePool(), ForkJoinPool.defaultForkJoinWorkerThreadFactory, null, true, config.getMergePoolAwaitShutdownMillis() ); }

Target:
public LifecycleForkJoinPoolProvider getMergeProcessingPoolProvider(DruidProcessingConfig config) { return new LifecycleForkJoinPoolProvider( config.getMergePoolParallelism(), ForkJoinPool.defaultForkJoinWorkerThreadFactory, (t, e) -> log.error(e, "Unhandled exception in thread [%s]", t), true, config.getMergePoolAwaitShutdownMillis() ); }
Source:
protected HttpCalloutOutcomes doTaskBackground(Object... params) { HttpCalloutOutcomes preHttpOutcome = doSetupTaskBeforeRequest(); if (preHttpOutcome != null) { return preHttpOutcome; } boolean calloutFailed = false; if (shouldMakeHttpCallout()) { HttpCalloutOutcomes outcome; try { Response response = doHttpRequest(); int responseCode = response.code(); if (responseCode >= 200 && responseCode < 300) { outcome = doResponseSuccess(response); } else if (responseCode == 401) { outcome = doResponseAuthFailed(response); } else { outcome = doResponseOther(response); } } catch (UnknownHostException e) { outcome = HttpCalloutOutcomes.NetworkFailure; } catch (SSLPeerUnverifiedException e) { outcome = HttpCalloutOutcomes.BadCertificate; } catch (IOException e) { e.printStackTrace(); outcome = HttpCalloutOutcomes.NetworkFailure; } if (outcome != HttpCalloutOutcomes.Success) { if (calloutSuccessRequired()) { return outcome; } else { calloutFailed = true; } } else { if (!processSuccessfulRequest()) { return HttpCalloutOutcomes.BadResponse; } } } return doPostCalloutTask(calloutFailed); }

Target:
protected HttpCalloutOutcomes doTaskBackground(Object... params) { HttpCalloutOutcomes preHttpOutcome = doSetupTaskBeforeRequest(); if (preHttpOutcome != null) { return preHttpOutcome; } boolean calloutFailed = false; if (shouldMakeHttpCallout()) { HttpCalloutOutcomes outcome; try { Response response = doHttpRequest(); int responseCode = response.code(); if (responseCode >= 200 && responseCode < 300) { outcome = doResponseSuccess(response); } else if (responseCode == 401) { outcome = doResponseAuthFailed(response); } else { outcome = doResponseOther(response); } } catch (UnknownHostException e) { outcome = HttpCalloutOutcomes.NetworkFailure; } catch (SSLPeerUnverifiedException e) { outcome = HttpCalloutOutcomes.BadCertificate; } catch (AuthenticationInterceptor.PlainTextPasswordException e) { e.printStackTrace(); outcome = HttpCalloutOutcomes.AuthOverHttp; } catch (IOException e) { e.printStackTrace(); outcome = HttpCalloutOutcomes.NetworkFailure; } if (outcome != HttpCalloutOutcomes.Success) { if (calloutSuccessRequired()) { return outcome; } else { calloutFailed = true; } } else { if (!processSuccessfulRequest()) { return HttpCalloutOutcomes.BadResponse; } } } return doPostCalloutTask(calloutFailed); }
Source:
public void weave(WovenClass wovenClass) { String className = wovenClass.getClassName(); if (className.equals("org.openengsb.core.api.model.annotation.Model") || className.contains("javassist") || className.contains("JavassistUtils")) { return; } try { LOGGER.debug("try to enhance {}", className); byte[] result = doActualWeaving(wovenClass.getBytes(), wovenClass.getBundleWiring().getClassLoader()); if (result != null) { wovenClass.getDynamicImports().add("org.openengsb.core.api.model"); wovenClass.setBytes(result); } LOGGER.debug("finished enhancing {}", className); } catch (IOException e) { e.printStackTrace(); } catch (CannotCompileException e) { e.printStackTrace(); } }

Target:
public void weave(WovenClass wovenClass) { String className = wovenClass.getClassName(); if (className.equals("org.openengsb.core.api.model.annotation.Model") || className.contains("javassist") || className.contains("JavassistUtils")) { return; } try { LOGGER.trace("try to enhance {}", className); byte[] result = doActualWeaving(wovenClass.getBytes(), wovenClass.getBundleWiring().getClassLoader()); if (result != null) { wovenClass.getDynamicImports().add("org.openengsb.core.api.model"); wovenClass.setBytes(result); } LOGGER.trace("finished enhancing {}", className); } catch (IOException e) { LOGGER.error("IOException while trying to enhance model {}", className, e); } catch (CannotCompileException e) { LOGGER.error("CannotCompileException while trying to enhance model {}", className, e); } }
Source:
public int generateDataAccessor(final long classid, final String classname, final int probecount, final MethodVisitor mv) { if (instrumented.size() == Companions.FIELDS_PER_CLASS) { throw new UnsupportedOperationException(); } final String fieldName = "p" + Long.toString(classid); if (instrumented.add(classname)) { cw.visitField( Opcodes.ACC_PUBLIC | Opcodes.ACC_STATIC | Opcodes.ACC_TRANSIENT | Opcodes.ACC_FINAL, fieldName, InstrSupport.DATAFIELD_DESC, null, null); generator.generateDataAccessor(classid, classname, probecount, this.mv); this.mv.visitFieldInsn(Opcodes.PUTSTATIC, companionName, fieldName, InstrSupport.DATAFIELD_DESC); } mv.visitFieldInsn(Opcodes.GETSTATIC, companionName, fieldName, InstrSupport.DATAFIELD_DESC); return 1; }

Target:
public int generateDataAccessor(final long classid, final String classname, final int probecount, final MethodVisitor mv) { if (instrumented.size() == Companions.FIELDS_PER_CLASS) { classFileWriter.write(getClassName(), getClassDefinition()); newCompanion(); } final String fieldName = fieldNameFor(classid); if (instrumented.add(classname)) { gen(classid, classname, probecount, fieldName); } mv.visitMethodInsn(Opcodes.INVOKESTATIC, companionName, fieldName, InstrSupport.INITMETHOD_DESC, false); return 1; }
Source:
MultiUserCasesDialog() { super(WindowManager.getDefault().getMainWindow(), REVIEW_MODE_TITLE, Dialog.ModalityType.APPLICATION_MODAL); getRootPane().registerKeyboardAction( e -> { setVisible(false); }, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_IN_FOCUSED_WINDOW); multiUserCasesPanel = new MultiUserCasesPanel(); add(multiUserCasesPanel); pack(); setResizable(false); }

Target:
private MultiUserCasesDialog() { super(WindowManager.getDefault().getMainWindow(), REVIEW_MODE_TITLE, Dialog.ModalityType.APPLICATION_MODAL); }
Source:
public IExampleService.updateResult fetchNewUpdates(IProgressMonitor monitor) { java.nio.file.Path storageLocation = getStorageLocation(); String remoteBranch = getPreference(ExamplesPreferenceConstants.REMOTE_BRANCH); try { Git git = Git.open(storageLocation.toFile()); if (git.branchList().setListMode(ListMode.REMOTE).call().stream().anyMatch(branch -> branch.getName().contains(remoteBranch))){ CheckoutCommand checkout = git.checkout(); checkout.setName(remoteBranch); if (!git.branchList().call().stream().anyMatch(branch -> branch.getName().contains(remoteBranch)) ) { checkout.setCreateBranch(true); } try { checkout.call(); } catch (RefNotFoundException | InvalidRefNameException e) { return IExampleService.updateResult.INVALID_CONFIGURATION; } } else { return IExampleService.updateResult.INVALID_CONFIGURATION; } FetchCommand fetch = git.fetch(); FetchResult result = fetch.setProgressMonitor(new EclipseGitProgressTransformer(monitor)).setDryRun(true) .call(); Collection<TrackingRefUpdate> trackingRefUpdates = result.getTrackingRefUpdates(); if (trackingRefUpdates.isEmpty()) { return IExampleService.updateResult.UPDATE_AVAILABLE; } else { return IExampleService.updateResult.NO_UPDATES; } } catch (RepositoryNotFoundException ex) { return IExampleService.updateResult.UPDATE_AVAILABLE; } catch (Exception ex) { ex.printStackTrace(); return IExampleService.updateResult.UPDATE_AVAILABLE; } }

Target:
public IExampleService.UpdateResult fetchNewUpdates(IProgressMonitor monitor) { java.nio.file.Path storageLocation = getStorageLocation(); String remoteBranch = getPreference(ExamplesPreferenceConstants.REMOTE_BRANCH); try { Git git = Git.open(storageLocation.toFile()); FetchCommand fetch = git.fetch(); FetchResult result = fetch.setProgressMonitor(new EclipseGitProgressTransformer(monitor)).call(); if (doesBranchExist(git, BranchType.REMOTE, remoteBranch)) { CheckoutCommand checkout = git.checkout(); checkout.setName(remoteBranch); checkout.setCreateBranch(!doesBranchExist(git, BranchType.LOCAL, remoteBranch)); try { checkout.call(); } catch (CheckoutConflictException e) { return IExampleService.UpdateResult.REPO_CONTAINS_CONFLICTS; } } else { return IExampleService.UpdateResult.REMOTE_BRANCH_NOT_FOUND; } if (result.getTrackingRefUpdates().isEmpty()) { return IExampleService.UpdateResult.NO_UPDATES; } else { return IExampleService.UpdateResult.UPDATE_AVAILABLE; } } catch (RepositoryNotFoundException ex) { return IExampleService.UpdateResult.NO_UPDATES; } catch (Exception ex) { ex.printStackTrace(); return IExampleService.UpdateResult.NO_UPDATES; } }
Source:
public void constructsValidWhereClauseForNOTIN() { Map<String, Object> op = new HashMap<String, Object>(); op.put("$in", Arrays.<Object>asList("mike", "fred")); Map<String, Object> notOp = new HashMap<String, Object>(); notOp.put("$not", op); Map<String, Object> name = new HashMap<String, Object>(); name.put("name", notOp); SqlParts where = QuerySqlTranslator.whereSqlForAndClause(Arrays.<Object>asList(name), indexName); String expectedSubWhere = "WHERE \"name\" IN ( ?, ? ))"; String expected = String.format("_id NOT IN (SELECT _id FROM %s %s", indexTable, expectedSubWhere); assertThat(where.sqlWithPlaceHolders, is(expected)); assertThat(where.placeHolderValues, is(arrayContaining("mike", "fred"))); }

Target:
public void constructsValidWhereClauseForNOTIN() { Map<String, Object> op = new HashMap<String, Object>(); op.put("$in", Arrays.<Object>asList("mike", "fred")); Map<String, Object> notOp = new HashMap<String, Object>(); notOp.put("$not", op); Map<String, Object> name = new HashMap<String, Object>(); name.put("name", notOp); SqlParts where = QuerySqlTranslator.whereSqlForAndClause(Arrays.<Object>asList(name), indexName); String expected = String.format("_id NOT IN (SELECT _id FROM %s %s)", indexTable, "WHERE \"name\" IN ( ?, ? )"); assertThat(where.sqlWithPlaceHolders, is(expected)); assertThat(where.placeHolderValues, is(arrayContaining("mike", "fred"))); }
Source:
public void test_create_text_type_with_wrong_number_of_parameters_throws_exception() { expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage("The number of parameters for the text data is wrong: 2"); StringType.of(List.of(1, 2)); }

Target:
public void test_create_text_type_with_wrong_number_of_parameters_throws_exception() { expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage("The text type can only have a single parameter value, received: 2"); StringType.of(List.of(1, 2)); }
Source:
private static void writeBagitFileInternal(final Version version, final Charset encoding, final Long payloadByteCount, final Long payloadFileCount, final Path outputDir) throws IOException{ final Path bagitPath = outputDir.resolve("bagit.txt"); logger.debug("Writing bagit.txt file to [{}]", outputDir); final String firstLine = "BagIt-Version : " + version + System.lineSeparator(); logger.debug("Writing line to [{}]", firstLine, bagitPath); Files.write(bagitPath, firstLine.getBytes(StandardCharsets.UTF_8), StandardOpenOption.WRITE, StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.CREATE); final String secondLine = "Tag-File-Character-Encoding : " + encoding + System.lineSeparator(); logger.debug("Writing line to [{}]", secondLine, bagitPath); Files.write(bagitPath, secondLine.getBytes(StandardCharsets.UTF_8), StandardOpenOption.WRITE, StandardOpenOption.APPEND); if(version.compareTo(ONE_DOT_ZERO) >= 0 && payloadByteCount != null && payloadFileCount != null){ final String thirdLine = "Payload-Byte-Count : " + payloadByteCount + System.lineSeparator(); Files.write(bagitPath, thirdLine.getBytes(StandardCharsets.UTF_8), StandardOpenOption.WRITE, StandardOpenOption.APPEND); final String fourthLine = "Payload-File-Count : " + payloadFileCount + System.lineSeparator(); Files.write(bagitPath, fourthLine.getBytes(StandardCharsets.UTF_8), StandardOpenOption.WRITE, StandardOpenOption.APPEND); } }

Target:
private static void writeBagitFileInternal(final Version version, final Charset encoding, final Long payloadByteCount, final Long payloadFileCount, final Path outputDir) throws IOException{ final Path bagitPath = outputDir.resolve("bagit.txt"); logger.debug("Writing bagit.txt file to [{}]", outputDir); final StringBuilder sb = new StringBuilder(100); sb.append("BagIt-Version : ").append(version).append(System.lineSeparator()) .append("Tag-File-Character-Encoding : ").append(encoding).append(System.lineSeparator()); logger.debug("Writing to [{}]", sb.toString(), bagitPath); if(version.compareTo(ONE_DOT_ZERO) >= 0 && payloadByteCount != null && payloadFileCount != null){ sb.append("Payload-Byte-Count : ").append(payloadByteCount).append(System.lineSeparator()) .append("Payload-File-Count : ").append(payloadFileCount).append(System.lineSeparator()); } Files.write(bagitPath, sb.toString().getBytes(StandardCharsets.UTF_8), StandardOpenOption.WRITE, StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.CREATE); }
Source:
public void handleData(final ITmfEvent event) { super.handleData(event); if (event.getTrace() == trace) { sci.processEvent(event); } else if (experiment != null) { for (ITmfTrace childTrace : experiment.getTraces()) { if (childTrace == event.getTrace()) { sci.processEvent(event); } } } }

Target:
public void handleData(final ITmfEvent event) { super.handleData(event); if (event.getTrace() == trace) { sci.processEvent(event); } else if (trace instanceof TmfExperiment) { for (ITmfTrace childTrace : ((TmfExperiment) trace).getTraces()) { if (childTrace == event.getTrace()) { sci.processEvent(event); } } } }
Source:
void errorOutReadLacKey(final CompletionKey key, final int rc) { LOG.info("Removing completion key: {}", key); final ReadLacCompletion readLacCompletion = (ReadLacCompletion)completionObjects.remove(key); if (null == readLacCompletion) { return; } executor.submitOrdered(readLacCompletion.ledgerId, new SafeRunnable() { @Override public void safeRun() { String bAddress = "null"; Channel c = channel; if (c != null) { bAddress = c.getRemoteAddress().toString(); } LOG.debug("Could not write request readLac for ledgerId: bookie: {}", new Object[] { readLacCompletion.ledgerId, bAddress}); readLacCompletion.cb.readLacComplete(rc, readLacCompletion.ledgerId, null, null, readLacCompletion.ctx); } }); }

Target:
void errorOutReadLacKey(final CompletionKey key, final int rc) { LOG.debug("Removing completion key: {}", key); final ReadLacCompletion readLacCompletion = (ReadLacCompletion)completionObjects.remove(key); if (null == readLacCompletion) { return; } executor.submitOrdered(readLacCompletion.ledgerId, new SafeRunnable() { @Override public void safeRun() { String bAddress = "null"; Channel c = channel; if (c != null) { bAddress = c.getRemoteAddress().toString(); } LOG.debug("Could not write request readLac for ledgerId: bookie: {}", new Object[] { readLacCompletion.ledgerId, bAddress}); readLacCompletion.cb.readLacComplete(rc, readLacCompletion.ledgerId, null, null, readLacCompletion.ctx); } }); }
Source:
private SerializedValue getSerializedValue(RestAction<?> action, Object object) throws ActionException { String bodyClass = action.getBodyClass(); if (bodyClass != null) { List<ContentType> contentTypes = action.getClientProducedContentTypes(); Serialization serialization = findSerialization(bodyClass, contentTypes); if (serialization != null) { try { return serialize(serialization, object, bodyClass, contentTypes); } catch (SerializationException e) { throw new ActionSerializationException(e); } } } throw new ActionSerializationException( "Unable to serialize request body. No serializer found."); }

Target:
private SerializedValue getSerializedValue(RestAction<?> action, Object object) throws ActionException { String bodyClass = action.getBodyClass(); if (bodyClass != null) { List<ContentType> contentTypes = action.getClientProducedContentTypes(); Serialization serialization = findSerialization(bodyClass, contentTypes); if (serialization != null) { return serialize(serialization, object, bodyClass, contentTypes); } } throw new ActionSerializationException( "Unable to serialize request body. No serializer found."); }
Source:
protected boolean activateOrDeactivateNic(Guid nicId, PlugAction plugAction) { VdcReturnValueBase activateVmNicReturnValue = getBackend().runInternalAction(VdcActionType.ActivateDeactivateVmNic, createActivateDeactivateParameters(nicId, plugAction)); if (!activateVmNicReturnValue.getSucceeded()) { propagateFailure(activateVmNicReturnValue); } return activateVmNicReturnValue.getSucceeded(); }

Target:
protected boolean activateOrDeactivateNic(Guid nicId, PlugAction plugAction) { VdcReturnValueBase returnValue = getBackend().runInternalAction(VdcActionType.ActivateDeactivateVmNic, createActivateDeactivateParameters(nicId, plugAction)); if (!returnValue.getSucceeded()) { propagateFailure(returnValue); } return returnValue.getSucceeded(); }
Source:
public long getLong(int field) { checkFieldType(field, ImmutableSet.of(BIGINT, INTEGER)); return Long.valueOf(String.valueOf(getFieldValue(field))); }

Target:
public long getLong(int field) { checkFieldType(field, ImmutableSet.of(BIGINT, INTEGER)); return (Integer) getFieldValue(field); }