auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
@Override public void onClose(Status status, Metadata trailers) { Throwable error = null; try (Scope scope = currentTraceContext.maybeScope(invocationContext)) { delegate().onClose(status, trailers); } catch (Throwable e) { error = e; throw e; } finally { GrpcClientResponse response = new GrpcClientResponse(request, status, trailers, error); finish(response, spanRef.getAndSet(null)); } }

Target:
@Override public void onClose(Status status, Metadata trailers) { GrpcClientResponse response = new GrpcClientResponse(request, status, trailers, null); finish(response, spanRef.getAndSet(null)); try (Scope scope = currentTraceContext.maybeScope(invocationContext)) { delegate().onClose(status, trailers); } }
Source:
public void onNext(final AllocatedEvaluator allocatedEvaluator) { final int evalCount = activeEvaluatorCount.getAndIncrement(); final String contextId = CONTEXT_ID_PREFIX + evalCount; final Configuration partialContextConf = ContextConfiguration.CONF .set(ContextConfiguration.IDENTIFIER, contextId) .build(); final Configuration contextConf = Configurations.merge( partialContextConf, emConf.getContextConfiguration(), aggregationManager.getContextConfiguration()); final Configuration serviceConf = Configurations.merge( emConf.getServiceConfiguration(contextId), aggregationManager.getServiceConfigurationWithoutNameResolver()); final Configuration traceConf = traceParameters.getConfiguration(); allocatedEvaluator.submitContextAndService(contextConf, Configurations.merge(serviceConf, traceConf)); LOG.info((evalCount + 1) + " evaluators active!"); }

Target:
public void onNext(final AllocatedEvaluator allocatedEvaluator) { final int evalCount = activeEvaluatorCount.getAndIncrement(); final String contextId = CONTEXT_ID_PREFIX + evalCount; final Configuration partialContextConf = ContextConfiguration.CONF .set(ContextConfiguration.IDENTIFIER, contextId) .build(); final Configuration contextConf = Configurations.merge( partialContextConf, emConf.getContextConfiguration(), aggregationManager.getContextConfiguration()); final Configuration serviceConf = Configurations.merge( emConf.getServiceConfiguration(contextId), aggregationManager.getServiceConfigurationWithoutNameResolver()); final Configuration traceConf = traceParameters.getConfiguration(); allocatedEvaluator.submitContextAndService(contextConf, Configurations.merge(serviceConf, traceConf)); LOG.log(Level.INFO, "{0} evaluators active!", evalCount + 1); }
Source:
private void recordWord(Word w) { if (RecordUtils.get().isRecording()) { return; } RecordUtils.get().startRecordWord(this, w.languageCode, w.serverID); recordingDialog.show(); handler.postDelayed(detectSound, DETECT_VOICE_INTERVAL); handler.postDelayed(new Runnable() { @Override public void run() { stopRecord(); } }, 3000); }

Target:
private void recordWord(Word w) { if (null != activeRecorder && activeRecorder.isRecording()) { activeRecorder.stop(); } File wsfile = WordSoundFileUtils.getFile(this, w.languageCode, w.serverID); activeRecorder = RecordUtils.get().createRecorder(wsfile); try { activeRecorder.start(); } catch (IllegalStateException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } recordingDialog.setCurrentRecordLength(0); recordingDialog.show(); handler.postDelayed(detectSound, DETECT_VOICE_INTERVAL); handler.postDelayed(countdownRecordTime, 1000); }
Source:
private Map<String, Object> getAnnotationValues(Annotation annotation) { if ( Proxy.isProxyClass( annotation.getClass() ) ) { InvocationHandler invocationHandler = Proxy.getInvocationHandler( annotation ); if ( invocationHandler instanceof AnnotationProxy ) { return ( (AnnotationProxy) invocationHandler ).values; } } AnnotationParameters annotationParameters = run( GetAnnotationParameters.action( annotation ) ); return annotationParameters.getParameters(); }

Target:
private Map<String, Object> getAnnotationValues(Annotation annotation) { if ( Proxy.isProxyClass( annotation.getClass() ) && System.getSecurityManager() == null ) { InvocationHandler invocationHandler = Proxy.getInvocationHandler( annotation ); if ( invocationHandler instanceof AnnotationProxy ) { return ( (AnnotationProxy) invocationHandler ).values; } } AnnotationParameters annotationParameters = run( GetAnnotationParameters.action( annotation ) ); return annotationParameters.getParameters(); }
Source:
public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) { if (tabbedPropertySheetPage instanceof ViewpointPropertySheetPage) super.createControls(parent, (ViewpointPropertySheetPage) tabbedPropertySheetPage); else super.createControls(parent, tabbedPropertySheetPage); composite = getWidgetFactory().createFlatFormComposite(parent); FormData data; nameLabel = getWidgetFactory().createCLabel(composite, "Add option override"); data = new FormData(); data.left = new FormAttachment(5, 5); nameLabel.setLayoutData(data); Image addImage = ExtendedImageRegistry.INSTANCE.getImage(DiagramUIPlugin.getPlugin().getImage(LayoutOptionPropertiesUtils.ADD_OPTION_IMAGE_NAME)); addOverrideButton = getWidgetFactory().createButton(composite, "", SWT.PUSH); addOverrideButton.setImage(addImage); data = new FormData(); data.left = new FormAttachment(0, 0); data.top = new FormAttachment(nameLabel, 0, SWT.CENTER); data.right = new FormAttachment(4, 0); addOverrideButton.setLayoutData(data); addOverrideButton.addSelectionListener(createButtonListener()); }

