auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean matchBeanRegex(Filter filter, boolean matchIfNoRegex) { ArrayList<Pattern> beanRegexes = filter.getBeanRegexes(); if (beanRegexes.isEmpty()) { return matchIfNoRegex; } for (Pattern beanRegex : beanRegexes) { Matcher m = beanRegex.matcher(beanStringName); if(m.matches()) { for (int i = 0; i<= m.groupCount(); i++) { this.beanParameters.put(""+i, m.group(i)); } return true; } } return false; }

Target:
private boolean matchBeanRegex(Filter filter, boolean matchIfNoRegex) { ArrayList<Pattern> beanRegexes = filter.getBeanRegexes(); if (beanRegexes.isEmpty()) { return matchIfNoRegex; } for (Pattern beanRegex : beanRegexes) { Matcher m = beanRegex.matcher(beanStringName); if(m.matches()) { for (int i = 0; i<= m.groupCount(); i++) { this.beanParameters.put(Integer.toString(i), m.group(i)); } return true; } } return false; }
Source:
private Quantum getQuantumClient() { if (quantumClient == null) { quantumClient = new Quantum(getProviderDetails().getUrl()); if (getProviderDetails().isRequiringAuthentication()) { final String tenantName = getProviderDetails().getAdditionalProperties().getTenantName(); final KeystoneTokenProvider keystoneTokenProvider = new KeystoneTokenProvider(Config.<String> GetValue(ConfigValues.KeystoneAuthUrl), getProviderDetails().getUsername(), getProviderDetails().getPassword()); quantumClient.setTokenProvider(keystoneTokenProvider.getProviderByTenant(tenantName)); } } return quantumClient; }

Target:
private Quantum getQuantumClient() { if (quantumClient == null) { quantumClient = new Quantum(getProvider().getUrl()); if (getProvider().isRequiringAuthentication()) { final String tenantName = getProvider().getAdditionalProperties().getTenantName(); final KeystoneTokenProvider keystoneTokenProvider = new KeystoneTokenProvider(Config.<String> GetValue(ConfigValues.KeystoneAuthUrl), getProvider().getUsername(), getProvider().getPassword()); quantumClient.setTokenProvider(keystoneTokenProvider.getProviderByTenant(tenantName)); } } return quantumClient; }
Source:
private ActivationWithLossGpuLayer(@Parameter(LayerIndex.class) final int index, @Parameter(LayerInputShape.class) final String inputShape, @Parameter(LossFunction.class) final String lossFunction, @Parameter(ActivationFunction.class) final String activationFunction, @Parameter(NeuralNetworkConfigurationParameters.BatchSize.class) final int batchSize, final MatrixFactory matrixFactory) { super(index, inputShape); this.lossFunction = lossFunction; this.matrixFactory = matrixFactory; final int inputChannel; final int inputHeight; final int inputWidth; if (getInputShape().length == 2) { inputChannel = 1; inputHeight = getInputShape()[0]; inputWidth = getInputShape()[1]; } else { inputChannel = getInputShape()[0]; inputHeight = getInputShape()[1]; inputWidth = getInputShape()[2]; } if (activationFunction.toLowerCase().equals("softmax")) { this.inputDesc = JavaCudnn.createTensorDesc(batchSize, inputChannel, inputHeight, inputWidth); detectErrorPointer(inputDesc); this.activationDesc = JavaCudnn.createTensorDesc(batchSize, inputChannel, inputHeight, inputWidth); detectErrorPointer(activationDesc); } else { throw new IllegalArgumentException("Unsupported activation function"); } }

Target:
private ActivationWithLossGpuLayer(@Parameter(LayerIndex.class) final int index, @Parameter(LayerInputShape.class) final String inputShape, @Parameter(LossFunction.class) final String lossFunction, @Parameter(ActivationFunction.class) final String activationFunction, @Parameter(NeuralNetworkConfigurationParameters.BatchSize.class) final int batchSize, final MatrixFactory matrixFactory) { super(index, inputShape); this.lossFunction = lossFunction; this.matrixFactory = matrixFactory; final int inputChannel; final int inputHeight; final int inputWidth; if (getInputShape().length == 2) { inputChannel = 1; inputHeight = getInputShape()[0]; inputWidth = getInputShape()[1]; } else { inputChannel = getInputShape()[0]; inputHeight = getInputShape()[1]; inputWidth = getInputShape()[2]; } if (activationFunction.toLowerCase().equals("softmax")) { this.inputDesc = JavaCudnn.createTensorDesc(batchSize, inputChannel, inputHeight, inputWidth); this.activationDesc = JavaCudnn.createTensorDesc(batchSize, inputChannel, inputHeight, inputWidth); } else { throw new IllegalArgumentException("Unsupported activation function"); } }
Source:
public void saveProjectProperties(final DmsProject study, final DmsProject trialDataset, final DmsProject measurementDataset, final List<MeasurementVariable> variables, final boolean isConstant) { if (variables != null) { int rank = this.getNextRank(study); final Set<Integer> geoIds = this.daoFactory.getGeolocationDao().getLocationIds(study.getProjectId()); final Geolocation geolocation = this.daoFactory.getGeolocationDao().getById(geoIds.iterator().next()); Hibernate.initialize(geolocation.getProperties()); for (final MeasurementVariable variable : variables) { switch (variable.getOperation().toString()) { case "DELETE": this.deleteVariable(study, trialDataset, measurementDataset, variable.getRole(), variable.getTermId(), geolocation); break; case "ADD": this.insertVariable(study, trialDataset, measurementDataset, variable, rank, isConstant, geolocation); break; case "UPDATE": this.updateVariable(study, trialDataset, measurementDataset, variable, isConstant, geolocation); break; default: break; } } } }

