auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public String getContent() { String value = super.getContent(); if (value != null) { return value; } else if(this.groupId.getContent() != null && this.artifactId.getContent() != null) { return this.groupId.getContent() .concat(".") .concat(this.artifactId.getContent()) .replaceAll("-", ""); } return null; }

Target:
public String getContent() { String value = super.getContent(); if (value != null) { return value; } else if(this.groupId.getContent() != null && this.artifactId.getContent() != null) { return this.groupId.getContent() .concat(".") .concat(this.artifactId.getContent()) .replaceAll("-", "") .replaceAll("\\.[0-9]+", "."); } return null; }
Source:
public UserRequest(final Activity activity, User user, HashMap<String, JSONObject> params, final Response.Listener<User> listener) { super(Request.Method.GET, makeURL("users"), new JSONObject(params), new Response.Listener<JSONObject>() { @Override public void onResponse(JSONObject jsonObject) { try { String userJson = jsonObject.get("user").toString(); ObjectMapper mapper = getNetworkManager(activity.getApplicationContext()).getObjectMapper(); User user = mapper.readValue(userJson, new TypeReference<User>() { }); listener.onResponse(user); } catch (Exception e) { Log.e("Json exception", e.toString()); } } }, activity); }

Target:
public UserRequest(final Activity activity, User user, HashMap<String, JSONObject> params, final Response.Listener<User> listener) { super(Request.Method.GET, makeObjectURL("users", user), new JSONObject(params), new Response.Listener<JSONObject>() { @Override public void onResponse(JSONObject jsonObject) { try { String userJson = jsonObject.get("user").toString(); ObjectMapper mapper = getNetworkManager(activity.getApplicationContext()).getObjectMapper(); User user = mapper.readValue(userJson, new TypeReference<User>() { }); listener.onResponse(user); } catch (Exception e) { Log.e("Json exception", e.toString()); } } }, activity); }
Source:
public void of(RecordCursor base, SqlExecutionContext executionContext) { try { this.chainCursor = chain.getCursor(base); final Record record = base.getRecord(); chain.clear(); while (base.hasNext()) { executionContext.getSqlExecutionInterruptor().checkInterrupted(); chain.put(record); } chainCursor.toTop(); } catch (CairoException ex) { base.close(); throw ex; } }

Target:
public void of(RecordCursor base, SqlExecutionContext executionContext) { try { this.chainCursor = chain.getCursor(base); final Record record = base.getRecord(); SqlExecutionInterruptor interruptor = executionContext.getSqlExecutionInterruptor(); chain.clear(); while (base.hasNext()) { interruptor.checkInterrupted(); chain.put(record); } chainCursor.toTop(); } catch (CairoException ex) { base.close(); throw ex; } }
Source:
public void testUpdateCommentEmail() throws Exception { CommentAttributes existingComment1 = dataBundle.comments.get("comment1FromI1C1toS1C1"); ______TS("typical success case: email changed"); String courseId = existingComment1.courseId; String oldInstrEmail = existingComment1.lastEditorEmail; String updatedInstrEmail = "otheremail@gmail.tmt"; commentsLogic.updateInstructorEmail(courseId, oldInstrEmail, updatedInstrEmail); List<CommentAttributes> updatedComments = commentsLogic.getCommentsForGiver(courseId, updatedInstrEmail); for (CommentAttributes updatedComment : updatedComments) { assertEquals(updatedInstrEmail, updatedComment.giverEmail); if (updatedComment.lastEditorEmail != null) { assertEquals(updatedInstrEmail, updatedComment.lastEditorEmail); } } commentsLogic.updateInstructorEmail(courseId, updatedInstrEmail, oldInstrEmail); }

Target:
public void testUpdateCommentEmail() throws Exception { CommentAttributes existingComment1 = dataBundle.comments.get("comment1FromI1C1toS1C1"); ______TS("typical success case: email changed"); String courseId = existingComment1.courseId; String oldInstrEmail = existingComment1.lastEditorEmail; String updatedInstrEmail = "otheremail@gmail.tmt"; commentsLogic.updateInstructorEmail(courseId, oldInstrEmail, updatedInstrEmail); List<CommentAttributes> updatedComments = commentsLogic.getCommentsForGiver(courseId, updatedInstrEmail); for (CommentAttributes updatedComment : updatedComments) { assertEquals(updatedInstrEmail, updatedComment.giverEmail); if (updatedComment.lastEditorEmail != null) { assertEquals(updatedInstrEmail, updatedComment.lastEditorEmail); } } }
Source:
public List<ProcessDTO> getProcesses() { try { if (ServiceManager.getSecurityAccessService().hasAuthorityToViewProcessList() && processList.isEmpty()) { processList = ServiceManager.getProcessService().loadData(0, 10, SORT_ID, SortOrder.DESCENDING, null); Collections.sort(processList, (one, other) -> other.getId() - one.getId()); } } catch (DataException | JsonException e) { Helper.setErrorMessage(ERROR_LOADING_MANY, new Object[] {ObjectType.PROCESS.getTranslationPlural() }, logger, e); } return processList; }

Target:
public List<ProcessDTO> getProcesses() { try { if (ServiceManager.getSecurityAccessService().hasAuthorityToViewProcessList() && processList.isEmpty()) { processList = ServiceManager.getProcessService().loadData(0, 10, SORT_ID, SortOrder.DESCENDING, null); } } catch (DataException | JsonException e) { Helper.setErrorMessage(ERROR_LOADING_MANY, new Object[] {ObjectType.PROCESS.getTranslationPlural() }, logger, e); } return processList; }
Source:
public synchronized long registerOperationWithHeapSize(long heapSize){ long operationId = ++operationSequenceGenerator; while (currentWriteBufferSize >= maxHeapSize || pendingOperationsWithSize.size() >= maxInFlightRpcs) { try { wait(WAIT_MILLIS); } catch (InterruptedException e) { LOG.error("Failed waiting for async operation", e); } } pendingOperationsWithSize.put(operationId, heapSize); currentWriteBufferSize += heapSize; return operationId; }

