auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public String toString() { StringBuilder sb = new StringBuilder("Project{"); sb.append("name='").append(name).append('\''); sb.append(", identifiers=").append(identifiers); sb.append(", description='").append(description).append('\''); sb.append(", imageUrl='").append(imageUrl).append('\''); sb.append(", startsAt=").append(startsAt); sb.append(", endsAt=").append(endsAt); sb.append(", type=").append(type); sb.append('}'); return sb.toString(); }

Target:
public String toString() { StringBuilder sb = new StringBuilder("Project{"); sb.append("name='").append(name).append('\''); sb.append(", identifiers=").append(identifiers); sb.append(", description='").append(description).append('\''); sb.append(", imageUrl='").append(imageUrl).append('\''); sb.append(", startsAt=").append(startsAt); sb.append(", endsAt=").append(endsAt); sb.append(", type=").append(type); sb.append(", campaign=").append(campaign); sb.append('}'); return sb.toString(); }
Source:
Optional<BufferAndAvailability> getNextBuffer() throws IOException { checkError(); ResultSubpartitionView subpartitionView = this.subpartitionView; if (subpartitionView == null) { if (isReleased) { return Optional.empty(); } subpartitionView = checkAndWaitForSubpartitionView(); } BufferAndBacklog next = subpartitionView.getNextBuffer(); if (next == null) { if (subpartitionView.isReleased()) { throw new CancelTaskException("Consumed partition " + subpartitionView + " has been released."); } else { return Optional.empty(); } } Buffer buffer = next.buffer(); numBytesIn.inc(buffer.getSize()); numBuffersIn.inc(); if (buffer.isBuffer()) { for (final long barrierId : pendingCheckpointBarriers) { channelStateWriter.addInputData( barrierId, getChannelInfo(), ChannelStateWriter.SEQUENCE_NUMBER_UNKNOWN, CloseableIterator.ofElement(buffer.retainBuffer(), Buffer::recycleBuffer)); } } else if (buffer.getDataType().hasPriority()) { final AbstractEvent priorityEvent = parsePriorityEvent(buffer); if (priorityEvent instanceof CheckpointBarrier) { final long barrierId = ((CheckpointBarrier) priorityEvent).getId(); seenCheckpointBarriers.add(barrierId); pendingCheckpointBarriers.remove(barrierId); } } return Optional.of(new BufferAndAvailability(buffer, next.getNextDataType(), next.buffersInBacklog())); }

Target:
Optional<BufferAndAvailability> getNextBuffer() throws IOException { checkError(); ResultSubpartitionView subpartitionView = this.subpartitionView; if (subpartitionView == null) { if (isReleased) { return Optional.empty(); } subpartitionView = checkAndWaitForSubpartitionView(); } BufferAndBacklog next = subpartitionView.getNextBuffer(); if (next == null) { if (subpartitionView.isReleased()) { throw new CancelTaskException("Consumed partition " + subpartitionView + " has been released."); } else { return Optional.empty(); } } Buffer buffer = next.buffer(); numBytesIn.inc(buffer.getSize()); numBuffersIn.inc(); if (buffer.getDataType().hasPriority()) { channelStatePersister.checkForBarrier(buffer); } else { channelStatePersister.maybePersist(buffer); } return Optional.of(new BufferAndAvailability( buffer, next.getNextDataType(), next.buffersInBacklog(), next.getSequenceNumber())); }
Source:
public void testAll() { ______TS("Typical case: Log in with filled profile values"); AppUrl url = createUrl(Const.WebPageURIs.STUDENT_PROFILE_PAGE).withUserId("SProfUiT.student"); loginAdminToPage(url, StudentHomePage.class); StudentProfilePage profilePage = AppPage.getNewPageInstance(browser, url, StudentProfilePage.class); profilePage.ensureProfileContains("Ben", "i.m.benny@gmail.tmt", "TEAMMATES Test Institute 4", "Singaporean", StudentProfileAttributes.Gender.MALE, "I am just another student :P"); ______TS("Typical case: picture upload and edit"); profilePage.fillProfilePic("src/test/resources/images/profile_pic.png"); profilePage.uploadPicture(); profilePage.verifyStatusMessage(Const.StatusMessages.STUDENT_PROFILE_PICTURE_SAVED); profilePage.showPictureEditor(); profilePage.waitForUploadEditModalVisible(); profilePage.editProfilePhoto(); profilePage.verifyPhotoSize("220px", "220px"); ______TS("Typical case: no picture"); profilePage.editProfileThroughUi("short.name", "e@email.tmt", "inst", "American", StudentProfileAttributes.Gender.FEMALE, "this is enough!$%&*</>"); profilePage.ensureProfileContains("short.name", "e@email.tmt", "inst", "American", StudentProfileAttributes.Gender.FEMALE, "this is enough!$%&*</>"); profilePage.verifyStatusMessage(Const.StatusMessages.STUDENT_PROFILE_EDITED); }

Target:
public void testAll() { ______TS("Typical case: Log in with filled profile values"); AppUrl url = createUrl(Const.WebPageURIs.STUDENT_PROFILE_PAGE).withUserId("SProfUiT.student"); loginAdminToPage(url, StudentHomePage.class); StudentProfilePage profilePage = AppPage.getNewPageInstance(browser, url, StudentProfilePage.class); profilePage.ensureProfileContains("Ben", "i.m.benny@gmail.tmt", "TEAMMATES Test Institute 4", "Singaporean", StudentProfileAttributes.Gender.MALE, "I am just another student :P"); ______TS("Typical case: picture upload and edit"); profilePage.fillProfilePic("src/test/resources/images/profile_pic.png"); profilePage.uploadPicture(); profilePage.verifyStatusMessage(Const.StatusMessages.STUDENT_PROFILE_PICTURE_SAVED); profilePage.showPictureEditor(); profilePage.waitForUploadEditModalVisible(); profilePage.editProfilePhoto(); profilePage.verifyPhotoSize("220px", "220px"); ______TS("Typical case: edit profile page"); profilePage.editProfileThroughUi("short.name", "e@email.tmt", "inst", "American", StudentProfileAttributes.Gender.FEMALE, "this is enough!$%&*</>"); profilePage.ensureProfileContains("short.name", "e@email.tmt", "inst", "American", StudentProfileAttributes.Gender.FEMALE, "this is enough!$%&*</>"); profilePage.verifyStatusMessage(Const.StatusMessages.STUDENT_PROFILE_EDITED); }
Source:
private void terminate(){ terminatePrcs(launchListener.getNodeJSLaunch().getProcesses()); ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager(); manager.removeLaunchListener(launchListener); }