Target:
public void saveProjectProperties(final DmsProject study, final DmsProject trialDataset, final DmsProject measurementDataset, final List<MeasurementVariable> variables, final boolean isConstant) { if (variables != null) { int rank = this.getNextRank(study); final Set<Integer> geoIds = this.daoFactory.getGeolocationDao().getLocationIds(study.getProjectId()); final Geolocation geolocation = this.daoFactory.getGeolocationDao().getById(geoIds.iterator().next()); Hibernate.initialize(geolocation.getProperties()); for (final MeasurementVariable variable : variables) { switch (variable.getOperation()) { case DELETE: this.deleteVariable(study, trialDataset, measurementDataset, variable.getRole(), variable.getTermId(), geolocation); break; case ADD: this.insertVariable(study, trialDataset, measurementDataset, variable, rank, isConstant, geolocation); rank++; break; case UPDATE: this.updateVariable(study, trialDataset, measurementDataset, variable, isConstant, geolocation); break; default: break; } } } }
Source:
protected ScriptVariableContainer readAllVariables() throws DbgpException { final IDbgpContextCommands commands = thread.getDbgpSession() .getCoreCommands(); final ScriptVariableContainer result = new ScriptVariableContainer(); if (!thread.isSuspended()) { needRefreshVariables = true; return result; } final Map names = commands.getContextNames(getLevel()); if (thread.retrieveLocalVariables() && names.containsKey(Integer.valueOf( IDbgpContextCommands.LOCAL_CONTEXT_ID))) { result.locals = readVariables(this, IDbgpContextCommands.LOCAL_CONTEXT_ID, commands); } if (thread.retrieveGlobalVariables() && names.containsKey(Integer.valueOf( IDbgpContextCommands.GLOBAL_CONTEXT_ID))) { result.globals = readVariables(this, IDbgpContextCommands.GLOBAL_CONTEXT_ID, commands); } if (thread.retrieveClassVariables() && names.containsKey(Integer.valueOf( IDbgpContextCommands.CLASS_CONTEXT_ID))) { result.classes = readVariables(this, IDbgpContextCommands.CLASS_CONTEXT_ID, commands); } return result; }

Target:
protected ScriptVariableContainer readAllVariables() throws DbgpException { final IDbgpContextCommands commands = thread.getDbgpSession() .getCoreCommands(); final ScriptVariableContainer result = new ScriptVariableContainer(); final Map names = commands.getContextNames(getLevel()); if (thread.retrieveLocalVariables() && names.containsKey(Integer.valueOf( IDbgpContextCommands.LOCAL_CONTEXT_ID))) { result.locals = readVariables(this, IDbgpContextCommands.LOCAL_CONTEXT_ID, commands); } if (thread.retrieveGlobalVariables() && names.containsKey(Integer.valueOf( IDbgpContextCommands.GLOBAL_CONTEXT_ID))) { result.globals = readVariables(this, IDbgpContextCommands.GLOBAL_CONTEXT_ID, commands); } if (thread.retrieveClassVariables() && names.containsKey(Integer.valueOf( IDbgpContextCommands.CLASS_CONTEXT_ID))) { result.classes = readVariables(this, IDbgpContextCommands.CLASS_CONTEXT_ID, commands); } return result; }
Source:
private void waitForInitialConfig(){ log.debug("Waiting for initial config from host"); String line = socket.readLine(); log.debug("got: " + line); if(line == null) { log.error("Host disconnect while waiting for initial config, BAIL OUT"); System.exit(-1); } try { JsonObject obj = parser.parse(line).getAsJsonObject(); log.debug("Got initial config from host, building model: "+obj.toString()); SevenWondersGame game = getLocalGame(); game.setCards(obj.getAsJsonArray(PROP_ROUTE_CARDS)); game.setDeck(obj.getAsJsonArray(PROP_ROUTE_DECK)); game.setWonders(obj.getAsJsonArray(PROP_ROUTE_WONDERS)); game.setPlayers(obj.getAsJsonObject(PROP_ROUTE_PLAYERS)); log.debug("Model built"); } catch(Exception e) { log.error("Exception while parsing initial config"); cleanup(); } }

Target:
private void waitForInitialConfig(){ log.debug("Waiting for initial config from host"); String line = socket.readLine(); log.debug("got: " + line); if(!socket.isValid()) { log.error("Host disconnect while waiting for initial config, BAIL OUT"); System.exit(-1); } try { JsonObject obj = parser.parse(line).getAsJsonObject(); log.debug("Got initial config from host, building model: "+obj.toString()); SevenWondersGame game = getLocalGame(); game.setCards(obj.getAsJsonArray(PROP_ROUTE_CARDS)); game.setDeck(obj.getAsJsonArray(PROP_ROUTE_DECK)); game.setWonders(obj.getAsJsonArray(PROP_ROUTE_WONDERS)); game.setPlayers(obj.getAsJsonObject(PROP_ROUTE_PLAYERS)); log.debug("Model built"); } catch(Exception e) { log.error("Exception while parsing initial config"); cleanup(); } }
Source:
private void processMovable(DescriptorPolicy descriptorPolicy, PlanningEntity entityAnnotation) { Class<? extends SelectionFilter> movableEntitySelectionFilterClass = entityAnnotation.movableEntitySelectionFilter(); boolean hasSelectionFilter = movableEntitySelectionFilterClass != PlanningEntity.NullMovableEntitySelectionFilter.class; Class<? extends PinningFilter> pinningFilterClass = entityAnnotation.pinningFilter(); boolean hasPinningFilter = pinningFilterClass != PlanningEntity.NullPinningFilter.class; if (hasPinningFilter && hasSelectionFilter) { throw new IllegalStateException("The entityClass (" + entityClass + ") uses both movableEntitySelectionFilter (" + movableEntitySelectionFilterClass + ") and pinningFilter (" + pinningFilterClass + "). " + "Use pinningFilter exclusively."); } if (hasPinningFilter) { declaredMovableEntitySelectionFilter = new SelectionFilter() { private final PinningFilter pinningFilter = ConfigUtils.newInstance(this, "pinningFilterClass", pinningFilterClass); @Override public boolean accept(ScoreDirector scoreDirector, Object selection) { return pinningFilter.accept(scoreDirector.getWorkingSolution(), selection); } }; } else if (hasSelectionFilter) { declaredMovableEntitySelectionFilter = ConfigUtils.newInstance(this, "movableEntitySelectionFilterClass", movableEntitySelectionFilterClass); } }