Target:
public synchronized long registerOperationWithHeapSize(long heapSize) throws InterruptedException { long operationId = ++operationSequenceGenerator; while (currentWriteBufferSize >= maxHeapSize || pendingOperationsWithSize.size() >= maxInFlightRpcs) { wait(WAIT_MILLIS); } lastOperationChange = System.currentTimeMillis(); pendingOperationsWithSize.put(operationId, heapSize); currentWriteBufferSize += heapSize; return operationId; }
Source:
public void firePropertyChangeEvent(String name, Object oldValue, Object newValue) { final Object[] list = getListeners(); if (list.length == 0) { return; } final PropertyChangeEvent event = new PropertyChangeEvent(this, name, oldValue, newValue); for (Object element : list) { final IPropertyChangeListener listener = (IPropertyChangeListener) element; SafeRunner.run(new SafeRunnable(JFaceResources .getString("PreferenceStore.changeError")) { @Override public void run() { listener.propertyChange(event); } }); } }

Target:
public void firePropertyChangeEvent(String name, Object oldValue, Object newValue) { final Object[] listeners = getListeners(); if (listeners.length == 0) { return; } final PropertyChangeEvent event = new PropertyChangeEvent(this, name, oldValue, newValue); for (Object listener : listeners) { final IPropertyChangeListener propertyChangeListener = (IPropertyChangeListener) listener; SafeRunner.run(new SafeRunnable(JFaceResources .getString("PreferenceStore.changeError")) { @Override public void run() { propertyChangeListener.propertyChange(event); } }); } }
Source:
public ChatComponent setUnderlined(boolean underlined) { $lock.writeLock().lock(); if (this.underlined == null) this.underlined = new AtomicBoolean(underlined); else this.underlined.set(underlined); $lock.writeLock().unlock(); return this; }

Target:
public ChatComponent setUnderlined(boolean underlined) { if (this.underlined == null) this.underlined = new AtomicBoolean(underlined); else this.underlined.set(underlined); return this; }
Source:
public void testGetStudyDetailsForGeolocationWithPI_ID() { final DmsProject environmentDataset = this.testDataInitializer .createDmsProject("Summary Dataset", "Summary Dataset-Description", study, study, DatasetTypeEnum.SUMMARY_DATA); final int locationId = 101; final Geolocation geolocation = this.testDataInitializer.createTestGeolocation("1", locationId); this.testDataInitializer .createTestExperiment(environmentDataset, geolocation, TermId.TRIAL_ENVIRONMENT_EXPERIMENT.getId(), "0", null); this.testDataInitializer.addProjectProp(study, TermId.PI_ID.getId(), "", VariableType.STUDY_DETAIL, "1", 6); final StudyDetailsDto studyDetailsDto = this.studyService.getStudyDetailsForGeolocation(geolocation.getLocationId()); Assert.assertFalse(CollectionUtils.isEmpty(studyDetailsDto.getContacts())); Assert.assertEquals(locationId, studyDetailsDto.getMetadata().getLocationId().intValue()); Assert.assertEquals(geolocation.getLocationId(), studyDetailsDto.getMetadata().getStudyDbId()); Assert.assertEquals(this.study.getProjectId(), studyDetailsDto.getMetadata().getTrialDbId()); Assert.assertEquals(this.study.getName() + " Environment Number 1", studyDetailsDto.getMetadata().getStudyName()); }

Target:
public void testGetStudyDetailsForGeolocationWithPI_ID() { final DmsProject environmentDataset = this.testDataInitializer .createDmsProject("Summary Dataset", "Summary Dataset-Description", this.study, this.study, DatasetTypeEnum.SUMMARY_DATA); final WorkbenchUser user = this.testDataInitializer.createUserForTesting(); final int locationId = 101; final Geolocation geolocation = this.testDataInitializer.createTestGeolocation("1", locationId); this.testDataInitializer .createTestExperiment(environmentDataset, geolocation, TermId.TRIAL_ENVIRONMENT_EXPERIMENT.getId(), "0", null); this.testDataInitializer.addProjectProp(this.study, TermId.PI_ID.getId(), "", VariableType.STUDY_DETAIL, user.getUserid().toString(), 6); final StudyDetailsDto studyDetailsDto = this.studyService.getStudyDetailsForGeolocation(geolocation.getLocationId()); Assert.assertFalse(CollectionUtils.isEmpty(studyDetailsDto.getContacts())); Assert.assertEquals(user.getUserid(), studyDetailsDto.getContacts().get(0).getUserId()); Assert.assertEquals(locationId, studyDetailsDto.getMetadata().getLocationId().intValue()); Assert.assertEquals(geolocation.getLocationId(), studyDetailsDto.getMetadata().getStudyDbId()); Assert.assertEquals(this.study.getProjectId(), studyDetailsDto.getMetadata().getTrialDbId()); Assert.assertEquals(this.study.getName() + " Environment Number 1", studyDetailsDto.getMetadata().getStudyName()); }
Source:
public int hashCode() { return name.hashCode(); }

Target:
public int hashCode() { return Objects.hash(volumeSize, super.hashCode()); }
Source:
public static int getBestMipMapLevel( final AffineTransform3D screenTransform, final Source< ? > source, final int timepoint ) { final int[] targetLevels = new int[] { -1, -1, -1 }; final int numLevels = source.getNumMipmapLevels(); for ( int level = numLevels - 1; level >= 0; --level ) { final double[] voxelScreenSize = getVoxelScreenSize( screenTransform, source, timepoint, level ); for ( int d = 0; d < 3; ++d ) { if ( voxelScreenSize[ d ] < 0.99 && targetLevels[ d ] == -1 ) { targetLevels[ d ] = Math.min( level + 1, numLevels - 1 ); } } } int targetLevel = Math.max( Arrays.stream( targetLevels ).max().getAsInt(), 0 ); if ( targetLevel > 0 ) { final double[] size1 = getVoxelScreenSize( screenTransform, source, timepoint, targetLevel ); final double[] size0 = getVoxelScreenSize( screenTransform, source, timepoint, targetLevel - 1 ); if ( Math.abs( Arrays.stream( size1 ).max().getAsDouble() - 1.0 ) / 2 > Math.abs( Arrays.stream( size0 ).max().getAsDouble() - 1.0 ) ) targetLevel--; } return targetLevel; }