Target:
public void terminate(){ if(launchListener != null){ ILaunch launch = launchListener.getNodeJSLaunch(); if(launch != null){ terminatePrcs(launch.getProcesses()); } ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager(); manager.removeLaunchListener(launchListener); } }
Source:
public Boolean LogIn(String username, String password) throws InvalidCredentialsException { List obj = Select(getUser) .setParameter("username", username) .list(); if (!obj.isEmpty()) { final UserEmployee userEmployee = (UserEmployee) obj.get(0); if (userEmployee.getPassword().equals(password)) { SID = new Session(Boolean.TRUE, userEmployee); return Boolean.TRUE; } else { return Boolean.FALSE; } } else { return Boolean.FALSE; } }

Target:
public Boolean LogIn(String username, String password) throws InvalidCredentialsException { List obj = Select(userLogin) .setParameter("username", username) .list(); if (!obj.isEmpty()) { final UserEmployee userEmployee = (UserEmployee) obj.get(0); if (userEmployee.getPassword().equals(password)) { SID = new Session(Boolean.TRUE, userEmployee); return Boolean.TRUE; } else { return Boolean.FALSE; } } else { return Boolean.FALSE; } }
Source:
HierarchicalElement getBaseFolder(final String url) throws RepositoryException { HierarchicalElement baseHierarchicalElement; if (url.toLowerCase().startsWith("sftp://")) { try { baseHierarchicalElement = new SftpHierarchicalElement(url); ((SftpHierarchicalElement) baseHierarchicalElement).retrieveDetails(); } catch (URISyntaxException | UnsupportedEncodingException ex) { throw new RepositoryException("Unable to process URL!",ex); } catch (JSchException | SftpException ex) { throw new RepositoryException(ex.getMessage(),ex); } } else { File base = new File(url); if (!base.exists()) { throw new RepositoryException("Source folder does not exist!"); } baseHierarchicalElement = new FileHierarchicalElement(base); } return baseHierarchicalElement; }

Target:
HierarchicalElement getBaseFolder(final String url) throws RepositoryException { HierarchicalElement baseHierarchicalElement; if (url.toLowerCase().startsWith("sftp://")) { try { baseHierarchicalElement = new SftpHierarchicalElement(url); ((SftpHierarchicalElement) baseHierarchicalElement).retrieveDetails(); } catch (URISyntaxException | UnsupportedEncodingException ex) { String msg = String.format("Unable to process URL %s", url); LOG.error(msg, ex); throw new RepositoryException(msg,ex); } catch (JSchException | SftpException ex) { LOG.error(ex.getMessage(),ex); throw new RepositoryException(ex.getMessage(),ex); } } else { File base = new File(url); if (!base.exists()) { throw new RepositoryException("Source folder does not exist!"); } baseHierarchicalElement = new FileHierarchicalElement(base); } return baseHierarchicalElement; }
Source:
public ExtensionsTool(ExtensionsToolArguments args, ExtensionsManager extensionsManager) { this.extensionsManager = extensionsManager; try { switch (args.getAction()) { case ExtensionsToolArguments.ACTION_AUTH_SEQUENCE: doAuthSequence(args); break; case ExtensionsToolArguments.ACTION_QUERY_BY_IDS: doQueryByIds(args); break; case ExtensionsToolArguments.ACTION_QUERY_BY_NAME: doQueryByName(args); break; } } catch (Exception ex) { log.error(ex.getMessage()); if (log.isDebugEnabled()) { log.debug("", ex); } } }

Target:
public ExtensionsTool(ExtensionsToolArguments args, ExtensionsManager extensionsManager) { this.args = args; this.extensionsManager = extensionsManager; }
Source:
private AuthenticationResult tryMRRT() throws AuthenticationException { if (mMrrtTokenCacheItem == null) { mMrrtTokenCacheItem = mTokenCacheAccessor.getMRRTItem(mAuthRequest.getClientId(), getUser()); } if (mMrrtTokenCacheItem == null) { if (lookUpCachedTokenWithNoUserForADFS()) { mMrrtTokenCacheItem = mTokenCacheAccessor.getMRRTItem(mAuthRequest.getClientId(), null); if (mMrrtTokenCacheItem == null) { return null; } } else { Logger.v(TAG, "MRRT token does not exist, try with FRT"); return tryFRT(AuthenticationConstants.MS_FAMILY_ID, null); } } if (!StringExtensions.IsNullOrBlank(mMrrtTokenCacheItem.getFamilyClientId()) && !mAttemptedWithFRT) { Logger.v(TAG, "MRRT item exists but it's also a FRT, try with FRT."); return tryFRT(mMrrtTokenCacheItem.getFamilyClientId(), null); } Logger.v(TAG, "Send request to use MRRT for new AT."); AuthenticationResult mrrtResult = acquireTokenWithCachedItem(mMrrtTokenCacheItem); if (containOauthError(mrrtResult)) { final String familyClientId = StringExtensions.IsNullOrBlank(mMrrtTokenCacheItem.getFamilyClientId()) ? AuthenticationConstants.MS_FAMILY_ID : mMrrtTokenCacheItem.getFamilyClientId(); mMrrtTokenCacheItem = null; mrrtResult = tryFRT(familyClientId, mrrtResult); } return mrrtResult; }

Target:
private AuthenticationResult tryMRRT() throws AuthenticationException { mMrrtTokenCacheItem = mTokenCacheAccessor.getMRRTItem(mAuthRequest.getClientId(), mAuthRequest.getUserFromRequest()); if (mMrrtTokenCacheItem == null) { Logger.v(TAG, "MRRT token does not exist, try with FRT"); return tryFRT(AuthenticationConstants.MS_FAMILY_ID, null); } if (mMrrtTokenCacheItem.isFamilyToken()) { Logger.v(TAG, "MRRT item exists but it's also a FRT, try with FRT."); return tryFRT(mMrrtTokenCacheItem.getFamilyClientId(), null); } AuthenticationResult mrrtResult = useMRRT(); if (isTokenRequestFailed(mrrtResult)) { final String familyClientId = StringExtensions.IsNullOrBlank(mMrrtTokenCacheItem.getFamilyClientId()) ? AuthenticationConstants.MS_FAMILY_ID : mMrrtTokenCacheItem.getFamilyClientId(); mrrtResult = tryFRT(familyClientId, mrrtResult); } return mrrtResult; }
Source:
public static ColumnarRow toColumnarRow(Block block) { requireNonNull(block, "block is null"); if (block instanceof DictionaryBlock) { return toColumnarRow((DictionaryBlock) block); } if (block instanceof RunLengthEncodedBlock) { return toColumnarRow((RunLengthEncodedBlock) block); } if (!(block instanceof AbstractRowBlock)) { throw new IllegalArgumentException("Invalid row block"); } AbstractRowBlock rowBlock = (AbstractRowBlock) block; int firstRowPosition = rowBlock.getColumnBlockOffset(0); int totalRowCount = rowBlock.getColumnBlockOffset(block.getPositionCount()) - firstRowPosition; Block[] fieldBlocks = new Block[rowBlock.numColumns]; for (int i = 0; i < fieldBlocks.length; i++) { fieldBlocks[i] = rowBlock.getColumnBlock(i).getRegion(firstRowPosition, totalRowCount); } return new ColumnarRow(block, fieldBlocks); }