Target:
public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) { if (tabbedPropertySheetPage instanceof ViewpointPropertySheetPage) super.createControls(parent, (ViewpointPropertySheetPage) tabbedPropertySheetPage); else super.createControls(parent, tabbedPropertySheetPage); composite = getWidgetFactory().createFlatFormComposite(parent); FormData data; Image addImage = ExtendedImageRegistry.INSTANCE.getImage(DiagramUIPlugin.getPlugin().getImage(LayoutOptionPropertiesUtils.ADD_OPTION_IMAGE_NAME)); addOverrideButton = getWidgetFactory().createButton(composite, "", SWT.PUSH); addOverrideButton.setImage(addImage); addOverrideButton.setText(Messages.AddOptionOverridePropertySection_overrideButtonLabel); data = new FormData(); data.left = new FormAttachment(0, 0); data.right = new FormAttachment(9, 0); addOverrideButton.setLayoutData(data); addOverrideButton.addSelectionListener(createButtonListener()); }
Source:
public ResponseEntity<?> getDistance(@PathVariable("eventTypeName") final String eventTypeName, @Valid @RequestBody final ValidListWrapper<CursorDistance> queries, final Client client) throws InternalNakadiException, NoSuchEventTypeException { checkReadScopes(eventTypeName, client); final EventType eventType = eventTypeRepository.findByName(eventTypeName); authorizeStreamRead(authorizationService, client, eventType); queries.getList().forEach(query -> { try { final NakadiCursor initialCursor = cursorConverter .convert(eventTypeName, query.getInitialCursor()); final NakadiCursor finalCursor = cursorConverter .convert(eventTypeName, query.getFinalCursor()); final Long distance = cursorOperationsService.calculateDistance(initialCursor, finalCursor); query.setDistance(distance); } catch (InternalNakadiException | ServiceUnavailableException e) { throw new MyNakadiRuntimeException1("problem calculating cursors distance", e); } catch (final NoSuchEventTypeException e) { throw new NotFoundException("event type not found", e); } catch (final InvalidCursorException e) { throw new CursorConversionException("problem converting cursors", e); } }); return status(OK).body(queries.getList()); }

Target:
public ResponseEntity<?> getDistance(@PathVariable("eventTypeName") final String eventTypeName, @Valid @RequestBody final ValidListWrapper<CursorDistance> queries, final Client client) throws InternalNakadiException, NoSuchEventTypeException { checkReadScopes(eventTypeName, client); final EventType eventType = eventTypeRepository.findByName(eventTypeName); authorizationValidator.authorizeStreamRead(client, eventType); queries.getList().forEach(query -> { try { final NakadiCursor initialCursor = cursorConverter .convert(eventTypeName, query.getInitialCursor()); final NakadiCursor finalCursor = cursorConverter .convert(eventTypeName, query.getFinalCursor()); final Long distance = cursorOperationsService.calculateDistance(initialCursor, finalCursor); query.setDistance(distance); } catch (InternalNakadiException | ServiceUnavailableException e) { throw new MyNakadiRuntimeException1("problem calculating cursors distance", e); } catch (final NoSuchEventTypeException e) { throw new NotFoundException("event type not found", e); } catch (final InvalidCursorException e) { throw new CursorConversionException("problem converting cursors", e); } }); return status(OK).body(queries.getList()); }
Source:
public void onException(SQLException e, OperationType operationType) { if (e instanceof SQLTransientConnectionException) { if (operationType == OperationType.Write) { metrics.writeRate.mark(); metrics.writeFailureCount.inc(); } else if (operationType == OperationType.Read) { metrics.readRate.mark(); metrics.readFailureCount.inc(); } else if (operationType == OperationType.Copy) { metrics.copyRate.mark(); metrics.copyFailureCount.inc(); } closeActiveConnection(); } }

Target:
public void onException(SQLException e, OperationType operationType) { if (e instanceof SQLTransientConnectionException) { if (operationType == OperationType.Write) { metrics.writeFailureCount.inc(); } else if (operationType == OperationType.Read) { metrics.readFailureCount.inc(); } else if (operationType == OperationType.Copy) { metrics.copyFailureCount.inc(); } closeActiveConnection(); } }
Source:
public void visitLiteral(Object constant) { if (constant instanceof Boolean) { append(constant.toString()); } else if (constant instanceof Number) { append(constant.toString()); } else if (constant instanceof String) { append("'"); append(escapeLiteral(constant.toString())); append("'"); } else if (constant instanceof Enum) { append(constant.getClass().getName()); append("."); append(((Enum<?>) constant).name()); } else { throw new IllegalArgumentException("Unsupported constant " + constant); } }

Target:
public void visitLiteral(Object constant) { if (constant instanceof Boolean) { append(constant.toString()); } else if (constant instanceof Number) { append(constant.toString()); } else if (constant instanceof String) { append("'"); append(escapeLiteral(constant.toString())); append("'"); } else if (constant instanceof Enum<?>) { append(constant.getClass().getName()); append("."); append(((Enum<?>) constant).name()); } else { throw new IllegalArgumentException("Unsupported constant " + constant); } }
Source:
public String cleanValue(String value) { value = value.replaceAll("\\s", ""); if (value.startsWith("\"") || value.startsWith("\'")) { return value.substring(1, value.length() - 2); } ; return value; }

Target:
public String cleanValue(String value) { value = value.replaceAll("\\s", ""); if ((value.startsWith("\"") && value.endsWith("\""))|| (value.startsWith("\'")) && value.endsWith("\'")) { return value.substring(1, value.length() - 2); } ; return value; }
Source:
public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) { super.createControls(parent, tabbedPropertySheetPage); eObject = layoutOption; FormData layoutData = (FormData) text.getLayoutData(); layoutData.right = new FormAttachment(96, 0); help = getWidgetFactory().createCLabel(composite, ""); FormData data = new FormData(); data.top = new FormAttachment(text, 0, SWT.TOP); data.left = new FormAttachment(nameLabel); help.setLayoutData(data); help.setImage(getHelpIcon()); help.setToolTipText(getToolTipText()); removeOverrideButton = LayoutOptionPropertiesUtils.createRemoveOptionButton(text, composite, (ViewpointPropertySheetPage) tabbedPropertySheetPage, getWidgetFactory(), layoutOption); }

Target:
public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) { super.createControls(parent, tabbedPropertySheetPage); eObject = layoutOption; FormData layoutData = (FormData) text.getLayoutData(); layoutData.right = new FormAttachment(95, 10); help = getWidgetFactory().createCLabel(composite, ""); FormData data = new FormData(); data.top = new FormAttachment(text, 0, SWT.TOP); data.left = new FormAttachment(nameLabel); help.setLayoutData(data); help.setImage(getHelpIcon()); help.setToolTipText(getToolTipText()); removeOverrideButton = LayoutOptionPropertiesUtils.createRemoveOptionButton(text, composite, (ViewpointPropertySheetPage) tabbedPropertySheetPage, getWidgetFactory(), layoutOption); }
Source:
public void onClick(Notification notification) { if (!notification.getOptions().isOngoing()) { String event = notification.isRepeating() ? "clear" : "cancel"; if (actionIdentifier != null) { LocalNotification.fireEvent("action", notification, actionIdentifier); if (event == "clear") { notification.clear(); } else { notification.cancel(); } } else { LocalNotification.fireEvent("click", notification); } LocalNotification.fireEvent(event, notification); } super.onClick(notification); }