Target:
private void processMovable(DescriptorPolicy descriptorPolicy, PlanningEntity entityAnnotation) { Class<? extends SelectionFilter> movableEntitySelectionFilterClass = entityAnnotation.movableEntitySelectionFilter(); boolean hasSelectionFilter = movableEntitySelectionFilterClass != PlanningEntity.NullMovableEntitySelectionFilter.class; Class<? extends PinningFilter> pinningFilterClass = entityAnnotation.pinningFilter(); boolean hasPinningFilter = pinningFilterClass != PlanningEntity.NullPinningFilter.class; if (hasPinningFilter && hasSelectionFilter) { throw new IllegalStateException("The entityClass (" + entityClass + ") uses both movableEntitySelectionFilter (" + movableEntitySelectionFilterClass + ") and pinningFilter (" + pinningFilterClass + ").\n" + "Maybe use only pinningFilterClass on your @" + PlanningEntity.class.getSimpleName() + " annotation."); } if (hasPinningFilter) { declaredMovableEntitySelectionFilter = new SelectionFilter() { private final PinningFilter pinningFilter = ConfigUtils.newInstance(this, "pinningFilterClass", pinningFilterClass); @Override public boolean accept(ScoreDirector scoreDirector, Object selection) { return !pinningFilter.accept(scoreDirector.getWorkingSolution(), selection); } }; } else if (hasSelectionFilter) { declaredMovableEntitySelectionFilter = ConfigUtils.newInstance(this, "movableEntitySelectionFilterClass", movableEntitySelectionFilterClass); } }
Source:
protected void onPostExecute(String response) { Log.i("Response--", response); if (response != null) { try { JSONObject mainObject = new JSONObject(response); JSONObject flavoursObject = mainObject.getJSONObject("flavors"); JSONObject githubObject = flavoursObject.getJSONObject("github"); JSONObject githubStableObject = githubObject.getJSONObject("stable"); String versionName = githubStableObject.getString("version"); String versionCode = githubStableObject.getString("version_code"); String apkLocationUrl = githubStableObject.getString("apk"); compareAppVersionAndShowNotification(versionName, apkLocationUrl, versionCode); } catch (JSONException ex) { ex.printStackTrace(); } } }

Target:
protected void onPostExecute(String response) { if (response != null) { try { JSONObject mainObject = new JSONObject(response); JSONObject flavoursObject = mainObject.getJSONObject("flavors"); JSONObject githubObject = flavoursObject.getJSONObject("github"); JSONObject githubStableObject = githubObject.getJSONObject("stable"); String versionName = githubStableObject.getString("version"); String versionCode = githubStableObject.getString("version_code"); String apkLocationUrl = githubStableObject.getString("apk"); compareAppVersionAndShowNotification(versionName, apkLocationUrl, versionCode); } catch (JSONException ex) { ErrorActivity.reportError(app, ex, null, null, ErrorActivity.ErrorInfo.make(UserAction.SOMETHING_ELSE, "none", "could not parse app update JSON data", R.string.app_ui_crash)); } } }
Source:
public void addIdP(IdentityProvider identityProvider) throws IdentityProviderManagementException { try { String tenantDomain = CarbonContext.getThreadLocalCarbonContext().getTenantDomain(); IdentityProviderManager.getInstance().addIdP(identityProvider, tenantDomain); } catch (IdentityProviderManagementException idpException) { log.error("Error while adding Identity provider", idpException); throw idpException; } }

Target:
public void addIdP(IdentityProvider identityProvider) throws IdentityProviderManagementException { String tenantDomain = ""; try { tenantDomain = CarbonContext.getThreadLocalCarbonContext().getTenantDomain(); IdentityProviderManager.getInstance().addIdP(identityProvider, tenantDomain); } catch (IdentityProviderManagementException idpException) { log.error("Error while adding Identity provider in tenantDomain : " + tenantDomain, idpException); throw idpException; } }
Source:
protected boolean canScroll(final View v, final boolean checkV, final int dx, final int x, final int y) { if (SDK_INT < ICE_CREAM_SANDWICH && v instanceof WebView) return v.canScrollHorizontally(-dx); else return super.canScroll(v, checkV, dx, x, y); }

Target:
protected boolean canScroll(final View v, final boolean checkV, final int dx, final int x, final int y) { if (SDK_INT < ICE_CREAM_SANDWICH && v instanceof WebView) return ((WebView) v).canScrollHorizontally(-dx); else return super.canScroll(v, checkV, dx, x, y); }
Source:
public QosClientLimitsConfig getConfigForClient(String client) { return qosClientLimitsConfigSupplier.get() .getOrDefault(client, ImmutableQosClientLimitsConfig.builder().build()); }

