auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append("AdapterFactoryProxy [contributor: "); sb.append(element.isValid() ? element.getContributor() : "<unknown>"); sb.append(", adaptableType: "); sb.append(element.isValid() ? element.getAttribute("adaptableType") : "<unknown>"); if (factory != null) { sb.append(", factory: "); sb.append(factory); } sb.append("]"); return sb.toString(); }

Target:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append("AdapterFactoryProxy [contributor: "); sb.append(contributorName); sb.append(", adaptableType: "); sb.append(adaptableType); if (factory != null) { sb.append(", factory: "); sb.append(factory); } sb.append("]"); return sb.toString(); }
Source:
private static PRPAMT201306UV02LivingSubjectName createName(String firstName, String lastName) { org.hl7.v3.ObjectFactory factory = new org.hl7.v3.ObjectFactory(); ENExplicit name = factory.createENExplicit(); if (lastName != null && lastName.length() > 0) { EnExplicitFamily familyName = new EnExplicitFamily(); familyName.setPartType("FAM"); familyName.setContent(lastName); name.getContent().add(factory.createENExplicitFamily(familyName)); } if (firstName != null && firstName.length() > 0) { EnExplicitGiven givenName = new EnExplicitGiven(); givenName.setPartType("GIV"); givenName.setContent(firstName); name.getContent().add(factory.createENExplicitGiven(givenName)); } PRPAMT201306UV02LivingSubjectName subjectName = new PRPAMT201306UV02LivingSubjectName(); subjectName.getValue().add(name); return subjectName; }

Target:
private static PRPAMT201306UV02LivingSubjectName createName(String firstName, String lastName) { org.hl7.v3.ObjectFactory factory = new org.hl7.v3.ObjectFactory(); ENExplicit name = factory.createENExplicit(); if (lastName != null && lastName.length() > 0) { EnExplicitFamily familyName = new EnExplicitFamily(); familyName.setPartType(FAMILY_NAME_CODE); familyName.setContent(lastName); name.getContent().add(factory.createENExplicitFamily(familyName)); } if (firstName != null && firstName.length() > 0) { EnExplicitGiven givenName = new EnExplicitGiven(); givenName.setPartType(GIVEN_NAME_CODE); givenName.setContent(firstName); name.getContent().add(factory.createENExplicitGiven(givenName)); } PRPAMT201306UV02LivingSubjectName subjectName = new PRPAMT201306UV02LivingSubjectName(); subjectName.getValue().add(name); return subjectName; }
Source:
public Set<String> getDataTypes() { if (!initialized.get()) { return new HashSet<>(); } else { return Collections.unmodifiableSet(typeToRanges.keySet()); } }

Target:
public Set<String> getDataTypes() { if (!initialized.get()) { return Collections.emptySet(); } else { return Collections.unmodifiableSet(typeToRanges.keySet()); } }
Source:
public Map<String, Object> createSampleList(final SampleListDto sampleListDto) { Preconditions.checkArgument(sampleListDto.getInstanceIds() != null, "The Instance List must not be null"); Preconditions.checkArgument(!sampleListDto.getInstanceIds().isEmpty(), "The Instance List must not be empty"); Preconditions.checkNotNull(sampleListDto.getSelectionVariableId(), "The Selection Variable Id must not be empty"); Preconditions.checkNotNull(sampleListDto.getStudyId(), "The Study Id must not be empty"); final HashMap<String, Object> mapResponse = new HashMap<>(); mapResponse.put("id", String.valueOf(0)); try { final SampleListDTO sampleListdto = translateToSampleListDto(sampleListDto); final Integer newSampleId = this.service.createOrUpdateSampleList(sampleListdto); if (newSampleId != null) { mapResponse.put("id", String.valueOf(newSampleId)); } else { mapResponse.put("ERROR", "Error on SampleListService.createOrUpdateSampleList"); } } catch (MiddlewareQueryException | ParseException e) { mapResponse.put("ERROR", "Error on SampleListService.createOrUpdateSampleList " + e.getMessage()); } return mapResponse; }

Target:
public Map<String, Object> createSampleList(final SampleListDto sampleListDto) { Preconditions.checkArgument(sampleListDto.getInstanceIds() != null, "The Instance List must not be null"); Preconditions.checkArgument(!sampleListDto.getInstanceIds().isEmpty(), "The Instance List must not be empty"); Preconditions.checkNotNull(sampleListDto.getSelectionVariableId(), "The Selection Variable Id must not be empty"); Preconditions.checkNotNull(sampleListDto.getStudyId(), "The Study Id must not be empty"); final HashMap<String, Object> mapResponse = new HashMap<>(); mapResponse.put("id", String.valueOf(0)); try { final SampleListDTO sampleListDtoMW = this.translateToSampleListDto(sampleListDto); final Integer newSampleId = this.sampleListServiceMW.createOrUpdateSampleList(sampleListDtoMW); mapResponse.put("id", String.valueOf(newSampleId)); } catch (MiddlewareQueryException | ParseException e) { mapResponse.put("ERROR", "Error on SampleListService.createOrUpdateSampleList " + e.getMessage()); } return mapResponse; }
Source:
static Map<String, Map<String, String>> getNextAssignment(Map<String, Map<String, String>> currentAssignment, Map<String, Map<String, String>> targetAssignment, int minAvailableReplicas, boolean enableStrictReplicaGroup) { Map<String, Map<String, String>> nextAssignment = new TreeMap<>(); if (enableStrictReplicaGroup) { Map<Set<String>, Set<String>> availableInstancesMap = new HashMap<>(); for (Map.Entry<String, Map<String, String>> entry : currentAssignment.entrySet()) { String segmentName = entry.getKey(); Map<String, String> currentInstanceStateMap = entry.getValue(); Map<String, String> targetInstanceStateMap = targetAssignment.get(segmentName); SingleSegmentAssignment assignment = getNextAssignment(currentInstanceStateMap, targetInstanceStateMap, minAvailableReplicas); Set<String> assignedInstances = assignment._instanceStateMap.keySet(); Set<String> availableInstances = assignment._availableInstances; Set<String> currentAvailableInstances = availableInstancesMap.get(assignedInstances); if (currentAvailableInstances == null) { nextAssignment.put(segmentName, assignment._instanceStateMap); availableInstancesMap.put(assignedInstances, availableInstances); } else { availableInstances.retainAll(currentAvailableInstances); if (availableInstances.size() >= minAvailableReplicas) { nextAssignment.put(segmentName, assignment._instanceStateMap); availableInstancesMap.put(assignedInstances, availableInstances); } else { nextAssignment.put(segmentName, currentInstanceStateMap); } } } } else { for (Map.Entry<String, Map<String, String>> entry : currentAssignment.entrySet()) { String segmentName = entry.getKey(); nextAssignment.put(segmentName, getNextAssignment(entry.getValue(), targetAssignment.get(segmentName), minAvailableReplicas)._instanceStateMap); } } return nextAssignment; }