Target:
public void onClick(Notification notification) { LocalNotification.fireEvent("click", notification, actionIdentifier); super.onClick(notification); if (notification.getOptions().isOngoing()) return; String event = notification.isRepeating() ? "clear" : "cancel"; LocalNotification.fireEvent(event, notification); }
Source:
public void doFilter(ServletRequest req, ServletResponse resp, FilterChain filterChain) throws IOException, ServletException { log.info("Entering MaxInactiveFilter"); final HttpServletRequest request = (HttpServletRequest) req; checkMaxInactive(request); log.info("Continuing on to other filters from MaxInactiveFilter"); filterChain.doFilter(req, resp); }

Target:
public void doFilter(ServletRequest req, ServletResponse resp, FilterChain filterChain) throws IOException, ServletException { log.debug("Entering MaxInactiveFilter"); final HttpServletRequest request = (HttpServletRequest) req; checkMaxInactive(request); log.debug("Continuing on to other filters from MaxInactiveFilter"); filterChain.doFilter(req, resp); }
Source:
public SpinnerAdapter(final Context context, final int textViewResourceId, final String[] objects, int textUnit, float textSize) { super(context, textViewResourceId, objects); this.context = context; this.textUnit = textUnit; this.textSize = textSize; items = new String[objects.length+1]; items[0] = ""; for(int i = 1; i < items.length; i ++){ items[i] = objects[i-1]; } }

Target:
public SpinnerAdapter(final Context context, final int textViewResourceId, final String[] objects, int textUnit, float textSize) { super(context, textViewResourceId, objects); this.context = context; this.textUnit = textUnit; this.textSize = textSize; items = new String[objects.length+1]; items[0] = ""; System.arraycopy(objects, 0, items, 1, items.length - 1); }
Source:
protected void autoFillNameTextField() { setAccountNameWithString(mobileNrInputTextField.getText().trim()); }

Target:
protected void autoFillNameTextField() { setAccountNameWithString(mobileNrInputTextField.getText()); }
Source:
public Attribute.AttributeMap getAttributes() { return null; }

Target:
public Attribute.AttributeMap getAttributes() { return attributes; }
Source:
public void render (Batch batch, Texture currentScreenTexture, Texture nextScreenTexture, float percent) { float width = currentScreenTexture.getWidth(); float height = currentScreenTexture.getHeight(); float x = 0; float y = 0; if (interpolation != null) percent = interpolation.apply(percent); Gdx.gl.glClearColor(0.0f, 0.0f, 0.0f, 1.0f); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); batch.begin(); float fade = percent * 2; if (fade > 1.0f) { fade = 1.0f - (percent * 2 - 1.0f); Color fadeIn = new Color(Color.WHITE); fadeIn.a = 1.0f - fade; batch.setColor(fadeIn); batch.draw(nextScreenTexture, 0, 0, width / 2, height / 2, nextScreenTexture.getWidth(), nextScreenTexture.getHeight(), 1, 1, 0, 0, 0, nextScreenTexture.getWidth(), nextScreenTexture.getHeight(), false, true); } else { Color fadeOut = new Color(Color.WHITE); fadeOut.a = 1.0f - fade; batch.setColor(fadeOut); batch.draw(currentScreenTexture, 0, 0, width / 2, height / 2, width, height, 1, 1, 0, 0, 0, (int)width, (int)height, false, true); } Color c = new Color(Color.WHITE); c.a = fade; batch.setColor(c); batch.draw(texture, 0, 0, width, height); batch.end(); batch.setColor(Color.WHITE); }

Target:
public void render (Batch batch, Texture currentScreenTexture, Texture nextScreenTexture, float percent) { float width = currentScreenTexture.getWidth(); float height = currentScreenTexture.getHeight(); float x = 0; float y = 0; if (interpolation != null) percent = interpolation.apply(percent); Gdx.gl.glClearColor(0.0f, 0.0f, 0.0f, 1.0f); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); batch.begin(); float fade = percent * 2; if (fade > 1.0f) { fade = 1.0f - (percent * 2 - 1.0f); color.a = 1.0f - fade; batch.setColor(color); batch.draw(nextScreenTexture, 0, 0, width / 2, height / 2, nextScreenTexture.getWidth(), nextScreenTexture.getHeight(), 1, 1, 0, 0, 0, nextScreenTexture.getWidth(), nextScreenTexture.getHeight(), false, true); } else { color.a = 1.0f - fade; batch.setColor(color); batch.draw(currentScreenTexture, 0, 0, width / 2, height / 2, width, height, 1, 1, 0, 0, 0, (int)width, (int)height, false, true); } color.a = fade; batch.setColor(color); batch.draw(texture, 0, 0, width, height); batch.end(); batch.setColor(Color.WHITE); }
Source:
private List<String> getSortedListOfTeams() { List<String> teams = new ArrayList<String>(rosterTeamNameEmailTable.keySet()); teams.remove(Const.USER_TEAM_FOR_INSTRUCTOR); Collections.sort(teams); return new ArrayList<String>(teams); }

Target:
private List<String> getSortedListOfTeams() { List<String> teams = new ArrayList<String>(rosterTeamNameMembersTable.keySet()); teams.remove(Const.USER_TEAM_FOR_INSTRUCTOR); Collections.sort(teams); return teams; }
Source:
public PerformanceReportEntity aggregateNumberAndValueOfPayments() { long[] results = (long[]) entityManager.get() .createNativeQuery("SELECT COUNT(c.amount) as total_volume, SUM(c.amount) as total_amount, AVG(c.amount) as average_amount FROM ChargeEntity c WHERE c.status = :status") .setParameter("status", CAPTURED) .setMaxResults(1) .getSingleResult(); long totalVolume = results[0]; long totalAmount = results[1]; long averageAmount = results[2]; return new PerformanceReportEntity( totalVolume, totalAmount, averageAmount ); }