Target:
public static int getBestMipMapLevel( final AffineTransform3D screenTransform, final Source< ? > source, final int timepoint ) { final int numLevels = source.getNumMipmapLevels(); final double[] bestPixelSourceSize = new double[] { 1, 1 }; int targetLevel = numLevels; double minDist = Double.POSITIVE_INFINITY; for ( int level = 0; level < numLevels; ++level ) { final double[] pixelSourceSize = getPixelSourceSize( screenTransform, source, timepoint, level ); final double dist = LinAlgHelpers.squareDistance( pixelSourceSize, bestPixelSourceSize ); if ( minDist > dist ) { minDist = dist; targetLevel = level; } } return targetLevel; }
Source:
public PooledConnection borrowConnection(ServerLocation server, long acquireTimeout, boolean onlyUseExistingCnx) throws AllConnectionsInUseException, NoAvailableServersException, ServerOperationException { PooledConnection connection = availableConnectionManager.useFirst((c) -> c.getServer().equals(server)); if (null != connection) { return connection; } if (!onlyUseExistingCnx) { connection = forceCreateConnection(server); if (null != connection) { return connection; } throw new ServerConnectivityException(BORROW_CONN_ERROR_MSG + server); } long waitStart = NOT_WAITING; try { long timeout = System.nanoTime() + MILLISECONDS.toNanos(acquireTimeout); while (true) { connection = availableConnectionManager.useFirst((c) -> c.getServer().equals(server)); if (null != connection) { return connection; } if (checkShutdownInterruptedOrTimeout(timeout)) { break; } waitStart = beginConnectionWaitStatIfNotStarted(waitStart); Thread.yield(); } } finally { endConnectionWaitStatIfStarted(waitStart); } cancelCriterion.checkCancelInProgress(null); throw new AllConnectionsInUseException(); }

Target:
public PooledConnection borrowConnection(ServerLocation server, long acquireTimeout, boolean onlyUseExistingCnx) throws AllConnectionsInUseException, NoAvailableServersException, ServerConnectivityException { PooledConnection connection = availableConnectionManager.useFirst((c) -> c.getServer().equals(server)); if (null != connection) { return connection; } if (!onlyUseExistingCnx) { connection = forceCreateConnection(server); if (null != connection) { return connection; } throw new ServerConnectivityException(BORROW_CONN_ERROR_MSG + server); } long waitStart = NOT_WAITING; try { long timeout = System.nanoTime() + MILLISECONDS.toNanos(acquireTimeout); while (true) { connection = availableConnectionManager.useFirst((c) -> c.getServer().equals(server)); if (null != connection) { return connection; } if (checkShutdownInterruptedOrTimeout(timeout)) { break; } waitStart = beginConnectionWaitStatIfNotStarted(waitStart); Thread.yield(); } } finally { endConnectionWaitStatIfStarted(waitStart); } cancelCriterion.checkCancelInProgress(null); throw new AllConnectionsInUseException(); }
Source:
private String waitAndRetrieveContainerID(String deploymentName) throws IOException { for (int i = 0; i < OPENSHIFT_WAIT_POD_TIMEOUT; i++) { try { Thread.sleep(OPENSHIFT_WAIT_POD_DELAY); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); } List<Pod> pods = openShiftClient.pods() .inNamespace(this.openShiftCheProjectName) .withLabel(OPENSHIFT_DEPLOYMENT_LABEL, deploymentName) .list() .getItems(); if (pods.size() < 1) { throw new DockerException(String.format("Pod with deployment name %s not found", deploymentName), 1); } else if (pods.size() > 1) { throw new DockerException(String.format("Multiple pods with deployment name %s found", deploymentName), 1); } Pod pod = pods.get(0); String status = pod.getStatus().getPhase(); if (OPENSHIFT_POD_STATUS_RUNNING.equals(status)) { String containerID = pod.getStatus().getContainerStatuses().get(0).getContainerID(); String normalizedID = KubernetesStringUtils.normalizeContainerID(containerID); openShiftClient.pods() .inNamespace(openShiftCheProjectName) .withName(pod.getMetadata().getName()) .edit() .editMetadata() .addToLabels(CHE_CONTAINER_IDENTIFIER_LABEL_KEY, KubernetesStringUtils.getLabelFromContainerID(normalizedID)) .endMetadata() .done(); return normalizedID; } } return null; }

Target:
private String waitAndRetrieveContainerID(String deploymentName) throws IOException { for (int i = 0; i < OPENSHIFT_WAIT_POD_TIMEOUT; i++) { try { Thread.sleep(OPENSHIFT_WAIT_POD_DELAY); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); } List<Pod> pods = openShiftClient.pods() .inNamespace(this.openShiftCheProjectName) .withLabel(OPENSHIFT_DEPLOYMENT_LABEL, deploymentName) .list() .getItems(); if (pods.size() < 1) { throw new OpenShiftException(String.format("Pod with deployment name %s not found", deploymentName)); } else if (pods.size() > 1) { throw new OpenShiftException(String.format("Multiple pods with deployment name %s found", deploymentName)); } Pod pod = pods.get(0); String status = pod.getStatus().getPhase(); if (OPENSHIFT_POD_STATUS_RUNNING.equals(status)) { String containerID = pod.getStatus().getContainerStatuses().get(0).getContainerID(); String normalizedID = KubernetesStringUtils.normalizeContainerID(containerID); openShiftClient.pods() .inNamespace(openShiftCheProjectName) .withName(pod.getMetadata().getName()) .edit() .editMetadata() .addToLabels(CHE_CONTAINER_IDENTIFIER_LABEL_KEY, KubernetesStringUtils.getLabelFromContainerID(normalizedID)) .endMetadata() .done(); return normalizedID; } } return null; }
Source:
public static Pair<String, Long> getPrimaryStoragePathAndSize() { return Pair.create(null, FileUtils.roundStorageSize(Environment.getDataDirectory().getTotalSpace())); }

Target:
public static Pair<String, Long> getPrimaryStoragePathAndSize() { return Pair.create(null, FileUtils.roundStorageSize(Environment.getDataDirectory().getTotalSpace() + Environment.getRootDirectory().getTotalSpace())); }
Source:
private void write(SelectionKey key, Transmissions transmissions) throws IOException { long startTimeToWriteInMs = time.milliseconds(); try { SocketChannel socketChannel = channel(key); NetworkSend networkSend = transmissions.send; Send send = networkSend.getPayload(); if (send == null) { throw new IllegalStateException("Registered for write interest but no response attached to key."); } send.writeTo(socketChannel); if (logger.isTraceEnabled()) { logger.trace("Bytes written to using key ", socketChannel.socket().getRemoteSocketAddress(), key); } if (send.isSendComplete()) { if (logger.isTraceEnabled()) { logger.trace("Finished writing, registering for read on connection {}", socketChannel.socket().getRemoteSocketAddress()); } this.completedSends.add(transmissions.send); transmissions.clearSend(); key.interestOps(key.interestOps() & ~SelectionKey.OP_WRITE | SelectionKey.OP_READ); } } finally { if (logger.isTraceEnabled()) { long writeTime = time.milliseconds() - startTimeToWriteInMs; logger.trace("SocketServer time spent on write per key = {}", transmissions.connectionId, writeTime); } } }