Target:
static Map<String, Map<String, String>> getNextAssignment(Map<String, Map<String, String>> currentAssignment, Map<String, Map<String, String>> targetAssignment, int minAvailableReplicas, boolean enableStrictReplicaGroup) { return enableStrictReplicaGroup ? getNextStrictReplicaGroupAssignment(currentAssignment, targetAssignment, minAvailableReplicas) : getNextNonStrictReplicaGroupAssignment(currentAssignment, targetAssignment, minAvailableReplicas); }
Source:
public CourseEditInstructorPanel(int instructorToShowIndex, int instructorIndex, InstructorAttributes instructor, List<String> sectionNames, List<String> feedbackNames) { if (instructorToShowIndex == -1) { index = instructorIndex; isAccessControlDisplayed = false; } else { index = instructorToShowIndex; isAccessControlDisplayed = true; } this.instructor = instructor; sectionRows = createSectionRows(instructorIndex, sectionNames, feedbackNames); permissionInputGroup1 = createPermissionInputGroup1ForInstructorPanel(); permissionInputGroup2 = createPermissionInputGroup2ForInstructorPanel(); permissionInputGroup3 = createPermissionInputGroup3ForInstructorPanel(); if (instructor != null) { String style = null; if (instructor.privileges.numberOfSectionsSpecial() >= sectionNames.size()) { style = "display: none;"; } String content = "Give different permissions for a specific section"; Map<String, String> attributes = new HashMap<>(); attributes.put("class", "small addSectionLevelForInstructor"); attributes.put("id", "addSectionLevelForInstructor" + index); attributes.put("href", "javascript:;"); attributes.put("style", style); attributes.put("data-index", Integer.toString(index)); attributes.put("data-first-blank-section-row-index", Integer.toString(firstBlankSectionRowIndex)); addSectionLevelForInstructorButton = createButton(content, attributes); } }

Target:
public CourseEditInstructorPanel(int instructorToShowIndex, int instructorIndex, InstructorAttributes instructor, List<String> sectionNames, List<String> feedbackNames) { if (instructorToShowIndex == -1) { index = instructorIndex; isAccessControlDisplayed = false; } else { index = instructorToShowIndex; isAccessControlDisplayed = true; } this.instructor = instructor; sectionRows = createSectionRows(instructorIndex, sectionNames, feedbackNames); permissionInputGroup1 = createPermissionInputGroup1ForInstructorPanel(); permissionInputGroup2 = createPermissionInputGroup2ForInstructorPanel(); permissionInputGroup3 = createPermissionInputGroup3ForInstructorPanel(); }
Source:
public double getMeanJobExecutionTime() { return executeReadOnlyTransaction(session -> { Query query = session.getNamedQuery("getMeanJobExecutionTime"); Double result = (Double) query.uniqueResult(); return result == null ? 0 : result; }); }

Target:
public double getMeanJobExecutionTime() { return executeReadOnlyTransaction(session -> { Query query = session.getNamedQuery("getMeanJobExecutionTime"); Double result = (Double) query.uniqueResult(); return result == null ? 0.0d : result; }); }
Source:
public void addSubmitRecords(ChangeAttribute ca, List<SubmitRecord> submitRecords) { ca.submitRecords = new ArrayList<SubmitRecordAttribute>(); for (SubmitRecord submitRecord : submitRecords) { SubmitRecordAttribute sa = new SubmitRecordAttribute(); switch (submitRecord.status) { case OK: sa.status = "OK"; break; case NOT_READY: sa.status = "NOT_READY"; if (!submitRecord.labels.isEmpty()) { sa.labels = new ArrayList<SubmitLabelAttribute>(); for (SubmitRecord.Label lbl : submitRecord.labels) { SubmitLabelAttribute la = new SubmitLabelAttribute(); la.label = lbl.label; switch (lbl.status) { case OK: la.status = "OK"; break; case REJECT: la.status = "REJECT"; break; case NEED: la.status = "NEED"; break; case MAY: la.status = "MAY"; break; case IMPOSSIBLE: la.status = "IMPOSSIBLE"; break; default: throw new IllegalArgumentException( "Unsupported SubmitRecord.Label.status (" + lbl.status + ")"); } sa.labels.add(la); } } break; case CLOSED: sa.status = "CLOSED"; break; case RULE_ERROR: sa.status = "RULE_ERROR"; break; default: throw new IllegalStateException( "Unsupported SubmitRecord.status + (" + submitRecord.status + ")"); } ca.submitRecords.add(sa); } if (ca.submitRecords.isEmpty()) { ca.submitRecords = null; } }

Target:
public void addSubmitRecords(ChangeAttribute ca, List<SubmitRecord> submitRecords) { ca.submitRecords = new ArrayList<SubmitRecordAttribute>(); for (SubmitRecord submitRecord : submitRecords) { SubmitRecordAttribute sa = new SubmitRecordAttribute(); switch (submitRecord.status) { case OK: sa.status = "OK"; addSubmitRecordLabels(submitRecord, sa); break; case NOT_READY: sa.status = "NOT_READY"; addSubmitRecordLabels(submitRecord, sa); break; case RULE_ERROR: sa.status = "RULE_ERROR"; break; default: throw new IllegalStateException( "Unsupported SubmitRecord.status + (" + submitRecord.status + ")"); } ca.submitRecords.add(sa); } if (ca.submitRecords.isEmpty()) { ca.submitRecords = null; } }
Source:
protected VdcActionType getImagesActionType() { if (getParameters().getOperation() == ImageOperation.Move) { return VdcActionType.MoveImageGroup; } return VdcActionType.MoveOrCopyImageGroup; }

Target:
protected VdcActionType getImagesActionType() { if (getParameters().getOperation() == ImageOperation.Move) { return VdcActionType.MoveImageGroup; } return VdcActionType.CopyImageGroup; }
Source:
protected Settings.Builder initializeSettingsBuilder(ElasticSearchRemoteConfig config) { String shieldAdminName = Framework.getProperty(ES_SHIELD_ADMIN_USERNAME, "Administrator"); String shieldAdminPasswd = Framework.getProperty(ES_SHIELD_ADMIN_PASSWORD, "Administrator"); Settings.Builder builder = super.initializeSettingsBuilder(config); builder.put("shield.user", shieldAdminName + ":" + shieldAdminPasswd); return builder; }