Target:
public PerformanceReportEntity aggregateNumberAndValueOfPayments() { return (PerformanceReportEntity) entityManager.get() .createQuery("SELECT NEW uk.gov.pay.connector.model.domain.report.PerformanceReportEntity(COUNT(c.amount), SUM(c.amount), AVG(c.amount)) FROM ChargeEntity c WHERE c.status = :status") .setParameter("status", CAPTURED.toString()) .setMaxResults(1) .getSingleResult(); }
Source:
public void replaceInvalidEmptyStringMacAddressesWithNull(List<VmNetworkInterface> vmNetworkInterfaces) { for (VmNetworkInterface vmNetworkInterface : vmNetworkInterfaces) { String macAddress = vmNetworkInterface.getMacAddress(); if (macAddress != null && macAddress.isEmpty()) { vmNetworkInterface.setMacAddress(null); } } }

Target:
public void replaceInvalidEmptyStringMacAddressesWithNull(List<VmNetworkInterface> vmNetworkInterfaces) { vmNetworkInterfaces.stream() .filter(this::hasEmptyStringMacAddress) .forEach(e->e.setMacAddress(null)); }
Source:
public void finish() { closeCurrentFile(); String fileName = getOutputFilePath(); String temporaryFileName = fileName + temporaryFileSuffix; sftpUtils.uploadFile(tempFile, temporaryFileName); Map<String, String> executedFiles = new HashMap<>(); executedFiles.put("temporary_filename", fileName + temporaryFileSuffix); executedFiles.put("real_filename", fileName); fileList.add(executedFiles); fileIndex++; }

Target:
public void finish() { closeCurrentFile(); String fileName = getOutputFilePath(); String temporaryFileName = fileName + temporaryFileSuffix; sftpUtils.uploadFile(tempFile, temporaryFileName); Map<String, String> executedFiles = new HashMap<>(); executedFiles.put("temporary_filename", temporaryFileName); executedFiles.put("real_filename", fileName); fileList.add(executedFiles); fileIndex++; }
Source:
public void put(long key, Chain chain) { try { segmentFor(key).put(key, chain); } catch (OversizeMappingException e) { try { handleOversizeMappingException(key, (long k) -> segmentFor(k).put(k, chain)); } catch (OversizeMappingException e1) { segmentFor(key).remove(key); throw e; } } }

Target:
public void put(long key, Chain chain) { try { try { segmentFor(key).put(key, chain); } catch (OversizeMappingException e) { handleOversizeMappingException(key, (long k) -> segmentFor(k).put(k, chain)); } } catch (Throwable t) { segmentFor(key).remove(key); throw t; } }
Source:
public void afterRefreshTreatment(boolean succeeded) { if (!succeeded) { lockManager.releaseLock(monitoringLock); return; } try { Guid storagePoolId = null; ArrayList<VDSDomainsData> domainsList = null; synchronized (this) { unrespondedAttempts.set(0); setLastUpdate(); try { hostMonitoring.afterRefreshTreatment(); if (cachedVds != null && cachedVds.getStatus() != VDSStatus.Maintenance) { storagePoolId = cachedVds.getStoragePoolId(); domainsList = cachedVds.getDomains(); } hostMonitoring = null; } catch (IRSErrorException ex) { logAfterRefreshFailureMessage(ex); if (log.isDebugEnabled()) { logException(ex); } } catch (RuntimeException ex) { logAfterRefreshFailureMessage(ex); logException(ex); } } if (domainsList != null) { updateVdsDomainsData(cachedVds, storagePoolId, domainsList); setDomains(cachedVds.getDomains()); } } catch (Exception e) { log.error("Timer update runtime info failed. Exception:", ExceptionUtils.getRootCauseMessage(e)); log.debug("Exception:", e); } finally { lockManager.releaseLock(monitoringLock); } }

Target:
public void afterRefreshTreatment(boolean succeeded) { if (!succeeded) { lockManager.releaseLock(monitoringLock); return; } try { Guid storagePoolId = null; ArrayList<VDSDomainsData> domainsList = null; synchronized (this) { unrespondedAttempts.set(0); setLastUpdate(); try { hostMonitoring.afterRefreshTreatment(); if (cachedVds != null && cachedVds.getStatus() != VDSStatus.Maintenance) { storagePoolId = cachedVds.getStoragePoolId(); domainsList = cachedVds.getDomains(); } hostMonitoring = null; } catch (IRSErrorException ex) { logAfterRefreshFailureMessage(ex); if (log.isDebugEnabled()) { logException(ex); } } catch (RuntimeException ex) { logAfterRefreshFailureMessage(ex); logException(ex); } } if (domainsList != null) { updateVdsDomainsData(cachedVds, storagePoolId, domainsList); setDomains(domainsList); } } catch (Exception e) { log.error("Timer update runtime info failed. Exception:", ExceptionUtils.getRootCauseMessage(e)); log.debug("Exception:", e); } finally { lockManager.releaseLock(monitoringLock); } }
Source:
public long saveRun(Run run) throws IOException { if (runStore != null) { long id; if (run.getId() == AbstractRun.UNSAVED_ID) { runStore.save(run); try { String name = namingScheme.generateNameFor(run); run.setName(name); validateNameOrThrow(run, namingScheme); Number newId = (long) runStore.save(run); if (newId.longValue() != run.getId()) { log.error("Expected Run ID doesn't match returned value from database insert: rolling back..."); runStore.remove(run); throw new IOException("Something bad happened. Expected Run ID doesn't match returned value from DB insert"); } else { id = run.getId(); } } catch (MisoNamingException e) { throw new IOException("Cannot save Run - issue with generating name"); } } else { runStore.save(run); id = run.getId(); } return id; } else { throw new IOException("No runStore available. Check that it has been declared in the Spring config."); } }