Target:
private void write(SelectionKey key, Transmissions transmissions) throws IOException { long startTimeToWriteInMs = time.milliseconds(); try { SocketChannel socketChannel = channel(key); NetworkSend networkSend = transmissions.send; Send send = networkSend.getPayload(); if (send == null) { throw new IllegalStateException("Registered for write interest but no response attached to key."); } send.writeTo(socketChannel); logger.trace("Bytes written to using key {}", socketChannel.socket().getRemoteSocketAddress(), transmissions.connectionId); if (send.isSendComplete()) { logger.trace("Finished writing, registering for read on connection {}", socketChannel.socket().getRemoteSocketAddress()); networkSend.onSendComplete(); this.completedSends.add(networkSend); metrics.sendInFlight.dec(); metrics.updateNodeSendMetric(transmissions.remoteHostName, transmissions.remotePort, send.sizeInBytes(), time.milliseconds() - networkSend.getSendStartTimeInMs()); transmissions.clearSend(); key.interestOps(key.interestOps() & ~SelectionKey.OP_WRITE | SelectionKey.OP_READ); } } finally { long writeTime = time.milliseconds() - startTimeToWriteInMs; logger.trace("SocketServer time spent on write per key = {}", transmissions.connectionId, writeTime); } }
Source:
@Nullable public String getScope() { for (FormGroup formGroup : form) { for (FormField formField : formGroup.getFields()) { if (formField.getId().equals("scope")) { return formField.getValue().toString(); } } } return null; }

Target:
@Nullable public String getScope() { for (FormGroup formGroup : form) { for (FormField formField : formGroup.getFields()) { if (formField.getId() != null && formField.getValue() != null && formField.getId().equals(FormField.SCOPE)) { return formField.getValue().toString(); } } } return null; }
Source:
protected void cleanUp(UserAccount userAccount) { SalesforceAnalyticsManager.reset(userAccount); RestClient.clearCaches(userAccount); UserAccountManager.getInstance().clearCachedCurrentUser(userAccount); }

Target:
protected void cleanUp(UserAccount userAccount) { SalesforceAnalyticsManager.reset(userAccount); RestClient.clearCaches(userAccount); UserAccountManager.getInstance().clearCachedCurrentUser(); }
Source:
public boolean isUseBase() { if (useBase == null){ return getDefault().useBase; } return useBase; }

Target:
public boolean isUseBase() { return useBase; }
Source:
public JSONArray(Iterable<?> iter) { this(); if (iter == null) { return; } this.addAll(iter); }

Target:
public JSONArray(Iterable<?> iter) { this(); if (iter == null) { return; } this.addAll(iter, true); }
Source:
public void setScrollTargetCallback(ScrollTargetCallback scrollTargetCallback) { mScrollTargetCallback = scrollTargetCallback; setBehaviorScrollTargetCallback(); }

Target:
public void setScrollTargetCallback(ScrollTargetCallback scrollTargetCallback) { mScrollTargetCallback = scrollTargetCallback; }
Source:
private void onStart() { if (!mIsRunning) { return; } mAnimatedDrawableDiagnostics.onStartMethodBegin(); try { mStartTimeMs = mMonotonicClock.now(); mStartTimeMs -= resumable ? mAnimatedDrawableBackend.getTimestampMsForFrame(mPauseFrameNumber) : 0; mScheduledFrameNumber = resumable ? mPauseFrameNumber : 0; mScheduledFrameMonotonicNumber = resumable ? mPauseFrameNumber : 0; long nextFrameMs = mStartTimeMs + mAnimatedDrawableBackend.getDurationMsForFrame(0); scheduleSelf(mNextFrameTask, nextFrameMs); mNextFrameTaskMs = nextFrameMs; doInvalidateSelf(); } finally { mAnimatedDrawableDiagnostics.onStartMethodEnd(); } }

Target:
private void onStart() { if (!mIsRunning) { return; } mAnimatedDrawableDiagnostics.onStartMethodBegin(); try { mStartTimeMs = mMonotonicClock.now(); if (mIsPaused) { mStartTimeMs -= mAnimatedDrawableBackend.getTimestampMsForFrame(mScheduledFrameNumber); } else { mScheduledFrameNumber = 0; mScheduledFrameMonotonicNumber = 0; } long nextFrameMs = mStartTimeMs + mAnimatedDrawableBackend.getDurationMsForFrame(0); scheduleSelf(mNextFrameTask, nextFrameMs); mNextFrameTaskMs = nextFrameMs; doInvalidateSelf(); } finally { mAnimatedDrawableDiagnostics.onStartMethodEnd(); } }
Source:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; RequestParam that = (RequestParam) o; return name.equals(that.name); }

Target:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; RequestParam that = (RequestParam) o; return name.equals(that.name) && value.equals(that.value); }
Source:
public PreviewEditModePageObject previewArticle() { preview(); return new PreviewEditModePageObject(driver); }

Target:
public PreviewEditModePageObject previewArticle() { driver.switchTo().defaultContent(); previewButton.click(); PageObjectLogging.log("preview", "Page preview displayed", true); return new PreviewEditModePageObject(driver); }
Source:
public static void _doScript(StaplerRequest req, StaplerResponse rsp, RequestDispatcher view, VirtualChannel channel, ACL acl) throws IOException, ServletException { acl.checkPermission(ADMINISTER); String text = req.getParameter("script"); if (text != null) { if (!"POST".equals(req.getMethod())) { throw HttpResponses.error(HttpURLConnection.HTTP_BAD_METHOD, "requires POST"); } if (channel == null) { throw HttpResponses.error(HttpURLConnection.HTTP_NOT_FOUND, "Node is offline"); } try { LOGGER.log(Level.INFO, req.getRemoteAddr() + "|" + Jenkins.getAuthentication().getName() + "|ScriptConsole|" + Base64.getEncoder().encodeToString(text.getBytes())); req.setAttribute("output", RemotingDiagnostics.executeGroovy(text, channel)); } catch (InterruptedException e) { throw new ServletException(e); } } view.forward(req, rsp); }