Target:
protected Settings.Builder initializeSettingsBuilder(ElasticSearchRemoteConfig config) { Settings.Builder builder = super.initializeSettingsBuilder(config); builder.put("shield.user", getUsername() + ":" + getPassword()); return builder; }
Source:
private static double getUnnormalizedLogProbabilityLaplaceApproximation(final double readCount, final double mu, final double psi) { final double variance = psi + 1.0 / readCount; final double logReadCount = FastMath.log(readCount); return - logReadCount - 0.5 * (LOG_2PI + FastMath.log(variance) + FastMath.pow(logReadCount - mu, 2) / variance); }

Target:
private static double getUnnormalizedLogProbabilityLaplaceApproximation(final double readCount, final double mu, final double psi) { final double variance = psi + 1.0 / readCount; final double logReadCount = FastMath.log(readCount); return - logReadCount - 0.5 * (LOG_2PI + FastMath.log(variance) + MathUtils.square(logReadCount - mu) / variance); }
Source:
public Attributes(Map<String, Type> types, Map<String, Value> data) throws UndeclaredAttributeException { for (Map.Entry<String, Type> entry: types.entrySet()) { String attrName = entry.getKey(); if (!data.containsKey(attrName)) { throw new UndeclaredAttributeException(attrName); } } for (String attrName: data.keySet()) { if (!types.containsKey(attrName)) { throw new UndeclaredAttributeException(attrName); } } this.data = ImmutableMap.copyOf(data); }

Target:
public Attributes(Map<String, Type> types, Map<String, Value> data) throws UndeclaredAttributeException, InvalidAttributeException { for (Map.Entry<String, Type> entry : types.entrySet()) { String attrName = entry.getKey(); if (!data.containsKey(attrName)) { throw new UndeclaredAttributeException(attrName); } } for (String attrName : data.keySet()) { if (!types.containsKey(attrName)) { throw new InvalidAttributeException(attrName); } } this.data = ImmutableMap.copyOf(data); }
Source:
public TaskLock lock(final Task task, final Interval interval) throws InterruptedException { long startTime = System.currentTimeMillis(); giant.lock(); try { Optional<TaskLock> taskLock; while (!(taskLock = tryLock(task, interval)).isPresent()) { lockReleaseCondition.await(lockTimeoutMillis, TimeUnit.MILLISECONDS); if (System.currentTimeMillis() - startTime > lockTimeoutMillis) { throw new InterruptedException(String.format( "Task [%s] can not acquire lock for interval [%s] within [%s] ms", task.getId(), interval, lockTimeoutMillis )); } } return taskLock.get(); } finally { giant.unlock(); } }

Target:
public TaskLock lock(final Task task, final Interval interval) throws InterruptedException { long timeout = lockTimeoutMillis; giant.lock(); try { Optional<TaskLock> taskLock; while (!(taskLock = tryLock(task, interval)).isPresent()) { long startTime = System.currentTimeMillis(); lockReleaseCondition.await(timeout, TimeUnit.MILLISECONDS); long timeDelta = System.currentTimeMillis() - startTime; if (timeDelta >= timeout) { log.error( "Task [%s] can not acquire lock for interval [%s] within [%s] ms", task.getId(), interval, lockTimeoutMillis ); throw new InterruptedException(String.format( "Task [%s] can not acquire lock for interval [%s] within [%s] ms", task.getId(), interval, lockTimeoutMillis )); } else { timeout -= timeDelta; } } return taskLock.get(); } finally { giant.unlock(); } }
Source:
public void testDontOverwriteDirtyFile() throws IOException { setupCase(mk("foo"), mk("other"), mk("foo")); writeTrashFile("foo", "different"); try { checkout(); fail("Didn't got the expected conflict"); } catch (CheckoutConflictException e) { assertIndex(mk("foo")); assertWorkDir(mkmap("foo", "different")); assertTrue(getConflicts().containsKey("foo")); assertTrue(new File(trash, "foo").isFile()); } }

Target:
public void testDontOverwriteDirtyFile() throws IOException { setupCase(mk("foo"), mk("other"), mk("foo")); writeTrashFile("foo", "different"); try { checkout(); fail("Didn't got the expected conflict"); } catch (CheckoutConflictException e) { assertIndex(mk("foo")); assertWorkDir(mkmap("foo", "different")); assertEquals(Arrays.asList("foo"), getConflicts()); assertTrue(getConflicts().containsKey("foo")); assertTrue(new File(trash, "foo").isFile()); } }
Source:
StreamsProducer threadProducer() { if (eosBetaStreamsProducer == null) { throw new IllegalStateException("Exactly-once beta is not enabled."); } return eosBetaStreamsProducer; }

Target:
StreamsProducer threadProducer() { if (processingMode != StreamThread.ProcessingMode.EXACTLY_ONCE_BETA) { throw new IllegalStateException("Exactly-once beta is not enabled."); } return threadProducer; }
Source:
public Object createEventSubscription() { String subscriptionId = subscriptions.createSubscription(this); if (subscriptionId == null) { return JSONResponse.createResponse(Status.FORBIDDEN, null, "Max number of subscriptions is reached."); } final EventOutput eventOutput = new SitemapEventOutput(subscriptions, subscriptionId); broadcaster.add(eventOutput); eventOutputs.put(subscriptionId, eventOutput); URI uri = uriInfo.getBaseUriBuilder().path(PATH_SITEMAPS).path(SEGMENT_EVENTS).path(subscriptionId).build(); return Response.created(uri); }

Target:
public Object createEventSubscription() { String subscriptionId = subscriptions.createSubscription(this); if (subscriptionId == null) { return JSONResponse.createResponse(Status.SERVICE_UNAVAILABLE, null, "Max number of subscriptions is reached."); } final EventOutput eventOutput = new SitemapEventOutput(subscriptions, subscriptionId); broadcaster.add(eventOutput); eventOutputs.put(subscriptionId, eventOutput); URI uri = uriInfo.getBaseUriBuilder().path(PATH_SITEMAPS).path(SEGMENT_EVENTS).path(subscriptionId).build(); return Response.created(uri); }
Source:
private boolean setVolumeLegalityInStorage(boolean legal) { SetVolumeLegalityVDSCommandParameters parameters = new SetVolumeLegalityVDSCommandParameters(getStoragePool().getId(), getStorageDomainId(), getImage().getImage().getDiskId(), getImage().getImageId(), legal); try { getBackend().getResourceManager().runVdsCommand(VDSCommandType.SetVolumeLegality, parameters); } catch (RuntimeException e) { log.error("Failed to set image's volume's legality: {}", e); return false; } return true; }