Target:
public QosClientLimitsConfig getConfigForClient(String client) { return qosClientLimitsConfigSupplier.get().getOrDefault(client, DEFAULT_LIMITS); }
Source:
public void close() { final Future<?> task; synchronized (this) { if (expireTask == null) { return; } task = expireTask; expireTask = null; } task.cancel(false); if (!task.isDone()) { try { task.get(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } catch (ExecutionException e) { } } }

Target:
public void close() { for (Future<?> future: this.expirationFutures.values()) { future.cancel(false); } for (Future<?> future: this.expirationFutures.values()) { if (!future.isDone()) { try { future.get(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } catch (ExecutionException e) { } } } this.expirationFutures.clear(); }
Source:
private boolean isAppInFeatureList(Feature feature, String applicationName) { String appKey = feature.getName() + "-" + feature.getVersion(); if (appKey.equalsIgnoreCase(applicationName)) { return true; } return false; }

Target:
private boolean isAppInFeatureList(Feature feature, String applicationName) { String appKey = feature.getName() + "-" + feature.getVersion(); return appKey.equalsIgnoreCase(applicationName); }
Source:
void setFieldValue( Value value, Field field ) { field.setStringValue( value.asLegacyObject().toString() ); }

Target:
void setFieldValue( Value value, Field field ) { field.setDoubleValue( Values.coerceToDouble(value) ); }
Source:
public String toString() { return "StateResponseCommand{" + "cache=" + cacheName + "stateChunks=" + stateChunks + ", origin=" + getOrigin() + ", topologyId=" + topologyId + '}'; }

Target:
public String toString() { return "StateResponseCommand{" + "cache=" + cacheName + ", stateChunks=" + stateChunks + ", origin=" + getOrigin() + ", topologyId=" + topologyId + '}'; }
Source:
public void serialize(DifferentialEntropyState state, BlockBuilder output) { int requiredBytes = SizeOf.SIZE_OF_INT + (state.getStrategy() == null ? 0 : state.getStrategy().getRequiredBytesForSerialization()); DifferentialEntropyStateStrategy strategy = state.getStrategy(); SliceOutput sliceOut = Slices.allocate(requiredBytes).getOutput(); if (strategy == null) { sliceOut.appendInt(0); } else if (strategy instanceof UnweightedReservoirSampleStateStrategy) { sliceOut.appendInt(1); } else if (strategy instanceof WeightedReservoirSampleStateStrategy) { sliceOut.appendInt(2); } else if (strategy instanceof FixedHistogramMleStateStrategy) { sliceOut.appendInt(3); } else if (strategy instanceof FixedHistogramJacknifeStateStrategy) { sliceOut.appendInt(4); } else { verify(false, "Strategy " + strategy.getClass().getSimpleName() + " cannot be serialized"); } if (strategy != null) { strategy.serialize(sliceOut); } VARBINARY.writeSlice(output, sliceOut.getUnderlyingSlice()); }

Target:
public void serialize(DifferentialEntropyState state, BlockBuilder output) { DifferentialEntropyStateStrategy strategy = state.getStrategy(); if (strategy == null) { SliceOutput sliceOut = Slices.allocate(SizeOf.SIZE_OF_INT).getOutput(); sliceOut.appendInt(0); VARBINARY.writeSlice(output, sliceOut.getUnderlyingSlice()); return; } int requiredBytes = SizeOf.SIZE_OF_INT + strategy.getRequiredBytesForSerialization(); SliceOutput sliceOut = Slices.allocate(requiredBytes).getOutput(); if (strategy instanceof UnweightedReservoirSampleStateStrategy) { sliceOut.appendInt(1); } else if (strategy instanceof WeightedReservoirSampleStateStrategy) { sliceOut.appendInt(2); } else if (strategy instanceof FixedHistogramMleStateStrategy) { sliceOut.appendInt(3); } else if (strategy instanceof FixedHistogramJacknifeStateStrategy) { sliceOut.appendInt(4); } else { verify(false, format("Strategy cannot be serialized: %s", strategy.getClass().getSimpleName())); } strategy.serialize(sliceOut); VARBINARY.writeSlice(output, sliceOut.getUnderlyingSlice()); }
Source:
public void impl$checkSerializationBehaviorForSaveChunks(CallbackInfoReturnable<Boolean> cir) { SerializationBehavior serializationBehavior = ((WorldProperties) this.world.getWorldInfo()).getSerializationBehavior(); if (serializationBehavior == SerializationBehaviors.NONE || serializationBehavior == SerializationBehaviors.METADATA_ONLY) { cir.setReturnValue(true); } }

Target:
public void impl$checkSerializationBehaviorForSaveChunks(CallbackInfoReturnable<Boolean> cir) { final SerializationBehavior behavior = ((WorldProperties) this.world.getWorldInfo()).getSerializationBehavior(); if (behavior == SerializationBehaviors.NONE || behavior == SerializationBehaviors.METADATA_ONLY) { cir.setReturnValue(true); } }
Source:
public void error(SAXParseException e) throws SAXException { if (firstException == null) { firstException = e; messageBuffer = new StringBuilder(64); messageBuffer.append('\'').append(resourceId).append('\'').append("' validation error:"); } messageBuffer.append('\n').append(e.toString()); }

Target:
public void error(SAXParseException e) { if (firstException == null) { firstException = e; messageBuffer = new StringBuilder(64); messageBuffer.append('\'').append(resourceId).append('\'').append("' validation error:"); } messageBuffer.append('\n').append(e.toString()); }
Source:
public static FileSystem write(final FileSystem fs, final Path path, final CharSequence charseq, final Charset cs) throws IOException { Objects.requireNonNull(path); Objects.requireNonNull(charseq); Objects.requireNonNull(cs); CharsetEncoder encoder = cs.newEncoder(); try (FSDataOutputStream out = fs.create(path); BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(out, encoder))) { writer.append(charseq); } return fs; }

Target:
public static FileSystem write(final FileSystem fs, final Path path, final CharSequence charseq, final Charset cs) throws IOException { Objects.requireNonNull(path); Objects.requireNonNull(charseq); Objects.requireNonNull(cs); CharsetEncoder encoder = cs.newEncoder(); try (FSDataOutputStream out = fs.createFile(path).overwrite(true).build(); BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(out, encoder))) { writer.append(charseq); } return fs; }
Source:
public void visitEnd() { try { Analyzer analyzer = new Analyzer(new SourceInterpreter()); Frame[] frames = analyzer.analyze(_classToAnalyze, this); int index = findMethodCall(this.instructions); if (index == -1) { LOGGER.error("Unable to find method call in instruction list, debug as this case is not expected"); return; } Frame f = frames[index]; List<String> localVariables = new ArrayList<>(); String fieldDesc = ""; for (int j = 0; j < f.getStackSize(); ++j) { SourceValue stack = (SourceValue) f.getStack(j); Object insn = stack.insns.iterator().next(); if (insn instanceof VarInsnNode) { VarInsnNode vinsn = (VarInsnNode) insn; if (vinsn.var < this.localVariables.size()) { String variable = ((LocalVariableNode) this.localVariables.get(vinsn.var)).name; if (!"this".equals(variable)) { localVariables.add(variable); } } } else if (insn instanceof FieldInsnNode) { FieldInsnNode fieldInstr = (FieldInsnNode) insn; fieldDesc = fieldInstr.name; } else if (insn instanceof TypeInsnNode) { TypeInsnNode typeInsnNode = (TypeInsnNode) insn; fieldDesc = "new " + Util.extractSimpleName(typeInsnNode.desc, "/") + "()"; } else if (insn instanceof MethodInsnNode) { MethodInsnNode methodInstr = (MethodInsnNode) insn; if (methodInstr.getOpcode() == Opcodes.INVOKESPECIAL && methodInstr.name.equals("<init>")) { fieldDesc = "new " + Util.extractSimpleName(methodInstr.owner, "/") + "()"; } else { Type methodType = Type.getMethodType(methodInstr.desc); int retSize = methodType.getArgumentsAndReturnSizes() & 0x03; if (retSize > 0) { fieldDesc = methodInstr.name + Util.getArgumentsInformation(methodInstr.desc); } } } } _inferredOperation = getInferredOperation(localVariables, fieldDesc); } catch (AnalyzerException e) { LOGGER.error("Unable to analyze class, could not infer operation", e.getMessage()); } }