Target:
public static void _doScript(StaplerRequest req, StaplerResponse rsp, RequestDispatcher view, VirtualChannel channel, ACL acl) throws IOException, ServletException { acl.checkPermission(ADMINISTER); String text = req.getParameter("script"); if (text != null) { if (!"POST".equals(req.getMethod())) { throw HttpResponses.error(HttpURLConnection.HTTP_BAD_METHOD, "requires POST"); } if (channel == null) { throw HttpResponses.error(HttpURLConnection.HTTP_NOT_FOUND, "Node is offline"); } try { LOGGER.log(Level.INFO, "Administrative Groovy script by " + Jenkins.getAuthentication().getName() + " from " + req.getRemoteAddr() + ": (base64) " + Base64.getEncoder().encodeToString(text.getBytes())); req.setAttribute("output", RemotingDiagnostics.executeGroovy(text, channel)); } catch (InterruptedException e) { throw new ServletException(e); } } view.forward(req, rsp); }
Source:
private void persist(List<EntityType> copiedEntityTypes, CopyState state) { entityTypeDependencyResolver .resolve(copiedEntityTypes) .stream() .map(copy -> cutDefaultValues(copy, state)) .map(this::persistEntityType) .collect(toList()) .stream() .map(copy -> copyEntities(copy, state)) .map(copy -> pasteDefaultValues(copy, state)) .forEach(e -> state.progress().increment(1)); }

Target:
private void persist(List<EntityType> copiedEntityTypes, CopyState state) { List<EntityType> persistedEntityTypes = entityTypeDependencyResolver .resolve(copiedEntityTypes) .stream() .map(copy -> cutDefaultValues(copy, state)) .map(this::persistEntityType) .collect(toList()); persistedEntityTypes .stream() .map(copy -> copyEntities(copy, state)) .map(copy -> pasteDefaultValues(copy, state)) .forEach(e -> state.progress().increment(1)); }
Source:
public boolean isValidTokenLocalUser(int token, String username) throws TOTPException { KeyRepresentation encoding = KeyRepresentation.BASE32; try { if ("Base64".equals(TOTPUtil.getEncodingMethod())) { encoding = KeyRepresentation.BASE64; } } catch (IdentityApplicationManagementException e) { log.error("Error when reading the tenant encoding method"); } GoogleAuthenticatorConfig.GoogleAuthenticatorConfigBuilder gacb = new GoogleAuthenticatorConfig .GoogleAuthenticatorConfigBuilder() .setKeyRepresentation(encoding); GoogleAuthenticator googleAuthenticator = new GoogleAuthenticator(gacb.build()); try { int tenantId = IdentityUtil.getTenantIdOFUser(username); UserRealm userRealm = TOTPManagerComponent.getRealmService().getTenantUserRealm(tenantId); if (userRealm != null) { UserStoreManager userStoreManager = userRealm.getUserStoreManager(); String secretkey = userStoreManager.getUserClaimValue(MultitenantUtils.getTenantAwareUsername (username), Constants.SECRET_KEY, null); return googleAuthenticator.authorize(secretkey, token); } else { throw new TOTPException("Cannot find the user realm for the given tenant domain : " + CarbonContext .getThreadLocalCarbonContext().getTenantDomain()); } } catch (IdentityException e) { throw new TOTPException("TOTPTokenVerifier failed while trying to get the tenant ID of the user : " + username, e); } catch (UserStoreException e) { log.error("TOTPTokenVerifier failed while trying to access userRealm", e); throw new TOTPException("TOTPTokenVerifier failed while trying to access userRealm of the user : " + username, e); } }

Target:
public boolean isValidTokenLocalUser(int token, String username) throws TOTPException { KeyRepresentation encoding = KeyRepresentation.BASE32; try { if ("Base64".equals(TOTPUtil.getEncodingMethod())) { encoding = KeyRepresentation.BASE64; } } catch (IdentityApplicationManagementException e) { log.error("Error when reading the tenant encoding method"); } GoogleAuthenticatorConfig.GoogleAuthenticatorConfigBuilder gacb = new GoogleAuthenticatorConfig .GoogleAuthenticatorConfigBuilder() .setKeyRepresentation(encoding); GoogleAuthenticator googleAuthenticator = new GoogleAuthenticator(gacb.build()); try { int tenantId = IdentityUtil.getTenantIdOFUser(username); UserRealm userRealm = TOTPManagerComponent.getRealmService().getTenantUserRealm(tenantId); if (userRealm != null) { UserStoreManager userStoreManager = userRealm.getUserStoreManager(); String secretkey = userStoreManager.getUserClaimValue(MultitenantUtils.getTenantAwareUsername (username), Constants.SECRET_KEY, null); return googleAuthenticator.authorize(secretkey, token); } else { throw new TOTPException("Cannot find the user realm for the given tenant domain : " + CarbonContext .getThreadLocalCarbonContext().getTenantDomain()); } } catch (IdentityException e) { throw new TOTPException("TOTPTokenVerifier failed while trying to get the tenant ID of the user : " + username, e); } catch (UserStoreException e) { throw new TOTPException("TOTPTokenVerifier failed while trying to access userRealm of the user : " + username, e); } }
Source:
private boolean hasSpaceForSnapthosts(VM vm) { for (Disk disk : getPluggedDisks(vm)) { if (disk.isAllowSnapshot()) { for (storage_domains domain : getStorageDomainDAO().getAllStorageDomainsByImageId(((DiskImage) disk).getImageId())) { if (!StorageDomainSpaceChecker.hasSpaceForRequest(domain, Config.<Integer> GetValue(ConfigValues.InitStorageSparseSizeInGB))) { log.errorFormat("not enough space to create snapshot for disk {0} on domain {1}", disk.getId(), domain.getId()); return false; } } } } return true; }

