auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Double getTotalCpuReqTask(ExecutorDetails exec) { if (hasExecInTopo(exec)) { return _resourceList .get(exec) .get(Config.TOPOLOGY_COMPONENT_CPU_PCORE_PERCENT); } LOG.warn("cannot find - {}", exec); return null; }

Target:
public Double getTotalCpuReqTask(ExecutorDetails exec) { if (hasExecInTopo(exec)) { return _resourceList .get(exec) .get(Config.TOPOLOGY_COMPONENT_CPU_PCORE_PERCENT); } return null; }
Source:
public void should_balance_requests_across_connections() throws InterruptedException { // Generate just the right load to completely fill the pool. All requests should succeed. int simultaneousRequests = POOL_SIZE * REQUESTS_PER_CONNECTION; for (int i = 0; i < simultaneousRequests; i++) { reschedule(null, null); } SECONDS.sleep(5); done.countDown(); Throwable unexpectedError = unexpectedErrorRef.get(); if (unexpectedError != null) { fail("At least one request failed unexpectedly", unexpectedError); } }

Target:
public void should_balance_requests_across_connections() throws InterruptedException { // Generate just the right load to completely fill the pool. All requests should succeed. int simultaneousRequests = POOL_SIZE * REQUESTS_PER_CONNECTION; for (int i = 0; i < simultaneousRequests; i++) { reschedule(null, null); } SECONDS.sleep(1); done.countDown(); Throwable unexpectedError = unexpectedErrorRef.get(); if (unexpectedError != null) { fail("At least one request failed unexpectedly", unexpectedError); } }
Source:
public void generateSourceMaps() throws Exception { when(xwikiPropertiesSource.getProperty("lesscss.generateInlineSourceMaps", false)).thenReturn(true); boolean b = mocker.getComponentUnderTest().isGenerateInlineSourceMaps(); assertTrue(b == true); }

Target:
public void generateSourceMaps() throws Exception { when(xwikiPropertiesSource.getProperty("lesscss.generateInlineSourceMaps", false)).thenReturn(true); boolean b = mocker.getComponentUnderTest().isGenerateInlineSourceMaps(); assertTrue(b); }
Source:
public String sendHttpGetToBroker(String table, String path) { return doHttpActionWithHeaders( Request.builder().prepareGet().setUri(URI.create(String.format("http://%s/%s", getBrokerHost(table), path))), Optional.empty(), Optional.empty()); }

Target:
private String sendHttpGetToBroker(String table, String path) { return doHttpActionWithHeaders( Request.builder().prepareGet().setUri(URI.create(String.format("http://%s/%s", getBrokerHost(table), path))), Optional.empty(), Optional.empty()); }
Source:
protected PhysicalOperator getNewWithChild(PhysicalOperator child) { return new IteratorValidator(child, this.isRepeatable); }

Target:
protected PhysicalOperator getNewWithChild(PhysicalOperator child) { return new IteratorValidator(child, isRepeatable); }
Source:
public synchronized List<Inode<?>> getInodeList() { return Lists.newArrayList(mLockList.getInodes()); }

Target:
public synchronized List<Inode<?>> getInodeList() { return mLockList.getInodes(); }
Source:
public WriteRequest(ByteBuf buf) { writeMode = ICorfuPayload.fromBuffer(buf, WriteMode.class); streamAddresses = null; data = ICorfuPayload.fromBuffer(buf, LogData.class); }

Target:
public WriteRequest(ByteBuf buf) { writeMode = ICorfuPayload.fromBuffer(buf, WriteMode.class); data = ICorfuPayload.fromBuffer(buf, LogData.class); }
Source:
public List<RepoImage> getUserRequestForStorageDomainRepoFileList(Guid storageDomainId, ImageFileType imageType, boolean forceRefresh) { // Query for storageDoaminId is looking for Active ISO domain if (!isStorageDomainIdValid(storageDomainId)) { throw new EngineException(EngineError.GetIsoListError); } if (forceRefresh) { if (refreshRepos(storageDomainId, imageType)) { throw new EngineException(EngineError.IMAGES_NOT_SUPPORTED_ERROR); } } else { refreshReposIfIntervalPassed(storageDomainId, imageType); } // In any case, whether refreshed or not, get Iso list from the cache. return getCachedIsoListByDomainId(storageDomainId, imageType); }

Target:
public List<RepoImage> getUserRequestForStorageDomainRepoFileList(Guid storageDomainId, ImageFileType imageType, boolean forceRefresh) { // Query for storageDoaminId is looking for Active ISO domain if (!isStorageDomainIdValid(storageDomainId)) { throw new EngineException(EngineError.GetIsoListError); } if (forceRefresh) { if (!refreshRepos(storageDomainId, imageType)) { throw new EngineException(EngineError.IMAGES_NOT_SUPPORTED_ERROR); } } else { refreshReposIfIntervalPassed(storageDomainId, imageType); } // In any case, whether refreshed or not, get Iso list from the cache. return getCachedIsoListByDomainId(storageDomainId, imageType); }
Source:
public int hashCode() { return HashCodeBuilder.reflectionHashCode(formField.getPageNumber()); }

Target:
public int hashCode() { return new HashCodeBuilder().append(formField.getPageNumber()).build(); }
Source:
public static byte[] toUtf8(final String string) { if(string == null){ return null; } try { return string.getBytes(UTF8_STRING); } catch (UnsupportedEncodingException e) { // Should never happen throw Throwables.propagate(e); } }

Target:
public static byte[] toUtf8(final String string) { try { return string.getBytes(UTF8_STRING); } catch (UnsupportedEncodingException e) { // Should never happen throw Throwables.propagate(e); } }
Source:
public String getText(Object element) { if (element instanceof String) { return (String) element; } if (element instanceof FileAndName) { return ((FileAndName) element).getFile().getName(); } return null; }

Target:
public String getText(Object element) { if (element instanceof String) { return (String) element; } if (element instanceof FileAndName) { final File file = ((FileAndName) element).getFile(); if (file != null) { // should never not happen since file is final // and always set automatically return file.getName(); } } return null; }
Source:
public SpatialLayoutUnique( CoordinateReferenceSystem crs, SpaceFillingCurve curve ) { super( crs, curve ); }

Target:
SpatialLayoutUnique( CoordinateReferenceSystem crs, SpaceFillingCurve curve ) { super( crs, curve ); }
Source:
public void close() throws IOException { // mark this context as closed. The real cleanup like closing of EJB receivers // *isn't* the responsibility of the EJB client context. We'll just let our EJBClientContextListeners // (if any) know about the context being closed and let them handle closing the receivers if they want to this.closed = true; for (final EJBClientContextListener listener : this.ejbClientContextListeners) { try { listener.contextClosed(this); } catch (Throwable t) { logger.debug("Ignoring the exception thrown by an EJB client context listener while closing the context " + this, t); } } // close the executor we use for reconnect handlers this.reconnectionExecutorService.shutdownNow(); }

Target:
public synchronized void close() throws IOException { if (closed) { return; } // mark this context as closed. The real cleanup like closing of EJB receivers // *isn't* the responsibility of the EJB client context. We'll just let our EJBClientContextListeners // (if any) know about the context being closed and let them handle closing the receivers if they want to this.closed = true; for (final EJBClientContextListener listener : this.ejbClientContextListeners) { try { listener.contextClosed(this); } catch (Throwable t) { logger.debug("Ignoring the exception thrown by an EJB client context listener while closing the context " + this, t); } } // close the executor we use for reconnect handlers this.reconnectionExecutorService.shutdownNow(); }
Source:
protected void readHiveRecordAndInsertIntoRecordBatch(Object rowValue) { for (int columnRefIdx = 0; columnRefIdx < selectedStructFieldRefs.length; columnRefIdx++) { Object columnValue = finalObjInspector.getStructFieldData(rowValue, selectedStructFieldRefs[columnRefIdx]); if (columnValue == null) { continue; } columnValueWriters[columnRefIdx].write(columnValue); } }

Target:
protected void readHiveRecordAndInsertIntoRecordBatch(Object rowValue) { for (int columnRefIdx = 0; columnRefIdx < selectedStructFieldRefs.length; columnRefIdx++) { Object columnValue = finalObjInspector.getStructFieldData(rowValue, selectedStructFieldRefs[columnRefIdx]); if (columnValue != null) { columnValueWriters[columnRefIdx].write(columnValue); } } }
Source:
private void matchSinglelineComment(boolean includeNewline) { int c = getChar(); while (c != '\n' && c != EOFCHAR && (includeNewline || (c != '\r'))) { c = getChar(); } if (c == EOFCHAR || !includeNewline) { ungetChar(c); } }

Target:
private void matchSinglelineComment(boolean includeNewline) { int c = getChar(); while (c != '\n' && c != EOFCHAR) { int next = getChar(); if (c == '\r' && next == '\n' && !includeNewline) { // exclude CRLF line ending ungetChar(next); break; } c = next; } if (c == EOFCHAR || !includeNewline) { ungetChar(c); } }
Source:
public long estimateEncodedKeyComponentSize(int[] key) { // the size is calculated conservatively, first key may be accounted for twice long estimatedSize = (key.length * Integer.BYTES); estimatedSize += Arrays.stream(key) .filter(element -> dimLookup.getValue(element) != null) .mapToLong(element -> dimLookup.getValue(element).length() * Character.BYTES).sum(); return estimatedSize; }

Target:
public long estimateEncodedKeyComponentSize(int[] key) { // string length is being accounted for each time they are referenced, based on dimension handler interface, // even though they are stored just once. It may overestimate the size by a bit, but we wanted to leave // more buffer to be safe long estimatedSize = key.length * Integer.BYTES; estimatedSize += Arrays.stream(key) .filter(element -> dimLookup.getValue(element) != null) .mapToLong(element -> dimLookup.getValue(element).length() * Character.BYTES) .sum(); return estimatedSize; }
Source:
public IAuthorizationPrincipal getPrincipalForEntity(Entity entity) { // attempt to determine the entity type class for this principal if (entity != null) { Class entityType; if (entity.getEntityType().equals(EntityEnum.GROUP.toString())) { entityType = IEntityGroup.class; } else { entityType = EntityEnum.getEntityEnum(entity.getEntityType()).getClazz(); } // construct an authorization principal for this JsonEntityBean AuthorizationService authService = AuthorizationService.instance(); IAuthorizationPrincipal p = authService.newPrincipal(entity.getId(), entityType); return p; } return null; }

Target:
public IAuthorizationPrincipal getPrincipalForEntity(Entity entity) { // attempt to determine the entity type class for this principal if (entity == null) { return null; } Class entityType; if (entity.getEntityType().equals(EntityEnum.GROUP.toString())) { entityType = IEntityGroup.class; } else { entityType = EntityEnum.getEntityEnum(entity.getEntityType()).getClazz(); } // construct an authorization principal for this JsonEntityBean AuthorizationService authService = AuthorizationService.instance(); IAuthorizationPrincipal p = authService.newPrincipal(entity.getId(), entityType); return p; }
Source:
public static List<String> getKeyListFromBlobStore(BlobStore blobStore) throws Exception { Iterator<String> keys = blobStore.listKeys(); List<String> keyList = new ArrayList<String>(); while (keys != null && keys.hasNext()) { keyList.add(keys.next()); } LOG.debug("KeyList from blobstore {}", keyList); return keyList; }

Target:
public static List<String> getKeyListFromBlobStore(BlobStore blobStore) throws Exception { Iterator<String> keys = blobStore.listKeys(); List<String> keyList = new ArrayList<String>(); if (keys != null) { while (keys.hasNext()) { keyList.add(keys.next()); } } LOG.debug("KeyList from blobstore {}", keyList); return keyList; }
Source:
public void setEnabled(boolean enabled) { asTextBox().setEnabled(enabled); if (enabled) { asTextBox().getElement().getStyle().setBackgroundColor("#ffffff"); //$NON-NLS-1$ } else { // the default background of the textbox is not the same as our disabled color asTextBox().getElement().getStyle().setBackgroundColor("#e5e5e5"); //$NON-NLS-1$ } }

Target:
public void setEnabled(boolean enabled) { asTextBox().setEnabled(enabled); }
Source:
public void registerLayers(MapActivity activity) { // remove old if existing after turn if(parkingLayer != null) { activity.getMapView().removeLayer(parkingLayer); } parkingLayer = new ParkingPositionLayer(activity, this); // activity.getMapView().addLayer(parkingLayer, 5.5f); registerWidget(activity); }

Target:
public void registerLayers(MapActivity activity) { registerWidget(activity); }
Source:
public String toString() { String prefix = (TotalMilliseconds < 0) ? "-" : ""; // Ok to use String.format directly since GWT does not use TimeSpan from ui override package return String.format("%s%d.%02d:%02d:%02d.%03d", prefix, Days, Hours, Minutes, Seconds, Milliseconds); }

Target:
public String toString() { // Ok to use String.format directly since GWT does not use TimeSpan from ui override package return String.format("%s%d.%02d:%02d:%02d.%03d", (TotalMilliseconds < 0) ? "-" : "", Days, Hours, Minutes, Seconds, Milliseconds); }
Source:
@Override public Response execute(Request request) throws IOException { HttpUriRequest apacheRequest = createRequest(request); HttpResponse apacheResponse = execute(client, apacheRequest); String url = request.getUrl(); if (this.redirectHandler != null && this.redirectHandler.finalUri != null) { // if we have a redirect handler, and it has been redirected, use it's url url = this.redirectHandler.finalUri.toString(); } return parseResponse(url, apacheResponse); }

Target:
@Override public Response execute(Request request) throws IOException { HttpUriRequest apacheRequest = createRequest(request); HttpResponse apacheResponse = execute(client, apacheRequest); String url = request.getUrl(); if (redirectHandler != null && redirectHandler.finalUri != null) { // If we have a redirect handler, and it has been redirected, use it's URL. url = redirectHandler.finalUri.toString(); } return parseResponse(url, apacheResponse); }
Source:
private void maybeAddCluster() throws IOException { for (Map.Entry<String, HelixAdmin> entry : adminForDc.entrySet()) { // Add a cluster entry in every DC String dcName = entry.getKey(); HelixAdmin admin = entry.getValue(); if (!admin.getClusters().contains(clusterName)) { info("Adding cluster in {}", clusterName, dcName); admin.addCluster(clusterName); admin.addStateModelDef(clusterName, LeaderStandbySMD.name, LeaderStandbySMD.build()); } } }

Target:
private void maybeAddCluster() { for (Map.Entry<String, HelixAdmin> entry : adminForDc.entrySet()) { // Add a cluster entry in every DC String dcName = entry.getKey(); HelixAdmin admin = entry.getValue(); if (!admin.getClusters().contains(clusterName)) { info("Adding cluster in {}", clusterName, dcName); admin.addCluster(clusterName); admin.addStateModelDef(clusterName, LeaderStandbySMD.name, LeaderStandbySMD.build()); } } }
Source:
private Function<Throwable, Throwable> getThrowableFunction(CoreEvent event) { return throwable -> { Throwable cause = getMessagingExceptionCause(throwable); CoreEvent exceptionEvent = event; if (throwable instanceof MessagingException) { exceptionEvent = ((MessagingException) throwable).getEvent(); } // MessagingException cause is set to null in order to avoid RETRY:EXHAUSTED ErrorType replacement // during ErrorType resolution (see ChainErrorHandlingUtils and MessagingExceptionResolver) return new MessagingException(exceptionEvent, new RetryPolicyExhaustedException(createStaticMessage(UNTIL_SUCCESSFUL_MSG_PREFIX, cause.getMessage()), null, owner), owner); }; }

Target:
private Function<Throwable, Throwable> getThrowableFunction(CoreEvent event) { return throwable -> { Throwable cause = getMessagingExceptionCause(throwable); CoreEvent exceptionEvent = event; if (throwable instanceof MessagingException) { exceptionEvent = ((MessagingException) throwable).getEvent(); } // RetryPolicyExhaustedException cause is not set in order to avoid RETRY:EXHAUSTED ErrorType replacement // during ErrorType resolution (see ChainErrorHandlingUtils and MessagingExceptionResolver) return new MessagingException(exceptionEvent, new RetryPolicyExhaustedException(createStaticMessage(UNTIL_SUCCESSFUL_MSG_PREFIX, cause.getMessage()), owner), owner); }; }
Source:
private void checkIfCrashRecoveryAndFinishActivity(final Activity context) { if (isRecoveredFromCrash()) { if (!(context instanceof MainMenuActivity)) { context.finish(); } else { PreferenceManager.getDefaultSharedPreferences(this).edit().putBoolean(RECOVERED_FROM_CRASH, false).commit(); } } CrashReporter.sendUnhandledCaughtException(); }

Target:
private void checkIfCrashRecoveryAndFinishActivity(final Activity context) { if (isRecoveredFromCrash()) { CrashReporter.sendUnhandledCaughtException(); if (!(context instanceof MainMenuActivity)) { context.finish(); } else { PreferenceManager.getDefaultSharedPreferences(this).edit().putBoolean(RECOVERED_FROM_CRASH, false).commit(); } } }
Source:
@Override public void initialize(Context context, ValueMap settings, LogLevel logLevel) throws IllegalStateException { if (!hasPermission(context, Manifest.permission.INTERNET)) { throw new IllegalStateException("Apptimize requires INTERNET permission"); } Apptimize.setup(context, settings.getString("appkey")); }

Target:
@Override public void initialize(Context context, ValueMap settings, LogLevel logLevel) throws IllegalStateException { Apptimize.setup(context, settings.getString("appkey")); }
Source:
private Long getHostsByCapability(List<Long> hostList, String hostCapability) { int totalHostswithCapability = 0; for (Long host : hostList) { //TODO: Fix this in single query instead of polling request for each Host Map<String, String> details = hostDetailsDao.findDetails(host); if (details.containsKey(Host.HOST_UEFI_ENABLE)) { if (details.get(Host.HOST_UEFI_ENABLE).equalsIgnoreCase("Yes")) { totalHostswithCapability++; } } } return totalHostswithCapability > 0 ? new Long(1) : new Long(0); }

Target:
private Long getHostsByCapability(List<Long> hostList, String hostCapability) { for (Long host : hostList) { //TODO: Fix this in single query instead of polling request for each Host Map<String, String> details = hostDetailsDao.findDetails(host); if (details.containsKey(Host.HOST_UEFI_ENABLE)) { if (details.get(Host.HOST_UEFI_ENABLE).equalsIgnoreCase("Yes")) { return new Long(1); } } } return new Long(0); }
Source:
public static void openClassLoader() throws IOException { ClassLoader myClassLoader = RetentionPolicyTest.class.getClassLoader(); assert myClassLoader != null; // Load the annotated class (and annotation classes) from the annotations-test.jar. See // http://b/132100102. File jarFile = new File(temporaryFolder.getRoot(), "annotations-test.jar"); try (InputStream in = myClassLoader.getResourceAsStream("annotations-test.jar"); OutputStream out = new FileOutputStream(jarFile)) { Streams.copy(in, out); } classLoader = new PathClassLoader(jarFile.getAbsolutePath(), myClassLoader); }

Target:
public static void openClassLoader() throws IOException { ClassLoader myClassLoader = RetentionPolicyTest.class.getClassLoader(); assertNotNull(myClassLoader); // Load the annotated class (and annotation classes) from the annotations-test.jar. File jarFile = new File(temporaryFolder.getRoot(), "annotations-test.jar"); try (InputStream in = myClassLoader.getResourceAsStream("annotations-test.jar"); OutputStream out = new FileOutputStream(jarFile)) { Streams.copy(in, out); } classLoader = new PathClassLoader(jarFile.getAbsolutePath(), myClassLoader); }
Source:
public String read(String key) { String data = dataManager.read(key); return (data == null) ? null : encode(cryptoBox.decrypt(iv, decode(data)); }

Target:
public String read(String key) { String data = dataManager.read(key); return (data == null) ? null : encode(cryptoBox.decrypt(iv, decode(data))); }
Source:
public IndexedInts getRow() { // Treat any non-single-valued row as a row containing a single null value, to ensure consistency with // other expression selectors. See also ExpressionSelectors.supplierFromDimensionSelector for similar behavior. final IndexedInts row = selector.getRow(); if (row.size() == 1) { if (nullAdjustment == 0) { return row; } else { return new SingleIndexedInt(row.get(0) + nullAdjustment); } } else { // Can't handle non-singly-valued rows in expressions. // Treat them as nulls until we think of something better to do. return new SingleIndexedInt(0); } }

Target:
public IndexedInts getRow() { final IndexedInts row = selector.getRow(); if (row.size() == 1) { if (nullAdjustment == 0) { return row; } else { return SingleIndexedInt.of(row.get(0) + nullAdjustment); } } else { // Can't handle non-singly-valued rows in expressions. // Treat them as nulls until we think of something better to do. return SingleIndexedInt.of(0); } }
Source:
public void checkSelectFilter(final String label, final String value) { selectInputs.computeIfPresent(label, (key, values) -> { values.forEach(i -> { if ((i.getValue().equals(value)) && i.getChecked() == false) { i.setChecked(true); } }); return values; }); }

Target:
public void checkSelectFilter(final String label, final String value) { selectInputs.computeIfPresent(label, (key, values) -> { values.forEach(i -> { if (i.getValue().equals(value) && i.getChecked() == false) { i.setChecked(true); } }); return values; }); }
Source:
public void init() throws DBException { synchronized(RocksDBClient.class) { if(rocksDb == null) { rocksDbDir = Paths.get(getProperties().getProperty(PROPERTY_ROCKSDB_DIR)); System.out.println("RocksDB data dir: " + rocksDbDir); try { rocksDb = initRocksDB(); } catch (final IOException | RocksDBException e) { throw new DBException(e); } } references++; } }

Target:
public void init() throws DBException { synchronized(RocksDBClient.class) { if(rocksDb == null) { rocksDbDir = Paths.get(getProperties().getProperty(PROPERTY_ROCKSDB_DIR)); LOGGER.info("RocksDB data dir: " + rocksDbDir); try { rocksDb = initRocksDB(); } catch (final IOException | RocksDBException e) { throw new DBException(e); } } references++; } }
Source:
protected void registerExtraDatabaseTypes( Properties configuration ) throws KettlePluginException { /*String hiveSimbaDriverName = configuration.getProperty( "hive2.simba.driver", "com.simba.hive.jdbc41.HS2Driver" ); JDBC_POSSIBLE_DRIVER_MAP.put( "hive2Simba", hiveSimbaDriverName );*/ String impalaSimbaDriverName = configuration.getProperty( "impala.simba.driver", "com.cloudera.impala.jdbc41.Driver" ); JDBC_POSSIBLE_DRIVER_MAP.put( "ImpalaSimba", impalaSimbaDriverName ); }

Target:
protected void registerExtraDatabaseTypes( Properties configuration ) throws KettlePluginException { /*String hiveSimbaDriverName = configuration.getProperty( "hive2.simba.driver", "com.simba.hive.jdbc41.HS2Driver" ); JDBC_POSSIBLE_DRIVER_MAP.put( "hive2Simba", hiveSimbaDriverName );*/ /*String impalaSimbaDriverName = configuration.getProperty( "impala.simba.driver", "com.cloudera.impala.jdbc41.Driver" ); JDBC_POSSIBLE_DRIVER_MAP.put( "ImpalaSimba", impalaSimbaDriverName );*/ }
Source:
public FileMockContext(Context context) { mContext = context; // default requestedPermissionName = "android.permission.INTERNET"; responsePermissionFlag = PackageManager.PERMISSION_GRANTED; permissionMap.put(requestedPermissionName,responsePermissionFlag); }

Target:
public FileMockContext(Context context) { mContext = context; // default String requestedPermissionName = "android.permission.INTERNET"; int responsePermissionFlag = PackageManager.PERMISSION_GRANTED; permissionMap.put(requestedPermissionName,responsePermissionFlag); }
Source:
public static boolean isWhitespaceOrComment(int kind) { switch (getCategory(kind)) { case WHITESPACE: case COMMENT: return true; default: return false; } }

Target:
public static boolean isWhitespaceOrComment(int kind) { return getCategory(kind).isWhitespaceOrComment(); }
Source:
private boolean appliesToEvent(ITmfEvent event) { String eventName = event.getType().getName(); String eventHandlerName = fName; // test for correct name if (eventName.equals(eventHandlerName)) { return true; } // test for the wildcard at the end if ((eventHandlerName.endsWith(TmfXmlStrings.WILDCARD) && eventName.startsWith(eventHandlerName.replace(TmfXmlStrings.WILDCARD, TmfXmlStrings.NULL)))) { return true; } return false; }

Target:
private boolean appliesToEvent(ITmfEvent event) { String eventName = event.getType().getName(); /* test for full name */ if (eventName.equals(fName)) { return true; } /* test for the wildcard at the end */ if ((fName.endsWith(TmfXmlStrings.WILDCARD) && eventName.startsWith(fName.replace(TmfXmlStrings.WILDCARD, TmfXmlStrings.NULL)))) { return true; } return false; }
Source:
@NonNull public String server() { // A protocol-relative URL can be returned from the API. // Protocol-relative URLs need to guarantee to be accessible via https, so we assume // https in this case. if (server.startsWith("//")) { server = "https:" + server; } return server; }

Target:
@NonNull public String server() { return server; }
Source:
public LogEntry deserializeLogData(ILogData logData) throws Exception{ LogEntry logEntry; try { logEntry = logData.getLogEntry(runtime); } catch (Exception e) { log.error("Cannot deserialize log entry" + logData.getGlobalAddress(), e); throw e; } return logEntry; }

Target:
public LogEntry deserializeLogData(ILogData logData) throws Exception{ return logData.getLogEntry(runtime); }
Source:
private static void checkAssertion(SamlAssertionWrapper assertion, String confirmMethod) throws WSSecurityException { if (OpenSAMLUtil.isMethodHolderOfKey(confirmMethod)) { if (assertion.getSubjectKeyInfo() == null) { LOG.debug("There is no Subject KeyInfo to match the holder-of-key subject conf method"); throw new WSSecurityException(ErrorCode.FAILED_CHECK, "noKeyInSAMLToken"); } // The assertion must have been signed for HOK if (!assertion.isSigned()) { LOG.debug("A holder-of-key assertion must be signed"); throw new WSSecurityException(ErrorCode.FAILED_CHECK, "invalidSAMLsecurity"); } } }

Target:
private static void checkAssertion(SamlAssertionWrapper assertion, String confirmMethod) throws WSSecurityException { if (OpenSAMLUtil.isMethodHolderOfKey(confirmMethod)) { if (assertion.getSubjectKeyInfo() == null) { LOG.info("There is no Subject KeyInfo to match the holder-of-key subject conf method"); throw new WSSecurityException(ErrorCode.FAILED_CHECK, "noKeyInSAMLToken"); } // The assertion must have been signed for HOK if (!assertion.isSigned()) { LOG.info("A holder-of-key assertion must be signed"); throw new WSSecurityException(ErrorCode.FAILED_CHECK, "invalidSAMLsecurity"); } } }
Source:
public void checkChangedColumn() throws Exception { test(String.format("ALTER session SET `%s` = %d;", SLICE_TARGET, ExecConstants.SLICE_TARGET_DEFAULT)); testBuilder() .sqlQuery("SELECT status FROM sys.options WHERE name = '%s' AND type = 'SESSION'", SLICE_TARGET) .unOrdered() .baselineColumns("status") .baselineValues("DEFAULT") .build() .run(); }

Target:
public void checkChangedColumn() throws Exception { test("ALTER session SET `%s` = %d;", SLICE_TARGET, ExecConstants.SLICE_TARGET_DEFAULT); testBuilder() .sqlQuery("SELECT status FROM sys.options WHERE name = '%s' AND type = 'SESSION'", SLICE_TARGET) .unOrdered() .baselineColumns("status") .baselineValues("DEFAULT") .build() .run(); }
Source:
protected boolean canSearchUsersAndGroups(NuxeoPrincipal principal) { if (principal.isAdministrator() || principal.isMemberOf(POWER_USERS_GROUP)) { return true; } UserManager um = Framework.getService(UserManager.class); List<String> adminGroups = um.getAdministratorsGroups(); return adminGroups.stream().anyMatch(principal::isMemberOf); }

Target:
protected boolean canSearchUsersAndGroups(NuxeoPrincipal principal) { return principal.isAdministrator() || principal.isMemberOf(POWER_USERS_GROUP); }
Source:
public String toString() { StringBuilder sb = new StringBuilder("MaprDBJsonRecordReader[Table="); if (table != null) { sb.append(table.getPath()); } if (reader != null) { sb.append(", Document ID=") .append(IdCodec.asString(reader.getId())); } sb.append(", reader=") .append(reader) .append(']'); return sb.toString(); }

Target:
public String toString() { StringBuilder sb = new StringBuilder("MaprDBJsonRecordReader[Table=") .append(table != null ? table.getPath() : null); if (reader != null) { sb.append(", Document ID=") .append(IdCodec.asString(reader.getId())); } sb.append(", reader=") .append(reader) .append(']'); return sb.toString(); }
Source:
void foo1() throws InvalidKeyException, InvalidAlgorithmParameterException, NoSuchAlgorithmException, NoSuchPaddingException, UnsupportedEncodingException, IllegalBlockSizeException, BadPaddingException { byte[] bytes = "111".getBytes("UTF-8"); random.nextBytes(bytes); IvParameterSpec iv = new IvParameterSpec(bytes); // Compliant }

Target:
void foo1() throws Exception { byte[] bytes = "111".getBytes("UTF-8"); random.nextBytes(bytes); IvParameterSpec iv = new IvParameterSpec(bytes); // Compliant }
Source:
private static PathAddress createDeploymentAddressPrefix(DeploymentUnit deploymentUnit) { if (deploymentUnit.getParent() == null) { return PathAddress.pathAddress(DEPLOYMENT, deploymentUnit.getAttachment(Attachments.MANAGEMENT_NAME)); } else { return createDeploymentAddressPrefix(deploymentUnit.getParent()).append(SUBDEPLOYMENT, deploymentUnit.getAttachment(Attachments.MANAGEMENT_NAME)); } }

Target:
private static PathAddress createDeploymentAddressPrefix(DeploymentUnit deploymentUnit) { if (deploymentUnit.getParent() == null) { return PathAddress.pathAddress(DEPLOYMENT, deploymentUnit.getAttachment(Attachments.MANAGEMENT_NAME)); } else { return createDeploymentAddressPrefix(deploymentUnit.getParent()).append(SUBDEPLOYMENT, deploymentUnit.getName()); } }
Source:
public List<Concept> getPossibleValues() { try { return Context.getConceptService().getConceptsByName(""); } catch (Exception e) { logger.error("Error", e); } //pass return Collections.emptyList(); }

Target:
public List<Concept> getPossibleValues() { try { return Context.getConceptService().getConceptsByName(""); } catch (Exception e) { log.error("Error", e); } //pass return Collections.emptyList(); }
Source:
TestShardConsumerSubscriber(RecordsPublisher recordsPublisher, ExecutorService executorService, int bufferSize, ShardConsumer shardConsumer, int readTimeoutsToIgnoreBeforeWarning) { super(recordsPublisher, executorService, bufferSize, shardConsumer, readTimeoutsToIgnoreBeforeWarning); this.recordsPublisher = recordsPublisher; this.executorService = executorService; this.bufferSize = bufferSize; this.shardConsumer = shardConsumer; }

Target:
TestShardConsumerSubscriber(RecordsPublisher recordsPublisher, ExecutorService executorService, int bufferSize, ShardConsumer shardConsumer, // Setup test expectations int readTimeoutsToIgnoreBeforeWarning) { super(recordsPublisher, executorService, bufferSize, shardConsumer, readTimeoutsToIgnoreBeforeWarning); }
Source:
public boolean flush () { final boolean[] success = {false}; ObjCRuntime.autoreleasepool(new Runnable() { @Override public void run() { if (!nsDictionary.writeToFileAtomically(file.getAbsolutePath(), false)) { Gdx.app.debug("IOSPreferences", "Failed to write NSDictionary to file " + file); success[0] = true; } } }); return success[0]; }

Target:
public boolean flush () { final boolean[] success = {false}; ObjCRuntime.autoreleasepool(new Runnable() { @Override public void run() { if (nsDictionary.writeToFileAtomically(file.getAbsolutePath(), false)) { success[0] = true; } else { Gdx.app.debug("IOSPreferences", "Failed to write NSDictionary to file " + file); } } }); return success[0]; }
Source:
public KomodoObject komodoServersNode(UnitOfWork transaction) throws KException { ArgCheck.isNotNull( transaction, "transaction" ); //$NON-NLS-1$ ArgCheck.isTrue( ( transaction.getState() == org.komodo.spi.repository.Repository.UnitOfWork.State.NOT_STARTED ), "transaction state is not NOT_STARTED" ); //$NON-NLS-1$ komodoEnvironment(transaction); return create(transaction, SERVERS_ROOT, Environment.SERVERS); }

Target:
public KomodoObject komodoServersNode(UnitOfWork transaction) throws KException { ArgCheck.isNotNull( transaction, "transaction" ); //$NON-NLS-1$ ArgCheck.isTrue( ( transaction.getState() == org.komodo.spi.repository.Repository.UnitOfWork.State.NOT_STARTED ), "transaction state is not NOT_STARTED" ); //$NON-NLS-1$ komodoEnvironment(transaction); return create(transaction, SERVERS_ROOT, null); }
Source:
public void setEventList(List<ITimeEvent> eventList) { fEventList = eventList; }

Target:
public void setEventList(List<ITimeEvent> eventList) { fEventList = new ArrayList<ITimeEvent>(eventList); }
Source:
public void execute() { if (!hasLightGrenade) { if (hasPowerFailure) player.endTurn(); return; } // The square the player stepped on has a light grenade and should // always cause a decrease of at least three actions at this point. player.skipNumberOfActions(3 + (hasPowerFailure ? 1 : 0)); }

Target:
public void execute() { if (!hasLightGrenade) { if (hasPowerFailure) player.endTurn(); } else { // The square the player stepped on has a light grenade and should // always cause a decrease of at least three actions at this point. player.skipNumberOfActions(3 + (hasPowerFailure ? 1 : 0)); } }
Source:
private boolean hasPersistentPower() { final PackageManager pm = this.getPackageManager(); return (pm != null && (pm.hasSystemFeature(PackageManager.FEATURE_LEANBACK) || pm.hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE))); }

Target:
private boolean hasPersistentPower() { // Cars and TVsets are always connected to the persistent power source final PackageManager pm = getPackageManager(); return (pm != null && (pm.hasSystemFeature(PackageManager.FEATURE_LEANBACK) || pm.hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE))); }
Source:
private boolean validatePage() { if (dcc.getDirectory() == null || dcc.getDirectory().equals("")) { //$NON-NLS-1$ setErrorMessage("Destination not selected!"); return false; } if(0 == systemTree.getCheckedElements().length){ setErrorMessage("Nothing selected for FMU generation!"); return false; } if (!isSomeLibrarySelected()){ setErrorMessage("No libraries selected to include"); return false; } setErrorMessage(null); return true; }

Target:
private boolean validatePage() { if ("".equals(dcc.getDirectory())){ //$NON-NLS-1$ setErrorMessage("Destination not selected!"); return false; } if(0 == systemTree.getCheckedElements().length){ setErrorMessage("Nothing selected for FMU generation!"); return false; } if (!isSomeLibrarySelected()){ setErrorMessage("No libraries selected to include"); return false; } setErrorMessage(null); return true; }
Source:
public LeaderElectorImp(Map conf, List<String> servers, CuratorFramework zk, String leaderlockPath, String id, AtomicReference<LeaderLatch> leaderLatch, AtomicReference<LeaderLatchListener> leaderLatchListener) { this.conf = conf; this.servers = servers; this.zk = zk; this.leaderLatch = leaderLatch; this.id = id; this.leaderLatch = leaderLatch; this.leaderLatchListener = leaderLatchListener; }

Target:
public LeaderElectorImp(Map conf, List<String> servers, CuratorFramework zk, String leaderlockPath, String id, AtomicReference<LeaderLatch> leaderLatch, AtomicReference<LeaderLatchListener> leaderLatchListener) { this.conf = conf; this.servers = servers; this.zk = zk; this.leaderlockPath = leaderlockPath; this.id = id; this.leaderLatch = leaderLatch; this.leaderLatchListener = leaderLatchListener; }
Source:
protected DocumentModel createDocument(boolean withBlobContent) { DocumentModel documentModel = session.createDocumentModel("/", "MyFile", "File"); if (withBlobContent) { documentModel.setPropertyValue(FILE_CONTENT_PROPERTY, (Serializable) Blobs.createBlob(FILE_CONTENT)); } documentModel = session.createDocument(documentModel); return documentModel; }

Target:
protected DocumentModel createDocument(boolean withBlobContent) { DocumentModel documentModel = session.createDocumentModel("/", "MyFile", "File"); if (withBlobContent) { documentModel.setPropertyValue(FILE_CONTENT_PROPERTY, (Serializable) Blobs.createBlob(FILE_CONTENT)); } return session.createDocument(documentModel); }
Source:
protected org.robolectric.bytecode.ShadowMap createShadowMap() { return super.createShadowMap() .newBuilder() .addShadowClass(ShadowCrashlytics.class) .addShadowClass(ShadowMapView.class) .addShadowClass(ShadowGLMatrix.class) .build(); }

Target:
protected ShadowMap createShadowMap() { return super.createShadowMap() .newBuilder() .addShadowClass(ShadowCrashlytics.class) .addShadowClass(ShadowMapView.class) .addShadowClass(ShadowGLMatrix.class) .build(); }
Source:
private boolean isTemplate(String expression) { return expression.startsWith(PARSER_CONTEXT.getExpressionPrefix()) && expression.endsWith(PARSER_CONTEXT.getExpressionSuffix()); }

Target:
private boolean isTemplate(String expression) { return expression.contains(PARSER_CONTEXT.getExpressionPrefix()) && expression.contains(PARSER_CONTEXT.getExpressionSuffix()); }
Source:
private static void resetJsonReaderEscapeAnyChar() { client.alterSession(ExecConstants.JSON_READER_ESCAPE_ANY_CHAR, false); }

Target:
private void resetJsonReaderEscapeAnyChar() { client.alterSession(ExecConstants.JSON_READER_ESCAPE_ANY_CHAR, false); }
Source:
public WhoisResources performUpdates(final UpdateContext updateContext, final Origin origin, final Collection<Update> updates, final Keyword keyword, final HttpServletRequest request) { loggerContext.log("msg-in.txt", new UpdateLogCallback(updates)); final UpdateResponse updateResponse = updateRequestHandler.handle(new UpdateRequest(origin, keyword, updates), updateContext); return performUpdates(request, updateContext, updates); }

Target:
public WhoisResources performUpdates(final UpdateContext updateContext, final Origin origin, final Collection<Update> updates, final Keyword keyword, final HttpServletRequest request) { loggerContext.log("msg-in.txt", new UpdateLogCallback(updates)); // todo: [TK] use response? updateRequestHandler.handle(new UpdateRequest(origin, keyword, updates), updateContext); return performUpdates(request, updateContext, updates); }
Source:
protected void addMappingsToConcepts(List<Object> explicitItems) { log("Adding mappings to Concepts"); if (MetadataSharing.getInstance().isAddLocalMappings()) { ConceptPubSubService pubsubService = Context.getService(ConceptPubSubService.class); for (Object explicitItem : explicitItems) { if (explicitItem instanceof Concept) { //MetadataSharing.getInstance().getConceptMapper().addSystemConceptMap((Concept) explicitItem); pubsubService.addLocalMappingToConcept((Concept) explicitItem); } } } }

Target:
protected void addMappingsToConcepts(List<Object> explicitItems) { if (MetadataSharing.getInstance().isAddLocalMappings()) { log("Adding mappings to Concepts"); ConceptPubSubService pubsubService = Context.getService(ConceptPubSubService.class); for (Object explicitItem : explicitItems) { if (explicitItem instanceof Concept) { pubsubService.addLocalMappingToConcept((Concept) explicitItem); } } } }
Source:
public void insertLocator(Locator locator) throws IOException { Session session = DatastaxIO.getSession(); // get shard this locator would belong to long shard = (long) Util.getShard(locator.toString()); // bound values and execute BoundStatement bs = putValue.bind(shard, locator.toString(), ""); Timer.Context timer = Instrumentation.getWriteTimerContext(CassandraModel.CF_METRICS_LOCATOR_NAME); try { session.execute(bs); } finally { timer.stop(); } }

Target:
public void insertLocator(Locator locator) throws IOException { Session session = DatastaxIO.getSession(); // get shard this locator would belong to long shard = (long) Util.getShard(locator.toString()); Timer.Context timer = Instrumentation.getWriteTimerContext(CassandraModel.CF_METRICS_LOCATOR_NAME); try { // bound values and execute BoundStatement bs = putValue.bind(shard, locator.toString(), ""); session.execute(bs); } finally { timer.stop(); } }
Source:
public int readBatch() throws Exception { ColumnReader<?> firstColumnStatus = readState.getFirstColumnReader(); int currBatchNumRecords = readState.batchSizerMgr().getCurrentRecordsPerBatch(); long recordsToRead = Math.min(currBatchNumRecords, readState.getRemainingValuesToRead()); int readCount = 0; if (recordsToRead > 0) { readCount = readRecords(firstColumnStatus, recordsToRead); } readState.fillNullVectors(readCount); return readCount; }

Target:
public int readBatch() throws Exception { ColumnReader<?> firstColumnStatus = readState.getFirstColumnReader(); int currBatchNumRecords = readState.batchSizerMgr().getCurrentRecordsPerBatch(); long recordsToRead = Math.min(currBatchNumRecords, readState.getRemainingValuesToRead()); int readCount = recordsToRead > 0 ? readRecords(firstColumnStatus, recordsToRead) : 0; readState.fillNullVectors(readCount); return readCount; }
Source:
public static Object encodeObject(Object dataToEncode) { Object returnValue = dataToEncode; if (dataToEncode instanceof byte[]) { returnValue = SafeEncoder.encode((byte[]) dataToEncode); } else if (dataToEncode instanceof ArrayList) { ArrayList arrayToDecode = (ArrayList)dataToEncode; ArrayList returnValueArray = new ArrayList(arrayToDecode.size()); for (Object arrayEntry : arrayToDecode) { returnValueArray.add(encodeObject(arrayEntry)); } returnValue = returnValueArray; } return returnValue; }

Target:
public static Object encodeObject(Object dataToEncode) { if (dataToEncode instanceof byte[]) { return SafeEncoder.encode((byte[]) dataToEncode); } if (dataToEncode instanceof List) { List arrayToDecode = (List)dataToEncode; List returnValueArray = new ArrayList(arrayToDecode.size()); for (Object arrayEntry : arrayToDecode) { // recursive call and add to list returnValueArray.add(encodeObject(arrayEntry)); } return returnValueArray; } return dataToEncode; }
Source:
public Class<?> getImplementationClass(CodeGenerator<?> cg) throws ClassTransformationException { try { return compileClass( cg ); } catch (CompileException | ClassNotFoundException e) { throw new ClassTransformationException(e); } catch (IOException e) { throw new ClassTransformationException(e); } }

Target:
public Class<?> getImplementationClass(CodeGenerator<?> cg) throws ClassTransformationException { try { return compileClass(cg); } catch (CompileException | ClassNotFoundException|IOException e) { throw new ClassTransformationException(e); } }
Source:
public static ZonedDateTime parse(String dateString) { int n = 0; for (DateTimeFormatter df : DATE_TIME_FORMATTERS) { try { return toZonedDateTime(df.parse(dateString)); } catch (DateTimeParseException dte) { // we ignore wrong formats n++; continue; } } if (IS_NUMERIC_P.matcher(dateString) .matches()) { long ldate = Long.parseLong(dateString); return Instant.ofEpochMilli(ldate) .atZone(UTC_ZONE_ID); } return null; }

Target:
public static ZonedDateTime parse(String dateString) { for (DateTimeFormatter df : DATE_TIME_FORMATTERS) { try { return toZonedDateTime(df.parse(dateString)); } catch (DateTimeParseException dte) { // we ignore wrong formats continue; } } if (IS_NUMERIC_P.matcher(dateString) .matches()) { long ldate = Long.parseLong(dateString); return Instant.ofEpochMilli(ldate) .atZone(UTC_ZONE_ID); } return null; }
Source:
private boolean containsNullOrEmpty(List<String> values) { //return values != null && ( values.contains(null) || values.contains("") ); if(values == null) return true ; if(values.isEmpty()) return true ; for(String str : values) { if(StringUtils.isBlank(str)) return true ; } return false; }

Target:
private boolean containsNullOrEmpty(List<String> values) { if(values == null || values.isEmpty()) return true ; for(String str : values) { if(StringUtils.isBlank(str)) return true ; } return false; }
Source:
private static Map<AbstractProject,DependencyChange> getDependencyChanges(Run<?,?> run) { AbstractBuild<?,?> build = null; if(run instanceof AbstractBuild) return ((AbstractBuild) run).getDependencyChanges((AbstractBuild)run); //jenkins workflow plugin etc. else return Maps.newHashMap(); }

Target:
private static Map<AbstractProject,DependencyChange> getDependencyChanges(Run<?,?> run) { if(run instanceof AbstractBuild) return ((AbstractBuild) run).getDependencyChanges((AbstractBuild)run); //jenkins workflow plugin etc. else return Maps.newHashMap(); }
Source:
void remove(Closeable hook) { if (closeHooks != null) { closeHooks.remove(hook); } }

Target:
synchronized void remove(Closeable hook) { if (closeHooks != null) { closeHooks.remove(hook); } }
Source:
private JavaSymbolicObject expandMacro(JavaSymbolicObject node) { JavaSymbolicObject expandedNode = (JavaSymbolicObject) node.accept(this); while (!node.equals(expandedNode)) { node = expandedNode; expandedNode = (JavaSymbolicObject) node.accept(this); } return node; }

Target:
private JavaSymbolicObject expandMacro(JavaSymbolicObject node) { JavaSymbolicObject expandedNode = (JavaSymbolicObject) node.accept(this); // while some macro rule has applied, making the term references different while (node != expandedNode) { node = expandedNode; expandedNode = (JavaSymbolicObject) node.accept(this); } return node; }
Source:
public ExtendedSymbolKindType(int _v) { try { SymbolKind s = SymbolKind.forValue(_v); value = _v; isProtocolSymbol = true; } catch (IllegalArgumentException e) { try { CquerySymbolKind c = CquerySymbolKind.forValue(_v); value = _v; isProtocolSymbol = false; } catch (IllegalArgumentException y) { throw new IllegalArgumentException("Illegal value for SymbolKind"); } } }

Target:
public ExtendedSymbolKindType(int _v) { try { SymbolKind.forValue(_v); value = _v; isProtocolSymbol = true; } catch (IllegalArgumentException e) { try { CquerySymbolKind.forValue(_v); value = _v; isProtocolSymbol = false; } catch (IllegalArgumentException y) { throw new IllegalArgumentException("Illegal value for SymbolKind"); //$NON-NLS-1$ } } }
Source:
private boolean applyTypedFilter(Instance instance) { // Loop through all the type filters for (String type : this.typeFilters.keySet()) { if (checkType(instance.getDefinition(), type)) { // instance equals type name for (Filter innerFilter : this.typeFilters.get(type)) { if (innerFilter.match(instance)) return true; } // So, instance matches type and but does not match filter return false; } } // it reaches here that means Instance does not match any type of // type filters. Method should return true. return true; }

Target:
private boolean applyTypedFilter(Instance instance) { // Loop through all the type filters for (String type : this.typeFilters.keySet()) { if (checkType(instance.getDefinition(), type)) { // instance equals type name for (Filter innerFilter : this.typeFilters.get(type)) { if (innerFilter.match(instance)) return true; } // So, instance matches type and but does not match filter return false; } } // it reaches here that means Instance does not match any type of // type filters. Method should return false for lazy evaluation. return false; }
Source:
public void synchronized setServiceContext(ServiceContext ctx) { setContext(ctx); }

Target:
public synchronized void setServiceContext(ServiceContext ctx) { setContext(ctx); }
Source:
public QueryInfo updateQueryInfo(Optional<StageInfo> stageInfo) { QueryInfo queryInfo = getQueryInfo(stageInfo); if (queryInfo.isFinalQueryInfo()) { session.getSessionLogger().log(() -> "Marking query finally done"); queryInfo.setSessionLogEntries(session.getSessionLogger().getEntries()); finalQueryInfo.compareAndSet(Optional.empty(), Optional.of(queryInfo)); } return queryInfo; }

Target:
public QueryInfo updateQueryInfo(Optional<StageInfo> stageInfo) { QueryInfo queryInfo = getQueryInfo(stageInfo); if (queryInfo.isFinalQueryInfo()) { queryInfo.setSessionLogEntries(session.getSessionLogger().getEntries()); finalQueryInfo.compareAndSet(Optional.empty(), Optional.of(queryInfo)); } return queryInfo; }
Source:
public Object execute(ExecutionEvent event) { InputDialog dialog = new InputDialog(Display.getCurrent() .getActiveShell(), Messages.PerfSaveSession_title, Messages.PerfSaveSession_msg, "", new IInputValidator() { //$NON-NLS-1$ @Override public String isValid(String newText) { if ("".equals(newText)) { //$NON-NLS-1$ return Messages.PerfSaveSession_invalid_filename_msg; } return null; } }); if (dialog.open() == Window.OK) { saveData(dialog.getValue()); } return null; }

Target:
public Object execute(ExecutionEvent event) { InputDialog dialog = new InputDialog(Display.getCurrent() .getActiveShell(), Messages.PerfSaveSession_title, Messages.PerfSaveSession_msg, "", new IInputValidator() { //$NON-NLS-1$ @Override public String isValid(String newText) { if (newText.isEmpty()) { return Messages.PerfSaveSession_invalid_filename_msg; } return null; } }); if (dialog.open() == Window.OK) { saveData(dialog.getValue()); } return null; }