Target:
public static ColumnarRow toColumnarRow(Block block) { requireNonNull(block, "block is null"); if (block instanceof DictionaryBlock) { return toColumnarRow((DictionaryBlock) block); } if (block instanceof RunLengthEncodedBlock) { return toColumnarRow((RunLengthEncodedBlock) block); } if (!(block instanceof AbstractRowBlock)) { throw new IllegalArgumentException("Invalid row block"); } AbstractRowBlock rowBlock = (AbstractRowBlock) block; int firstRowPosition = rowBlock.getFieldBlockOffset(0); int totalRowCount = rowBlock.getFieldBlockOffset(block.getPositionCount()) - firstRowPosition; Block[] fieldBlocks = new Block[rowBlock.numFields]; for (int i = 0; i < fieldBlocks.length; i++) { fieldBlocks[i] = rowBlock.getFieldBlocks()[i].getRegion(firstRowPosition, totalRowCount); } return new ColumnarRow(block, fieldBlocks); }
Source:
public ClasspathShortener(String os, String javaVersion, ILaunch launch, String[] cmdLine, int lastJavaArgumentIndex, File workingDir, String[] envp) { this.os = os; this.javaVersion = javaVersion; this.launch = launch; this.cmdLine = new ArrayList<>(Arrays.asList(cmdLine)); this.lastJavaArgumentIndex = lastJavaArgumentIndex; this.envp = envp == null ? null : Arrays.copyOf(envp, envp.length); this.processTempFilesDir = workingDir != null ? workingDir : new File(".").getAbsoluteFile(); }

Target:
protected ClasspathShortener(String os, String javaVersion, ILaunch launch, String[] cmdLine, int lastJavaArgumentIndex, File workingDir, String[] envp) { this.os = os; this.javaVersion = javaVersion; this.launch = launch; this.cmdLine = new ArrayList<>(Arrays.asList(cmdLine)); this.lastJavaArgumentIndex = lastJavaArgumentIndex; this.envp = envp == null ? null : Arrays.copyOf(envp, envp.length); this.processTempFilesDir = workingDir != null ? workingDir : Paths.get(".").toAbsolutePath().normalize().toFile(); }
Source:
public List<String> getCaFilePaths() { List<String> caFilePaths = new ArrayList<>(); if(hasMultipleCaCerts()) { caFilePaths = Arrays.asList(caFilePath.split(CA_CERT_FILE_DELIMITER)); } else { caFilePaths.add(caFilePath); } return caFilePaths; }

Target:
public List<String> getCaFilePaths() { List<String> caFilePaths = new ArrayList<>(); if(StringUtils.isNotBlank(caFilePath)) { if(hasMultipleCaCerts()) { caFilePaths = Arrays.asList(caFilePath.split(CA_CERT_FILE_DELIMITER)); } else { caFilePaths.add(caFilePath); } } return caFilePaths; }
Source:
public Object fromString(String param) { String[] elements = param.split(separator); Object array = Array.newInstance(rawType.getComponentType(), elements.length); try { for (int i = 0; i < elements.length; i++) { Array.set(array, i, stringParameterInjector.extractValue(elements[i])); } } catch (Exception e) { throw new RuntimeException("Ooops"); } return array; }

Target:
public Object fromString(String param) { String[] elements = param.split(separator); Object array = Array.newInstance(rawType.getComponentType(), elements.length); try { for (int i = 0; i < elements.length; i++) { Array.set(array, i, stringParameterInjector.extractValue(elements[i])); } } catch (Exception e) { throw new RuntimeException(Messages.MESSAGES.errorCreatingArray(param)); } return array; }
Source:
protected synchronized void doStart() { try { try (Admin admin = getPeerConnection().getAdmin()) { String version = admin.getClusterMetrics().getHBaseVersion(); LOG.info("Peer cluster version is for peer {}", version, ctx.getPeerId()); if (Integer.parseInt(version.split("\\.")[0]) >= 3) { setRegionServers(fetchSlavesAddresses()); fetchServersUseZk = false; fetchServersChore = new FetchServersChore(ctx.getServer(), this); ctx.getServer().getChoreService().scheduleChore(fetchServersChore); } else { fetchServersUseZk = true; } } catch (Throwable t) { fetchServersUseZk = true; LOG.warn("Peer try to fetch servers by admin failed. Using zk impl.", ctx.getPeerId(), t); } reloadZkWatcher(); notifyStarted(); } catch (IOException e) { notifyFailed(e); } }

Target:
protected synchronized void doStart() { this.shortOperationTimeout = ctx.getLocalConfiguration().getInt( HBASE_RPC_SHORTOPERATION_TIMEOUT_KEY, DEFAULT_HBASE_RPC_SHORTOPERATION_TIMEOUT); try { if (ctx.getLocalConfiguration().getBoolean(FETCH_SERVERS_USE_ZK_CONF_KEY, false)) { fetchServersUseZk = true; } else { try { if (ReplicationUtils.isPeerClusterSupportReplicationOffload(getPeerConnection())) { fetchServersChore = new FetchServersChore(ctx.getServer(), this); ctx.getServer().getChoreService().scheduleChore(fetchServersChore); fetchServersUseZk = false; } else { fetchServersUseZk = true; } } catch (Throwable t) { fetchServersUseZk = true; LOG.warn("Peer try to fetch servers by admin failed. Using zk impl.", ctx.getPeerId(), t); } } reloadZkWatcher(); notifyStarted(); } catch (IOException e) { notifyFailed(e); } }
Source:
public void deleteOldVersionPath(String path, List<String> zNodeIds, int numVersionsToLeave, Comparator<String> c) { if (StringUtils.isEmpty(path) || zNodeIds == null) { LOG.warn("cannot cleanup empty path or empty list in ZK"); } LOG.info("ids = " + zNodeIds); if (zNodeIds.size() > numVersionsToLeave) { Collections.sort(zNodeIds, c); LOG.info("sorted ids = " + zNodeIds); int i = 0; int size = zNodeIds.size(); LOG.info("starting cleaning of barrier versions. size=" + size + "; num to leave=" + numVersionsToLeave); for (String znodeId: zNodeIds) { i++; if (size - i < numVersionsToLeave) { break; } LOG.info(path + "/" + znodeId); zkClient.deleteRecursive(path + "/" + znodeId); } } }