Target:
public boolean hasSpaceForSnapthosts(VM vm) { Map<storage_domains, Integer> map = mapStorageDomainsToNumOfDisks(vm); Integer minSnapshotSize = Config.<Integer> GetValue(ConfigValues.InitStorageSparseSizeInGB); for (storage_domains domain : map.keySet()) { if (!StorageDomainSpaceChecker.hasSpaceForRequest(domain, minSnapshotSize * map.get(domain))) { log.error("not enough space to create snapshot on domain {0}" + domain.getId()); return false; } } return true; }
Source:
public void onActivityResult(final int requestCode, final int resultCode, @NonNull final Intent data) { assureCorrectAppLanguage(getContext()); super.onActivityResult(requestCode, resultCode, data); if (DEBUG) { Log.d(TAG, "onActivityResult() called with: " + "requestCode = [" + requestCode + "], " + "resultCode = [" + resultCode + "], " + "data = [" + data + "]"); } if ((requestCode == REQUEST_IMPORT_PATH || requestCode == REQUEST_EXPORT_PATH) && resultCode == Activity.RESULT_OK && data.getData() != null) { try { Uri uri = data.getData(); if (FilePickerActivityHelper.isOwnFileUri(getContext(), uri)) { uri = Uri.fromFile(Utils.getFileForUri(uri)); } if (requestCode == REQUEST_EXPORT_PATH) { final StoredDirectoryHelper directory = new StoredDirectoryHelper(getContext(), uri, null); final SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.US); exportDatabase(directory.createFile("NewPipeData-" + sdf.format(new Date()) + ".zip", "application/zip")); } else { final StoredFileHelper file = new StoredFileHelper(getContext(), uri, StoredFileHelper.DEFAULT_MIME); final AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setMessage(R.string.override_current_data) .setPositiveButton(getString(R.string.finish), (DialogInterface d, int id) -> importDatabase(file)) .setNegativeButton(android.R.string.cancel, (DialogInterface d, int id) -> d.cancel()); builder.create().show(); } } catch (IOException e) { e.printStackTrace(); } } }

Target:
public void onActivityResult(final int requestCode, final int resultCode, @NonNull final Intent data) { assureCorrectAppLanguage(getContext()); super.onActivityResult(requestCode, resultCode, data); if (DEBUG) { Log.d(TAG, "onActivityResult() called with: " + "requestCode = [" + requestCode + "], " + "resultCode = [" + resultCode + "], " + "data = [" + data + "]"); } if ((requestCode == REQUEST_IMPORT_PATH || requestCode == REQUEST_EXPORT_PATH) && resultCode == Activity.RESULT_OK && data.getData() != null) { final StoredFileHelper file = new StoredFileHelper(getContext(), data.getData(), "application/zip"); if (requestCode == REQUEST_EXPORT_PATH) { exportDatabase(file); } else { final AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setMessage(R.string.override_current_data) .setPositiveButton(R.string.finish, (DialogInterface d, int id) -> importDatabase(file)) .setNegativeButton(R.string.cancel, (DialogInterface d, int id) -> d.cancel()); builder.create().show(); } } }
Source:
public ViewerCell<E> getCell(int column) { if (column >= 0) return new ViewerCell<E>((ViewerRow<E>) clone(), column, getElement()); return null; }

Target:
public ViewerCell<E> getCell(int column) { if (column >= 0){ @SuppressWarnings("unchecked") ViewerRow<E> viewerRow = (ViewerRow<E>) clone(); return new ViewerCell<E>(viewerRow, column, getElement()); } return null; }
Source:
private static DetailAST adjustParens(DetailAST node, UnaryOperator<DetailAST> step) { DetailAST result = node; int acc = 0; while (true) { if (result.getType() == TokenTypes.LPAREN) { acc--; } else if (result.getType() == TokenTypes.RPAREN) { acc++; } if (acc == 0) { break; } result = step.apply(result); } return result; }

Target:
private static DetailAST adjustParens(DetailAST node, UnaryOperator<DetailAST> step) { DetailAST result = node; int accumulator = 0; while (true) { if (result.getType() == TokenTypes.LPAREN) { accumulator--; } else if (result.getType() == TokenTypes.RPAREN) { accumulator++; } if (accumulator == 0) { break; } result = step.apply(result); } return result; }
Source:
public boolean StorageDomainRemoved(storage_domain_static storageDomain) { final List<storage_server_connections> list = DbFacade.getInstance() .getStorageServerConnectionDao().getAllForVolumeGroup(storageDomain.getstorage()); final List<LUNs> lunsList = DbFacade.getInstance().getLunDao().getAllForVolumeGroup(storageDomain.getstorage()); int numOfRemovedLuns = 0; for (LUNs lun : lunsList) { if (DbFacade.getInstance().getDiskLunMapDao().getDiskIdByLunId(lun.getLUN_id()) == null) { DbFacade.getInstance().getLunDao().remove(lun.getLUN_id()); numOfRemovedLuns++; } else { DbFacade.getInstance().getLunDao().updateLUNsVolumeGroupId(lun.getLUN_id(), ""); } } if (numOfRemovedLuns > 0) { for (storage_server_connections connection : FilterConnectionsUsedByOthers(list, storageDomain.getstorage())) { DbFacade.getInstance().getStorageServerConnectionDao().remove(connection.getid()); } } return true; }

Target:
public boolean StorageDomainRemoved(storage_domain_static storageDomain) { int numOfRemovedLuns = removeLunsOfLunStorageDomain(storageDomain); if (numOfRemovedLuns > 0) { List<storage_server_connections> list = DbFacade.getInstance() .getStorageServerConnectionDao().getAllForVolumeGroup(storageDomain.getstorage()); for (storage_server_connections connection : FilterConnectionsUsedByOthers(list, storageDomain.getstorage())) { DbFacade.getInstance().getStorageServerConnectionDao().remove(connection.getid()); } } return true; }
Source:
public List<FormField> getOrderedFormFields() { if (this.formFields != null) { List<FormField> fieldList = new ArrayList<FormField>(); Set<FormField> fieldSet = new HashSet<FormField>(); fieldSet.addAll(this.formFields); int fieldSize = fieldSet.size(); for (int i = 0; i < fieldSize; i++) { int fieldNum = 0; FormField next = null; for (FormField ff : fieldSet) { if (ff.getFieldNumber() != null) { if (ff.getFieldNumber() < fieldNum || fieldNum == 0) { fieldNum = ff.getFieldNumber(); next = ff; } } else { if (fieldNum == 0) { next = ff; } } } fieldList.add(next); fieldSet.remove(next); } return fieldList; } else { return null; } }

Target:
public List<FormField> getOrderedFormFields() { if (this.formFields != null) { List<FormField> fieldList = new ArrayList<>(); Set<FormField> fieldSet = new HashSet<>(this.formFields); int fieldSize = fieldSet.size(); for (int i = 0; i < fieldSize; i++) { int fieldNum = 0; FormField next = null; for (FormField ff : fieldSet) { if (ff.getFieldNumber() != null) { if (ff.getFieldNumber() < fieldNum || fieldNum == 0) { fieldNum = ff.getFieldNumber(); next = ff; } } else { if (fieldNum == 0) { next = ff; } } } fieldList.add(next); fieldSet.remove(next); } return fieldList; } else { return null; } }
Source:
public void replay() { long lastBlock = blockStore.getMaxNumber(); logger.info("Replaying blocks from " + firstBlock + ", current best block: " + lastBlock); int cnt = 0; long num = firstBlock; while(true) { for (; num <= lastBlock; num++) { replayBlock(num); cnt++; if (cnt % 1000 == 0) { logger.info("Replayed " + cnt + " blocks so far. Current block: " + num); } } synchronized (this) { if (onBlockBuffer.size() < onBlockBuffer.maxSize()) { replayComplete = true; break; } else { long newLastBlock = blockStore.getMaxNumber() - 192; if (lastBlock >= newLastBlock) { replayComplete = true; break; } else { lastBlock = newLastBlock; } } } } logger.info("Replay complete."); }