Target:
public void visitEnd() { try { Analyzer analyzer = new Analyzer(new SourceInterpreter()); Frame[] frames = analyzer.analyze(_classToAnalyze, this); int index = findMethodCall(this.instructions); if (index == -1) { return; } Frame f = frames[index]; String fieldDesc = ""; for (int j = 0; j < f.getStackSize(); ++j) { SourceValue stack = (SourceValue) f.getStack(j); Object insn = stack.insns.iterator().next(); if (insn instanceof FieldInsnNode) { FieldInsnNode fieldInstr = (FieldInsnNode) insn; fieldDesc = fieldInstr.name; } else if (insn instanceof TypeInsnNode) { TypeInsnNode typeInsnNode = (TypeInsnNode) insn; fieldDesc = "new " + Util.extractSimpleName(typeInsnNode.desc, "/") + "()"; } else if (insn instanceof MethodInsnNode) { MethodInsnNode methodInstr = (MethodInsnNode) insn; if (methodInstr.getOpcode() == Opcodes.INVOKESPECIAL && methodInstr.name.equals("<init>")) { fieldDesc = "new " + Util.extractSimpleName(methodInstr.owner, "/") + "()"; } else { Type methodType = Type.getMethodType(methodInstr.desc); int retSize = methodType.getArgumentsAndReturnSizes() & 0x03; if (retSize > 0) { fieldDesc = methodInstr.name + Util.getArgumentsInformation(methodInstr.desc); } } } } _inferredOperation = getInferredOperation(fieldDesc); } catch (AnalyzerException e) { System.out.println("Unable to analyze class, could not infer operation"); } }
Source:
private void updateTabletLocation() { Path locationPath; if (volumeChooserUpdateInterval > 0 && (lastVolumeChooserUpdate + volumeChooserUpdateInterval < System.currentTimeMillis())) { VolumeManager fs = this.tabletServer.getFileSystem(); UniqueNameAllocator namer = context.getUniqueNameAllocator(); VolumeChooserEnvironment chooserEnv = new VolumeChooserEnvironment(extent.getTableId(), context); Text endRow = extent.getEndRow(); String directory = fs.choose(chooserEnv, ServerConstants.getBaseUris(context.getConfiguration())) + Constants.HDFS_TABLES_DIR + Path.SEPARATOR + extent.getTableId().toString() + Path.SEPARATOR; if (endRow == null) { directory += Constants.DEFAULT_TABLET_LOCATION; } else { directory += Constants.GENERATED_TABLET_DIRECTORY_PREFIX + namer.getNextName(); } locationPath = new Path(directory); this.location = locationPath; this.tabletDirectory = locationPath.toString(); } }

Target:
private void updateTabletLocation() { Path locationPath; VolumeManager fs = this.tabletServer.getFileSystem(); UniqueNameAllocator namer = context.getUniqueNameAllocator(); VolumeChooserEnvironment chooserEnv = new VolumeChooserEnvironment(extent.getTableId(), context); Text endRow = extent.getEndRow(); String directory = fs.choose(chooserEnv, ServerConstants.getBaseUris(context.getConfiguration())) + Constants.HDFS_TABLES_DIR + Path.SEPARATOR + extent.getTableId().toString() + Path.SEPARATOR; if (endRow == null) { directory += Constants.DEFAULT_TABLET_LOCATION; } else { directory += Constants.GENERATED_TABLET_DIRECTORY_PREFIX + namer.getNextName(); } locationPath = new Path(directory); this.location = locationPath; this.tabletDirectory = locationPath.toString(); }
Source:
private void renderRemovedPost(final int position, final ReaderRemovedPostViewHolder holder) { final ReaderPost post = getItem(position); final Context context = holder.mRemovedPostContainer.getContext(); holder.mTxtRemovedPostTitle.setText(createTextForRemovedPostContainer(post, context)); Drawable[] compoundDrawables = holder.mUndoRemoveAction.getCompoundDrawables(); for (Drawable item : compoundDrawables) { if (item != null) { DrawableCompat.setTint(item, context.getResources().getColor(R.color.blue_medium)); } } holder.mCardView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { undoPostUnbookmarked(post, position); } }); }

Target:
private void renderRemovedPost(final int position, final ReaderRemovedPostViewHolder holder) { final ReaderPost post = getItem(position); final Context context = holder.mRemovedPostContainer.getContext(); holder.mTxtRemovedPostTitle.setText(createTextForRemovedPostContainer(post, context)); Drawable drawable = context.getResources().getDrawable(R.drawable.ic_undo_24dp); DrawableCompat.setTint(drawable, context.getResources().getColor(R.color.blue_medium)); DrawableCompat.setTintMode(drawable, PorterDuff.Mode.SRC_IN); holder.mUndoRemoveAction.setCompoundDrawablesWithIntrinsicBounds(drawable, null, null, null); holder.mCardView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { undoPostUnbookmarked(post, position); } }); }
Source:
public void run() { String carbonConfigDirPath = CarbonUtils.getCarbonConfigDirPath(); File log4j2File = new File(carbonConfigDirPath + File.separator + "log4j2.properties"); try (WatchService watchService = FileSystems.getDefault().newWatchService()) { Path carbonConfigDirectory = Paths.get(carbonConfigDirPath); carbonConfigDirectory.register(watchService, StandardWatchEventKinds.ENTRY_MODIFY); WatchKey key; while ((key = watchService.take()) != null) { for (WatchEvent<?> event : key.pollEvents()) { WatchEvent<Path> watchEvent = (WatchEvent<Path>) event; Path fileName = watchEvent.context(); Path changedFile = carbonConfigDirectory.resolve(fileName); if (changedFile.toFile().equals(log4j2File)) { updateLoggingConfiguration(); } } key.reset(); } } catch (IOException e) { LOG.error("Error while retrieving watch events", e); } catch (InterruptedException e) { LOG.error("Error while waiting to watch events", e); } }