Target:
void deleteOldVersionPath(String path, List<String> zNodeIds, int numVersionsToLeave, Comparator<String> c) { if (StringUtils.isEmpty(path) || zNodeIds == null) { LOG.warn("cannot cleanup empty path or empty list in ZK"); return; } if (zNodeIds.size() > numVersionsToLeave) { Collections.sort(zNodeIds, c); int size = zNodeIds.size(); List<String> zNodesToDelete = zNodeIds.subList(0, zNodeIds.size() - numVersionsToLeave); LOG.info("Starting cleanup of barrier version zkNodes. From size=" + size + " to size " + zNodesToDelete.size() + "; numberToLeave=" + numVersionsToLeave); for (String znodeId : zNodesToDelete) { String pathToDelete = path + "/" + znodeId; try { LOG.info("deleting " + pathToDelete); zkClient.deleteRecursive(pathToDelete); } catch (Exception e) { LOG.warn("delete of node " + pathToDelete + " failed.", e); } } } }
Source:
public static HyperLogLog newInstance(int numberOfBuckets) { Preconditions.checkArgument(numberOfBuckets <= 8192, "numberOfBuckets must be <= 8192, actual: %s", numberOfBuckets); return new HyperLogLog(new SparseHll(indexBitLength(numberOfBuckets))); }

Target:
public static HyperLogLog newInstance(int numberOfBuckets) { checkArgument(numberOfBuckets <= MAX_NUMBER_OF_BUCKETS, "numberOfBuckets must be <= %s, actual: %s", MAX_NUMBER_OF_BUCKETS, numberOfBuckets); return new HyperLogLog(new SparseHll(indexBitLength(numberOfBuckets))); }
Source:
public void updateModel(final OperationContext context, ModelNode model, ListAttributeDefinition attributeDefinition, ModelNode listAttribute) throws OperationFailedException { listAttribute.set(Collections.<ModelNode>emptyList()); }

Target:
void updateModel(final OperationContext context, ModelNode model, ListAttributeDefinition attributeDefinition, ModelNode listAttribute) throws OperationFailedException { listAttribute.setEmptyList(); }
Source:
protected GroupRest createAndReturn(Context context) throws AuthorizeException, RepositoryMethodNotImplementedException { HttpServletRequest req = getRequestService().getCurrentRequest().getHttpServletRequest(); ObjectMapper mapper = new ObjectMapper(); GroupRest groupRest = null; try { groupRest = mapper.readValue(req.getInputStream(), GroupRest.class); } catch (IOException excIO) { throw new UnprocessableEntityException("error parsing the body... maybe this is not the right error code"); } Group group = null; try { group = gs.create(context); gs.setName(group, groupRest.getName()); gs.update(context, group); if (groupRest.getMetadata() != null) { for (MetadataEntryRest mer: groupRest.getMetadata()) { String[] metadatakey = mer.getKey().split("\\."); gs.addMetadata(context, group, metadatakey[0], metadatakey[1], metadatakey.length == 3 ? metadatakey[2] : null, mer.getLanguage(), mer.getValue()); } } } catch (SQLException excSQL) { throw new RuntimeException(excSQL.getMessage(), excSQL); } return converter.convert(group); }

Target:
protected GroupRest createAndReturn(Context context) throws AuthorizeException, RepositoryMethodNotImplementedException { HttpServletRequest req = getRequestService().getCurrentRequest().getHttpServletRequest(); ObjectMapper mapper = new ObjectMapper(); GroupRest groupRest = null; try { groupRest = mapper.readValue(req.getInputStream(), GroupRest.class); } catch (IOException excIO) { throw new UnprocessableEntityException("error parsing the body ..." + excIO.getMessage()); } Group group = null; try { group = gs.create(context); gs.setName(group, groupRest.getName()); gs.update(context, group); if (groupRest.getMetadata() != null) { for (MetadataEntryRest mer: groupRest.getMetadata()) { String[] metadatakey = mer.getKey().split("\\."); gs.addMetadata(context, group, metadatakey[0], metadatakey[1], metadatakey.length == 3 ? metadatakey[2] : null, mer.getLanguage(), mer.getValue()); } } } catch (SQLException excSQL) { throw new RuntimeException(excSQL.getMessage(), excSQL); } return converter.convert(group); }
Source:
public Value get( String fieldName ) { Integer fieldIndex = fieldLookup.get( fieldName ); if ( fieldIndex == null ) { throw new ValueNotFoundException( fieldName ); } else { return fields[fieldIndex]; } }

Target:
public Value get( String fieldName ) { Integer fieldIndex = fieldLookup.get( fieldName ); if ( fieldIndex == null ) { return null; } else { return fields[fieldIndex]; } }
Source:
protected void loadConfig() throws IOException { if (this.config_location != null && !this.config_location.isEmpty()) { this.loadConfig(this.config_location); return; } final ArrayList<String> file_locations = new ArrayList<String>(); file_locations.add("opentsdb.conf"); if (System.getProperty("os.name").toUpperCase().contains("WINDOWS")) { file_locations.add("C:\\Program Files\\opentsdb\\opentsdb.conf"); file_locations.add("C:\\Program Files (x86)\\opentsdb\\opentsdb.conf"); } else { file_locations.add("/etc/opentsdb.conf"); file_locations.add("/etc/opentsdb/opentsdb.conf"); file_locations.add("/opt/opentsdb/opentsdb.conf"); } for (String file : file_locations) { try { FileInputStream file_stream = new FileInputStream(file); this.properties.clear(); this.properties.load(file_stream); } catch (Exception e) { LOG.debug("Unable to find or load " + file); continue; } LOG.info("Successfully loaded configuration file: " + file); this.config_location = file; return; } LOG.info("No configuration found, will use defaults"); }