Target:
private boolean setVolumeLegalityInStorage(boolean legal) { SetVolumeLegalityVDSCommandParameters parameters = new SetVolumeLegalityVDSCommandParameters(getStoragePool().getId(), getStorageDomainId(), getImage().getImage().getDiskId(), getImage().getImageId(), legal); try { runVdsCommand(VDSCommandType.SetVolumeLegality, parameters); } catch (EngineException e) { log.error("Failed to set image's volume's legality to for image and volume {}: {}", legal, getImage().getImage().getDiskId(), getImage().getImageId(), e); return false; } return true; }
Source:
public String loadInitialGermplasmTreeTable(final Model model) { try { final List<TreeTableNode> rootNodes = new ArrayList<>(); final TreeTableNode localNode = new TreeTableNode(GermplasmTreeController.LISTS, AppConstants.LISTS.getString(), null, null, null, null, "1"); rootNodes.add(localNode); model.addAttribute(GermplasmTreeController.GERMPLASM_LIST_ROOT_NODES, rootNodes); } catch (final Exception e) { GermplasmTreeController.LOG.error(e.getMessage(), e); } return super.showAjaxPage(model, GermplasmTreeController.GERMPLASM_LIST_TABLE_PAGE); }

Target:
public String loadInitialGermplasmTreeTable(final Model model) { final List<TreeTableNode> rootNodes = new ArrayList<>(); final TreeTableNode localNode = new TreeTableNode(GermplasmTreeController.LISTS, AppConstants.LISTS.getString(), null, null, null, null, "1"); rootNodes.add(localNode); model.addAttribute(GermplasmTreeController.GERMPLASM_LIST_ROOT_NODES, rootNodes); return super.showAjaxPage(model, GermplasmTreeController.GERMPLASM_LIST_TABLE_PAGE); }
Source:
protected static ColumnMessage defaultBytesProto(final Column<?> column) { final BlobColumnMessage.Builder inner = BlobColumnMessage.newBuilder(); int bblen = 0; int startP = 0, endP = 0; for (int i = 0; i < column.size(); i++) { bblen = bblen + column.getBlob(i).array().length; } ByteBuffer bb = ByteBuffer.allocate(bblen); int offset = bb.position(); for (int i = 0; i < column.size(); i++) { int len = column.getBlob(i).array().length; endP = startP + len; inner.addStartIndices(startP); inner.addEndIndices(endP); bb.put(column.getBlob(i).array(), offset, len); startP = endP; offset = bb.position(); len = 0; } bb.flip(); inner.setData(ByteString.copyFrom(bb)); return ColumnMessage.newBuilder().setType(ColumnMessage.Type.BLOB).setBlobColumn(inner).build(); }

Target:
protected static ColumnMessage defaultBytesProto(final Column<?> column) { final BlobColumnMessage.Builder inner = BlobColumnMessage.newBuilder(); int bblen = 0; for (int i = 0; i < column.size(); i++) { bblen = bblen + column.getBlob(i).array().length; } ByteBuffer bb = ByteBuffer.allocate(bblen); int startP = 0, endP = 0; for (int i = 0; i < column.size(); i++) { int len = column.getBlob(i).array().length; endP = startP + len; inner.addStartIndices(startP); inner.addEndIndices(endP); bb.put(column.getBlob(i).array(), bb.position(), len); startP = endP; } bb.flip(); inner.setData(ByteString.copyFrom(bb)); return ColumnMessage.newBuilder().setType(ColumnMessage.Type.BLOB).setBlobColumn(inner).build(); }
Source:
public void createFromInspection(String json) { JSONObject request; try { request = new JSONObject(json); } catch (JSONException e) { SoapUI.logError(e); return; } Analytics.trackAction(EXPLORE_API_CLICK_SAVE_REQUEST, "HTTPMethod", HttpMethod.valueOf(extractMethod(request)).toString(), "Endpoint", extractUrl(request)); String url = extractUrl(request); if (StringUtils.isNullOrEmpty(url)) { return; } HttpMethod method = HttpMethod.valueOf(extractMethod(request)); RequestInspectionData inspectionData = new RequestInspectionData(extractHeaders(request), extractPayload(request)); SwingUtilities.invokeLater(new Runnable() { @Override public void run() { HashMap<String, Object> context = new HashMap<>(); context.put("URLs", Arrays.asList(url)); context.put("Methods", Arrays.asList(method)); context.put("InspectionData", Arrays.asList(inspectionData)); SaveRequestAction saveRequestAction = new SaveRequestAction(context); saveRequestAction.showNewRestRequestDialog(); } }); }

Target:
public void createFromInspection(String json) { JSONObject request; try { request = new JSONObject(json); } catch (JSONException e) { SoapUI.logError(e); return; } Analytics.trackAction(EXPLORE_API_CLICK_SAVE_REQUEST, "HTTPMethod", extractMethod(request), "Endpoint", extractUrl(request)); String url = extractUrl(request); if (StringUtils.isNullOrEmpty(url)) { return; } HttpMethod method = HttpMethod.valueOf(extractMethod(request)); RequestInspectionData inspectionData = new RequestInspectionData(extractHeaders(request), extractPayload(request)); SwingUtilities.invokeLater(new Runnable() { @Override public void run() { HashMap<String, Object> context = new HashMap<>(); context.put("URLs", Arrays.asList(url)); context.put("Methods", Arrays.asList(method)); context.put("InspectionData", Arrays.asList(inspectionData)); SaveRequestAction saveRequestAction = new SaveRequestAction(context); saveRequestAction.showNewRestRequestDialog(); } }); }
Source:
public AmazonPubsubSubscription( String name, String topicARN, String queueARN, String templatePath, MessageFormat messageFormat, boolean idInMessageAttributes, Long dedupeRetentionMillis ) { this.name = name; this.topicARN = topicARN; this.queueARN = queueARN; this.templatePath = templatePath; this.messageFormat = messageFormat; this.idInMessageAttributes = idInMessageAttributes; if (dedupeRetentionMillis != null && dedupeRetentionMillis >= 0) { this.dedupeRetentionMillis = dedupeRetentionMillis; } }