Target:
public void replay() { long lastBlock = blockStore.getMaxNumber(); logger.info("Replaying blocks from " + firstBlock + ", current best block: " + lastBlock); int cnt = 0; long num = firstBlock; while(!replayComplete) { for (; num <= lastBlock; num++) { replayBlock(num); cnt++; if (cnt % 1000 == 0) { logger.info("Replayed " + cnt + " blocks so far. Current block: " + num); } } synchronized (this) { if (onBlockBuffer.size() < onBlockBuffer.maxSize()) { replayComplete = true; } else { long newLastBlock = blockStore.getMaxNumber() - HALF_BUFFER; if (lastBlock >= newLastBlock) { replayComplete = true; } else { lastBlock = newLastBlock; } } } } logger.info("Replay complete."); }
Source:
protected abstract C retrieveCredentials(final WebContext context) throws RequiresHttpAction; public final U getUserProfile(final C credentials, final WebContext context) { init(); logger.debug("credentials : {}", credentials); if (credentials == null) { return null; } final U profile = retrieveUserProfile(credentials, context); for (AuthorizationGenerator<U> authorizationGenerator : this.authorizationGenerators) { authorizationGenerator.generate(profile); } return profile; }

Target:
protected abstract C retrieveCredentials(final WebContext context) throws RequiresHttpAction; public final U getUserProfile(final C credentials, final WebContext context) { init(); logger.debug("credentials : {}", credentials); if (credentials == null) { return null; } final U profile = retrieveUserProfile(credentials, context); if (this.authorizationGenerators != null) { for (AuthorizationGenerator<U> authorizationGenerator : this.authorizationGenerators) { authorizationGenerator.generate(profile); } } return profile; }
Source:
boolean verifyEliminateNots() { return !SanityManager.ASSERT || (leftOperand.verifyEliminateNots() && rightOperand.verifyEliminateNots()); }

Target:
boolean verifyEliminateNots() { if (SanityManager.ASSERT) { return (leftOperand.verifyEliminateNots() && rightOperand.verifyEliminateNots()); } else {return true;} }
Source:
public void testCompareAndSetConcurrent(Method method) throws ExecutionException, InterruptedException, TimeoutException { final int numThreadsPerNode = 2; final int totalThreads = CLUSTER_SIZE * numThreadsPerNode; final List<Future<LinkedList<Boolean>>> workers = new ArrayList<>(totalThreads); final String counterName = method.getName(); final CyclicBarrier barrier = new CyclicBarrier(totalThreads); final long maxIterations = 100; for (int i = 0; i < totalThreads; ++i) { final int cmIndex = i % numThreadsPerNode; workers.add(fork(() -> { long iteration = 0; final long initialValue = 0; long previousValue = initialValue; LinkedList<Boolean> retValues = new LinkedList<>(); CounterManager manager = counterManager(cmIndex); StrongTestCounter counter = createCounter(manager, counterName, initialValue); while (iteration < maxIterations) { assertEquals(previousValue, counter.getValue()); long update = previousValue + 1; barrier.await(); boolean ret = counter.compareAndSet(previousValue, update); if (ret) { previousValue = update; } else { previousValue = counter.getValue(); } retValues.add(ret); ++iteration; } return retValues; })); } List<LinkedList<Boolean>> workerList = new LinkedList<>(); for (Future<LinkedList<Boolean>> w : workers) { LinkedList<Boolean> returnValues = w.get(1, TimeUnit.MINUTES); workerList.add(returnValues); } for (int i = 0; i != maxIterations; i++) { List<Boolean> headOfWorkers = new LinkedList<>(); for (LinkedList<Boolean> worker: workerList) { headOfWorkers.add(worker.removeFirst()); } assertEquals("Incomplete results in iteration " + i, totalThreads, headOfWorkers.size()); assertEquals("Multiple threads succeeded with update in iteration " + i, 1, headOfWorkers.stream().filter(Boolean::booleanValue).count()); } }

Target:
public void testCompareAndSetConcurrent(Method method) throws ExecutionException, InterruptedException, TimeoutException { final int numThreadsPerNode = 2; final int totalThreads = CLUSTER_SIZE * numThreadsPerNode; final List<Future<Boolean>> workers = new ArrayList<>(totalThreads); final String counterName = method.getName(); final CyclicBarrier barrier = new CyclicBarrier(totalThreads); final AtomicIntegerArray retValues = new AtomicIntegerArray(totalThreads); final long maxIterations = 100; for (int i = 0; i < totalThreads; ++i) { final int threadIndex = i; final int cmIndex = i % CLUSTER_SIZE; workers.add(fork(() -> { long iteration = 0; final long initialValue = 0; long previousValue = initialValue; CounterManager manager = counterManager(cmIndex); StrongTestCounter counter = createCounter(manager, counterName, initialValue); while (iteration < maxIterations) { assertEquals(previousValue, counter.getValue()); long update = previousValue + 1; barrier.await(); boolean ret = counter.compareAndSet(previousValue, update); if (ret) { previousValue = update; } else { previousValue = counter.getValue(); } retValues.set(threadIndex, ret == true ? 1 : 0); barrier.await(); assertUnique(retValues, iteration); ++iteration; } return true; })); } for (Future<?> w : workers) { w.get(1, TimeUnit.MINUTES); } }
Source:
private static Optional<LiteralTree[]> getLiteralsFromFinalVariables(IdentifierTree identifier) { Symbol symbol = identifier.symbol(); if (!symbol.isVariableSymbol()) { return Optional.empty(); } Symbol.VariableSymbol variableSymbol = (Symbol.VariableSymbol) symbol; if (!variableSymbol.isFinal()) { return Optional.empty(); } VariableTree declaration = variableSymbol.declaration(); if (declaration == null) { return Optional.empty(); } ExpressionTree initializer = declaration.initializer(); if (initializer == null) { return Optional.empty(); } return getLiterals(initializer); }