Target:
protected void loadConfig() throws IOException { if (this.config_location != null && !this.config_location.isEmpty()) { this.loadConfig(this.config_location); return; } final ArrayList<String> file_locations = new ArrayList<String>(); file_locations.add("opentsdb.conf"); if (System.getProperty("os.name").toUpperCase().contains("WINDOWS")) { file_locations.add("C:\\Program Files\\opentsdb\\opentsdb.conf"); file_locations.add("C:\\Program Files (x86)\\opentsdb\\opentsdb.conf"); } else { file_locations.add("/etc/opentsdb.conf"); file_locations.add("/etc/opentsdb/opentsdb.conf"); file_locations.add("/opt/opentsdb/opentsdb.conf"); } for (String file : file_locations) { try { FileInputStream file_stream = new FileInputStream(file); Properties props = new Properties(); props.load(file_stream); this.loadHashMap(props); } catch (Exception e) { LOG.debug("Unable to find or load " + file, e); continue; } LOG.info("Successfully loaded configuration file: " + file); this.config_location = file; return; } LOG.info("No configuration found, will use defaults"); }
Source:
public static SimpleFeatureType getSchema(Map<String, Object> json, CoordinateReferenceSystem crs, boolean ignoreGeometryProperties) { replaceGeometry(json, GeoJSONReader2::toGeometry); if (ignoreGeometryProperties) { replaceMapProperties(json, it -> { try { GeoJSONReader2.toGeometry(it); return null; } catch (Exception e) { return it; } }); } else { replaceMapProperties(json, it -> { try { return GeoJSONReader2.toGeometry(it); } catch (Exception e) { return it; } }); } Map<String, Class<?>> bindings = new HashMap<>(); String type = GeoJSONUtil.getString(json, GeoJSON.TYPE); switch (type) { case GeoJSON.FEATURE_COLLECTION: List<Object> features = GeoJSONUtil.getList(json, GeoJSON.FEATURES); for (Object feature : features) { addAttributes((Map<String, Object>) feature, bindings); } break; case GeoJSON.FEATURE: addAttributes(json, bindings); break; default: throw new IllegalArgumentException("Invalid type"); } if (bindings.isEmpty()) { return null; } SimpleFeatureTypeBuilder sftb = new SimpleFeatureTypeBuilder(); sftb.setName("FeatureType"); sftb.setNamespaceURI("<LINK_0>"); sftb.setDefaultGeometry(GeoJSONUtil.DEFAULT_GEOMETRY_ATTRIBUTE_NAME); sftb.setCRS(crs); for (Map.Entry<String, Class<?>> attribute : bindings.entrySet()) { String name = attribute.getKey(); Class<?> cl = attribute.getValue(); if (cl.isAssignableFrom(Geometry.class)) { sftb.add(name, cl, crs); } else { sftb.add(name, cl); } } return sftb.buildFeatureType(); }

Target:
public static SimpleFeatureType getSchema(Map<String, Object> json, CoordinateReferenceSystem crs, boolean ignoreGeometryProperties) { replaceGeometry(json, GeoJSONReader2::toGeometry); replaceMapProperties(json, it -> { try { Geometry g = GeoJSONReader2.toGeometry(it); if (ignoreGeometryProperties) { return null; } return g; } catch (Exception e) { return it; } }); Map<String, Class<?>> bindings = new HashMap<>(); String type = GeoJSONUtil.getString(json, GeoJSON.TYPE); switch (type) { case GeoJSON.FEATURE_COLLECTION: List<Object> features = GeoJSONUtil.getList(json, GeoJSON.FEATURES); for (Object feature : features) { addAttributes((Map<String, Object>) feature, bindings); } break; case GeoJSON.FEATURE: addAttributes(json, bindings); break; default: throw new IllegalArgumentException("Invalid type"); } if (bindings.isEmpty()) { return null; } SimpleFeatureTypeBuilder sftb = new SimpleFeatureTypeBuilder(); sftb.setName("FeatureType"); sftb.setNamespaceURI("<LINK_0>"); sftb.setDefaultGeometry(GeoJSONUtil.DEFAULT_GEOMETRY_ATTRIBUTE_NAME); sftb.setCRS(crs); for (Map.Entry<String, Class<?>> attribute : bindings.entrySet()) { String name = attribute.getKey(); Class<?> cl = attribute.getValue(); if (cl.isAssignableFrom(Geometry.class)) { sftb.add(name, cl, crs); } else { sftb.add(name, cl); } } return sftb.buildFeatureType(); }
Source:
public View onCreateView(LayoutInflater inflater, ViewGroup container, final Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_page, container, false); webView = (ObservableWebView) rootView.findViewById(R.id.page_web_view); initWebViewListeners(); webView.getSettings().setBuiltInZoomControls(true); webView.getSettings().setDisplayZoomControls(false); tocDrawer = (WikiDrawerLayout) rootView.findViewById(R.id.page_toc_drawer); tocDrawer.setDragEdgeWidth(getResources().getDimensionPixelSize(R.dimen.drawer_drag_margin)); tocButton = (FloatingActionButton) rootView.findViewById(R.id.floating_toc_button); tocButton.setOnClickListener(tocButtonOnClickListener); refreshView = (SwipeRefreshLayoutWithScroll) rootView .findViewById(R.id.page_refresh_container); int swipeOffset = getContentTopOffsetPx(getActivity()) + REFRESH_SPINNER_ADDITIONAL_OFFSET; refreshView.setProgressViewOffset(false, -swipeOffset, swipeOffset); refreshView.setScrollableChild(webView); refreshView.setOnRefreshListener(pageRefreshListener); errorView = (WikiErrorView)rootView.findViewById(R.id.page_error); return rootView; }

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, final Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_page, container, false); webView = (ObservableWebView) rootView.findViewById(R.id.page_web_view); initWebViewListeners(); tocDrawer = (WikiDrawerLayout) rootView.findViewById(R.id.page_toc_drawer); tocDrawer.setDragEdgeWidth(getResources().getDimensionPixelSize(R.dimen.drawer_drag_margin)); tocButton = (FloatingActionButton) rootView.findViewById(R.id.floating_toc_button); tocButton.setOnClickListener(tocButtonOnClickListener); refreshView = (SwipeRefreshLayoutWithScroll) rootView .findViewById(R.id.page_refresh_container); int swipeOffset = getContentTopOffsetPx(getActivity()) + REFRESH_SPINNER_ADDITIONAL_OFFSET; refreshView.setProgressViewOffset(false, -swipeOffset, swipeOffset); refreshView.setScrollableChild(webView); refreshView.setOnRefreshListener(pageRefreshListener); errorView = (WikiErrorView)rootView.findViewById(R.id.page_error); return rootView; }
Source:
public String apply(Location input) { return new StringBuilder().append(input.getId()).append(':').append(input.getScope()).toString(); }

Target:
public String apply(Location input) { return input.getId() + ":" + input.getScope(); }
Source:
public HTML(final Response res) { super(RsWithType.make(res, RsWithType.TYPE_HTML)); }