Target:
public AmazonPubsubSubscription( String name, String topicARN, String queueARN, String templatePath, MessageFormat messageFormat, boolean idInMessageAttributes, Long dedupeRetentionMillis ) { this.name = name; this.topicARN = topicARN; this.queueARN = queueARN; this.templatePath = templatePath; this.messageFormat = messageFormat; this.idInMessageAttributes = idInMessageAttributes; if (dedupeRetentionMillis != null && dedupeRetentionMillis >= 0) { this.dedupeRetentionMillis = dedupeRetentionMillis; } else { if (dedupeRetentionMillis != null) { log.warn("Ignoring dedupeRetentionMillis invalid value of " + dedupeRetentionMillis); } } }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); copyFileFromAssetsToCache(getString(R.string.bristol_model)); copyFileFromAssetsToCache(getString(R.string.bristol_skin)); setupToolbar(); mSceneView = findViewById(R.id.sceneView); ArcGISScene scene = new ArcGISScene(Basemap.createImagery()); mSceneView.setScene(scene); Surface surface = new Surface(); ArcGISTiledElevationSource elevationSource = new ArcGISTiledElevationSource( getString(R.string.world_elevation_service_url)); surface.getElevationSources().add(elevationSource); scene.setBaseSurface(surface); mSceneOverlay = new GraphicsOverlay(); mSceneOverlay.getSceneProperties().setSurfacePlacement(LayerSceneProperties.SurfacePlacement.ABSOLUTE); mSceneView.getGraphicsOverlays().add(mSceneOverlay); Camera camera = new Camera(38.459291, -109.937576, 5500, 150.0, 20.0, 0.0); mSceneView.setViewpointCamera(camera); Point locationPoint = new Point(-109.929589, 38.437304, 1700, SpatialReferences.getWgs84()); mOrbitLocationCameraController = new OrbitLocationCameraController(locationPoint, 5000); mOrbitLocationCameraController.setCameraPitchOffset(3); mOrbitLocationCameraController.setCameraHeadingOffset(150); loadModel().addDoneLoadingListener(() -> { mOrbitAeroplaneCameraController = new OrbitGeoElementCameraController(mPlane3D, 100.0); mOrbitAeroplaneCameraController.setCameraPitchOffset(30); mOrbitAeroplaneCameraController.setCameraHeadingOffset(150); }); }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); copyFileFromAssetsToCache(getString(R.string.bristol_model)); copyFileFromAssetsToCache(getString(R.string.bristol_skin)); setupToolbar(); mSceneView = findViewById(R.id.sceneView); ArcGISScene scene = new ArcGISScene(Basemap.createImagery()); mSceneView.setScene(scene); Surface surface = new Surface(); ArcGISTiledElevationSource elevationSource = new ArcGISTiledElevationSource( getString(R.string.world_elevation_service_url)); surface.getElevationSources().add(elevationSource); scene.setBaseSurface(surface); mSceneOverlay = new GraphicsOverlay(); mSceneOverlay.getSceneProperties().setSurfacePlacement(LayerSceneProperties.SurfacePlacement.ABSOLUTE); mSceneView.getGraphicsOverlays().add(mSceneOverlay); Camera camera = new Camera(38.459291, -109.937576, 5500, 150.0, 20.0, 0.0); mSceneView.setViewpointCamera(camera); Point locationPoint = new Point(-109.929589, 38.437304, 1700, SpatialReferences.getWgs84()); mOrbitLocationCameraController = new OrbitLocationCameraController(locationPoint, 5000); mOrbitLocationCameraController.setCameraPitchOffset(3); mOrbitLocationCameraController.setCameraHeadingOffset(150); loadModel().addDoneLoadingListener(() -> { mOrbitPlaneCameraController = new OrbitGeoElementCameraController(mPlane3D, 100.0); mOrbitPlaneCameraController.setCameraPitchOffset(30); mOrbitPlaneCameraController.setCameraHeadingOffset(150); }); }
Source:
void startWorkspaceAsync(final UsersWorkspaceImpl usersWorkspace, final String envName) throws ConflictException { try { final RuntimeWorkspaceImpl runtime = workspaceRegistry.get(usersWorkspace.getId()); throw new ConflictException(format("Could not start workspace '%s' because its status is '%s'", runtime.getName(), runtime.getStatus())); } catch (NotFoundException ignored) { } executor.execute(ThreadLocalPropagateContext.wrap(new Runnable() { @Override public void run() { startWorkspaceSync(usersWorkspace, envName); } })); }

Target:
UsersWorkspaceImpl startWorkspaceAsync(final UsersWorkspaceImpl usersWorkspace, final String envName) { executor.execute(ThreadLocalPropagateContext.wrap(() -> { try { startWorkspaceSync(usersWorkspace, envName); } catch (BadRequestException | ServerException | NotFoundException | ConflictException e) { LOG.error(e.getLocalizedMessage(), e); } })); addChannels(usersWorkspace); return usersWorkspace; }
Source:
public Serializable execute(TaskResult... results) throws IOException { List<String> filesRelativePathName; FTPClient ftpClient = new FTPClient(); try { ftpClient.connect(ftpHostname, ftpPort); int reply = ftpClient.getReplyCode(); if (!FTPReply.isPositiveCompletion(reply)) { ftpClient.disconnect(); throw new IOException("Exception in connecting to FTP Server"); } if (!ftpClient.login(ftpUsername, ftpPassword)) { throw new IOException("Logging refused. check the FTP_USERNAME and the FTP_PASSWORD values."); } ftpClient.enterLocalPassiveMode(); getOut().println("Connected"); switch (ftpMode) { case "GET": filesRelativePathName = ftpGet(ftpClient); break; case "PUT": filesRelativePathName = ftpPut(ftpClient); break; default: throw new IllegalArgumentException("FTP MODE can only be PUT or GET."); } } catch (IOException e) { throw new IOException(e); } finally { ftpClient.logout(); ftpClient.disconnect(); getOut().println("Disconnected"); } return (Serializable) filesRelativePathName; }

Target:
public Serializable execute(TaskResult... results) throws IOException { List<String> filesRelativePathName; FTPClient ftpClient = new FTPClient(); try { ftpClient.connect(ftpHostname, ftpPort); int reply = ftpClient.getReplyCode(); if (!FTPReply.isPositiveCompletion(reply)) { ftpClient.disconnect(); throw new IOException("Exception in connecting to FTP Server"); } if (!ftpClient.login(ftpUsername, ftpPassword)) { throw new IOException("Logging refused. check the FTP_USERNAME and FTP_PASSWORD values."); } ftpClient.enterLocalPassiveMode(); getOut().println("Connected"); switch (ftpMode) { case "GET": filesRelativePathName = ftpGet(ftpClient); break; case "PUT": filesRelativePathName = ftpPut(ftpClient); break; default: throw new IllegalArgumentException("FTP MODE can only be PUT or GET."); } } finally { ftpClient.logout(); ftpClient.disconnect(); getOut().println("Disconnected"); } return (Serializable) filesRelativePathName; }
Source:
public void testInitializationWithQuotaUnset() { int testCurrentTaskThreadPoolSize = 100; LiveInstance liveInstance = createLiveInstance(null, null); liveInstance.setCurrentTaskThreadPoolSize(testCurrentTaskThreadPoolSize); AssignableInstance ai = new AssignableInstance(createClusterConfig(null, null, false), new InstanceConfig(testInstanceName), liveInstance); Assert.assertEquals(ai.getUsedCapacity().size(), 1); Assert.assertEquals( (int) ai.getUsedCapacity().get(LiveInstance.InstanceResourceType.TASK_EXEC_THREAD.name()) .get(AssignableInstance.DEFAULT_QUOTA_TYPE), 0); Assert.assertEquals( (int) ai.getTotalCapacity().get(LiveInstance.InstanceResourceType.TASK_EXEC_THREAD.name()) .get(AssignableInstance.DEFAULT_QUOTA_TYPE), testCurrentTaskThreadPoolSize); Assert.assertEquals(ai.getCurrentAssignments().size(), 0); }