Target:
private static Optional<LiteralTree[]> getLiteralsFromFinalVariables(IdentifierTree identifier) { Symbol symbol = identifier.symbol(); if (!symbol.isVariableSymbol()) { return Optional.empty(); } Symbol.VariableSymbol variableSymbol = (Symbol.VariableSymbol) symbol; if (!(variableSymbol.isFinal() || JUtils.isEffectivelyFinal(variableSymbol))) { return Optional.empty(); } VariableTree declaration = variableSymbol.declaration(); if (declaration == null) { return Optional.empty(); } ExpressionTree initializer = declaration.initializer(); if (initializer == null) { return Optional.empty(); } return getLiterals(initializer); }
Source:
void setFullscreenDialog(){ try{ WindowManager manager = (WindowManager) getContext().getSystemService(Activity.WINDOW_SERVICE); int width, height; if (Build.VERSION.SDK_INT > Build.VERSION_CODES.FROYO) { width = manager.getDefaultDisplay().getWidth(); height = manager.getDefaultDisplay().getHeight(); } else { Point point = new Point(); manager.getDefaultDisplay().getSize(point); width = point.x; height = point.y; } WindowManager.LayoutParams lp = new WindowManager.LayoutParams(); lp.copyFrom(getWindow().getAttributes()); lp.width = width; lp.height = height; getWindow().setAttributes(lp); }catch (NullPointerException ex){ ex.printStackTrace(); } }

Target:
void setFullscreenDialog(){ try{ WindowManager manager = (WindowManager) getContext().getSystemService(Activity.WINDOW_SERVICE); Point point = new Point(); manager.getDefaultDisplay().getSize(point); WindowManager.LayoutParams lp = new WindowManager.LayoutParams(); lp.copyFrom(getWindow().getAttributes()); lp.width = point.x; lp.height = point.y; getWindow().setAttributes(lp); }catch (NullPointerException ex){ Log.e(TAG, ex.getMessage()); } }
Source:
public void testConstraintSolverForceBacktrackWithSpreadCoLocation() { ConstraintSolverStrategy cs = new ConstraintSolverStrategy() { @Override public <K extends Comparable<K>, V extends Comparable<V>> NavigableMap<K, V> sortByValues(final Map<K, V> map) { return super.sortByValues(map).descendingMap(); } }; basicUnitTestWithKillAndRecover(cs, BACKTRACK_BOLT_PARALLEL, CO_LOCATION_CNT); }

Target:
public void testConstraintSolverForceBacktrackWithSpreadCoLocation() { if (CO_LOCATION_CNT > 1 && !consolidatedConfigFlag) { LOG.info("INFO: Skipping Test with {}={} (required 1), and consolidatedConfigFlag={} (required false)", "testConstraintSolverForceBacktrackWithSpreadCoLocation", ConstraintSolverStrategy.CONSTRAINT_TYPE_MAX_NODE_CO_LOCATION_CNT, CO_LOCATION_CNT, consolidatedConfigFlag); return; } ConstraintSolverStrategy cs = new ConstraintSolverStrategy() { @Override public <K extends Comparable<K>, V extends Comparable<V>> NavigableMap<K, V> sortByValues(final Map<K, V> map) { return super.sortByValues(map).descendingMap(); } }; basicUnitTestWithKillAndRecover(cs, BACKTRACK_BOLT_PARALLEL, CO_LOCATION_CNT); }
Source:
public static String getLanguageNameFromCode(@NonNull String languageCode) throws InvalidLocaleException { final String lowercaseLanguage = languageCode.toLowerCase(Locale.ROOT); switch (lowercaseLanguage) { case "zh_cn": case "zh_hans": return "Simplified Chinese"; case "zh_tw": case "zh_hant": return "Traditional Chinese"; default: if (!isValidBcp47Alpha(lowercaseLanguage, 2, 3)) { throw new InvalidLocaleException("Invalid language: " + languageCode); } return new Locale(languageCode).getDisplayLanguage(); } }

Target:
public static String getLanguageNameFromCode(@NonNull String languageCode) throws InvalidLocaleException { final String lowercaseLanguage = languageCode.toLowerCase(Locale.ROOT); switch (lowercaseLanguage) { case "zh_cn": case "zh_hans": return Locale.SIMPLIFIED_CHINESE.getDisplayLanguage(); case "zh_tw": case "zh_hant": return Locale.TRADITIONAL_CHINESE.getDisplayLanguage(); default: if (!isValidBcp47Alpha(lowercaseLanguage, 2, 3)) { throw new InvalidLocaleException("Invalid language: " + languageCode); } return new Locale(languageCode).getDisplayLanguage(); } }
Source:
public void waitForWritesCompleted(Duration timeout) throws InterruptedException, TimeoutException { lock.writeLock().lockInterruptibly(); lock.writeLock().unlock(); for (StoreObjectAccessorWithLock writer : writers.values()) writer.waitForCurrentWrites(timeout); }

Target:
public void waitForWritesCompleted(Duration timeout) throws InterruptedException, TimeoutException { boolean locked = lock.readLock().tryLock(timeout.toMillisecondsRoundingUp(), TimeUnit.MILLISECONDS); if (locked) { lock.readLock().unlock(); for (StoreObjectAccessorWithLock writer : writers.values()) writer.waitForCurrentWrites(timeout); } else { throw new TimeoutException("Timeout waiting for writes to "+objectStore); } }
Source:
public StarTreeFilterOperator(StarTreeV2 starTreeV2, Map<String, List<PredicateEvaluator>> predicateEvaluatorsMap, Set<String> groupByColumns, @Nullable Map<String, String> debugOptions) { _starTreeV2 = starTreeV2; _predicateEvaluatorsMap = predicateEvaluatorsMap; _groupByColumns = groupByColumns; _debugOptions = debugOptions; _groupByColumns.removeAll(_predicateEvaluatorsMap.keySet()); }

Target:
public StarTreeFilterOperator(StarTreeV2 starTreeV2, Map<String, List<PredicateEvaluator>> predicateEvaluatorsMap, Set<String> groupByColumns, @Nullable Map<String, String> debugOptions) { _starTreeV2 = starTreeV2; _predicateEvaluatorsMap = predicateEvaluatorsMap; _debugOptions = debugOptions; if (groupByColumns != null) { _groupByColumns = new HashSet<>(groupByColumns); _groupByColumns.removeAll(_predicateEvaluatorsMap.keySet()); } else { _groupByColumns = Collections.emptySet(); } }