Target:
public HTML(final Response res) { this(res, new Opt.Empty<Charset>()); }
Source:
private void onEditSnapshotSchedule() { final GlusterVolumeSnapshotModel snapshotModel = (GlusterVolumeSnapshotModel) getWindow(); if (!snapshotModel.validate(false)) { return; } setConfirmWindow(null); scheduleSnapshot(snapshotModel, true); }

Target:
public void onEditSnapshotSchedule() { final GlusterVolumeSnapshotModel snapshotModel = (GlusterVolumeSnapshotModel) getWindow(); if (snapshotModel.getRecurrence().getSelectedItem() == GlusterVolumeSnapshotScheduleRecurrence.UNKNOWN) { confirmDeleteVolumeSnapshotSchedule(); } else { onEditSnapshotScheduleInternal(); } }
Source:
public final void clear() { ref.clear(); }

Target:
public final void clear() { ref.clear(); manager.removeStallEntries(); }
Source:
public Mono<HttpResponse> process(HttpPipelineCallContext context, HttpPipelineNextPolicy next) { final Flux<ByteBuffer> contents = context.getHttpRequest().body() == null ? Flux.just(getEmptyBuffer()) : context.getHttpRequest().body(); return credentials .getAuthorizationHeadersAsync( context.getHttpRequest().getUrl(), context.getHttpRequest().getHttpMethod().toString(), contents.defaultIfEmpty(getEmptyBuffer())) .flatMapMany(headers -> Flux.fromIterable(headers.entrySet())) .map(header -> context.getHttpRequest().setHeader(header.getKey(), header.getValue())) .last() .flatMap(request -> next.process()); }

Target:
public Mono<HttpResponse> process(HttpPipelineCallContext context, HttpPipelineNextPolicy next) { final Flux<ByteBuffer> contents = context.getHttpRequest().getBody() == null ? Flux.just(getEmptyBuffer()) : context.getHttpRequest().getBody(); return credentials .getAuthorizationHeadersAsync( context.getHttpRequest().getUrl(), context.getHttpRequest().getHttpMethod().toString(), contents.defaultIfEmpty(getEmptyBuffer())) .flatMapMany(headers -> Flux.fromIterable(headers.entrySet())) .map(header -> context.getHttpRequest().setHeader(header.getKey(), header.getValue())) .last() .flatMap(request -> next.process()); }
Source:
public void setItemRegistry(ItemRegistry itemRegistry) { this.itemRegistry = itemRegistry; LOGGER.debug("Item registry set for SiteWhere persistence."); }

Target:
public void setItemRegistry(ItemRegistry itemRegistry) { this.itemRegistry = itemRegistry; LOGGER.trace("Item registry set for SiteWhere persistence."); }
Source:
private void refreshHostStorage(Guid hostId) { getBackendCollection(VdcQueryType.GetDeviceList, new GetDeviceListQueryParameters(hostId, StorageType.ISCSI, Boolean.FALSE)); }

Target:
private void refreshHostStorage(Guid hostId) { getBackendCollection(VdcQueryType.GetDeviceList, new GetDeviceListQueryParameters(hostId, StorageType.ISCSI, false, null)); }
Source:
public Optional<DecisionTable> getModelClass() { final DecisionTable dtable = new DecisionTable(); return Optional.of(dtable); }

Target:
public Optional<DecisionTable> getModelClass() { return Optional.of(new DecisionTable()); }
Source:
private static boolean isInSetMethodsBlackList(final String methodName) { return ("addAll".equals(methodName) || "containsAll".equals(methodName) || "iterator".equals(methodName) || "removeAll".equals(methodName) || "retainAll".equals(methodName) || "toArray".equals(methodName)); }