Target:
public void testInitializationWithQuotaUnset() { int expectedCurrentTaskThreadPoolSize = 100; LiveInstance liveInstance = createLiveInstance(null, null); liveInstance.setCurrentTaskThreadPoolSize(expectedCurrentTaskThreadPoolSize); AssignableInstance ai = new AssignableInstance(createClusterConfig(null, null, false), new InstanceConfig(testInstanceName), liveInstance); Assert.assertEquals(ai.getUsedCapacity().size(), 1); Assert.assertEquals( (int) ai.getUsedCapacity().get(LiveInstance.InstanceResourceType.TASK_EXEC_THREAD.name()) .get(AssignableInstance.DEFAULT_QUOTA_TYPE), 0); Assert.assertEquals( (int) ai.getTotalCapacity().get(LiveInstance.InstanceResourceType.TASK_EXEC_THREAD.name()) .get(AssignableInstance.DEFAULT_QUOTA_TYPE), expectedCurrentTaskThreadPoolSize); Assert.assertEquals(ai.getCurrentAssignments().size(), 0); }
Source:
public void drawItems(Rectangle bounds, ITimeDataProvider timeProvider, Item[] items, int topIndex, int nameSpace, GC gc) { for (int i = topIndex; i < items.length; i++) { Item item = items[i]; drawItem(item, bounds, timeProvider, i, nameSpace, gc); } fTimeGraphProvider.postDrawControl(bounds, gc); }

Target:
public void drawItems(Rectangle bounds, ITimeDataProvider timeProvider, Item[] items, int topIndex, int nameSpace, GC gc) { for (int i = topIndex; i < items.length; i++) { Item item = items[i]; drawItem(item, bounds, timeProvider, i, nameSpace, gc); } }
Source:
private void addClickHandler(final Button button) { button.addClickHandler(new ClickHandler() { @SuppressWarnings("unchecked") @Override public void onClick(ClickEvent event) { if (!button.isEnabled()) { return; } MultiSelectionModel<EntityModel> sourceSelectionModel = (button == downButton) ? topSelectionModel : bottomSelectionModel; EntityModelCellTable<ListModel> sourceTable = (button == downButton) ? topTable : bottomTable; EntityModelCellTable<ListModel> targetTable = (button == downButton) ? bottomTable : topTable; Set<EntityModel> selectedItems = sourceSelectionModel.getSelectedSet(); ((Collection<EntityModel>) sourceTable.flush().getItems()).removeAll(selectedItems); ListModel targetListModel = targetTable.flush(); Collection<EntityModel> targetItems = (Collection<EntityModel>) targetListModel.getItems(); if (targetItems == null) { targetItems = new LinkedList<EntityModel>(); targetListModel.setItems(targetItems); } targetItems.addAll(selectedItems); refresh(); } }); }

Target:
private void addClickHandler(final Button button) { button.addClickHandler(new ClickHandler() { @SuppressWarnings("unchecked") @Override public void onClick(ClickEvent event) { MultiSelectionModel<EntityModel> sourceSelectionModel = getSelectionModelForButton(button); EntityModelCellTable<ListModel> sourceTable = (button == downButton) ? topTable : bottomTable; EntityModelCellTable<ListModel> targetTable = (button == downButton) ? bottomTable : topTable; Set<EntityModel> selectedItems = sourceSelectionModel.getSelectedSet(); ((Collection<EntityModel>) sourceTable.flush().getItems()).removeAll(selectedItems); ListModel targetListModel = targetTable.flush(); Collection<EntityModel> targetItems = (Collection<EntityModel>) targetListModel.getItems(); if (targetItems == null) { targetItems = new LinkedList<EntityModel>(); targetListModel.setItems(targetItems); } targetItems.addAll(selectedItems); refresh(); } }); }
Source:
public void changeDisposition(int id){ factionInfo.setDisposition(id, -1); }

Target:
public void changeDisposition(int id) { FactionInfo.setDisposition(id, -1); }
Source:
public MotorcycleFlagEncoder( int speedBits, double speedFactor, int maxTurnCosts ) { super(speedBits, speedFactor, maxTurnCosts); restrictions.remove("motorcar"); restrictions.add("motorcycle"); trackTypeSpeedMap.clear(); defaultSpeedMap.clear(); trackTypeSpeedMap.put("grade1", 20); trackTypeSpeedMap.put("grade2", 15); trackTypeSpeedMap.put("grade3", 10); trackTypeSpeedMap.put("grade4", 5); trackTypeSpeedMap.put("grade5", 5); avoidSet.add("motorway"); avoidSet.add("trunk"); avoidSet.add("motorroad"); avoidSet.add("residential"); preferSet.add("primary"); preferSet.add("secondary"); preferSet.add("tertiary"); maxPossibleSpeed = 120; defaultSpeedMap.put("motorway", 100); defaultSpeedMap.put("motorway_link", 80); defaultSpeedMap.put("motorroad", 90); defaultSpeedMap.put("trunk", 80); defaultSpeedMap.put("trunk_link", 75); defaultSpeedMap.put("primary", 100); defaultSpeedMap.put("primary_link", 80); defaultSpeedMap.put("secondary", 90); defaultSpeedMap.put("secondary_link", 70); defaultSpeedMap.put("tertiary", 80); defaultSpeedMap.put("tertiary_link", 60); defaultSpeedMap.put("unclassified", 40); defaultSpeedMap.put("residential", 30); defaultSpeedMap.put("living_street", 5); defaultSpeedMap.put("service", 20); defaultSpeedMap.put("road", 40); defaultSpeedMap.put("track", 15); enjoyableTags.add("scenic"); frustratingTags.add("lit"); frustratingTags.add("motorroad"); frustratingTags.add("sidewalk"); }