Target:
public void run() { String carbonConfigDirPath = CarbonUtils.getCarbonConfigDirPath(); File log4j2File = new File(carbonConfigDirPath + File.separator + "log4j2.properties"); try (WatchService watchService = FileSystems.getDefault().newWatchService()) { Path carbonConfigDirectory = Paths.get(carbonConfigDirPath); carbonConfigDirectory.register(watchService, StandardWatchEventKinds.ENTRY_MODIFY); WatchKey key; while ((key = watchService.take()) != null) { for (WatchEvent<?> event : key.pollEvents()) { WatchEvent<Path> watchEvent = (WatchEvent<Path>) event; Path fileName = watchEvent.context(); Path changedFile = carbonConfigDirectory.resolve(fileName); if (changedFile.toFile().getCanonicalFile().equals(log4j2File.getCanonicalFile())) { updateLoggingConfiguration(); } } key.reset(); } } catch (IOException e) { LOG.error("Error while retrieving watch events", e); } catch (InterruptedException e) { LOG.error("Error while waiting to watch events", e); } }
Source:
public void createEmptyPartition(ConnectorSession session, String schema, String table, List<Object> partitionColumnNames, List<Object> partitionValues) { HiveMetadata hiveMetadata = hiveMetadataFactory.create(); HiveInsertTableHandle hiveInsertTableHandle = hiveMetadata.beginInsert(session, new HiveTableHandle(schema, table)); List<String> actualPartitionColumnNames = hiveInsertTableHandle.getInputColumns().stream() .filter(HiveColumnHandle::isPartitionKey) .map(HiveColumnHandle::getName) .collect(toImmutableList()); checkArgument(Objects.equals(partitionColumnNames, actualPartitionColumnNames), "input partition column names doesn't match actual partition column names"); List<String> partitionStringValues = partitionValues.stream() .map(String.class::cast) .collect(toImmutableList()); if (metastore.getPartition(schema, table, partitionStringValues).isPresent()) { throw new PrestoException(ALREADY_EXISTS, "Partition already exists"); } String partitionName = FileUtils.makePartName(actualPartitionColumnNames, partitionStringValues); WriteInfo writeInfo = locationService.getPartitionWriteInfo(hiveInsertTableHandle.getLocationHandle(), Optional.empty(), partitionName); hiveMetadata.finishInsert( session, hiveInsertTableHandle, ImmutableList.of( Slices.wrappedBuffer( partitionUpdateJsonCodec.toJsonBytes( new PartitionUpdate( partitionName, UpdateMode.NEW, writeInfo.getWritePath(), writeInfo.getTargetPath(), ImmutableList.of(), 0, 0, 0)))), ImmutableList.of()); hiveMetadata.commit(); }

Target:
public void createEmptyPartition(ConnectorSession session, String schema, String table, List<Object> partitionColumnNames, List<Object> partitionValues) { TransactionalMetadata hiveMetadata = hiveMetadataFactory.get(); HiveInsertTableHandle hiveInsertTableHandle = (HiveInsertTableHandle) hiveMetadata.beginInsert(session, new HiveTableHandle(schema, table)); List<String> actualPartitionColumnNames = hiveInsertTableHandle.getInputColumns().stream() .filter(HiveColumnHandle::isPartitionKey) .map(HiveColumnHandle::getName) .collect(toImmutableList()); if (!Objects.equals(partitionColumnNames, actualPartitionColumnNames)) { throw new PrestoException(INVALID_PROCEDURE_ARGUMENT, "input partition column names doesn't match actual partition column names"); } List<String> partitionStringValues = partitionValues.stream() .map(String.class::cast) .collect(toImmutableList()); if (metastore.getPartition(schema, table, partitionStringValues).isPresent()) { throw new PrestoException(ALREADY_EXISTS, "Partition already exists"); } String partitionName = FileUtils.makePartName(actualPartitionColumnNames, partitionStringValues); WriteInfo writeInfo = locationService.getPartitionWriteInfo(hiveInsertTableHandle.getLocationHandle(), Optional.empty(), partitionName); Slice serializedPartitionUpdate = Slices.wrappedBuffer( partitionUpdateJsonCodec.toJsonBytes( new PartitionUpdate( partitionName, UpdateMode.NEW, writeInfo.getWritePath(), writeInfo.getTargetPath(), ImmutableList.of(), 0, 0, 0))); hiveMetadata.finishInsert( session, hiveInsertTableHandle, ImmutableList.of(serializedPartitionUpdate), ImmutableList.of()); hiveMetadata.commit(); }
Source:
private Iterable<Object> processData(Class<?> entityClass, Map<String, Object> data, Optional<FilterExpression> filterExpression, Optional<Sorting> sorting, Optional<Pagination> pagination, RequestScope scope) { List<Object> results = filterExpression .map(fe -> { Predicate predicate = fe.accept(new InMemoryFilterVisitor(scope)); return data.values().stream().filter(predicate::test).collect(Collectors.toList()); }) .orElseGet(() -> new ArrayList<>(data.values())); Comparator<Object> noSort = (left, right) -> 0; List<Object> sorted = sorting .map(sort -> { Map<Path, Sorting.SortOrder> sortRules = sort.getValidSortingRules(entityClass, dictionary); if (sortRules.isEmpty()) { return results; } Comparator<Object> comp = sortRules.entrySet().stream() .map(entry -> getComparator(entry.getKey(), entry.getValue(), scope)) .reduce(noSort, (first, second) -> (left, right) -> { int comparison = first.compare(left, right); if (comparison == 0) { return second.compare(left, right); } return comparison; }); results.sort(comp); return results; }) .orElse(results); return pagination .map(p -> { int offset = p.getOffset(); int limit = p.getLimit(); if (offset < 0 || offset >= sorted.size()) { return Collections.emptyList(); } int endIdx = offset + limit; if (endIdx > sorted.size()) { endIdx = sorted.size(); } return sorted.subList(offset, endIdx); }) .orElse(sorted); }

Target:
private Iterable<Object> processData(Class<?> entityClass, Map<String, Object> data, Optional<FilterExpression> filterExpression, Optional<Sorting> sorting, Optional<Pagination> pagination, RequestScope scope) { List<Object> results = filterExpression .map(fe -> { Predicate predicate = fe.accept(new InMemoryFilterVisitor(scope)); return data.values().stream().filter(predicate::test).collect(Collectors.toList()); }) .orElseGet(() -> new ArrayList<>(data.values())); Comparator<Object> noSort = (left, right) -> 0; List<Object> sorted = sorting .map(sort -> { Map<Path, Sorting.SortOrder> sortRules = sort.getValidSortingRules(entityClass, dictionary); if (sortRules.isEmpty()) { return results; } Comparator<Object> comp = sortRules.entrySet().stream() .map(entry -> getComparator(entry.getKey(), entry.getValue(), scope)) .reduce(noSort, (comparator1, comparator2) -> (left, right) -> { int comparison = comparator1.compare(left, right); if (comparison == 0) { return comparator2.compare(left, right); } return comparison; }); results.sort(comp); return results; }) .orElse(results); return pagination .map(p -> { int offset = p.getOffset(); int limit = p.getLimit(); if (offset < 0 || offset >= sorted.size()) { return Collections.emptyList(); } int endIdx = offset + limit; if (endIdx > sorted.size()) { endIdx = sorted.size(); } return sorted.subList(offset, endIdx); }) .orElse(sorted); }
Source:
protected ScheduledExecutorService executor() { final ThreadFactory threadFactory = new ThreadFactoryBuilder() .setNameFormat(serviceName()) .setDaemon(false) .build(); return Executors.newSingleThreadScheduledExecutor(threadFactory); }