Target:
private static boolean isInSetMethodsBlackList(final String methodName) { return isInCollectionMethodsBlackList(methodName); }
Source:
protected ResultQueueEntry<FlatRow> getNext() throws IOException { ResultQueueEntry<FlatRow> queueEntry; try { queueEntry = resultQueue.take(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new IOException("Interrupted while waiting for next result", e); } return queueEntry; }

Target:
protected ResultQueueEntry<FlatRow> getNext() throws IOException { ResultQueueEntry<FlatRow> queueEntry; try { queueEntry = resultQueue.take(); if (queueEntry == null) { throw new IllegalStateException("Timed out awaiting next sync rows"); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new IOException("Interrupted while waiting for next result", e); } return queueEntry; }
Source:
public void request(@NonNull Context context, @NonNull Site site, int age, @NonNull final FeedClient.Callback cb) { cb.success(Collections.singletonList(card)); }

Target:
public void request(@NonNull Context context, @NonNull Site site, int age, @NonNull final FeedClient.Callback cb) { cb.success(Collections.singletonList(getNewCard(site))); }
Source:
public static void trace(String option, String message, Throwable throwable) { String systemPrintableMessage = message; while (systemPrintableMessage.length() > 100) { String partial = systemPrintableMessage.substring(0, 100); systemPrintableMessage = systemPrintableMessage.substring(100); System.out.println(partial + "\\"); } System.out.println(systemPrintableMessage); if(fgDebugTrace != null) { fgDebugTrace.trace(option, message, throwable); } }

Target:
public static void trace(String option, String message, Throwable throwable) { if (DEBUG) { System.out.println(message); } if(fgDebugTrace != null) { fgDebugTrace.trace(option, message, throwable); } }
Source:
private Content setCommonFields(Content content, LoveFilmDataRow source) { content.setActivelyPublished(true); content.setTitle(ITEM_NAME.valueFrom(source)); content.setImage(HEROSHOT_URL.valueFrom(source)); content.setYear(yearFrom(ORIGINAL_PUBLICATION_DATE.valueFrom(source))); content.setGenres(genresFrom(GENRE.valueFrom(source))); content.setPeople(peopleFrom(CONTRIBUTOR.valueFrom(source))); content.setLanguages(languagesFrom(LANGUAGE.valueFrom(source))); content.setCertificates(certificatesFrom(BBFC_RATING.valueFrom(source))); content.setMediaType(MediaType.VIDEO); content.setDescription(SYNOPSIS.valueFrom(source)); String asin = ASIN.valueFrom(source); if (asin.length() > 0) { content.addAliasUrl(AMAZON_ALIAS_URL_PREFIX + asin); content.addAlias(new Alias(ASIN_NAMESPACE, asin)); } String imdbId = IMDB_ID.valueFrom(source); if (imdbId.length() > 0) { content.addAliasUrl(IMDB_ALIAS_URL_PREFIX + imdbId); content.addAlias(new Alias(IMDB_NAMESPACE, imdbId)); } return content; }

Target:
private Content setCommonFields(Content content, LoveFilmDataRow source) { content.setActivelyPublished(true); content.setTitle(ITEM_NAME.valueFrom(source)); content.setImage(HEROSHOT_URL.valueFrom(source)); content.setYear(yearFrom(ORIGINAL_PUBLICATION_DATE.valueFrom(source))); content.setGenres(genresFrom(GENRE.valueFrom(source))); content.setPeople(peopleFrom(CONTRIBUTOR.valueFrom(source))); content.setLanguages(languagesFrom(LANGUAGE.valueFrom(source))); content.setCertificates(certificatesFrom(BBFC_RATING.valueFrom(source))); content.setMediaType(MediaType.VIDEO); content.setDescription(SYNOPSIS.valueFrom(source)); String asin = ASIN.valueFrom(source); if (!Strings.isNullOrEmpty(asin)) { content.addAliasUrl(AMAZON_ALIAS_URL_PREFIX + asin); content.addAlias(new Alias(ASIN_NAMESPACE, asin)); } String imdbId = IMDB_ID.valueFrom(source); if (!Strings.isNullOrEmpty(imdbId)) { content.addAliasUrl(IMDB_ALIAS_URL_PREFIX + imdbId); content.addAlias(new Alias(IMDB_NAMESPACE, imdbId)); } return content; }
Source:
public boolean savePassword(final Network network, final NicProfile nic, final VirtualMachineProfile vm) throws ResourceUnavailableException { if (!canHandle(network, null)) { return false; } final List<DomainRouterVO> routers = _routerDao.listByNetworkAndRole(network.getId(), Role.VIRTUAL_ROUTER); if (routers == null || routers.isEmpty()) { s_logger.debug("Can't find virtual router element in network " + network.getId()); return true; } final VirtualMachineProfile uservm = vm; final DataCenterVO dcVO = _dcDao.findById(network.getDataCenterId()); final NetworkTopology networkTopology = networkTopologyContext.retrieveNetworkTopology(dcVO); if (!network.isRedundant()) { return networkTopology.savePasswordToRouter(network, nic, uservm, routers.get(0)); } Boolean applied; for (final VirtualRouter router : routers) { if (router.getState() == State.Running && router.getRedundantState() == VirtualRouter.RedundantState.MASTER) { applied = networkTopology.savePasswordToRouter(network, nic, uservm, router); if (!applied) { return false; } return true; } } final String password = (String) uservm.getParameter(VirtualMachineProfile.Param.VmPassword); final String password_encrypted = DBEncryptionUtil.encrypt(password); final UserVmVO userVmVO = _userVmDao.findById(vm.getId()); _userVmDao.loadDetails(userVmVO); userVmVO.setDetail("password", password_encrypted); _userVmDao.saveDetails(userVmVO); userVmVO.setUpdateParameters(true); _userVmDao.update(userVmVO.getId(), userVmVO); return true; }

Target:
public boolean savePassword(final Network network, final NicProfile nic, final VirtualMachineProfile vm) throws ResourceUnavailableException { if (!canHandle(network, null)) { return false; } final List<DomainRouterVO> routers = _routerDao.listByNetworkAndRole(network.getId(), Role.VIRTUAL_ROUTER); if (routers == null || routers.isEmpty()) { s_logger.debug("Can't find virtual router element in network " + network.getId()); return true; } final VirtualMachineProfile uservm = vm; final DataCenterVO dcVO = _dcDao.findById(network.getDataCenterId()); final NetworkTopology networkTopology = networkTopologyContext.retrieveNetworkTopology(dcVO); if (!network.isRedundant()) { return networkTopology.savePasswordToRouter(network, nic, uservm, routers.get(0)); } for (final VirtualRouter router : routers) { if (router.getState() == State.Running && router.getRedundantState() == VirtualRouter.RedundantState.MASTER) { return networkTopology.savePasswordToRouter(network, nic, uservm, router); } } return savePassword(uservm); }
Source:
public void putTicket(ImageTicket ticket) { BasicHttpEntityEnclosingRequest request = new BasicHttpEntityEnclosingRequest( "PUT", TICKETS_URI + ticket.getId(), HttpVersion.HTTP_1_1); StringEntity entity = new StringEntity(new Gson().toJson(ticket.toDict()), StandardCharsets.UTF_8); request.setEntity(entity); request.setHeader("content-length", String.valueOf(entity.getContentLength())); DefaultBHttpClientConnection conn = getConnection(); HttpEntity response = executeRequest(request, conn); finalize(response, conn); }

Target:
public void putTicket(ImageTicket ticket) { BasicHttpEntityEnclosingRequest request = new BasicHttpEntityEnclosingRequest( "PUT", TICKETS_URI + ticket.getId(), HttpVersion.HTTP_1_1); try (DefaultBHttpClientConnection conn = getConnection()) { StringEntity entity = new StringEntity( new ObjectMapper().writeValueAsString(ticket.toDict()), StandardCharsets.UTF_8); request.setEntity(entity); request.setHeader("content-length", String.valueOf(entity.getContentLength())); consumeResponse(executeRequest(request, conn)); } catch (IOException e) { throw new RuntimeException(e.getMessage(), e); } }
Source:
public final static String formatNumber(long value, int base, boolean signed) { String s; switch (base) { case 2: s = "0b" + Long.toBinaryString(value); break; case 8: s = "0" + Long.toOctalString(value); break; case 16: s = "0x" + Long.toHexString(value); break; case 10: default: if (!signed && value < 0) { BigInteger bigInteger = BigInteger.valueOf(value); BigInteger powerOfTwo = (BigInteger.valueOf(Long.MAX_VALUE)).add(BigInteger.valueOf(1)); powerOfTwo = powerOfTwo.multiply(BigInteger.valueOf(2)); bigInteger = bigInteger.add(powerOfTwo); s = bigInteger.toString(); } else { s = Long.toString(value); } break; } return s; }

Target:
public final static String formatNumber(long value, int base, boolean signed) { String s; switch (base) { case 2: s = "0b" + Long.toBinaryString(value); break; case 8: s = "0" + Long.toOctalString(value); break; case 16: s = "0x" + Long.toHexString(value); break; case 10: default: if (!signed && value < 0) { BigInteger bigInteger = BigInteger.valueOf(value); bigInteger = bigInteger.add(BigInteger.valueOf(1).shiftLeft(64)); s = bigInteger.toString(); } else { s = Long.toString(value); } break; } return s; }
Source:
protected void executeCommand() { String connectionId = getConnection().getid(); getStorageServerConnectionDao().remove(connectionId); if (!Guid.isNullOrEmpty(getParameters().getVdsId())) { disconnectStorage(); } setSucceeded(true); }

Target:
protected void executeCommand() { String connectionId = getConnection().getid(); getStorageServerConnectionDao().remove(connectionId); log.debugFormat("Removing connection %s from database ", connectionId); if (Guid.isNullOrEmpty(getParameters().getVdsId())) { log.debug("No vdsId passed - hosts will not be disconnected."); } else { disconnectStorage(); } setSucceeded(true); }
Source:
public void onException(final Exception ex) { LOG.warn("Exception occurred while streaming", ex); if (!headersSent) { headersSent = true; try { if (ex instanceof NakadiException) { writeProblemResponse(Response.Status.BAD_REQUEST, ((NakadiException) ex).getProblemMessage()); } else { writeProblemResponse(Response.Status.SERVICE_UNAVAILABLE, "Failed to continue streaming"); } } catch (final IOException e) { LOG.error("Failed to write exception to response", e); } } else { LOG.warn("Exception found while streaming, but no data could be provided to client", ex); } }

Target:
public void onException(final Exception ex) { LOG.warn("Exception occurred while streaming", ex); if (!headersSent) { headersSent = true; try { if (ex instanceof NakadiException) { writeProblemResponse(((NakadiException) ex).asProblem()); } else { writeProblemResponse(Problem.valueOf(Response.Status.SERVICE_UNAVAILABLE, "Failed to continue streaming")); } } catch (final IOException e) { LOG.error("Failed to write exception to response", e); } } else { LOG.warn("Exception found while streaming, but no data could be provided to client", ex); } }
Source:
public CSCMatrix horzcatSparse(final List<Vector> vectors) { List<breeze.linalg.SparseVector<Double>> breezeVecList = Lists.transform(vectors, new Function<Vector, breeze.linalg.SparseVector<Double>>() { public breeze.linalg.SparseVector<Double> apply(final Vector vector) { return ((SparseVector) vector).getBreezeVector(); } }); return new CSCMatrix( breeze.linalg.SparseVector.horzcat(JavaConversions.asScalaBuffer(breezeVecList), ZERO, TAG)); }

Target:
public CSCMatrix horzcatSparse(final List<Vector> vectors) { final List<breeze.linalg.SparseVector<Double>> breezeVecList = Lists.transform(vectors, new Function<Vector, breeze.linalg.SparseVector<Double>>() { public breeze.linalg.SparseVector<Double> apply(final Vector vector) { return ((SparseVector) vector).getBreezeVector(); } }); return new CSCMatrix( breeze.linalg.SparseVector.horzcat(JavaConversions.asScalaBuffer(breezeVecList), ZERO, TAG)); }
Source:
private void readRenameModeFromPreferences() { IPreferenceStore store = getPreferenceStore(); String renameMode = store.getString(IWorkbenchPreferenceConstants.RESOURCE_RENAME_MODE_DIALOG); if (renameMode == null || renameMode.isEmpty()) { renameMode = getRenameModePreference(); } renameModeInline = !IWorkbenchPreferenceConstants.RESOURCE_RENAME_MODE_DIALOG.equals(renameMode); }

Target:
private void readRenameModeFromPreferences() { IPreferenceStore store = getPreferenceStore(); String renameMode = store.getString(IWorkbenchPreferenceConstants.RESOURCE_RENAME_MODE); renameModeInline = !IWorkbenchPreferenceConstants.RESOURCE_RENAME_MODE_DIALOG.equals(renameMode); }
Source:
private void validateSetOptimizeQueriesOption(boolean optimizeQueries) { if (!setCacheDeserializedValuesExplicitlyInvoked) { return; } if (cacheDeserializedValues == CacheDeserializedValues.INDEX_ONLY) { throw new ConfigurationException("Deprecated option 'optimize-queries' is being set" + ", but 'cacheDeserializedValues' was set to INDEX_ONLY. " + "These are conflicting options. Please remove the `optimize-queries'"); } else if (cacheDeserializedValues == CacheDeserializedValues.NEVER && optimizeQueries) { throw new ConfigurationException("Deprecated option 'optimize-queries' is being set to true, " + "but 'cacheDeserializedValues' is set to NEVER. " + "These are conflicting options. Please remove the `optimize-queries'"); } else if (cacheDeserializedValues == CacheDeserializedValues.ALWAYS && !optimizeQueries) { throw new ConfigurationException("Deprecated option 'optimize-queries' is being set to false, " + "but 'cacheDeserializedValues' is set to ALWAYS. " + "These are conflicting options. Please remove the `optimize-queries'"); } }

Target:
private void validateSetOptimizeQueriesOption(boolean optimizeQueries) { if (!setCacheDeserializedValuesExplicitlyInvoked) { return; } if (cacheDeserializedValues != CacheDeserializedValues.ALWAYS && optimizeQueries) { throw new ConfigurationException("Deprecated option 'optimize-queries' is being set to true, " + "but 'cacheDeserializedValues' was set to NEVER or INDEX_ONLY. " + "These are conflicting options. Please remove the `optimize-queries'"); } else if (cacheDeserializedValues == CacheDeserializedValues.ALWAYS && !optimizeQueries) { throw new ConfigurationException("Deprecated option 'optimize-queries' is being set to false, " + "but 'cacheDeserializedValues' was set to ALWAYS. " + "These are conflicting options. Please remove the `optimize-queries'"); } }
Source:
public void playerInteract(PlayerInteractEvent event) { if (event.action == PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK && event.entityPlayer.getHeldItem().itemID < Block.blocksList.length && Block.blocksList[event.entityPlayer.getHeldItem().itemID] != null) { int x = event.x + (new int[] {0, 0, 0, 0, -1, 1})[event.face]; int y = event.y - 1 + (new int[] {-1, 1, 0, 0, 0, 0})[event.face]; int z = event.z + (new int[] {0, 0, -1, 1, 0, 0})[event.face];getClass(); if (event.entityPlayer.worldObj.getBlockId(x, y, z) == ModBlocks.aludel.blockID) { event.setCanceled(true); } } }

Target:
public void playerInteract(PlayerInteractEvent event) { if (event.action == PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK && event.entityPlayer.getHeldItem().itemID < Block.blocksList.length && Block.blocksList[event.entityPlayer.getHeldItem().itemID] != null) { int x = event.x + (new int[] {0, 0, 0, 0, -1, 1})[event.face]; int y = event.y - 1 + (new int[] {-1, 1, 0, 0, 0, 0})[event.face]; int z = event.z + (new int[] {0, 0, -1, 1, 0, 0})[event.face]; if (event.entityPlayer.worldObj.getBlockId(x, y, z) == ModBlocks.aludel.blockID) { event.setCanceled(true); } } }