Target:
public MotorcycleFlagEncoder( int speedBits, double speedFactor, int maxTurnCosts ) { super(speedBits, speedFactor, maxTurnCosts); restrictions.remove("motorcar"); restrictions.add("motorcycle"); trackTypeSpeedMap.clear(); defaultSpeedMap.clear(); trackTypeSpeedMap.put("grade1", 20); trackTypeSpeedMap.put("grade2", 15); trackTypeSpeedMap.put("grade3", 10); trackTypeSpeedMap.put("grade4", 5); trackTypeSpeedMap.put("grade5", 5); avoidSet.add("motorway"); avoidSet.add("trunk"); avoidSet.add("motorroad"); avoidSet.add("residential"); preferSet.add("primary"); preferSet.add("secondary"); preferSet.add("tertiary"); maxPossibleSpeed = 120; defaultSpeedMap.put("motorway", 100); defaultSpeedMap.put("motorway_link", 70); defaultSpeedMap.put("motorroad", 90); defaultSpeedMap.put("trunk", 80); defaultSpeedMap.put("trunk_link", 75); defaultSpeedMap.put("primary", 65); defaultSpeedMap.put("primary_link", 60); defaultSpeedMap.put("secondary", 60); defaultSpeedMap.put("secondary_link", 50); defaultSpeedMap.put("tertiary", 50); defaultSpeedMap.put("tertiary_link", 40); defaultSpeedMap.put("unclassified", 30); defaultSpeedMap.put("residential", 30); defaultSpeedMap.put("living_street", 5); defaultSpeedMap.put("service", 20); defaultSpeedMap.put("road", 20); defaultSpeedMap.put("track", 15); }
Source:
public GetBiosInfoVDSCommand(P parameters) { super(parameters, parameters.getVds()); if (getVds() == null) { setVds(DbFacade.getInstance().getVdsDao().get(parameters.getVdsId())); parameters.setVds(getVds()); } }

Target:
public GetBiosInfoVDSCommand(P parameters) { super(parameters, parameters.getVds()); }
Source:
public float getMin() { if (dataPoints.size() == 0) { return 0; } float smallestValue = dataPoints.get(0).floatValue(); for (int i = 1; i < dataPoints.size(); i++) { if (dataPoints.get(i).floatValue() < smallestValue) { smallestValue = dataPoints.get(i).floatValue(); } } return smallestValue; }

Target:
public double getMin() { if (dataPoints.size() == 0) { return 0; } double smallestValue = dataPoints.get(0).doubleValue(); for (int i = 1; i < dataPoints.size(); i++) { if (dataPoints.get(i).doubleValue() < smallestValue) { smallestValue = dataPoints.get(i).doubleValue(); } } return smallestValue; }
Source:
public boolean isEnabled(final String serviceId) { checkNotNull(serviceId); if ("wms".equalsIgnoreCase(serviceId)) { return isWMSCEnabled(); } if ("wmts".equalsIgnoreCase(serviceId)) { throw new ServiceException("To check if WMTS service is enable or disable use service info."); } if ("tms".equalsIgnoreCase(serviceId)) { return isTMSEnabled(); } return true; }

Target:
public boolean isEnabled(final String serviceId) { checkNotNull(serviceId); if ("wms".equalsIgnoreCase(serviceId)) { return isWMSCEnabled(); } if ("wmts".equalsIgnoreCase(serviceId)) { throw new RuntimeException("To check if WMTS service is enable or disable use service info."); } if ("tms".equalsIgnoreCase(serviceId)) { return isTMSEnabled(); } return true; }
Source:
public String getUsage() { StringBuilder sb = new StringBuilder(); sb.append("Usage: convert_type_ids -[P|U]\n"); sb.append("Synopsis:\n"); sb.append("This command will convert local type ids to remote type ids and vice versa (if needed to go back)\n"); sb.append("When ran without the [P] option, it only prints the numbers of rows in each table.\n"); sb.append("When ran with the [P] option, it converts the database putting remote_ids in for local_ids\n"); sb.append("When ran with the [U] (undo) option, it converts the database putting back local_ids in for remotes\n"); sb.append("Options:\n"); sb.append("\tP: Convert the database\n"); sb.append("\tU: Unconvert the database\n"); return sb.toString(); }

Target:
public String getUsage() { StringBuilder sb = new StringBuilder(); sb.append("Usage: convert_type_ids -[P|U]\n"); sb.append("Synopsis:\n"); sb.append("This command will convert local type ids to remote type ids and vice versa (if needed to go back)\n"); sb.append("When ran without the -P or -U option, it only prints the numbers of rows in each table.\n"); sb.append("When ran with the -P option, it converts the database putting remote_ids in for local_ids\n"); sb.append("When ran with the -U (undo) option, it converts the database putting back local_ids in for remotes\n"); sb.append("Options:\n"); sb.append("\tP: Convert the database\n"); sb.append("\tU: Unconvert the database\n"); return sb.toString(); }
Source:
public void increment(long amount) { long now = System.currentTimeMillis(); long ellapsedTime = now - buckets.get().getTimestamp(); long currentBucketKey = TimeUnit.SECONDS.convert(ellapsedTime, TimeUnit.MILLISECONDS); incrementBucket(currentBucketKey, amount); trimBuckets(currentBucketKey); }

Target:
public void increment(long amount) { long now = System.currentTimeMillis() / 1000L; int index = (int) now % numBuckets; buckets.get().addAndGet(index, amount); }
Source:
private void addCurrencyPairMetadata( Map<CurrencyPair, CurrencyPairMetaData> pairs, CurrencyPair pair, CurrencyPairMetaData pairMetadata) { CurrencyPairMetaData baseMetaData = pairs.get(pair); BigDecimal maxAmount = baseMetaData == null ? pairMetadata.getMaximumAmount() : baseMetaData.getMaximumAmount(); pairs.put( pair, new CurrencyPairMetaData( pairMetadata.getTradingFee(), pairMetadata.getMinimumAmount(), maxAmount, pairMetadata.getPriceScale(), null)); }