Target:
public long saveRun(Run run) throws IOException { if (runStore != null) { long id; if (run.getId() == AbstractRun.UNSAVED_ID) { run.setName(generateTemporaryName()); run.setId(runStore.save(run)); try { String name = namingScheme.generateNameFor(run); run.setName(name); validateNameOrThrow(run, namingScheme); id = runStore.save(run); } catch (MisoNamingException e) { throw new IOException("Cannot save Run - issue with generating name"); } } else { runStore.save(run); id = run.getId(); } return id; } else { throw new IOException("No runStore available. Check that it has been declared in the Spring config."); } }
Source:
public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; CommitMessageWithCaretPosition other = (CommitMessageWithCaretPosition) obj; if (desiredCaretPosition != other.desiredCaretPosition) return false; if (message == null) { if (other.message != null) return false; } else if (!message.equals(other.message)) return false; return true; }

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } CommitMessageWithCaretPosition other = (CommitMessageWithCaretPosition) obj; return desiredCaretPosition == other.desiredCaretPosition && Objects.equals(message, other.message); }
Source:
public void testUploadProject() throws ProjectManagerException { System.out.println("projectManagerTest: testUploadProject"); ProjectManager manager = createProjectManager(); String projectName = "myTestUploadProject"; String projectDescription = "This is to test uploading a project"; User user = new User("testUser"); Project project = createProjectUtil(manager, projectName, projectDescription, user); File testDir = new File("src/test/resources/project/testjob/testjob.zip"); System.out.println("Uploading zip file: " + testDir.getAbsolutePath()); Props props = new Props(); manager.uploadProject(project, testDir, "zip", user, props); System.out.println("Uploaded project successfully"); }

Target:
public void testUploadProject() throws Exception { System.out.println("TestUploadProject"); Project project = manager.createProject(PROJECT_NAME, PROJECT_DESCRIPTION, user); File testDir = new File(this.getClass().getClassLoader().getResource("project/testjob/testjob.zip").getFile()); System.out.println("Uploading zip file: " + testDir.getAbsolutePath()); Props props = new Props(); manager.uploadProject(project, testDir, FILE_TYPE, user, props); verify(loader).uploadProjectFile(project, PROJECT_VERSION + 1, FILE_TYPE, testDir.getName(), testDir, user.getUserId()); verify(loader).uploadFlows(eq(project), eq(PROJECT_VERSION + 1), anyCollection()); verify(loader).changeProjectVersion(project, PROJECT_VERSION + 1, user.getUserId()); verify(loader, times(2)).uploadProjectProperties(eq(project), anyList()); verify(loader).postEvent(project, ProjectLogEvent.EventType.UPLOADED, user.getUserId(), "Uploaded project files zip " + testDir.getName()); verify(loader).cleanOlderProjectVersion(project.getId(), PROJECT_VERSION + 1 - PROJECT_VERSION_RETENTIION); }
Source:
public static Matcher<Watermark> watermark(long timestamp) { return new WatermarkMatcher(timestamp); }

Target:
public static Matcher<Watermark> watermark(long timestamp) { return new FeatureMatcher<Watermark, Long>( equalTo(timestamp), "a watermark with value", "value of watermark" ) { @Override protected Long featureValueOf(Watermark actual) { return actual.getTimestamp(); } }; }
Source:
public void cancelRefresh() { if(refresh == null) { return; } else { refresh.cancel(); } }

Target:
public void cancelRefresh() { if(refresh != null) { refresh.cancel(); } }
Source:
private List<CustomAction> customActions() { List<CustomAction> actions = new LinkedList<>(); CustomAction pos = new CustomAction("org.finra.datagenerator", "transform", Transform.class); actions.add(pos); pos = new CustomAction("org.finra.datagenerator", "positive", Assign.class); actions.add(pos); return actions; }

Target:
private List<CustomAction> customActions() { List<CustomAction> actions = new LinkedList<>(); CustomAction pos = new CustomAction("org.finra.datagenerator", "transform", Transform.class); actions.add(pos); return actions; }
Source:
public synchronized Swagger read(Set<Class<?>> classes) { listeners.clear(); for(Class<?> cls: classes) { if( ReaderListener.class.isAssignableFrom( ReaderListener.class ) && listeners.containsKey( cls )){ try { listeners.put( cls, (ReaderListener) cls.newInstance()); } catch (Exception e) { LOGGER.error("Failed to create ReaderListener", e); } } } for( ReaderListener listener : listeners.values()){ listener.beforeScan( this, swagger ); } for(Class<?> cls: classes) read(cls); for( ReaderListener listener : listeners.values()){ listener.afterScan( this, swagger); } return swagger; }

Target:
public Swagger read(Set<Class<?>> classes) { Map<Class<?>,ReaderListener> listeners = new HashMap<Class<?>, ReaderListener>(); for(Class<?> cls: classes) { if( ReaderListener.class.isAssignableFrom( cls ) && !listeners.containsKey( cls )){ try { listeners.put( cls, (ReaderListener) cls.newInstance()); } catch (Exception e) { LOGGER.error("Failed to create ReaderListener", e); } } } for( ReaderListener listener : listeners.values()){ try { listener.beforeScan(this, swagger); } catch( Exception e ){ LOGGER.error( "Unexpected error invoking beforeScan listener [" + listener.getClass().getName() + "]", e ); } } for(Class<?> cls: classes) read(cls); for( ReaderListener listener : listeners.values()){ try { listener.afterScan( this, swagger); } catch( Exception e ){ LOGGER.error( "Unexpected error invoking afterScan listener [" + listener.getClass().getName() + "]", e ); } } return swagger; }
Source:
public void deleteTopicFromRegistry(String topicName, String subscriptionId) throws BrokerManagerAdminException { try { QueueManagerService queueManagerService = AndesBrokerManagerAdminServiceDSHolder.getInstance().getQueueManagerService(); queueManagerService.deleteTopicFromRegistry(topicName, subscriptionId); } catch (QueueManagerException e) { String message = e.getMessage(); throw new BrokerManagerAdminException("Error in deleting topic from registry. " + "" + message, e); } }

Target:
public void deleteTopicFromRegistry(String topicName, String subscriptionId) throws BrokerManagerAdminException { try { QueueManagerService queueManagerService = AndesBrokerManagerAdminServiceDSHolder.getInstance().getQueueManagerService(); queueManagerService.deleteTopicFromRegistry(topicName, subscriptionId); } catch (QueueManagerException e) { String message = e.getMessage(); log.error("Error in deleting topic from registry.", e); throw new BrokerManagerAdminException("Error in deleting topic from registry. " , e); } }
Source:
public String toString() { String classPath = subPaths.get(0).toString(); for (int i = 1; i < subPaths.size(); i++) { classPath += File.pathSeparatorChar + subPaths.get(i).toString(); if (subPaths.get(i).toString().contains("testrunner")) { classPath += File.pathSeparatorChar + subPaths.get(i).toString() + File.separatorChar + "tmc-junit-runner.jar"; } } return classPath; }