Target:
protected ScheduledExecutorService executor() { final ThreadFactory threadFactory = new ThreadFactoryBuilder() .setNameFormat(serviceName()) .setDaemon(true) .build(); return Executors.newSingleThreadScheduledExecutor(threadFactory); }
Source:
protected boolean canDoAction() { if (getParameters().getParametersList().isEmpty()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_NO_DISKS_SPECIFIED); } for ( MoveDiskParameters param : getParameters().getParametersList() ) { if (getDiskImageDao().get(param.getImageId()).isShareable()) { if ( getStorageDomainDAO().get(param.getStorageDomainId()).getStorageType().equals(StorageType.GLUSTERFS) ) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_CANT_MOVE_SHAREABLE_DISK_TO_GLUSTERFS); } } } return true; }

Target:
protected boolean canDoAction() { if (getParameters().getParametersList().isEmpty()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_NO_DISKS_SPECIFIED); } else { return verifyShareableDisksMoving(); } }
Source:
public void execute(final OperationParams params) { try { final DynamoDBLocal server = options.getServer(); server.start(); if (interactive) { System.out.println("hit any key to shutdown .."); System.in.read(); System.out.println("Shutting down!"); server.stop(); } else { Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { try { server.stop(); } catch (final Exception e) { LOGGER.warn("Unable to shutdown redis", e); System.out.println("Error shutting down redis."); } System.out.println("Shutting down!"); } }); while (true) { Thread.sleep(TimeUnit.MILLISECONDS.convert(Long.MAX_VALUE, TimeUnit.DAYS)); } } } catch (final Exception e) { LOGGER.error("Unable to run embedded Redis server", e); } }

Target:
public void execute(final OperationParams params) { try { final DynamoDBLocal server = options.getServer(); server.start(); if (interactive) { System.out.println("hit any key to shutdown .."); System.in.read(); System.out.println("Shutting down!"); server.stop(); } else { Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { try { server.stop(); } catch (final Exception e) { LOGGER.warn("Unable to shutdown DynamoDB", e); System.out.println("Error shutting down DynamoDB."); } System.out.println("Shutting down!"); } }); while (true) { Thread.sleep(TimeUnit.MILLISECONDS.convert(Long.MAX_VALUE, TimeUnit.DAYS)); } } } catch (final Exception e) { LOGGER.error("Unable to run embedded DynamoDB server", e); } }
Source:
protected boolean internalTestConnection(ConnectionRequestInfo cri, Subject subject) { log.debugf("%s: testConnection(%s, %s)", poolName, cri, subject); log.debugf("testConnection subjectIdentityHashCode=%s", System.identityHashCode(subject)); log.debugf("%s: Statistics=%s", poolName, statistics); boolean result = false; boolean kill = false; ConnectionListener cl = null; if (shutdown.get()) return false; if (isFull()) return false; try { boolean separateNoTx = false; if (noTxSeparatePools) { separateNoTx = cm.isTransactional(); } Object key = getKey(subject, cri, separateNoTx); ManagedConnectionPool mcp = getManagedConnectionPool(key, subject, cri); cl = mcp.getConnection(subject, cri); result = true; } catch (Throwable t) { kill = true; } finally { if (cl != null) { try { returnConnection(cl, kill); } catch (ResourceException ire) { } } } return result; }

Target:
protected boolean internalTestConnection(ConnectionRequestInfo cri, Subject subject) { log.debugf("%s: testConnection(%s, %s)(%s)", poolName, cri, subject, Integer.toHexString(System.identityHashCode(subject))); log.debugf("%s: Statistics=%s", poolName, statistics); boolean result = false; boolean kill = false; ConnectionListener cl = null; if (shutdown.get()) return false; if (isFull()) return false; try { boolean separateNoTx = false; if (noTxSeparatePools) { separateNoTx = cm.isTransactional(); } Object key = getKey(subject, cri, separateNoTx); ManagedConnectionPool mcp = getManagedConnectionPool(key, subject, cri); cl = mcp.getConnection(subject, cri); result = true; } catch (Throwable t) { kill = true; } finally { if (cl != null) { try { returnConnection(cl, kill); } catch (ResourceException ire) { } } } return result; }
Source:
private ConfigDescriptionParameter buildConfigParam(Set<ModuleInformation> moduleInformations, ActionModuleKind kind) { List<ParameterOption> options = new ArrayList<>(); if (kind == ActionModuleKind.SINGLE) { if (moduleInformations.size() == 1) { if (((ModuleInformation) moduleInformations.toArray()[0]).getConfigName() == null && ((ModuleInformation) moduleInformations.toArray()[0]).getThingUID() == null) { return null; } } } else if (kind == ActionModuleKind.SERVICE) { for (ModuleInformation mi : moduleInformations) { String configName = mi.getConfigName(); options.add(new ParameterOption(configName, null)); } return ConfigDescriptionParameterBuilder.create(CONFIG_PARAM, Type.TEXT).withLabel(SELECT_SERVICE_LABEL) .withOptions(options).withLimitToOptions(true).withRequired(true).build(); } else if (kind == ActionModuleKind.THING) { for (ModuleInformation mi : moduleInformations) { String thingUID = mi.getThingUID(); options.add(new ParameterOption(thingUID, null)); } return ConfigDescriptionParameterBuilder.create(CONFIG_PARAM, Type.TEXT).withLabel("Select Thing") .withContext("thing").withOptions(options).withLimitToOptions(true).withRequired(true).build(); } return null; }