Target:
private void addCurrencyPairMetadata( Map<CurrencyPair, CurrencyPairMetaData> pairs, CurrencyPair pair, CurrencyPairMetaData pairMetadata) { CurrencyPairMetaData baseMetaData = pairs.get(pair); BigDecimal maxAmount = baseMetaData == null ? pairMetadata.getMaximumAmount() : baseMetaData.getMaximumAmount(); pairs.put( pair, new CurrencyPairMetaData.Builder() .tradingFee(pairMetadata.getTradingFee()) .minimumAmount(pairMetadata.getMinimumAmount()) .maximumAmount(maxAmount) .priceScale(pairMetadata.getPriceScale()) .build()); }
Source:
public Optional<QueryId> chooseQueryToKill(List<QueryMemoryInfo> queries, List<MemoryInfo> nodes) { Map<QueryId, Long> memoryReservationOnBlockedNodes = new HashMap<>(); for (MemoryInfo node : nodes) { MemoryPoolInfo generalPool = node.getPools().get(GENERAL_POOL); if (generalPool == null) { continue; } if (generalPool.getFreeBytes() + generalPool.getReservedRevocableBytes() > 0) { continue; } Map<QueryId, Long> queryMemoryReservations = generalPool.getQueryMemoryReservations(); for (Map.Entry<QueryId, Long> query : queryMemoryReservations.entrySet()) { QueryId queryId = query.getKey(); long memoryReservation = query.getValue(); memoryReservationOnBlockedNodes.compute(queryId, (id, oldValue) -> oldValue == null ? memoryReservation : oldValue + memoryReservation); } } QueryId biggestQuery = null; long maxMemory = 0; for (Map.Entry<QueryId, Long> query : memoryReservationOnBlockedNodes.entrySet()) { long bytesUsed = query.getValue(); if (bytesUsed > maxMemory) { biggestQuery = query.getKey(); maxMemory = bytesUsed; } } return Optional.ofNullable(biggestQuery); }

Target:
public Optional<QueryId> chooseQueryToKill(List<QueryMemoryInfo> queries, List<MemoryInfo> nodes) { Map<QueryId, Long> memoryReservationOnBlockedNodes = new HashMap<>(); for (MemoryInfo node : nodes) { MemoryPoolInfo generalPool = node.getPools().get(GENERAL_POOL); if (generalPool == null) { continue; } if (generalPool.getFreeBytes() + generalPool.getReservedRevocableBytes() > 0) { continue; } Map<QueryId, Long> queryMemoryReservations = generalPool.getQueryMemoryReservations(); queryMemoryReservations.forEach((queryId, memoryReservation) -> { memoryReservationOnBlockedNodes.compute(queryId, (id, oldValue) -> oldValue == null ? memoryReservation : oldValue + memoryReservation); }); } return memoryReservationOnBlockedNodes.entrySet().stream() .max(comparingLong(Map.Entry::getValue)) .map(Map.Entry::getKey); }
Source:
private static boolean isLowMemoryDevice(ActivityManager activityManager) { return Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT && activityManager.isLowRamDevice(); }

Target:
private static boolean isLowMemoryDevice(ActivityManager activityManager) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { return activityManager.isLowRamDevice(); } else { return false; } }
Source:
private Object toPrestoValue(Object tpcdsValue, Type type) { if (type instanceof VarcharType) { return Slices.utf8Slice((String) tpcdsValue); } else if (type instanceof CharType) { return trimSpacesAndTruncateToLength(Slices.utf8Slice((String) tpcdsValue), type); } else if (type.equals(BIGINT) || type.equals(INTEGER) || type.equals(DATE) || type instanceof DecimalType) { return ((Number) tpcdsValue).longValue(); } else if (type.equals(DOUBLE)) { return ((Number) tpcdsValue).doubleValue(); } else if (type.equals(TimeType.TIME)) { return ((Number) tpcdsValue).longValue(); } throw new IllegalArgumentException("unsupported column type " + type); }

Target:
private Object toPrestoValue(Object tpcdsValue, Type type) { if (type instanceof VarcharType) { return Slices.utf8Slice((String) tpcdsValue); } else if (type instanceof CharType) { return trimSpacesAndTruncateToLength(Slices.utf8Slice((String) tpcdsValue), type); } else if (type.equals(BIGINT) || type.equals(INTEGER) || type.equals(DATE) || (type instanceof DecimalType && isShortDecimal(type))) { return ((Number) tpcdsValue).longValue(); } else if (type.equals(DOUBLE)) { return ((Number) tpcdsValue).doubleValue(); } else if (type.equals(TimeType.TIME)) { return ((Number) tpcdsValue).longValue(); } throw new IllegalArgumentException("unsupported column type " + type); }
Source:
public Range(long rangeStart, long rangeEnd) { this.rangeStart = rangeStart; this.rangeEnd = rangeEnd; long numberOfMacsLong = (rangeEnd - rangeStart) + 1; if (numberOfMacsLong > Integer.MAX_VALUE) { throw new IllegalArgumentException(); } int numberOfMacs = (int) numberOfMacsLong; this.availableMacsCount = numberOfMacs; this.usedMacs = new BitSet(numberOfMacs); }

Target:
public Range(long rangeStart, long rangeEnd) { this.rangeStart = rangeStart; this.rangeEnd = rangeEnd; long numberOfMacsLong = (rangeEnd - rangeStart) + 1; Validate.isTrue(numberOfMacsLong <= Integer.MAX_VALUE, String.format("Range too big; Range shouldn't be bigger than %1$s, but passed one " + "contains %2$s elements.", Integer.MAX_VALUE, numberOfMacsLong)); int numberOfMacs = (int) numberOfMacsLong; this.availableMacsCount = numberOfMacs; this.usedMacs = new BitSet(numberOfMacs); }
Source:
protected Package definePackage(final String name, final String specTitle, final String specVersion, final String specVendor, final String implTitle, final String implVersion, final String implVendor, final URL sealBase) throws IllegalArgumentException { ThreadLocal<Boolean> suppressor = GET_PACKAGE_SUPPRESSOR; suppressor.set(Boolean.TRUE); try { Package existing = packages.get(name); if (existing != null) { return existing; } Package pkg; try { pkg = super.definePackage(name, specTitle, specVersion, specVendor, implTitle, implVersion, implVendor, sealBase); } catch (final IllegalArgumentException iae) { pkg = super.getPackage(name); } existing = packages.putIfAbsent(name, pkg); return existing != null ? existing : pkg; } finally { suppressor.remove(); } }

Target:
protected Package definePackage(final String name, final String specTitle, final String specVersion, final String specVendor, final String implTitle, final String implVersion, final String implVendor, final URL sealBase) throws IllegalArgumentException { ThreadLocal<Boolean> suppressor = GET_PACKAGE_SUPPRESSOR; suppressor.set(Boolean.TRUE); try { Package existing = packages.get(name); if (existing != null) { return existing; } Package pkg; try { pkg = super.definePackage(name, specTitle, specVersion, specVendor, implTitle, implVersion, implVendor, sealBase); } catch (final IllegalArgumentException iae) { pkg = super.getPackage(name); if (pkg == null) throw iae; } existing = packages.putIfAbsent(name, pkg); return existing != null ? existing : pkg; } finally { suppressor.remove(); } }