Target:
public String toString() { if (subPaths.isEmpty()) { return ""; } String classPath = subPaths.get(0).toString(); for (int i = 1; i < subPaths.size(); i++) { classPath += File.pathSeparatorChar + subPaths.get(i).toString(); } return classPath; }
Source:
private T getClaimValue(final String name) { final Bean<?> bean = bm.resolve(bm.getBeans(JsonWebToken.class)); if (RequestScoped.class.equals(bean.getScope())) { jsonWebToken = JsonWebToken.class.cast(bm.getReference(bean, JsonWebToken.class, null)); } if (jsonWebToken == null || !bean.getScope().equals(RequestScoped.class)) { logger.warning(String.format("Can't retrieve claim %s. No active principal.", name)); return null; } final Optional<T> claimValue = jsonWebToken.claim(name); logger.finest(String.format("Found ClaimValue=%s for name=%s", claimValue, name)); return claimValue.orElse(null); }

Target:
private T getClaimValue(final String name) { final Bean<?> bean = bm.resolve(bm.getBeans(JsonWebToken.class)); JsonWebToken jsonWebToken = null; if (RequestScoped.class.equals(bean.getScope())) { jsonWebToken = JsonWebToken.class.cast(bm.getReference(bean, JsonWebToken.class, null)); } if (jsonWebToken == null || !bean.getScope().equals(RequestScoped.class)) { logger.warning(String.format("Can't retrieve claim %s. No active principal.", name)); return null; } final Optional<T> claimValue = jsonWebToken.claim(name); logger.finest(String.format("Found ClaimValue=%s for name=%s", claimValue, name)); return claimValue.orElse(null); }
Source:
private IASTTranslationUnit getAST() { if (fTranslationUnit != null) return fTranslationUnit; IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); if (window == null) return null; IWorkbenchPage page = window.getActivePage(); if (page == null) return null; IEditorPart editor = page.getActiveEditor(); if (editor == null) return null; IWorkingCopyManager manager = CUIPlugin.getDefault().getWorkingCopyManager(); ITranslationUnit unit = manager.getWorkingCopy(editor.getEditorInput()); if (unit == null) return null; try { fTranslationUnit = unit.getAST(CCorePlugin.getIndexManager().getIndex(unit.getCProject()), ITranslationUnit.AST_SKIP_ALL_HEADERS); return fTranslationUnit; } catch (CoreException e) { CUIPlugin.log(e); } return null; }

Target:
private IASTTranslationUnit getAST() { if (fTranslationUnit != null) return fTranslationUnit; IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); if (window == null) return null; IWorkbenchPage page = window.getActivePage(); if (page == null) return null; IEditorPart editor = page.getActiveEditor(); if (editor == null) return null; IWorkingCopyManager manager = CUIPlugin.getDefault().getWorkingCopyManager(); ITranslationUnit unit = manager.getWorkingCopy(editor.getEditorInput()); if (unit == null) return null; try { fTranslationUnit = unit.getAST(CCorePlugin.getIndexManager().getIndex(unit.getCProject(), IIndexManager.ADD_DEPENDENCIES), ITranslationUnit.AST_SKIP_ALL_HEADERS); return fTranslationUnit; } catch (CoreException e) { CUIPlugin.log(e); } return null; }
Source:
public static int getValue(String text) { if (text == null || text.isEmpty() || text.equals("build")) { return BUILD; } if (text.equals("codan")) { return CODAN; } if (text.equals("build,codan")) { return BUILD_AND_CODAN; } throw new IllegalArgumentException("Unknown context value: " + text); }

Target:
public static int getValue(String text) { if (text == null || text.isEmpty() || text.equals("build")) { return BUILD; } if (text.equals("codan")) { return CODAN; } throw new IllegalArgumentException("Unknown context value: " + text); }
Source:
private boolean response429ButExceptionIsNotRetryable(Response response, Exception exception) { return (response.status() == 429) && !isExceptionIsRetryable(exception); }

Target:
private boolean response429ButExceptionIsNotRetryable(Response response, Exception exception) { return (response.status() == 429) && !isExceptionRetryable(exception); }
Source:
protected static JSIBackgroundDataType getBackgroundData(BackgroundData source) { JSIBackgroundDataType toReturn = new JSIBackgroundDataType(); JSIFactMappingValuesType factMappingValuesType = new JSIFactMappingValuesType(); toReturn.setFactMappingValues(factMappingValuesType); final List<FactMappingValue> unmodifiableFactMappingValues = source.getUnmodifiableFactMappingValues(); List<JSIFactMappingValueType> toSet = new ArrayList<>(); populateJSIFactMappingValuesType(toSet, unmodifiableFactMappingValues); factMappingValuesType.setFactMappingValue(toSet); return toReturn; }

Target:
protected static JSIBackgroundDataType getBackgroundData(BackgroundData source) { JSIBackgroundDataType toReturn = new JSIBackgroundDataType(); JSIFactMappingValuesType factMappingValuesType = new JSIFactMappingValuesType(); toReturn.setFactMappingValues(factMappingValuesType); final List<FactMappingValue> unmodifiableFactMappingValues = source.getUnmodifiableFactMappingValues(); List<JSIFactMappingValueType> toSet = populateJSIFactMappingValuesType(unmodifiableFactMappingValues); factMappingValuesType.setFactMappingValue(toSet); return toReturn; }
Source:
void scheduleMessageWithTransaction() { final ServiceBusMessage testData = new ServiceBusMessage(TEST_CONTENTS.getBytes(UTF_8)); final Instant scheduledEnqueueTime = Instant.now(); final long sequenceNumber = 1; when(asyncSender.scheduleMessage(testData, scheduledEnqueueTime, transactionContext)).thenReturn(Mono.just(sequenceNumber)); sender.scheduleMessage(testData, scheduledEnqueueTime, transactionContext); verify(asyncSender, times(1)).scheduleMessage(testData, scheduledEnqueueTime, transactionContext); verify(asyncSender).scheduleMessage(singleMessageCaptor.capture(), scheduleMessageCaptor.capture(), transactionCaptor.capture()); final ServiceBusMessage message = singleMessageCaptor.getValue(); Assertions.assertArrayEquals(testData.getBody(), message.getBody()); final Instant scheduledEnqueueTimeActual = scheduleMessageCaptor.getValue(); Assertions.assertEquals(scheduledEnqueueTime, scheduledEnqueueTimeActual); Assertions.assertEquals(transactionContext, transactionCaptor.getValue()); }