Target:
private ConfigDescriptionParameter buildConfigParam(Set<ModuleInformation> moduleInformations, ActionModuleKind kind) { List<ParameterOption> options = new ArrayList<>(); if (kind == ActionModuleKind.SINGLE) { if (moduleInformations.size() == 1) { if (((ModuleInformation) moduleInformations.toArray()[0]).getConfigName() == null && ((ModuleInformation) moduleInformations.toArray()[0]).getThingUID() == null) { return null; } } } else if (kind == ActionModuleKind.SERVICE) { for (ModuleInformation mi : moduleInformations) { String configName = mi.getConfigName(); options.add(new ParameterOption(configName, configName)); } return ConfigDescriptionParameterBuilder.create(CONFIG_PARAM, Type.TEXT).withLabel(SELECT_SERVICE_LABEL) .withOptions(options).withLimitToOptions(true).withRequired(true).build(); } else if (kind == ActionModuleKind.THING) { for (ModuleInformation mi : moduleInformations) { String thingUID = mi.getThingUID(); options.add(new ParameterOption(thingUID, null)); } return ConfigDescriptionParameterBuilder.create(CONFIG_PARAM, Type.TEXT).withLabel(SELECT_THING_LABEL) .withContext("thing").withOptions(options).withLimitToOptions(true).withRequired(true).build(); } return null; }
Source:
public boolean updateEntityInTableTransactional(String tableName, ODataEntry oldProperties, ODataEntry newProperties) { List<String> pKeys = this.primaryKeys.get(tableName); String newPropertyObjectKeyValue = null; String oldPropertyObjectKeyValue = null; for (String newPropertyObjectKeyName : newProperties.getData().keySet()) { if (newPropertyObjectKeyName.equals(DOCUMENT_ID)) { newPropertyObjectKeyValue = newProperties.getValue(newPropertyObjectKeyName); } } for (String oldPropertyObjectKeyName : oldProperties.getData().keySet()) { if (oldPropertyObjectKeyName.equals(DOCUMENT_ID)) { oldPropertyObjectKeyValue = oldProperties.getValue(oldPropertyObjectKeyName); } } for (String column : newProperties.getData().keySet()) { if (!pKeys.contains(column)) { String propertyValue = newProperties.getValue(column); assert newPropertyObjectKeyValue != null; jongo.getCollection(tableName).update(new ObjectId(newPropertyObjectKeyValue)).upsert().with(SET + column + ": '" + propertyValue + "'}}"); } } for (String column : oldProperties.getNames()) { if (!pKeys.contains(column)) { String propertyValue = oldProperties.getValue(column); assert oldPropertyObjectKeyValue != null; jongo.getCollection(tableName).update(new ObjectId(oldPropertyObjectKeyValue)).upsert().with(SET + column + ": '" + propertyValue + "'}}"); } } return true; }

Target:
public boolean updateEntityInTableTransactional(String tableName, ODataEntry oldProperties, ODataEntry newProperties) throws ODataServiceFault { String oldPropertyObjectKeyValue = oldProperties.getValue(DOCUMENT_ID); StringBuilder updateNewProperties = new StringBuilder(); updateNewProperties.append("{$set: {"); boolean propertyMatch = false; for (String column : newProperties.getData().keySet()) { if (propertyMatch) { updateNewProperties.append("', "); } String propertyValue = newProperties.getValue(column); updateNewProperties.append(column).append(": '").append(propertyValue); propertyMatch = true; } updateNewProperties.append("'}}"); String query = updateNewProperties.toString(); WriteResult update = jongo.getCollection(tableName).update(new ObjectId(oldPropertyObjectKeyValue)).with(query); int wasUpdated = update.getN(); if (wasUpdated == 1) { return update.wasAcknowledged(); } else { throw new ODataServiceFault("Error occured while updating the entity to collection :" + tableName + "."); } }
Source:
private List<BinaryExpressionTree> flattenLogicalExpression(ExpressionTree expression) { if (expression.is(CONDITIONAL_AND, CONDITIONAL_OR)) { ignored.add(expression); BinaryExpressionTree binaryExpr = (BinaryExpressionTree) expression; ExpressionTree left = ExpressionUtils.skipParentheses(binaryExpr.leftOperand()); ExpressionTree right = ExpressionUtils.skipParentheses(binaryExpr.rightOperand()); return Stream.of(flattenLogicalExpression(left), Collections.singletonList(binaryExpr), flattenLogicalExpression(right)) .flatMap(List::stream) .collect(Collectors.toList()); } return Collections.emptyList(); }

Target:
private Stream<BinaryExpressionTree> flattenLogicalExpression(ExpressionTree expression) { if (expression.is(CONDITIONAL_AND, CONDITIONAL_OR)) { ignored.add(expression); BinaryExpressionTree binaryExpr = (BinaryExpressionTree) expression; ExpressionTree left = ExpressionUtils.skipParentheses(binaryExpr.leftOperand()); ExpressionTree right = ExpressionUtils.skipParentheses(binaryExpr.rightOperand()); return Stream.concat(Stream.concat(flattenLogicalExpression(left), Stream.of(binaryExpr)), flattenLogicalExpression(right)); } return Stream.empty(); }
Source:
private void updateActionAvailability() { getEditCommand().setIsExecutionAllowed(getSelectedItems() != null && getSelectedItems().size() == 1); boolean removeAllowed = true; if (getSelectedItems() == null || getSelectedItems().isEmpty()) { removeAllowed = false; } else { for (MacPool macPool : (Iterable<MacPool>) getSelectedItems()) { if (macPool.isDefaultPool()) { removeAllowed = false; } } } getRemoveCommand().setIsExecutionAllowed(removeAllowed); }

Target:
private void updateActionAvailability() { getEditCommand().setIsExecutionAllowed(getSelectedItems() != null && getSelectedItems().size() == 1); boolean removeAllowed = true; if (getSelectedItems() == null || getSelectedItems().isEmpty()) { removeAllowed = false; } else { for (MacPool macPool : (Iterable<MacPool>) getSelectedItems()) { if (macPool.isDefaultPool()) { removeAllowed = false; break; } } } getRemoveCommand().setIsExecutionAllowed(removeAllowed); }
Source:
protected boolean overrideHotcodeReplace(IServer server, ILaunch launch) throws CoreException { IJavaHotCodeReplaceListener l = getHotCodeReplaceListener(server, launch); if( l != null) { IDebugTarget[] targets = launch.getDebugTargets(); if( targets != null && l != null) { for( int i = 0; i < targets.length; i++ ) { if( targets[i] instanceof IJavaDebugTarget) { ((IJavaDebugTarget)targets[i]).addHotCodeReplaceListener(l); } } } return true; } return false; }

Target:
protected boolean overrideHotcodeReplace(IServer server, ILaunch launch) throws CoreException { IJavaHotCodeReplaceListener l = getHotCodeReplaceListener(server, launch); IDebugTarget[] targets = launch.getDebugTargets(); if( targets != null && l != null) { for( int i = 0; i < targets.length; i++ ) { if( targets[i] instanceof IJavaDebugTarget) { ((IJavaDebugTarget)targets[i]).addHotCodeReplaceListener(l); } } } return true; }
Source:
public void setLongitude(double longitude) { this.mLongitude = longitude; }

Target:
public void setLongitude(double longitude) { mLongitude = longitude; }