Target:
void scheduleMessageWithTransaction() { final ServiceBusMessage testData = new ServiceBusMessage(TEST_CONTENTS.getBytes(UTF_8)); final Instant scheduledEnqueueTime = Instant.now(); final long expected = 1; when(asyncSender.scheduleMessage(testData, scheduledEnqueueTime, transactionContext)).thenReturn(Mono.just(expected)); long actual = sender.scheduleMessage(testData, scheduledEnqueueTime, transactionContext); Assertions.assertEquals(expected, actual); verify(asyncSender).scheduleMessage(testData, scheduledEnqueueTime, transactionContext); }
Source:
public void testCatchErrorOnEmbeddedSubprocessWithoutErrorCode() { try { testCatchErrorOnEmbeddedSubprocess(); } catch (ActivitiException re) { } }

Target:
public void testCatchErrorOnEmbeddedSubprocessWithoutErrorCode() { Throwable throwable = catchThrowable(() -> repositoryService .createDeployment() .addClasspathResource("org/activiti/engine/test/bpmn/event/error/BoundaryErrorEventTest.testCatchErrorOnEmbeddedSubprocessWithoutErrorCode.bpmn20.xml") .deploy()); assertThat(throwable).isInstanceOf(ActivitiException.class) .hasMessageContaining("activiti-error-missing-error-code"); }
Source:
public void build() { class TestItem { } final PutResolver<TestItem> putResolver = mock(PutResolver.class); final GetResolver<TestItem> getResolver = mock(GetResolver.class); final DeleteResolver<TestItem> deleteResolver = mock(DeleteResolver.class); final SQLiteTypeMapping<TestItem> typeMapping = SQLiteTypeMapping.<TestItem>builder() .putResolver(putResolver) .getResolver(getResolver) .deleteResolver(deleteResolver) .build(); assertThat(typeMapping.putResolver()).isEqualTo(putResolver); assertThat(typeMapping.getResolver()).isEqualTo(getResolver); assertThat(typeMapping.deleteResolver()).isEqualTo(deleteResolver); }

Target:
public void build() { class TestItem { } final PutResolver<TestItem> putResolver = mock(PutResolver.class); final GetResolver<TestItem> getResolver = mock(GetResolver.class); final DeleteResolver<TestItem> deleteResolver = mock(DeleteResolver.class); final SQLiteTypeMapping<TestItem> typeMapping = SQLiteTypeMapping.<TestItem>builder() .putResolver(putResolver) .getResolver(getResolver) .deleteResolver(deleteResolver) .build(); assertThat(typeMapping.putResolver()).isSameAs(putResolver); assertThat(typeMapping.getResolver()).isSameAs(getResolver); assertThat(typeMapping.deleteResolver()).isSameAs(deleteResolver); }
Source:
public BatchSizeIncreasingIterator(BatchProvider<T> batchProvider, int originalBatchSize, @Nullable ClosableIterator<T> currentResults) { Preconditions.checkArgument(originalBatchSize > 0); this.batchProvider = batchProvider; this.originalBatchSize = originalBatchSize; this.currentResults = new ExhaustibleClosableIterator<>(currentResults); if (currentResults != null) { this.lastBatchSize = originalBatchSize; } }

Target:
public BatchSizeIncreasingIterator(BatchProvider<T> batchProvider, int originalBatchSize, @Nullable ClosableIterator<T> currentResults) { Preconditions.checkArgument(originalBatchSize > 0); this.batchProvider = batchProvider; this.originalBatchSize = originalBatchSize; if (currentResults != null) { this.currentResults = new ExhaustibleClosableIterator<>(currentResults); this.lastBatchSize = originalBatchSize; } }
Source:
public double calcTurnWeight(int edgeFrom, int nodeVia, int edgeTo) { if (edgeFrom == EdgeIterator.NO_EDGE || edgeTo == EdgeIterator.NO_EDGE) { return 0; } if (turnCostExt.isUTurn(edgeFrom, edgeTo)) { return uTurnCost; } long turnFlags = turnCostExt.getTurnCostFlags(edgeFrom, nodeVia, edgeTo); if (turnCostEncoder.isTurnRestricted(turnFlags)) return Double.POSITIVE_INFINITY; return turnCostEncoder.getTurnCost(turnFlags); }

Target:
public double calcTurnWeight(int edgeFrom, int nodeVia, int edgeTo) { if (!EdgeIterator.Edge.isValid(edgeFrom) || !EdgeIterator.Edge.isValid(edgeTo)) { return 0; } if (turnCostExt.isUTurn(edgeFrom, edgeTo)) { return uTurnCost; } long turnFlags = turnCostExt.getTurnCostFlags(edgeFrom, nodeVia, edgeTo); if (turnCostEncoder.isTurnRestricted(turnFlags)) return Double.POSITIVE_INFINITY; return turnCostEncoder.getTurnCost(turnFlags); }
Source:
void processFiles() { File[] files = storage.listFiles(new FilenameFilter() { public boolean accept(File dir, String name) { return name.endsWith(RaygunOnFailedSendOfflineStorageHandler.fileExtension); } }); if (files == null) { return; } for (File file : files) { InputStream inputStream = null; ByteArrayOutputStream outputStream = null; try { inputStream = getInputStream(file); outputStream = new ByteArrayOutputStream(); byte[] buffer = new byte[(int) file.length()]; int length; while ((length = inputStream.read(buffer)) != -1) { outputStream.write(buffer, 0, length); } inputStream.close(); int reponseCode = client.send(outputStream.toString("UTF-8")); if (reponseCode == 202 || reponseCode == 429 ) { file.delete(); } } catch (IOException e) { Logger.getLogger("Raygun4Java").warning("exception processing offline payload: " + e.getMessage()); return; } finally { if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { Logger.getLogger("Raygun4Java").warning("exception closing outputStream: " + e.getMessage()); } } if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { Logger.getLogger("Raygun4Java").warning("exception closing inputStream: " + e.getMessage()); } } } } }

Target:
void processFiles() { File[] files = storage.listFiles(new FilenameFilter() { public boolean accept(File dir, String name) { return name.endsWith(RaygunOnFailedSendOfflineStorageHandler.fileExtension); } }); if (files == null) { return; } for (File file : files) { InputStream inputStream = null; ByteArrayOutputStream outputStream = null; try { inputStream = getInputStream(file); outputStream = new ByteArrayOutputStream(); byte[] buffer = new byte[(int) file.length()]; int length; while ((length = inputStream.read(buffer)) != -1) { outputStream.write(buffer, 0, length); } inputStream.close(); int reponseCode = client.send(outputStream.toString("UTF-8")); if (deleteOnStatusCodes.contains(reponseCode)) { file.delete(); } } catch (IOException e) { Logger.getLogger("Raygun4Java").warning("exception processing offline payload: " + e.getMessage()); return; } finally { if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { Logger.getLogger("Raygun4Java").warning("exception closing outputStream: " + e.getMessage()); } } if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { Logger.getLogger("Raygun4Java").warning("exception closing inputStream: " + e.getMessage()); } } } } }
Source:
public static Predicate<GHEventsSubscriber> isApplicableFor(final AbstractProject<?, ?> project) { return new Predicate<GHEventsSubscriber>() { @Override public boolean apply(GHEventsSubscriber subscriber) { Validate.notNull(subscriber); return subscriber.isApplicable(project); } }; }

Target:
public static Predicate<GHEventsSubscriber> isApplicableFor(final AbstractProject<?, ?> project) { return new Predicate<GHEventsSubscriber>() { @Override public boolean apply(GHEventsSubscriber subscriber) { return notNull(subscriber).isApplicable(project); } }; }
Source:
public void close() { if (!shuttingDown.getAndSet(true)) { logger.info("CoordinatorBackedRouter closing"); if (!operationPool.isShutdown()) { try { operationPool.shutdown(); operationPool.awaitTermination(1, TimeUnit.MINUTES); coordinator.close(); logger.info("CoordinatorBackedRouter closed"); } catch (IOException e) { logger.error("Error closing Coordinator in CoordinatorBackedRouter", e); } catch (Exception e) { logger.error("Error shutting down operationPool in CoordinatorBackedRouter", e); } } } }

Target:
public void close() throws IOException { try { if (routerOpen.compareAndSet(true, false)) { logger.info("CoordinatorBackedRouter closing"); operationPool.shutdown(); operationPool.awaitTermination(1, TimeUnit.MINUTES); coordinator.close(); logger.info("CoordinatorBackedRouter closed"); } else { operationPool.awaitTermination(1, TimeUnit.MINUTES); } } catch (InterruptedException e) { logger.error("Error shutting down operationPool in CoordinatorBackedRouter", e); } }
Source:
private String renderInput(Options options, String inputFile) { Asciidoctor asciidoctor = JRubyAsciidoctor.create(); return asciidoctor.renderFile(new File(inputFile), options); }

Target:
private void renderInput(Options options, String inputFile) { Asciidoctor asciidoctor = JRubyAsciidoctor.create(); asciidoctor.renderFile(new File(inputFile), options); }
Source:
public StorageFactory storageFactory() { if (environment().isTests()) { if (storageFactoryForTests != null) { return storageFactoryForTests; } this.storageFactoryForTests = InMemoryStorageFactory.newInstance(); return storageFactoryForTests; } checkNotNull(productionStorageFactory, "Production `%s` is not configured." + " Please call `configureStorage()`.", StorageFactory.class.getSimpleName() ); return productionStorageFactory; }

Target:
public StorageFactory storageFactory() { if (environment().isTests()) { if (storageFactoryForTests == null) { this.storageFactoryForTests = InMemoryStorageFactory.newInstance(); } return storageFactoryForTests; } checkNotNull(productionStorageFactory, "Production `%s` is not configured." + " Please call `configureStorage()`.", StorageFactory.class.getSimpleName() ); return productionStorageFactory; }
Source:
public void testCommentAndExtraInSameOrder() throws Exception { String comment = makeString(17, "z"); byte[] extra = makeString(11, "a").getBytes(); File f = createTemporaryZipFile(); ZipOutputStream out = createZipOutputStream(f); ZipEntry ze = new ZipEntry("x"); ze.setSize(0); ze.setTime(TEST_TIME); ze.setExtra(extra); ze.setComment(comment); out.putNextEntry(ze); out.closeEntry(); ze = new ZipEntry("y"); ze.setTime(TEST_TIME); ze.setExtra(extra); ze.setComment(comment); out.putNextEntry(ze); out.closeEntry(); out.close(); ZipFile zipFile = new ZipFile(f); try { assertEquals(comment, zipFile.getEntry("x").getComment()); assertTrue(Arrays.equals(extra, zipFile.getEntry("x").getExtra())); assertEquals(comment, zipFile.getEntry("y").getComment()); assertTrue(Arrays.equals(extra, zipFile.getEntry("y").getExtra())); } finally { zipFile.close(); } }

Target:
public void testCommentAndExtraInSameOrder() throws Exception { String comment = makeString(17, "z"); byte[] extra = makeString(11, "a").getBytes(); File f = createTemporaryZipFile(); ZipOutputStream out = createZipOutputStream(f); ZipEntry ze = new ZipEntry("x"); ze.setSize(0); ze.setTime(ENTRY_TIME); ze.setExtra(extra); ze.setComment(comment); out.putNextEntry(ze); out.closeEntry(); ze = new ZipEntry("y"); ze.setTime(ENTRY_TIME); ze.setExtra(extra); ze.setComment(comment); out.putNextEntry(ze); out.closeEntry(); out.close(); ZipFile zipFile = new ZipFile(f); try { assertEquals(comment, zipFile.getEntry("x").getComment()); assertTrue(Arrays.equals(extra, zipFile.getEntry("x").getExtra())); assertEquals(comment, zipFile.getEntry("y").getComment()); assertTrue(Arrays.equals(extra, zipFile.getEntry("y").getExtra())); } finally { zipFile.close(); } }
Source:
public boolean isRange() { int ordinal = this.ordinal(); return (ordinal == GREATER_THAN.ordinal() || ordinal == GREATER_THAN_OR_EQUAL.ordinal() || ordinal == LESS_THAN .ordinal() || ordinal == LESS_THAN_OR_EQUAL.ordinal() || ordinal == BETWEEN.ordinal()); }

Target:
public boolean isRange() { return (this == GREATER_THAN || this == GREATER_THAN_OR_EQUAL || this == LESS_THAN || this == LESS_THAN_OR_EQUAL || this == BETWEEN); }